erGtkIconView.h

Go to the documentation of this file.
00001 #ifndef __ERGTK_ICON_VIEW_H__
00002 #define __ERGTK_ICON_VIEW_H__
00003 
00004 /**
00005  * \file erGtkIconView.h
00006  * \brief ereader gtk library - GtkIconView object adapted for ereader system
00007  */
00008  
00009 /*
00010  * This file is part of libergtk.
00011  *
00012  * libergtk is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation, either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * libergtk is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00024  */
00025  
00026 /**
00027  * Copyright (C) 2008 iRex Technologies B.V.
00028  * All rights reserved.
00029  */
00030 
00031 G_BEGIN_DECLS
00032 
00033 #define ERGTK_TYPE_ICON_VIEW                (ergtk_icon_view_get_type())
00034 #define ERGTK_ICON_VIEW(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), ERGTK_TYPE_ICON_VIEW, erGtkIconView))
00035 #define ERGTK_IS_ICON_VIEW(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), ERGTK_TYPE_ICON_VIEW))
00036 
00037 #define ERGTK_ICON_VIEW_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),  ERGTK_TYPE_ICON_VIEW, erGtkIconViewClass))
00038 #define ERGTK_ICON_VIEW_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj),  ERGTK_TYPE_ICON_VIEW, erGtkIconViewClass))
00039 #define ERGTK_IS_ICON_VIEW_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE((klass),  ERGTK_TYPE_ICON_VIEW))
00040 
00041 #define ERGTK_ICON_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ERGTK_TYPE_ICON_VIEW, erGtkIconViewPrivate))
00042 
00043 typedef enum
00044 {
00045     ERGTK_ICON_VIEW_PRESS_SHORT_UP,
00046     ERGTK_ICON_VIEW_PRESS_SHORT_DOWN,
00047     ERGTK_ICON_VIEW_PRESS_SHORT_LEFT,
00048     ERGTK_ICON_VIEW_PRESS_SHORT_RIGHT,
00049     ERGTK_ICON_VIEW_PRESS_LONG_UP,
00050     ERGTK_ICON_VIEW_PRESS_LONG_DOWN,
00051     ERGTK_ICON_VIEW_PRESS_LONG_LEFT,
00052     ERGTK_ICON_VIEW_PRESS_LONG_RIGHT,
00053     ERGTK_ICON_VIEW_PRESS_ACTIVATE
00054 } erGtkIconViewKeyPress;
00055 
00056 typedef struct _erGtkIconView      erGtkIconView;
00057 typedef struct _erGtkIconViewClass erGtkIconViewClass;
00058 
00059 /**===========================================================================
00060  *
00061  * Class Name: erGtkIconView
00062  *
00063  * @brief:     Derive from GtkIconView.
00064  *             Properties:
00065  *             navigate-mode       gchar *       READ/WRITE
00066  *             "normal-navigate-mode" default navigate mode. 
00067  *             "simple-navigate-mode" translate up/down to left/right.
00068  *
00069  *==========================================================================*/
00070 
00071 struct _erGtkIconView
00072 {
00073     GtkIconView            parent;                // parent class
00074     
00075     // private
00076     struct _erGtkIconView  *next;
00077     struct _erGtkIconView  *previous;
00078     
00079     gint num_rows;
00080     gint num_cols;
00081 };
00082 
00083 struct _erGtkIconViewClass
00084 {
00085     GtkIconViewClass parent_class;
00086 
00087     // virtual methods
00088 
00089     // signal handlers
00090     gboolean (*pre_move_cursor) ( erGtkIconView         *icon_view,
00091                                   erGtkIconViewKeyPress navigate   );
00092 };
00093 
00094 GtkWidget          *ergtk_icon_view_new                     (void);
00095 GtkWidget          *ergtk_icon_view_new_with_model          (GtkTreeModel           *model);
00096 
00097 void                ergtk_icon_view_set_model               (erGtkIconView          *er_iconview,
00098                                                              GtkTreeModel           *model);
00099 
00100 void                ergtk_icon_view_set_next                (erGtkIconView          *er_iconview,
00101                                                              erGtkIconView          *next);
00102 
00103 void                ergtk_icon_view_set_previous            (erGtkIconView          *er_iconview,
00104                                                              erGtkIconView          *previous);
00105 
00106 void                ergtk_icon_view_get_view_size           (erGtkIconView          *er_iconview,
00107                                                              gint                   *num_rows,
00108                                                              gint                   *num_cols,
00109                                                              gint                   *num_items);
00110 
00111 void                ergtk_icon_view_get_icon_size           (erGtkIconView          *er_iconview,
00112                                                              gint                   *icon_width,
00113                                                              gint                   *icon_height);
00114 
00115 void                ergtk_icon_view_get_cursor              (erGtkIconView          *er_iconview,
00116                                                              gint                   *row,
00117                                                              gint                   *col);
00118 
00119 void                ergtk_icon_view_set_cursor              (erGtkIconView          *er_iconview,
00120                                                              gint                   row,
00121                                                              gint                   col);
00122 
00123 void                ergtk_icon_view_set_focus_mode          (erGtkIconView          *er_listview, 
00124                                                              gboolean               focus_in,
00125                                                              gboolean               focus_out);
00126 
00127 
00128 /**
00129  * get type of erGtkIconView widget
00130  *
00131  * @returns type
00132  */
00133 GType ergtk_icon_view_get_type(void);
00134 
00135 
00136 G_END_DECLS
00137 
00138 #endif  // __ERGTK_ICON_VIEW_H__
Generated by  doxygen 1.6.2-20100208