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

treestore.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_TREE_STORE_HH 00025 #define GFC_GTK_TREE_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_TREE_STORE_H__ 00044 #include <gtk/gtktreestore.h> 00045 #endif 00046 00047 namespace GFC { 00048 00049 namespace Gtk { 00050 00051 class TreeIter; 00052 00060 00061 class TreeStore : public G::Object, public TreeModel, public TreeSortable, public TreeDragSource, public TreeDragDest 00062 { 00063 friend class G::Object; 00064 00065 TreeStore(const TreeStore&); 00066 TreeStore& operator=(const TreeStore&); 00067 00068 protected: 00071 00072 explicit TreeStore(GtkTreeStore *tree_store, bool owns_reference = true); 00079 00081 00082 public: 00085 00086 TreeStore(int n_columns, ...); 00093 00094 TreeStore(int n_columns, const GType types[]); 00099 00100 virtual ~TreeStore(); 00102 00106 00107 GtkTreeStore* gtk_tree_store() const; 00109 00110 operator GtkTreeStore* () const; 00112 00113 bool is_ancestor(const TreeIter& iter, const TreeIter& descendant) const; 00119 00120 int iter_depth(const TreeIter& iter) const; 00126 00127 bool iter_is_valid(const TreeIter& iter) const; 00133 00137 00138 TreeIter prepend(TreeIter *parent = 0); 00147 00148 TreeIter append(TreeIter *parent = 0); 00157 00158 TreeIter insert(int position, TreeIter *parent = 0); 00169 00170 TreeIter insert_before(TreeIter& sibling, TreeIter *parent = 0); 00179 00180 TreeIter insert_after(TreeIter& sibling, TreeIter *parent = 0); 00189 00190 bool remove(TreeIter& iter); 00197 00198 void clear(); 00200 00201 void reorder(const TreeIter& parent, int *new_order); 00208 00209 void swap(const TreeIter& a, const TreeIter& b); 00215 00216 void move_after(const TreeIter& iter, const TreeIter *position); 00224 00225 void move_before(const TreeIter& iter, const TreeIter *position); 00233 00234 void set_value(const TreeIter& iter, int column, const G::Value& value); 00241 00242 void set_value(const TreeIter& iter, int column, const char *str); 00247 00251 00252 template<typename DataType> 00253 void set_value(const TreeIter& iter, int column, const DataType& data); 00262 00263 template<typename DataType> 00264 void set_enum(const TreeIter& iter, int column, const DataType& data); 00273 00274 template<typename DataType> 00275 void set_object(const TreeIter& iter, int column, const DataType& data); 00283 00284 template<typename DataType> 00285 void set_pointer(const TreeIter& iter, int column, const DataType& data); 00296 00298 }; 00299 00300 } // namespace Gtk 00301 00302 } // namespace GFC 00303 00304 #include <gfc/gtk/inline/treestore.inl> 00305 00306 #endif // GFC_GTK_TREE_STORE_HH 00307

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