diff options
Diffstat (limited to 'libs/gtkmm2/gtk/gtkmm/iconview.h')
-rw-r--r-- | libs/gtkmm2/gtk/gtkmm/iconview.h | 596 |
1 files changed, 596 insertions, 0 deletions
diff --git a/libs/gtkmm2/gtk/gtkmm/iconview.h b/libs/gtkmm2/gtk/gtkmm/iconview.h new file mode 100644 index 0000000000..26fc442662 --- /dev/null +++ b/libs/gtkmm2/gtk/gtkmm/iconview.h @@ -0,0 +1,596 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _GTKMM_ICONVIEW_H +#define _GTKMM_ICONVIEW_H + +#include <glibmm.h> + +/* $Id$ */ + +/* iconview.h + * + * Copyright (C) 1998-2004 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <gtkmm/container.h> +#include <gtkmm/treemodel.h> +#include <gtkmm/treepath.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GtkIconView GtkIconView; +typedef struct _GtkIconViewClass GtkIconViewClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Gtk +{ class IconView_Class; } // namespace Gtk +namespace Gtk +{ + +/** TODO + * + * @ingroup Widgets + * @ingroup Containers + */ + +class IconView : public Container +{ + public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef IconView CppObjectType; + typedef IconView_Class CppClassType; + typedef GtkIconView BaseObjectType; + typedef GtkIconViewClass BaseClassType; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + virtual ~IconView(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +private: + friend class IconView_Class; + static CppClassType iconview_class_; + + // noncopyable + IconView(const IconView&); + IconView& operator=(const IconView&); + +protected: + explicit IconView(const Glib::ConstructParams& construct_params); + explicit IconView(GtkIconView* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GtkObject. + GtkIconView* gobj() { return reinterpret_cast<GtkIconView*>(gobject_); } + + ///Provides access to the underlying C GtkObject. + const GtkIconView* gobj() const { return reinterpret_cast<GtkIconView*>(gobject_); } + + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment); + virtual void on_item_activated(const TreeModel::Path& path); + virtual void on_selection_changed(); + + +private: + +public: + + IconView(); + explicit IconView(const Glib::RefPtr<TreeModel>& model); + + + /** Sets the model for a Gtk::IconView. + * If the @a icon_view already has a model set, it will remove + * it before setting the new model. If @a model is <tt>0</tt>, then + * it will unset the old model. + * + * Since: 2.6 + * @param model The model. + */ + void set_model(const Glib::RefPtr<TreeModel>& model); + + /** Returns the model the Gtk::IconView is based on. Returns <tt>0</tt> if the + * model is unset. + * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used. + * + * Since: 2.6. + */ + Glib::RefPtr<TreeModel> get_model(); + + /** Returns the model the Gtk::IconView is based on. Returns <tt>0</tt> if the + * model is unset. + * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used. + * + * Since: 2.6. + */ + Glib::RefPtr<const TreeModel> get_model() const; + + + /** Sets the column with text for @a icon_view to be @a column . The text + * column must be of type G::TYPE_STRING. + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_text_column(int column); + + /** Sets the column with text for @a icon_view to be @a column . The text + * column must be of type G::TYPE_STRING. + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_text_column(const TreeModelColumnBase& model_column); + + /** Returns the column with text for @a icon_view . + * @return The text column, or -1 if it's unset. + * + * Since: 2.6. + */ + int get_text_column() const; + + /** Sets the column with markup information for @a icon_view to be + * @a column . The markup column must be of type G::TYPE_STRING. + * If the markup column is set to something, it overrides + * the text column set by set_text_column(). + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_markup_column(int column); + + /** Sets the column with markup information for @a icon_view to be + * @a column . The markup column must be of type G::TYPE_STRING. + * If the markup column is set to something, it overrides + * the text column set by set_text_column(). + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_markup_column(const TreeModelColumnBase& column); + + /** Returns the column with markup text for @a icon_view . + * @return The markup column, or -1 if it's unset. + * + * Since: 2.6. + */ + int get_markup_column() const; + + /** Sets the column with pixbufs for @a icon_view to be @a column . The pixbuf + * column must be of type Gdk::TYPE_PIXBUF + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_pixbuf_column(int column); + + /** Sets the column with pixbufs for @a icon_view to be @a column . The pixbuf + * column must be of type Gdk::TYPE_PIXBUF + * + * Since: 2.6 + * @param column A column in the currently used model. + */ + void set_pixbuf_column(const TreeModelColumnBase& column); + + /** Returns the column with pixbufs for @a icon_view . + * @return The pixbuf column, or -1 if it's unset. + * + * Since: 2.6. + */ + int get_pixbuf_column() const; + + + /** Sets the ::orientation property which determines whether the labels + * are drawn beside the icons instead of below. + * + * Since: 2.6 + * @param orientation The relative position of texts and icons. + */ + void set_orientation(Orientation orientation); + + /** Returns the value of the ::orientation property which determines + * whether the labels are drawn beside the icons instead of below. + * @return The relative position of texts and icons + * + * Since: 2.6. + */ + Orientation get_orientation() const; + + + void set_columns(int columns); + + int get_columns() const; + + void set_item_width(int item_width); + + int get_icon_width() const; + + void set_spacing(int spacing); + + int get_spacing() const; + + void set_row_spacing(int row_spacing); + + gint get_row_spacing() const; + + void set_column_spacing(int column_spacing); + + int get_column_spacing() const; + + + void set_margin(int margin); + + int get_margin() const; + + + /** Finds the path at the point ( @a x , @a y ), relative to widget coordinates. + * @param x The x position to be identified. + * @param y The y position to be identified. + * @return The Gtk::TreePath corresponding to the icon or <tt>0</tt> + * if no icon exists at that position. + * + * Since: 2.6. + */ + TreeModel::Path get_path_at_pos(int x, int y) const; + + /** For instance, + * void on_foreach(const Gtk::TreeModel::Path& path); + */ + typedef sigc::slot<void, const TreeModel::Path&> SlotForeach; + + /** Calls a function for each selected icon. Note that the model or + * selection cannot be modified from within this function. + * + * @param slot The callback to call for each selected icon. + */ + void selected_foreach(const SlotForeach& slot); + + +//Default value?: + + /** Sets the selection mode of the @a icon_view . + * + * Since: 2.6 + * @param mode The selection mode. + */ + void set_selection_mode(SelectionMode mode); + + /** Gets the selection mode of the @a icon_view . + * @return The current selection mode + * + * Since: 2.6. + */ + SelectionMode get_selection_mode() const; + + /** Selects the row at @a path . + * + * Since: 2.6 + * @param path The Gtk::TreePath to be selected. + */ + void select_path(const TreeModel::Path& path); + + /** Unselects the row at @a path . + * + * Since: 2.6 + * @param path The Gtk::TreePath to be unselected. + */ + void unselect_path(const TreeModel::Path& path); + + /** Returns <tt>true</tt> if the icon pointed to by @a path is currently + * selected. If @a icon does not point to a valid location, <tt>false</tt> is returned. + * @param path A Gtk::TreePath to check selection on. + * @return <tt>true</tt> if @a path is selected. + * + * Since: 2.6. + */ + bool path_is_selected(const TreeModel::Path& path) const; + + + #ifndef DOXYGEN_SHOULD_SKIP_THIS + //TODO: I'm not sure about these to_*() functions. murrayc. + struct TreePathTraits + { + typedef TreePath CppType; + typedef const GtkTreePath* CType; + typedef GtkTreePath* CTypeNonConst; + + static CType to_c_type (const CppType& obj) { return obj.gobj(); } + static CType to_c_type (const CType& obj) { return obj; } + static CppType to_cpp_type (const CType& obj) { return CppType(const_cast<CTypeNonConst>(obj), true); } + static void release_c_type (const CType&) {} + }; + #endif //DOXYGEN_SHOULD_SKIP_THIS + + typedef Glib::ListHandle<TreePath, TreePathTraits> ArrayHandle_TreePaths; + + + /** Creates a list of paths of all selected items. Additionally, if you are + * planning on modifying the model after calling this function, you may + * want to convert the returned list into a list of Gtk::TreeRowReference<!-- -->s. + * To do this, you can use Gtk::Tree::row_reference_new(). + * + * To free the return value, use: + * @code + * g_list_foreach (list, gtk_tree_path_free, <tt>0</tt>); + * g_list_free (list); + * @endcode + * @return A G::List containing a Gtk::TreePath for each selected row. + * + * Since: 2.6. + */ + ArrayHandle_TreePaths get_selected_items() const; + + + /** Selects all the icons. @a icon_view must has its selection mode set + * to Gtk::SELECTION_MULTIPLE. + * + * Since: 2.6 + */ + void select_all(); + + /** Unselects all the icons. + * + * Since: 2.6 + */ + void unselect_all(); + + /** Activates the item determined by @a path . + * + * Since: 2.6 + * @param path The Gtk::TreePath to be activated. + */ + void item_activated(const TreeModel::Path& path); + + + Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments(); + + + Glib::SignalProxy1< void,const TreeModel::Path& > signal_item_activated(); + + + Glib::SignalProxy0< void > signal_selection_changed(); + + + /* Key binding signals */ + + + /** Model column used to retrieve the icon pixbuf from. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_pixbuf_column() ; + +/** Model column used to retrieve the icon pixbuf from. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_pixbuf_column() const; + + /** Model column used to retrieve the text from. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_text_column() ; + +/** Model column used to retrieve the text from. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_text_column() const; + + /** Model column used to retrieve the text if using Pango markup. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_markup_column() ; + +/** Model column used to retrieve the text if using Pango markup. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_markup_column() const; + + /** The selection mode. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<SelectionMode> property_selection_mode() ; + +/** The selection mode. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<SelectionMode> property_selection_mode() const; + + /** How the text and icon of each item are positioned relative to each other. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Orientation> property_orientation() ; + +/** How the text and icon of each item are positioned relative to each other. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Orientation> property_orientation() const; + + /** The model for the icon view. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy< Glib::RefPtr<TreeModel> > property_model() ; + +/** The model for the icon view. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > property_model() const; + + /** Number of columns to display. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_columns() ; + +/** Number of columns to display. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_columns() const; + + /** The width used for each item. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_item_width() ; + +/** The width used for each item. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_item_width() const; + + /** Space which is inserted between cells of an item. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_spacing() ; + +/** Space which is inserted between cells of an item. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_spacing() const; + + /** Space which is inserted between grid rows. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_row_spacing() ; + +/** Space which is inserted between grid rows. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_row_spacing() const; + + /** Space which is inserted between grid column. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_column_spacing() ; + +/** Space which is inserted between grid column. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_column_spacing() const; + + /** Space which is inserted at the edges of the icon view. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_margin() ; + +/** Space which is inserted at the edges of the icon view. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_margin() const; + + +}; + +} // namespace Gtk + + +namespace Glib +{ + /** @relates Gtk::IconView + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Gtk::IconView* wrap(GtkIconView* object, bool take_copy = false); +} +#endif /* _GTKMM_ICONVIEW_H */ + |