Back to index

unity  6.0.0
Indicators.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2010-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: Neil Jagdish Patel <neil.patel@canonical.com>
00018  */
00019 
00020 #ifndef UNITY_INDICATORS_H
00021 #define UNITY_INDICATORS_H
00022 
00023 #include <sigc++/trackable.h>
00024 
00025 #include "Indicator.h"
00026 
00027 
00028 namespace unity
00029 {
00030 namespace indicator
00031 {
00032 
00033 class Indicators : public sigc::trackable, boost::noncopyable
00034 {
00035 public:
00036   typedef std::list<Indicator::Ptr> IndicatorsList;
00037 
00038   Indicators();
00039   virtual ~Indicators();
00040 
00041   IndicatorsList GetIndicators() const;
00042 
00046   void ActivateEntry(std::string const& entry_id, nux::Rect const& geometry);
00047 
00051   void SetEntryShowNow(std::string const& entry_id, bool show_now);
00052 
00056   virtual void OnEntryScroll(std::string const& entry_id, int delta) = 0;
00057 
00061   virtual void OnEntryShowMenu(std::string const& entry_id, unsigned int xid,
00062                                int x, int y, unsigned int button,
00063                                unsigned int timestamp) = 0;
00064 
00068   virtual void OnEntrySecondaryActivate(std::string const& entry_id,
00069                                         unsigned int timestamp) = 0;
00070 
00074   virtual void OnShowAppMenu(unsigned int xid, int x, int y,
00075                              unsigned int timestamp) = 0;
00076 
00077   // Signals
00078   sigc::signal<void, Indicator::Ptr const&> on_object_added;
00079   sigc::signal<void, Indicator::Ptr const&> on_object_removed;
00080 
00087   sigc::signal<void, std::string const&> on_entry_activate_request;
00088 
00093   sigc::signal<void, std::string const&, nux::Rect const&> on_entry_activated;
00094 
00098   sigc::signal<void> on_synced;
00099 
00109   sigc::signal<void, std::string const&, unsigned int, int, int, unsigned int, unsigned int> on_entry_show_menu;
00110 
00118   sigc::signal<void, unsigned int, int, int, unsigned int> on_show_appmenu;
00119 
00120 protected:
00121   Indicator::Ptr GetIndicator(std::string const& name);
00122   Indicator::Ptr AddIndicator(std::string const& name);
00123   void RemoveIndicator(std::string const& name);
00124 
00125 private:
00126   class Impl;
00127   std::unique_ptr<Impl> pimpl;
00128 };
00129 
00130 }
00131 }
00132 
00133 #endif // INDICATOR_OBJECT_FACTORY_H