Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

notebook.h

Go to the documentation of this file.
00001 /*  Inti - GTK+ C++ Object Developemnt Enviroment
00002  *  Copyright (C) 2002-2003 The Inti Develeopement Team.
00003  *  Copyright (C) 2000 Red Hat, Inc.
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 as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019  
00025 
00026 #ifndef INTI_GTK_NOTEBOOK_H
00027 #define INTI_GTK_NOTEBOOK_H
00028 
00029 #ifndef INTI_GTK_CONTAINER_H
00030 #include <inti/gtk/container.h>
00031 #endif
00032 
00033 #ifndef __GTK_NOTEBOOK_H__
00034 #include <gtk/gtknotebook.h>
00035 #endif
00036 
00037 namespace Inti {
00038 
00039 namespace Gtk {
00040 
00041 class Label;
00042 class NotebookClass;
00043 
00047 
00048 enum NotebookTab
00049 {
00050         NOTEBOOK_TAB_FIRST = GTK_NOTEBOOK_TAB_FIRST, 
00052 
00053         NOTEBOOK_TAB_LAST = GTK_NOTEBOOK_TAB_LAST 
00055 };
00056 
00067 
00068 class Notebook : public Container
00069 {
00070         friend class G::Object;
00071         friend class NotebookClass;
00072 
00073         Notebook(const Notebook&);
00074         Notebook& operator=(const Notebook&);
00075 
00076 protected:
00079 
00080         explicit Notebook(GtkNotebook *notebook, bool reference = false);
00087 
00091 
00092         virtual void on_switch_page(GtkNotebookPage *page, unsigned int page_num);
00096 
00098 //  Properties
00099 
00100         typedef G::Property<int> PagePropertyType;
00101         typedef G::PropertyProxy<G::Object, PagePropertyType> PagePropertyProxy;
00102         static const PagePropertyType page_property;
00103 
00104         typedef G::Property<PositionType, int> TabPosPropertyType;
00105         typedef G::PropertyProxy<G::Object, TabPosPropertyType> TabPosPropertyProxy;
00106         static const TabPosPropertyType tab_pos_property;
00107 
00108         typedef G::WritableProperty<unsigned int> TabBorderPropertyType;
00109         typedef G::PropertyProxy<G::Object, TabBorderPropertyType> TabBorderPropertyProxy;
00110         static const TabBorderPropertyType tab_border_property;
00111 
00112         typedef G::Property<unsigned int> TabHBorderPropertyType;
00113         typedef G::PropertyProxy<G::Object, TabHBorderPropertyType> TabHBorderPropertyProxy;
00114         static const TabHBorderPropertyType tab_hborder_property;
00115 
00116         typedef G::Property<unsigned int> TabVBorderPropertyType;
00117         typedef G::PropertyProxy<G::Object, TabVBorderPropertyType> TabVBorderPropertyProxy;
00118         static const TabVBorderPropertyType tab_vborder_property;
00119 
00120         typedef G::Property<bool> ShowTabsPropertyType;
00121         typedef G::PropertyProxy<G::Object, ShowTabsPropertyType> ShowTabsPropertyProxy;
00122         static const ShowTabsPropertyType show_tabs_property;
00123 
00124         typedef G::Property<bool> ShowBorderPropertyType;
00125         typedef G::PropertyProxy<G::Object, ShowBorderPropertyType> ShowBorderPropertyProxy;
00126         static const ShowBorderPropertyType show_border_property;
00127 
00128         typedef G::Property<bool> ScrollablePropertyType;
00129         typedef G::PropertyProxy<G::Object, ScrollablePropertyType> ScrollablePropertyProxy;
00130         static const ScrollablePropertyType scrollable_property;
00131 
00132         typedef G::Property<bool> EnablePopupPropertyType;
00133         typedef G::PropertyProxy<G::Object, EnablePopupPropertyType> EnablePopupPropertyProxy;
00134         static const EnablePopupPropertyType enable_popup_property;
00135 
00136         typedef G::Property<bool> HomogeneousPropertyType;
00137         typedef G::PropertyProxy<G::Object, HomogeneousPropertyType> HomogeneousPropertyProxy;
00138         static const HomogeneousPropertyType homogeneous_property;
00139 
00140 //  Child properties
00141 
00142         typedef Gtk::ChildProperty<String> TabLabelPropertyType;
00143         typedef Gtk::ChildPropertyProxy<Container, TabLabelPropertyType> TabLabelPropertyProxy;
00144         static const TabLabelPropertyType tab_label_property;
00145 
00146         typedef Gtk::ChildProperty<String> MenuLabelPropertyType;
00147         typedef Gtk::ChildPropertyProxy<Container, MenuLabelPropertyType> MenuLabelPropertyProxy;
00148         static const MenuLabelPropertyType menu_label_property;
00149 
00150         typedef Gtk::ChildProperty<unsigned int> PositionPropertyType;
00151         typedef Gtk::ChildPropertyProxy<Container, PositionPropertyType> PositionPropertyProxy;
00152         static const PositionPropertyType position_property;
00153 
00154         typedef Gtk::ChildProperty<bool> TabExpandPropertyType;
00155         typedef Gtk::ChildPropertyProxy<Container, TabExpandPropertyType> TabExpandPropertyProxy;
00156         static const TabExpandPropertyType tab_expand_property;
00157 
00158         typedef Gtk::ChildProperty<bool> TabFillPropertyType;
00159         typedef Gtk::ChildPropertyProxy<Container, TabFillPropertyType> TabFillPropertyProxy;
00160         static const TabFillPropertyType tab_fill_property;
00161 
00162         typedef Gtk::ChildProperty<PackType, int> TabPackPropertyType;
00163         typedef Gtk::ChildPropertyProxy<Container, TabPackPropertyType> TabPackPropertyProxy;
00164         static const TabPackPropertyType tab_pack_property;
00165 
00166 //  Signals
00167 
00168         typedef G::Signal2<void, GtkNotebookPage*, unsigned int> SwitchPageSignalType;
00169         typedef G::SignalProxy<TypeInstance, SwitchPageSignalType> SwitchPageSignalProxy;
00170         static const SwitchPageSignalType switch_page_signal;
00171 
00172 public:
00175 
00176         Notebook();
00178 
00179         virtual ~Notebook();
00181 
00185 
00186         GtkNotebook* gtk_notebook() const { return (GtkNotebook*)instance; }
00188 
00189         GtkNotebookClass* gtk_notebook_class() const;
00191 
00192         operator GtkNotebook* () const;
00194 
00195         int get_current_page() const;
00200 
00201         Widget* get_current_nth_page() const;
00204 
00205         Widget* get_nth_page(int page_num) const;
00209 
00210         int get_n_pages() const;
00212 
00213         int page_num(const Widget& child) const;
00217 
00218         bool get_show_border() const;
00221 
00222         bool get_show_tabs() const;
00225 
00226         PositionType get_tab_pos() const;
00229 
00230         bool get_scrollable() const;    
00233 
00234         Label* get_tab_label(const Widget& child) const;
00241 
00242         Label* get_tab_label(int page_num) const;
00249 
00250         String get_tab_label_text(const Widget& child) const;
00254 
00255         String get_tab_label_text(int page_num) const;
00259 
00260         Label* get_menu_label(const Widget& child) const;
00264 
00265         Label* get_menu_label(int page_num) const;
00269 
00270         String get_menu_label_text(const Widget& child) const;
00275 
00276         String get_menu_label_text(int page_num) const;
00281 
00282         void query_tab_label_packing(const Widget& child, bool *expand, bool *fill, PackType *pack_type) const;
00288 
00292 
00293         void append_page(Widget& child, Widget *tab_label = 0, Widget *menu_label = 0);
00304 
00305         void append_page(Widget& child, const String& tab_label, const String& menu_label = 0);
00312 
00313         void prepend_page(Widget& child, Widget *tab_label = 0, Widget *menu_label = 0);
00324 
00325         void prepend_page(Widget& child, const String& tab_label, const String& menu_label = 0);
00332 
00333         void insert_page(Widget& child, int position, Widget *tab_label = 0, Widget *menu_label = 0);
00346 
00347         void insert_page(Widget& child, int position, const String& tab_label, const String& menu_label = 0);
00357 
00358         void remove_page(int page_num);
00361 
00362         void set_current_page(int page_num);
00368 
00369         void next_page();
00371 
00372         void prev_page();
00374 
00375         void set_show_border(bool show_border);
00380 
00381         void set_show_tabs(bool show_tabs);
00384 
00385         void set_tab_pos(PositionType pos);
00388 
00389         void set_scrollable(bool scrollable);
00393 
00394         void popup_enable();
00397 
00398         void popup_disable();
00400 
00401         void set_tab_label(Widget& child, Widget *tab_label);
00405 
00406         void set_tab_label_text(Widget& child, const String& tab_text);
00410 
00411         void set_menu_label(Widget& child, Widget *menu_label);
00415 
00416         void set_menu_label_text(Widget& child, const String& menu_text);
00420 
00421         void set_tab_label_packing(Widget& child, bool expand, bool fill, PackType pack_type);
00428 
00429         void reorder_child(Widget& child, int position);
00436 
00440 
00441         const PagePropertyProxy prop_page()
00442         {
00443                 return PagePropertyProxy(this, &page_property);
00444         }
00446 
00447         const TabPosPropertyProxy prop_tab_pos()
00448         {
00449                 return TabPosPropertyProxy(this, &tab_pos_property);
00450         }
00452 
00453         const TabBorderPropertyProxy prop_tab_border()
00454         {
00455                 return TabBorderPropertyProxy(this, &tab_border_property);
00456         }
00458 
00459         const TabHBorderPropertyProxy prop_tab_hborder()
00460         {
00461                 return TabHBorderPropertyProxy(this, &tab_hborder_property);
00462         }
00464 
00465         const TabVBorderPropertyProxy prop_tab_vborder()
00466         {
00467                 return TabVBorderPropertyProxy(this, &tab_vborder_property);
00468         }
00470 
00471         const ShowTabsPropertyProxy prop_show_tabs()
00472         {
00473                 return ShowTabsPropertyProxy(this, &show_tabs_property);
00474         }
00476 
00477         const ShowBorderPropertyProxy prop_show_border()
00478         {
00479                 return ShowBorderPropertyProxy(this, &show_border_property);
00480         }
00482 
00483         const ScrollablePropertyProxy prop_scrollable()
00484         {
00485                 return ScrollablePropertyProxy(this, &scrollable_property);
00486         }
00488 
00489         const EnablePopupPropertyProxy prop_enable_popup()
00490         {
00491                 return EnablePopupPropertyProxy(this, &enable_popup_property);
00492         }
00495 
00496         const HomogeneousPropertyProxy prop_homogeneous()
00497         {
00498                 return HomogeneousPropertyProxy(this, &homogeneous_property);
00499         }
00501 
00505 
00506         const TabLabelPropertyProxy prop_tab_label()
00507         {
00508                 return TabLabelPropertyProxy(this, &tab_label_property);
00509         }
00511 
00512         const MenuLabelPropertyProxy prop_menu_label()
00513         {
00514                 return MenuLabelPropertyProxy(this, &menu_label_property);
00515         }
00517 
00518         const PositionPropertyProxy prop_position()
00519         {
00520                 return PositionPropertyProxy(this, &position_property);
00521         }
00523 
00524         const TabExpandPropertyProxy prop_tab_expand()
00525         {
00526                 return TabExpandPropertyProxy(this, &tab_expand_property);
00527         }
00529 
00530         const TabFillPropertyProxy prop_tab_fill()
00531         {
00532                 return TabFillPropertyProxy(this, &tab_fill_property);
00533         }
00535 
00536         const TabPackPropertyProxy prop_tab_pack()
00537         {
00538                 return TabPackPropertyProxy(this, &tab_pack_property);
00539         }
00542 
00546 
00547         const SwitchPageSignalProxy sig_switch_page()
00548         {
00549                 return SwitchPageSignalProxy(this, &switch_page_signal);
00550         }
00553 
00555 };
00556 
00557 } // namespace Gtk
00558 
00559 } // namespace Inti
00560 
00561 #endif // INTI_GTK_NOTEBOOK_H
00562 
Main Page - Footer


Generated on Sun Sep 14 20:08:03 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002