6 * @brief Contains the structures and methods to support the Desktop
8 * @addtogroup Efreet_Menu Efreet_Menu: The FDO Desktop Menu Specification
9 * functions and structures
17 typedef enum Efreet_Menu_Entry_Type
19 EFREET_MENU_ENTRY_MENU,
20 EFREET_MENU_ENTRY_DESKTOP,
21 EFREET_MENU_ENTRY_SEPARATOR,
22 EFREET_MENU_ENTRY_HEADER
23 } Efreet_Menu_Entry_Type;
28 typedef struct Efreet_Menu Efreet_Menu;
32 * Stores information on a entry in the menu
36 Efreet_Menu_Entry_Type type;
37 const char *id; /**< File-id for desktop and relative name for menu */
39 const char *name; /**< Name this entry should show */
40 const char *icon; /**< Icon for this entry */
42 Efreet_Desktop *desktop; /**< The desktop we refer too */
43 Eina_List *entries; /**< The menu items */
48 * @return Returns no value
49 * @brief Initialize legacy kde support. This function blocks while
50 * the kde-config script is run.
52 EAPI int efreet_menu_kde_legacy_init(void);
55 * @param name The internal name of the menu
56 * @return Returns the Efreet_Menu on success or
58 * @brief Creates a new menu
60 EAPI Efreet_Menu *efreet_menu_new(const char *name);
63 * @brief Override which file is used for menu creation
64 * @param file The file to use for menu creation
66 * This file is only used if it exists, else the standard files will be used
69 EAPI void efreet_menu_file_set(const char *file);
72 * @return Returns the Efreet_Menu_Internal representation of the default menu or
74 * @brief Creates the default menu representation
76 EAPI Efreet_Menu *efreet_menu_get(void);
79 * @param path The path of the menu to load
80 * @return Returns the Efreet_Menu_Internal representation on success or NULL on
82 * @brief Parses the given .menu file and creates the menu representation
84 EAPI Efreet_Menu *efreet_menu_parse(const char *path);
87 * @param menu The menu to work with
88 * @param path The path where the menu should be saved
89 * @return Returns 1 on success, 0 on failure
90 * @brief Saves the menu to file
92 EAPI int efreet_menu_save(Efreet_Menu *menu, const char *path);
95 * @param menu The Efreet_Menu to free
96 * @return Returns no value
97 * @brief Frees the given structure
99 EAPI void efreet_menu_free(Efreet_Menu *menu);
103 * @param menu The menu to work with
104 * @param desktop The desktop to insert
105 * @param pos The position to place the new desktop
106 * @return Returns 1 on success, 0 on failure
107 * @brief Insert a desktop element in a menu structure. Only accepts desktop files
108 * in default directories.
110 EAPI int efreet_menu_desktop_insert(Efreet_Menu *menu,
111 Efreet_Desktop *desktop,
115 * @param menu The menu to work with
116 * @param desktop The desktop to remove
117 * @return Returns 1 on success, 0 on failure
118 * @brief Remove a desktop element in a menu structure. Only accepts desktop files
119 * in default directories.
121 EAPI int efreet_menu_desktop_remove(Efreet_Menu *menu,
122 Efreet_Desktop *desktop);
126 * @param menu The menu to work with
127 * @param menu The menu to work with
128 * @param indent The indent level to print the menu at
129 * @return Returns no value
130 * @brief Dumps the contents of the menu to the command line
132 EAPI void efreet_menu_dump(Efreet_Menu *menu, const char *indent);