Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
src/Browser/NowPlaying/TextItemsMgr.hh
Go to the documentation of this file.
00001 #ifndef FREYA_TEXTITEMSMGR_HH
00002 #define FREYA_TEXTITEMSMGR_HH
00003 
00004 #include <gtkmm.h>
00005 #include "../../Glyr/UpdateInterface.hh"
00006 
00007 /*
00008  * Instance the Manager from the glade file,
00009  * any other instancing is done by the manager itself,
00010  * also remember a pointer to the manager, so we can update
00011  * it later.
00012  */
00013 #define ADD_MANAGER(builder, name, interface)        \
00014         BUILDER_GET_DERIVED(builder,name,interface); \
00015         managerList.push_back(interface);            \
00016 
00017 namespace Browser 
00018 {
00019     typedef std::vector<Glyr::UpdateInterface*> ManagerVector;
00020 
00021     class TextItemsMgr : public Gtk::Expander, public Glyr::UpdateInterface
00022     {
00023         public:
00024 
00025             TextItemsMgr(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
00026             void update(MPD::Client& client, mpd_idle event, MPD::NotifyData& data);
00027 
00028         protected:
00029 
00030             void on_type_combo_changed();
00031             void add_txtview_page(const Glib::RefPtr<Gtk::Builder>& builder, GLYR_GET_TYPE type, const char * name, Gtk::StockID icon);
00032 
00033         private:
00034 
00035             Gtk::Notebook * mp_NBook;
00036             Gtk::ComboBox * mp_TypeSelection;
00037 
00038             /* 
00039              * Text pages
00040              */
00041             ManagerVector managerList;
00042 
00043             /* 
00044              * Model for the combobox
00045              */
00046             class TypeModelColumns : public Gtk::TreeModel::ColumnRecord {
00047                 public:
00048                     TypeModelColumns() {
00049                         add(m_col_id);
00050                         add(m_col_icon);
00051                     }
00052                     Gtk::TreeModelColumn<Glib::ustring> m_col_id;
00053                     Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf>> m_col_icon;
00054             };
00055             TypeModelColumns m_TypeColumns;
00056             Glib::RefPtr<Gtk::ListStore> m_TypeModel;
00057     };
00058 }
00059 
00060 #endif /* end of include guard: FREYA_TEXTITEMSMGR_HH*/