libhildonmenu.h

00001 #ifndef __LIBMENU_H__
00002 #define __LIBMENU_H__
00003 
00004 #include <libxml/xmlreader.h>
00005 #include <gtk/gtk.h>
00006 #include <libintl.h>
00007 
00008 G_BEGIN_DECLS
00009 
00010 /* [Desktop Entry] */
00011 #define DESKTOP_ENTRY_TYPE_FIELD     "Type"
00012 #define DESKTOP_ENTRY_ICON_FIELD     "Icon"
00013 #define DESKTOP_ENTRY_NAME_FIELD     "Name"
00014 #define DESKTOP_ENTRY_EXEC_FIELD     "Exec"
00015 #define DESKTOP_ENTRY_SERVICE_FIELD  "X-Osso-Service"
00016 
00017 #define SEPARATOR_STRING   "SEPARATOR"
00018 #define EXTRAS_MENU_STRING "tana_fi_extras"
00019 
00020 /* Default directory for .desktop files */
00021 #define DEFAULT_APPS_DIR "/usr/share/applications/"
00022 #define ICON_FAVOURITES  "qgn_list_gene_favor"
00023 #define ICON_FOLDER      "qgn_list_gene_fldr_cls"
00024 #define ICON_DEFAULT_APP "qgn_list_gene_default_app"
00025 #define ICON_SIZE        26
00026 
00027 #define EMBLEM_EXPANDER_OPEN   "qgn_list_gene_fldr_exp"
00028 #define EMBLEM_EXPANDER_CLOSED "qgn_list_gene_fldr_clp"
00029 
00030 /* This string is only displayed in the task navigator applet */
00031 #define FAVOURITES_LOGICAL_STRING "tncpa_li_of_favourites"
00032 #define FAVOURITES_NAME  dgettext("osso-applet-tasknavigator", FAVOURITES_LOGICAL_STRING)
00033 
00034 /* Default systemwide menu */
00035 #define SYSTEMWIDE_MENU_FILE "/etc/xdg/menus/applications.menu"
00036 
00037 /* User specific menu. $HOME is prepended to this! */
00038 #define USER_MENU_FILE ".osso/menus/applications.menu"
00039 
00040 
00041 /* TreeModel items */
00042 enum {
00043     TREE_MODEL_NAME = 0,
00044     TREE_MODEL_ICON,
00045     TREE_MODEL_EMBLEM_EXPANDER_OPEN,
00046     TREE_MODEL_EMBLEM_EXPANDER_CLOSED,
00047     TREE_MODEL_EXEC,
00048     TREE_MODEL_SERVICE,
00049     TREE_MODEL_DESKTOP_ID,
00050     TREE_MODEL_COLUMNS
00051 };
00052 
00053 /* Menu types */
00054 enum {
00055     USER_MENU = 0,        /* User specific menu */
00056     SYSTEMWIDE_MENU,      /* The (default) systemwide menu */
00057     MENU_TYPES            /* Number of menu types */
00058 };
00059 
00060 
00061 
00062 /* Function for getting an icon */
00063 GdkPixbuf *get_icon(const char *icon_name, int icon_size);
00064 
00065 /* Function for getting the menu contents */
00066 GtkTreeModel *get_menu_contents(void);
00067 
00068 /* Function for finding the first and last folders on root level
00069  * i.e. under Favourites.
00070  *
00071  * model        - The tree model which to search for the folders
00072  * first_folder - GtkTreePath to be set to point to the first folder
00073  * last_folder  - GtkTreePath to be set to point to the last folder
00074  */
00075 void find_first_and_last_root_level_folders( GtkTreeModel *model,
00076         GtkTreePath **first_folder, GtkTreePath **last_folder );
00077 
00078 /* Function for setting the separators to correct positions 
00079  *
00080  * model - The tree model of the menu in which we want to set the separators.
00081  *
00082  * Returns TRUE on success, FALSE on failure.
00083  */
00084 gboolean set_separators( GtkTreeModel *model );
00085 
00086 /* Function for setting the menu contents, i.e. writing it to the file */
00087 gboolean set_menu_contents( GtkTreeModel *model );
00088 
00089 G_END_DECLS
00090 
00091 #endif

Generated on Fri Jun 9 16:23:10 2006 for maemo-af-desktop-documentation by  doxygen 1.4.6