GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

selection.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 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 Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00028 00029 #ifndef GFC_GTK_SELECTION_HH 00030 #define GFC_GTK_SELECTION_HH 00031 00032 #ifndef GFC_G_BOXED_HH 00033 #include <gfc/glib/boxed.hh> 00034 #endif 00035 00036 #ifndef GFC_GDK_TYPES_HH 00037 #include <gfc/gdk/types.hh> 00038 #endif 00039 00040 #ifndef GFC_GTK_DND_HH 00041 #include <gfc/gtk/dnd.hh> 00042 #endif 00043 00044 #ifndef _CPP_VECTOR 00045 #include <vector> 00046 #endif 00047 00048 namespace GFC { 00049 00050 namespace Gdk { 00051 class Display; 00052 } 00053 00054 namespace Gtk { 00055 00056 class TreeModel; 00057 class TreePath; 00058 00071 00072 class SelectionData : public G::Boxed 00073 { 00074 SelectionData(const SelectionData&); 00075 SelectionData& operator=(const SelectionData&); 00076 00077 public: 00080 00081 explicit SelectionData(GtkSelectionData *data); 00089 00090 SelectionData(GtkSelectionData *data, bool copy); 00100 00101 ~SelectionData(); 00103 00107 00108 GtkSelectionData* gtk_selection_data() const; 00110 00111 bool is_valid() const; 00113 00114 Gdk::Atom selection() const; 00116 00117 String get_selection() const; 00119 00120 Gdk::Atom target() const; 00122 00123 String get_target() const; 00125 00126 Gdk::Atom type() const; 00128 00129 String get_type() const; 00131 00132 int format() const; 00134 00135 unsigned char* data() const; 00137 00138 int length() const; 00140 00141 Gdk::Display* display() const; 00143 00144 String get_text() const; 00148 00149 bool get_targets(std::vector<Gdk::Atom>& targets) const; 00156 00157 bool get_targets(std::vector<String>& targets) const; 00165 00166 bool targets_include_text() const; 00168 00172 00173 void set(Gdk::Atom type, int format, const void *data, int length); 00181 00182 bool set_text(const char *str); 00183 bool set_text(const String& str); 00188 00192 00193 bool get_row_drag_data(TreeModel **model, Pointer<TreePath> *path) const; 00205 00206 bool set_row_drag_data(TreeModel& tree_model, const TreePath& path); 00214 00216 }; 00217 00230 00231 class TargetEntry 00232 { 00233 GtkTargetEntry entry_; 00234 00235 public: 00238 00239 TargetEntry(); 00241 00242 TargetEntry(const char *target_name, unsigned int unique_id, Gtk::TargetFlagsField drag_flags = 0); 00243 TargetEntry(const String& target_name, unsigned int unique_id, Gtk::TargetFlagsField drag_flags = 0); 00251 00255 00256 GtkTargetEntry* gtk_target_entry() const; 00258 00259 const char* target() const; 00261 00262 unsigned int flags() const; 00266 00267 unsigned int info() const; 00270 00274 00275 void set(const char *target_name, unsigned int unique_id, Gtk::TargetFlagsField drag_flags = 0); 00276 void set(const String& target_name, unsigned int unique_id, Gtk::TargetFlagsField drag_flags = 0); 00284 00286 }; 00287 00301 00302 class TargetList : public GFC::Object 00303 { 00304 GtkTargetList *target_list_; 00305 00306 public: 00309 00310 TargetList(); 00312 00313 TargetList(const std::vector<TargetEntry>& targets); 00316 00317 explicit TargetList(GtkTargetList *target_list); 00320 00321 TargetList(const TargetList& src); 00324 00325 virtual ~TargetList(); 00327 00328 TargetList& operator=(const TargetList& src); 00331 00335 00336 GtkTargetList* gtk_target_list() const; 00338 00339 operator GtkTargetList* () const; 00341 00345 00346 void add(Gdk::Atom target, unsigned int flags, unsigned int info); 00351 00352 void add(const TargetEntry& entry); 00355 00356 void add(const std::vector<TargetEntry>& targets); 00359 00360 void remove(Gdk::Atom target); 00363 00364 bool find(Gdk::Atom target, unsigned int *info); 00369 00371 }; 00372 00373 } // namespace Gtk 00374 00375 } // namespace GFC 00376 00377 #include <gfc/gtk/inline/selection.inl> 00378 00379 #endif // GFC_GTK_SELECTION_HH 00380

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8