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

entry.h

Go to the documentation of this file.
00001 /*  Inti: Integrated Foundation Classes
00002  *  Copyright (C) 2002-2003 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_ENTRY_H
00026 #define INTI_GTK_ENTRY_H
00027 
00028 #ifndef INTI_GTK_EDITABLE_H
00029 #include <inti/gtk/editable.h>
00030 #endif
00031 
00032 #ifndef INTI_GTK_CELL_EDITABLE_H
00033 #include <inti/gtk/celleditable.h>
00034 #endif
00035 
00036 #ifndef INTI_GTK_WIDGET_H
00037 #include <inti/gtk/widget.h>
00038 #endif
00039 
00040 #ifndef __GTK_ENTRY_H__
00041 #include <gtk/gtkentry.h>
00042 #endif
00043 
00044 namespace Inti {
00045 
00046 namespace G {
00047 class Unichar;
00048 }
00049 
00050 namespace Pango {
00051 class Layout;
00052 }
00053 
00054 namespace Gtk {
00055 
00056 class EntryClass;
00057 class Menu;
00058 
00066 
00067 class Entry : public Widget, public Editable, public CellEditable
00068 {
00069         friend class G::Object;
00070         friend class EntryClass;
00071 
00072         Entry(const Entry&);
00073         Entry& operator=(const Entry&);
00074         
00075 protected:
00078 
00079         explicit Entry(GtkEntry *entry, bool reference = false);
00086 
00090 
00091         virtual void on_populate_popup(Menu& menu);
00094 
00095         virtual void on_activate();
00097         
00098         virtual void on_insert_at_cursor(const String& text);
00101 
00103 //  Properties
00104 
00105         typedef G::ReadableProperty<int> CursorPositionPropertyType;
00106         typedef G::PropertyProxy<G::Object, CursorPositionPropertyType> CursorPositionPropertyProxy;
00107         static const CursorPositionPropertyType cursor_position_property;
00108 
00109         typedef G::ReadableProperty<int> SelectionBoundPropertyType;
00110         typedef G::PropertyProxy<G::Object, SelectionBoundPropertyType> SelectionBoundPropertyProxy;
00111         static const SelectionBoundPropertyType selection_bound_property;
00112 
00113         typedef G::Property<bool> EditablePropertyType;
00114         typedef G::PropertyProxy<G::Object, EditablePropertyType> EditablePropertyProxy;
00115         static const EditablePropertyType editable_property;
00116 
00117         typedef G::Property<int> MaxLengthPropertyType;
00118         typedef G::PropertyProxy<G::Object, MaxLengthPropertyType> MaxLengthPropertyProxy;
00119         static const MaxLengthPropertyType max_length_property;
00120 
00121         typedef G::Property<bool> VisibilityPropertyType;
00122         typedef G::PropertyProxy<G::Object, VisibilityPropertyType> VisibilityPropertyProxy;
00123         static const VisibilityPropertyType visibility_property;
00124 
00125         typedef G::Property<bool> HasFramePropertyType;
00126         typedef G::PropertyProxy<G::Object, HasFramePropertyType> HasFramePropertyProxy;
00127         static const HasFramePropertyType has_frame_property;
00128 
00129         typedef G::Property<gunichar, unsigned int> InvisibleCharPropertyType;
00130         typedef G::PropertyProxy<G::Object, InvisibleCharPropertyType> InvisibleCharPropertyProxy;
00131         static const InvisibleCharPropertyType invisible_char_property;
00132 
00133         typedef G::Property<bool> ActivatesDefaultPropertyType;
00134         typedef G::PropertyProxy<G::Object, ActivatesDefaultPropertyType> ActivatesDefaultPropertyProxy;
00135         static const ActivatesDefaultPropertyType activates_default_property;
00136 
00137         typedef G::Property<int> WidthCharsPropertyType;
00138         typedef G::PropertyProxy<G::Object, WidthCharsPropertyType> WidthCharsPropertyProxy;
00139         static const WidthCharsPropertyType width_chars_property;
00140 
00141         typedef G::ReadableProperty<int> ScrollOffsetPropertyType;
00142         typedef G::PropertyProxy<G::Object, ScrollOffsetPropertyType> ScrollOffsetPropertyProxy;
00143         static const ScrollOffsetPropertyType scroll_offset_property;
00144 
00145         typedef G::Property<String> TextPropertyType;
00146         typedef G::PropertyProxy<G::Object, TextPropertyType> TextPropertyProxy;
00147         static const TextPropertyType text_property;
00148 
00149 //  Signals
00150 
00151         typedef G::Signal1<void, GtkMenu*> PopulatePopupSignalType;
00152         typedef G::SignalProxy<TypeInstance, PopulatePopupSignalType> PopulatePopupSignalProxy;
00153         static const PopulatePopupSignalType populate_popup_signal;
00154 
00155         typedef G::Signal0<void> ActviateSignalType;
00156         typedef G::SignalProxy<TypeInstance, ActviateSignalType> ActviateSignalProxy;
00157         static const ActviateSignalType activate_signal;
00158         
00159         typedef G::Signal1<void, const char*> InsertAtCursorSignalType;
00160         typedef G::SignalProxy<TypeInstance, InsertAtCursorSignalType> InsertAtCursorSignalProxy;
00161         static const InsertAtCursorSignalType insert_at_cursor_signal;
00162 
00163 public:
00166 
00167         Entry();
00169 
00170         explicit Entry(int max_length);
00175 
00176         virtual ~Entry();
00178         
00182 
00183         GtkEntry* gtk_entry() const { return (GtkEntry*)instance; }
00185 
00186         GtkEntryClass* gtk_entry_class() const;
00188 
00189         operator GtkEntry* () const;
00191 
00192         String get_text() const;
00195 
00196         bool get_visibility() const;
00198         
00199         G::Unichar get_invisible_char() const;
00203 
00204         bool get_has_frame() const;
00206 
00207         bool get_activates_default() const;
00209 
00210         int get_width_chars() const;
00212 
00213         int get_max_length() const;
00216         
00217         Pango::Layout* get_layout() const;
00224 
00225         void get_layout_offsets(int *x, int *y) const;
00235 
00239 
00240         void set_visibility(bool visible);
00248         
00249         void set_invisible_char(G::Unichar ch);
00258         
00259         void set_has_frame(bool setting);
00262         
00263         void set_max_length(int max);
00269 
00270         void set_text(const String& text);
00273 
00274         void set_activates_default(bool setting);
00281 
00282         void set_width_chars(int n_chars);
00289 
00293 
00294         const CursorPositionPropertyProxy prop_cursor_position()
00295         {
00296                 return CursorPositionPropertyProxy(this, &cursor_position_property);
00297         }
00299 
00300         const SelectionBoundPropertyProxy prop_selection_bound()
00301         {
00302                 return SelectionBoundPropertyProxy(this, &selection_bound_property);
00303         }
00305 
00306         const EditablePropertyProxy prop_editable()
00307         {
00308                 return EditablePropertyProxy(this, &editable_property);
00309         }
00311 
00312         const MaxLengthPropertyProxy prop_max_length()
00313         {
00314                 return MaxLengthPropertyProxy(this, &max_length_property);
00315         }
00317 
00318         const VisibilityPropertyProxy prop_visibility()
00319         {
00320                 return VisibilityPropertyProxy(this, &visibility_property);
00321         }
00323 
00324         const HasFramePropertyProxy prop_has_frame()
00325         {
00326                 return HasFramePropertyProxy(this, &has_frame_property);
00327         }
00329 
00330         const InvisibleCharPropertyProxy prop_invisible_char()
00331         {
00332                 return InvisibleCharPropertyProxy(this, &invisible_char_property);
00333         }
00335 
00336         const ActivatesDefaultPropertyProxy prop_activates_default()
00337         {
00338                 return ActivatesDefaultPropertyProxy(this, &activates_default_property);
00339         }
00342 
00343         const WidthCharsPropertyProxy prop_width_chars()
00344         {
00345                 return WidthCharsPropertyProxy(this, &width_chars_property);
00346         }
00348 
00349         const ScrollOffsetPropertyProxy prop_scroll_offset()
00350         {
00351                 return ScrollOffsetPropertyProxy(this, &scroll_offset_property);
00352         }
00354 
00355         const TextPropertyProxy prop_text()
00356         {
00357                 return TextPropertyProxy(this, &text_property);
00358         }
00360 
00364 
00365         const PopulatePopupSignalProxy sig_populate_popup()
00366         {
00367                 return PopulatePopupSignalProxy(this, &populate_popup_signal);
00368         }
00370 
00371         const ActviateSignalProxy sig_activate()
00372         {
00373                 return ActviateSignalProxy(this, &activate_signal);
00374         }
00376 
00377         const InsertAtCursorSignalProxy sig_insert_at_cursor()
00378         {
00379                 return InsertAtCursorSignalProxy(this, &insert_at_cursor_signal);
00380         }
00383 
00385 };
00386 
00387 } // namespace Gtk
00388 
00389 } // namespace Inti
00390 
00391 #endif // INTI_GTK_ENTRY_H
00392 
Main Page - Footer


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