Back to index

unity  6.0.0
SoftwareCenterLauncherIcon.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2012 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Bilal Akhtar <bilalakhtar@ubuntu.com>
00018  *              Marco Trevisan (TreviƱo) <3v1n0@ubuntu.com>
00019  */
00020 
00021 #ifndef SOFTWARE_CENTER_LAUNCHERICON_H
00022 #define SOFTWARE_CENTER_LAUNCHERICON_H
00023 
00024 #include <UnityCore/GLibDBusProxy.h>
00025 #include "BamfLauncherIcon.h"
00026 #include "LauncherDragWindow.h"
00027 
00028 namespace unity
00029 {
00030 namespace launcher
00031 {
00032 class Launcher;
00033 
00034 class SoftwareCenterLauncherIcon : public BamfLauncherIcon
00035 {
00036   NUX_DECLARE_OBJECT_TYPE(SoftwareCenterLauncherIcon, BamfLauncherIcon);
00037 public:
00038   typedef nux::ObjectPtr<SoftwareCenterLauncherIcon> Ptr;
00039 
00040   SoftwareCenterLauncherIcon(BamfApplication* app,
00041                              std::string const& aptdaemon_trans_id,
00042                              std::string const& icon_path);
00043 
00044   void Animate(nux::ObjectPtr<Launcher> launcher, int icon_x, int icon_y, int icon_size);
00045 
00046   std::string GetName() const;
00047 
00048 protected:
00049   void ActivateLauncherIcon(ActionArg arg);
00050 
00051 private:
00052   void OnPropertyChanged(GVariant* params);
00053   void OnFinished(GVariant *params);
00054   void OnDragAnimationFinished();
00055 
00056   glib::DBusProxy aptdaemon_trans_;
00057 
00058   nux::ObjectPtr<nux::IOpenGLBaseTexture> icon_texture_;
00059   nux::ObjectPtr<LauncherDragWindow> drag_window_;
00060   nux::ObjectPtr<Launcher> launcher_;
00061   bool finished_;
00062   bool needs_urgent_;
00063 };
00064 
00065 }
00066 }
00067 
00068 #endif //SOFTWARE_CENTER_LAUNCHERICON_H