Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# item.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development 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
    00024
    00025 #ifndef INTI_GTK_ITEM_H
    00026 #define INTI_GTK_ITEM_H
    00027
    00028 #ifndef INTI_GTK_BIN_H
    00029 #include <inti/gtk/bin.h>
    00030 #endif
    00031
    00032 #ifndef __GTK_ITEM_H__
    00033 #include <gtk/gtkitem.h>
    00034 #endif
    00035
    00036 namespace Inti {
    00037
    00038 namespace Gtk {
    00039
    00040 class ItemClass;
    00041
    00046
    00047 class Item : public Bin
    00048 {
    00049         friend class G::Object;
    00050         friend class ItemClass;
    00051
    00052         Item(const Item&);
    00053         Item& operator=(const Item&);
    00054
    00055 protected:
    00058
    00059         Item();
    00061
    00062         explicit Item(GtkItem *item, bool reference = false);
    00069
    00073
    00074         virtual void on_select();
    00076
    00077         virtual void on_deselect();
    00079
    00080         virtual void on_toggle();
    00082
    00084 //  Signals
    00085
    00086         typedef G::Signal0<void> SelectSignalType;
    00087         typedef G::SignalProxy<TypeInstance, SelectSignalType> SelectSignalProxy;
    00088         static const SelectSignalType select_signal;
    00089
    00090         typedef G::Signal0<void> DeselectSignalType;
    00091         typedef G::SignalProxy<TypeInstance, DeselectSignalType> DeselectSignalProxy;
    00092         static const DeselectSignalType deselect_signal;
    00093
    00094         typedef G::Signal0<void> ToggleSignalType;
    00095         typedef G::SignalProxy<TypeInstance, ToggleSignalType> ToggleSignalProxy;
    00096         static const ToggleSignalType toggle_signal;
    00097
    00098 public:
    00101         virtual ~Item();
    00103
    00107
    00108         GtkItem* gtk_item() const { return (GtkItem*)instance; }
    00110
    00111         GtkItemClass* gtk_item_class() const;
    00113
    00114         operator GtkItem* () const;
    00116
    00120
    00121         void select();
    00123
    00124         void deselect();
    00126
    00127         void toggle();
    00129
    00133
    00134         const SelectSignalProxy sig_select()
    00135         {
    00136                 return SelectSignalProxy(this, &select_signal);
    00137         }
    00139
    00140
    00141         const DeselectSignalProxy sig_deselect()
    00142         {
    00143                 return DeselectSignalProxy(this, &deselect_signal);
    00144         }
    00146
    00147         const ToggleSignalProxy sig_toggle()
    00148         {
    00149                 return ToggleSignalProxy(this, &toggle_signal);
    00150         }
    00152
    00154 };
    00155
    00156 } // namespace Gtk
    00157
    00158 } // namespace Inti
    00159
    00160 #endif // INTI_GTK_ITEM_H
    00161

Main Page - Footer