Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

gtk-utils.h

Go to the documentation of this file.
00001 /*
00002  * XetPan: a libEtPan! based Mail User Agent
00003  * Copyright (C) 2002-2003 Melvin Hadasht
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifndef GTK_UTILS_H
00021 #define GTK_UTILS_H
00022 
00023 #define XEP_GTKUTILS_OK      (1 << 0)
00024 #define XEP_GTKUTILS_CANCEL  (1 << 1)
00025 #define XEP_GTKUTILS_FILESEL (1 << 2)
00026 
00027 #include <gtk/gtkwidget.h>
00028 #include <gtk/gtktextbuffer.h>
00029 #include <gtk/gtkenums.h> /* GtkIconSize */
00030 #include <gtk/gtktreestore.h>
00031 #include <gtk/gtktreeview.h>
00032 #include <gtk/gtktable.h>
00033 
00034 #include <clist.h>
00035 
00036 #include "cntree.h"
00037 #include "message-types.h"
00038 #include "defines.h"
00039 
00040 #define GTK_DEST_CHARSET "UTF8"
00041 
00042 enum
00043   {
00044     TREE_DESCRIPTION_COL,
00045     TREE_TYPE_COL,
00046     TREE_WEIGHT_COL,
00047     TREE_POINTER_COL,
00048     TREE_POINTER2_COL,
00049     TREE_COL_NB
00050   };
00051 
00052 typedef int (*XePGtkUtilsSelectionCb)(void *adata, const char *fname);
00053 
00054 typedef struct XePGtkUtilsTree_s XePGtkUtilsTree;
00055 
00056 typedef void *(*XePGtkUtilsTreeCb)(XePGtkUtilsTree *utils_tree,
00057                                   void *data);
00058 
00059 void
00060 a_GtkUtils_dialog_get_string(const char *title, 
00061                              GtkWidget *parent,
00062                              const char *label_text,
00063                              const char *help_text,
00064                              const char *default_str,
00065                              int buttons,
00066                              int modal,
00067                              void (*callback)(void *d, int a, gchar *s),
00068                              void *data);
00069 
00092 int
00093 a_GtkUtils_dialog_alert(const char *title, 
00094                         GtkWidget *parent,
00095                         int type,
00096                         const char *message_text,
00097                         const char *help_text,
00098                         int buttons,
00099                         gboolean modal,
00100                         gboolean async,
00101                         void (*user_callback)(void *adata, int aresponse),
00102                         void *user_data);
00103 
00104 GtkWidget *
00105 a_GtkUtils_label_new_bold_large(const char *text);
00106 
00107 GtkWidget *
00108 a_GtkUtils_label_new_bold(const char *text);
00109 
00110 GtkWidget *
00111 a_GtkUtils_label_new_italic(const char *text);
00112 
00113 GtkWidget *
00114 a_GtkUtils_transient_new(GtkWidget *toplevel,
00115                          const char *title, 
00116                          int width,
00117                          int height);
00118 
00119 GtkWidget *
00120 a_GtkUtils_toplevel_new(const char *terminal, 
00121                         const char *title, 
00122                         const char **xpm_data,
00123                         int width,
00124                         int height);
00125 
00142 void
00143 a_GtkUtils_file_viewer_new(const char *terminal,
00144                            const char *title,
00145                            const char **xpm_data,
00146                            int width,
00147                            int height,
00148                            const char *filename,
00149                            const char *data,
00150                            size_t size,
00151                            const char *charset);
00152 
00153 GtkWidget *
00154 a_GtkUtils_text_view_new(const char *text, 
00155                          gint len, 
00156                          gboolean editable);
00157 
00158 void
00159 a_GtkUtils_text_buffer_append(GtkTextBuffer *buffer,
00160                               const char *text,
00161                               int size);
00162 
00163 void
00164 a_GtkUtils_text_buffer_create_tags(GtkTextBuffer *buffer);
00165 
00166 void
00167 a_GtkUtils_text_buffer_get_header_tag(XePMessageHeaderType type,
00168                                       const char **header_name_tag,
00169                                       const char **header_value_tag);
00170 
00171 void
00172 a_GtkUtils_text_buffer_convert_insert(GtkTextBuffer *buffer,
00173                                       GtkTextIter *iter,
00174                                       const char *text,
00175                                       size_t text_len,
00176                                       const char *source_charset);
00177 
00178 int
00179 a_GtkUtils_text_buffer_insert_image_file(GtkTextBuffer *buffer,
00180                                          GtkTextIter *iter,
00181                                          const char *filename);
00182 
00183 int
00184 a_GtkUtils_text_buffer_append_image_data(GtkTextBuffer *buffer,
00185                                          const char *data,
00186                                          size_t len);
00187 
00188 
00197 void
00198 a_GtkUtils_paned_shrink_control(GtkWidget *paned, gpointer anint);
00199 
00200 gboolean
00201 a_GtkUtils_filename_is_supported_image(const char *filename);
00202 
00218 void
00219 a_GtkUtils_file_selection(const char *title,
00220                           GtkWidget *toplevel,
00221                           const char *filename,
00222                           XePGtkUtilsSelectionCb callback,
00223                           void *data);
00224 
00225 void
00226 a_GtkUtils_dir_selection(const char *title,
00227                          GtkWidget *toplevel,
00228                          const char *dir,
00229                          XePGtkUtilsSelectionCb callback,
00230                          void *data);
00231 
00232 GtkWidget *
00233 a_GtkUtils_button_new_from_stock(const char *stock_id, 
00234                                  const char *text,
00235                                  gboolean use_markup,
00236                                  GtkIconSize icon_size);
00237 gchar *
00238 a_GtkUtils_make_display_name(GtkWidget *toplevel);
00239 
00240 XePGtkUtilsTree *
00241 a_GtkUtils_tree_new(GtkOrientation orientation, gboolean reordable,
00242                     GtkPolicyType hpolicy, GtkPolicyType vpolicy);
00243 
00244 void
00245 a_GtkUtils_tree_free(XePGtkUtilsTree *tree);
00246 
00247 GtkTreeStore *
00248 a_GtkUtils_tree_get_tree_store(XePGtkUtilsTree *utils_tree);
00249 
00250 GtkWidget *
00251 a_GtkUtils_tree_get_tree_view(XePGtkUtilsTree *utils_tree);
00252 
00253 void
00254 a_GtkUtils_tree_set_list(XePGtkUtilsTree *utils_tree,
00255                          clist *list);
00256 
00257 void
00258 a_GtkUtils_tree_set_tree(XePGtkUtilsTree *utils_tree,
00259                          cntree *ntree);
00260 
00261 GtkTreeSelection *
00262 a_GtkUtils_tree_get_selection(XePGtkUtilsTree *utils_tree);
00263 
00264 void
00265 a_GtkUtils_tree_selection_set_mode(XePGtkUtilsTree *utils_tree, 
00266                                    GtkSelectionMode mode);
00267 
00272 int
00273 a_GtkUtils_tree_selected_is_expanded(XePGtkUtilsTree *utils_tree);
00274 
00275 void
00276 a_GtkUtils_tree_set_path(XePGtkUtilsTree *utils_tree, GtkTreePath *path);
00277 
00278 void
00279 a_GtkUtils_tree_get_selected_data(XePGtkUtilsTree *utils_tree, 
00280                                   const char **description,
00281                                   int *type,
00282                                   int *weight,
00283                                   void **user_data1,
00284                                   void **user_data2);
00285 
00286 void
00287 a_GtkUtils_tree_refresh(XePGtkUtilsTree *utils_tree);
00288 
00289 void
00290 a_GtkUtils_tree_changed(XePGtkUtilsTree *utils_tree);
00291 
00292 void
00293 a_GtkUtils_tree_clear(XePGtkUtilsTree *utils_tree);
00294 
00295 GtkWidget *
00296 a_GtkUtils_tree_get_tree_widget(XePGtkUtilsTree *utils_tree);
00297 
00298 GtkWidget *
00299 a_GtkUtils_tree_get_buttons_widget(XePGtkUtilsTree *utils_tree);
00300 
00316 void
00317 a_GtkUtils_tree_set_add_callback(XePGtkUtilsTree *utils_tree,
00318                                  XePGtkUtilsTreeCb callback,
00319                                  void *data);
00320 
00345 void
00346 a_GtkUtils_tree_set_remove_callback(XePGtkUtilsTree *utils_tree,
00347                                     XePGtkUtilsTreeCb callback,
00348                                     void *data);
00349 void
00350 a_GtkUtils_tree_set_edit_callback(XePGtkUtilsTree *utils_tree,
00351                                   XePGtkUtilsTreeCb callback,
00352                                   void *data);
00353 void
00354 a_GtkUtils_tree_set_top_callback(XePGtkUtilsTree *utils_tree,
00355                                  XePGtkUtilsTreeCb callback,
00356                                  void *data);
00357 
00358 void
00359 a_GtkUtils_tree_set_changed_callback(XePGtkUtilsTree *utils_tree,
00360                                      XePGtkUtilsTreeCb callback,
00361                                      void *data);
00362 
00363 void
00364 a_GtkUtils_tree_set_refresh_callback(XePGtkUtilsTree *utils_tree,
00365                                      XePGtkUtilsTreeCb callback,
00366                                      void *data);
00367 
00368 void
00369 a_GtkUtils_tree_set_expanded_callback(XePGtkUtilsTree *utils_tree,
00370                                       XePGtkUtilsTreeCb callback,
00371                                       void *data);
00372 
00392 void 
00393 a_GtkUtils_tree_finalize_add(XePGtkUtilsTree *utils_tree, void *new_item);
00394 
00405 void 
00406 a_GtkUtils_tree_finalize_edit(XePGtkUtilsTree *utils_tree, void *edited_item);
00407 
00408 void
00409 a_GtkUtils_tree_finalize_remove(XePGtkUtilsTree *utils_tree);
00410 
00411 void
00412 a_GtkUtils_tree_finalize_top(XePGtkUtilsTree *utils_tree);
00413 
00414 #define XEP_GTKUTILS_TREE_WIDGET(utils_tree) \
00415   (a_GtkUtils_tree_get_tree_widget(utils_tree))
00416 
00417 #define XEP_GTKUTILS_TREE_BUTTONS(utils_tree) \
00418   (a_GtkUtils_tree_get_buttons_widget(utils_tree))
00419 
00420 GtkWidget *
00421 a_GtkUtils_table_add_entry(GtkTable *table, const char *name, GtkWidget *label,
00422                            const char *help, guint col, guint row);
00423 
00424 GtkWidget *
00425 a_GtkUtils_table_add_entry_full(GtkTable *table, const char *name, 
00426                                 GtkWidget *label,
00427                                 const char *help, guint col, guint width,
00428                                 guint row, guint height);
00429 
00430 #define a_GtkUtils_entry_set_text(entry, text) \
00431   (gtk_entry_set_text(GTK_ENTRY(entry), (text) ? (text) : ""))
00432 
00433 void a_GtkUtils_set_tip(GtkWidget *widget, const gchar *help);
00434 
00435 #endif

Generated on Wed Oct 22 15:50:38 2003 for XetPan by doxygen 1.3.2