00001 #ifndef __ERGTK_PAGE_BAR_H__ 00002 #define __ERGTK_PAGE_BAR_H__ 00003 00004 /** 00005 * \file erGtkPageBar.h 00006 * \brief ereader gtk library - GtkPageBar widget 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 GTK_PAGEBAR_TYPE (gtk_pagebar_get_type ()) 00034 #define GTK_PAGEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_PAGEBAR_TYPE, GtkPagebar)) 00035 #define GTK_PAGEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_PAGEBAR_TYPE, GtkPagebarClass)) 00036 #define IS_GTK_PAGEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_PAGEBAR_TYPE)) 00037 #define IS_GTK_PAGEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_PAGEBAR_TYPE)) 00038 00039 typedef struct _GtkPagebar GtkPagebar; 00040 typedef struct _GtkPagebarClass GtkPagebarClass; 00041 00042 /** 00043 * @brief Creates a new gtk pagebar widget. 00044 * 00045 * @param - 00046 * 00047 * @return Reference to created widget. 00048 */ 00049 GtkWidget *gtk_pagebar_new(void); 00050 00051 /** 00052 * @brief Specify the total number of page. 00053 * @param pagebar The pagebar object. 00054 * @param number The total page number. 00055 * @return It does not have return value. 00056 */ 00057 void gtk_pagebar_set_number_of_pages(GtkPagebar * pagebar, 00058 const unsigned int number); 00059 00060 /** 00061 * @brief Get total number from pagebar. 00062 * @param pagebar The pagebar object. 00063 * @return return the total number of pages 00064 */ 00065 unsigned int gtk_pagebar_get_number_of_pages(GtkPagebar * pagebar); 00066 00067 /** 00068 * @brief Specify the current page. 00069 * @param pagebar The pagebar object. 00070 * @param page The current page number. 00071 * @return It returns FALSE if current page is ouf of range. Otherwise 00072 * It returns TRUE. 00073 */ 00074 gboolean gtk_pagebar_set_current_page(GtkPagebar * pagebar, 00075 const unsigned int page); 00076 00077 /** 00078 * @brief Get the current page. 00079 * @param pagebar The pagebar object. 00080 * @return Return the number of current page 00081 */ 00082 unsigned int gtk_pagebar_get_current_page(GtkPagebar * pagebar); 00083 00084 /** 00085 * @brief Add a bookmark to the specified page. 00086 * @param pagebar The pagebar object. 00087 * @param page The target page number. 00088 * @return It returns FALSE if set fails, otherwise 00089 * returns TRUE. 00090 */ 00091 gboolean gtk_pagebar_set_bookmark(GtkPagebar * pagebar, 00092 const unsigned int page); 00093 00094 /** 00095 * @brief Remove a bookmark of specified page 00096 * @param pagebar The pagebar object. 00097 * @param page The target page number. 00098 * @return Returns TRUE if sucessfully delete the bookmark, otherwise 00099 * returns FALSE 00100 */ 00101 gboolean gtk_pagebar_delete_bookmark(GtkPagebar * pagebar, 00102 const unsigned int page); 00103 00104 /** 00105 * @brief Get the read only bookmarks array 00106 * @param pagebar The pagebar object. 00107 * @return Returns the READ ONLY bookmarks array. It can be NULL 00108 */ 00109 const GArray* gtk_pagebar_get_bookmarks(GtkPagebar * pagebar); 00110 00111 /** 00112 * @brief Reset the pagebar. 00113 * @param pagebar The pagebar object. 00114 * @return This function does not have return value. 00115 */ 00116 void gtk_pagebar_reset(GtkPagebar * pagebar); 00117 00118 /** 00119 * @brief Get type of gtk pagebar widget. 00120 * 00121 * @returns type 00122 */ 00123 GType gtk_pagebar_get_type(void); 00124 00125 /** 00126 * @brief Get the minimal height of pagebar. If the widget height is less 00127 than minimal height, the pagebar cannot be displayed normally. 00128 * @param pagebar The pagebar object. 00129 * @return return the minimal height of page bar. 00130 */ 00131 unsigned int gtk_pagebar_get_minimal_height(GtkPagebar * pagebar); 00132 00133 /** 00134 * @brief Redraw the pagebar. 00135 * @param pagebar The pagebar object. 00136 */ 00137 void gtk_pagebar_update(GtkPagebar * pagebar); 00138 00139 G_END_DECLS 00140 00141 #endif // __GTK_PAGE_BAR_H__