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

liststore.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 00023 00024 #ifndef GFC_GTK_LIST_STORE_HH 00025 #define GFC_GTK_LIST_STORE_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_TREE_MODEL_HH 00032 #include <gfc/gtk/treemodel.hh> 00033 #endif 00034 00035 #ifndef GFC_GTK_TREE_SORTABLE_HH 00036 #include <gfc/gtk/treesortable.hh> 00037 #endif 00038 00039 #ifndef GFC_GTK_TREE_DND_HH 00040 #include <gfc/gtk/treednd.hh> 00041 #endif 00042 00043 #ifndef __GTK_LIST_STORE_H__ 00044 #include <gtk/gtkliststore.h> 00045 #endif 00046 00047 namespace GFC { 00048 00049 namespace Gtk { 00050 00051 class TreeIter; 00052 00147 00148 class ListStore : public G::Object, public TreeModel, public TreeSortable, public TreeDragSource, public TreeDragDest 00149 { 00150 friend class G::Object; 00151 00152 ListStore(const ListStore&); 00153 ListStore& operator=(const ListStore&); 00154 00155 protected: 00158 00159 explicit ListStore(GtkListStore *list_store, bool owns_reference = true); 00166 00168 00169 public: 00172 00173 ListStore(int n_columns, ...); 00181 00182 ListStore(int n_columns, const GType types[]); 00187 00188 virtual ~ListStore(); 00190 00194 00195 GtkListStore* gtk_list_store() const; 00197 00198 operator GtkListStore* () const; 00200 00201 bool iter_is_valid(const TreeIter& iter) const; 00208 00212 00213 TreeIter prepend(); 00219 00220 TreeIter append(); 00226 00227 TreeIter insert(int position); 00235 00236 TreeIter insert_before(TreeIter& sibling); 00243 00244 TreeIter insert_after(TreeIter& sibling); 00251 00252 bool remove(TreeIter& iter); 00259 00260 void clear(); 00262 00263 void reorder(int *new_order); 00268 00269 void swap(const TreeIter& a, const TreeIter& b); 00275 00276 void move_after(const TreeIter& iter, const TreeIter *position); 00283 00284 void move_before(const TreeIter& iter, const TreeIter *position); 00291 00292 void set_value(const TreeIter& iter, int column, const G::Value& value); 00299 00300 void set_value(const TreeIter& iter, int column, const char *str); 00305 00309 00310 template<typename DataType> 00311 void set_value(const TreeIter& iter, int column, const DataType& data); 00320 00321 template<typename DataType> 00322 void set_enum(const TreeIter& iter, int column, const DataType& data); 00331 00332 template<typename DataType> 00333 void set_object(const TreeIter& iter, int column, const DataType& data); 00341 00342 template<typename DataType> 00343 void set_pointer(const TreeIter& iter, int column, const DataType& data); 00354 00356 }; 00357 00358 } // namespace Gtk 00359 00360 } // namespace GFC 00361 00362 #include <gfc/gtk/inline/liststore.inl> 00363 00364 #endif // GFC_GTK_LIST_STORE_HH 00365

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