/*
 *  meniou
 *
 *  a light modular menu application
 *  Copyright (C) 2011-2013 Valère Monseur
 *
 *  This file is part of meniou.
 *
 *  meniou is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  meniou is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with meniou. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _MENIOU_MODULE_H
#define _MENIOU_MODULE_H 1

#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib.h>

/*
 * The purpose of this function is to create a new instance of a menu and
 * perform any required initialisation.
 *
 * It receives as input parameter the module name as well as
 * the path in which the module configuration file(s) has(have) to reside.
 *
 * It has to return a gpointer to the internal data structure of that menu.
 */

gpointer meniou_module_initialise (gchar *config_module_path, gchar *module_name);

/*
 * The purpose of this function is to perform any finalisation process
 * required to free a menu instance.
 *
 * After that function call, the gpointer to the menu is to be considered invalid.
 */

void meniou_module_finalise (gpointer meniou);

/*
 * The purpose of this function is to request the addition of all entries
 * in the menu. It has to be done by calling the function 'add_entry_callback'
 * received as parameter for each entry that has to be added in the menu,
 * like this:
 *
 *   add_entry_callback (gpointer_to_an_entry);
 */

void meniou_module_add_entries (gpointer meniou, GFunc add_entry_callback);

/*
 * The purpose of this function is to return the visibility status
 * of the related entry in the menu.
 */

gboolean meniou_module_get_entry_visible (gpointer meniou, gpointer entry);

/*
 * The purpose of this function is to return the icon of the related entry
 * in the menu. The requested icon size is received as input parameter.
 */

GdkPixbuf* meniou_module_get_entry_icon (gpointer meniou, gpointer entry, gint icon_size);

/*
 * The purpose of this function is to return the name of the related entry
 * in the menu.
 */

gchar* meniou_module_get_entry_name (gpointer meniou, gpointer entry);

/*
 * The purpose of this function is to execute the command of the related entry.
 */

gboolean meniou_module_exec_entry (gpointer meniou, gpointer entry);

/*
 * The purpose of this function is to execute the command passed as parameter.
 */

gboolean meniou_module_exec_command (gpointer meniou, gchar *command);

#endif /* _MENIOU_MODULE_H */
