Back to index

unity  6.0.0
DeviceLauncherSection.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
00017  */
00018 
00019 #ifndef _DEVICE_LAUNCHER_SECTION_H_
00020 #define _DEVICE_LAUNCHER_SECTION_H_
00021 
00022 #include <map>
00023 
00024 #include <gio/gio.h>
00025 #include <sigc++/sigc++.h>
00026 #include <sigc++/signal.h>
00027 #include <UnityCore/GLibWrapper.h>
00028 #include <UnityCore/GLibSignal.h>
00029 #include <UnityCore/GLibSource.h>
00030 
00031 #include "DeviceLauncherIcon.h"
00032 
00033 class Launcher;
00034 class LauncherIcon;
00035 
00036 namespace unity
00037 {
00038 namespace launcher
00039 {
00040 
00041 class DeviceLauncherSection : public sigc::trackable
00042 {
00043 public:
00044   DeviceLauncherSection();
00045 
00046   sigc::signal<void, AbstractLauncherIcon::Ptr> IconAdded;
00047 
00048 private:
00049   void PopulateEntries();
00050 
00051   void OnVolumeAdded(GVolumeMonitor* monitor, GVolume* volume);
00052   void OnVolumeRemoved(GVolumeMonitor* monitor, GVolume* volume);
00053 
00054 private:
00055   std::map<GVolume*, DeviceLauncherIcon*> map_;
00056   glib::Object<GVolumeMonitor> monitor_;
00057   glib::Idle device_populate_idle_;
00058   glib::SignalManager sig_manager_;
00059 };
00060 
00061 }
00062 } // namespace unity
00063 
00064 #endif // _DEVICE_LAUNCHER_SECTION_H_