Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AppMainMenu Class Reference
Inheritance diagram for AppMainMenu:
EventObject CoreCustomData CoreBaseObject CoreBaseType

Classes

struct  MainMenuItemMovedInfo
 

Public Types

typedef bool(* MenuItemCallback )(AppMainMenuItem &item)
 
- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Public Member Functions

 AppMainMenu (AppObject &app)
 
virtual AppMainMenuItemadd_command (const CoreString &menu_path, const CoreString &file_path="", const CoreString &shortcut="", const CoreString &description="")
 add a new command in the main menu
 
virtual AppMainMenuItemadd_command_as_script (const CoreString &module_scripting, const CoreString &menu_path, const CoreString &script, const CoreString &shortcut="", const CoreString &description="")
 add a new command in the main menu
 
virtual AppMainMenuItemadd_command (const CoreString &menu_path, MenuItemCallback callback, const CoreString &shortcut="", const CoreString &description="")
 add a new command in the main menu
 
virtual bool add_show_callback (const CoreString &menu_path, MenuItemCallback callback)
 add a show callback on a command
 
virtual bool add_show_callback (const CoreString &menu_path, const CoreString &file_path)
 add a show callback on a command
 
virtual bool remove_command (const CoreString &menu_path)
 remove a command
 
virtual bool remove_all_commands ()
 remove all commands
 
virtual bool remove_all_commands (const CoreString &parent_menu_path)
 remove all commands from a parent menu
 
virtual bool exec_command (const CoreString &menu_path)
 execute the command (script file or callback)
 
CoreVector< CoreStringget_sub_commands (const CoreString &parent_menu_path, const bool &recursive=true, const bool &show_menu_and_separator=true)
 get all commands in a parent menu
 
CoreVector< CoreStringget_all_commands (const bool &recursive=true, const bool &show_menu_and_separator=true)
 
virtual bool enable_command (const CoreString &menu_path, const bool &state)
 
virtual AppObjectget_application () const
 
CoreArray< CoreStringget_menu_config_file () const
 
CoreArray< CoreStringget_menu_script_path () const
 
CoreArray< CoreStringget_menu_icon_path () const
 
bool run_file (const CoreString &file_path, CoreString force_working_directory="")
 
bool run_script (const CoreString &script, const CoreString &engine_class_name)
 
AppMainMenuItemget_item (const CoreString &menu_path, const bool &recursive=true)
 
virtual GuiWindowget_clarisse_window () const
 
bool move_command (const CoreString &item_path, const CoreString &neighbor_item_path, const bool &after=true)
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject () override
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
CoreArray< EventObject * > get_senders () const
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
virtual size_t get_memory_size () const override
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
const unsigned long & get_class_info_id () const
 
virtual bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Protected Member Functions

CoreString get_main_menu_item_path ()
 

Protected Attributes

CoreVector< AppMainMenuItem * > m_items_menu
 

Friends

class AppMainMenuItem
 
class GuiAppMainMenu
 

Additional Inherited Members

- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 

Detailed Description

Application Menu API


Class Documentation

struct AppMainMenu::MainMenuItemMovedInfo
Class Members
bool after
AppMainMenuItem * item
AppMainMenuItem * neighbor_item

Member Function Documentation

AppMainMenuItem * AppMainMenu::add_command ( const CoreString menu_path,
const CoreString file_path = "",
const CoreString shortcut = "",
const CoreString description = "" 
)
virtual

add a new command in the main menu

Note
the command execution used a script file
AppMainMenuItem * AppMainMenu::add_command ( const CoreString menu_path,
AppMainMenu::MenuItemCallback  item_callback,
const CoreString shortcut = "",
const CoreString description = "" 
)
virtual

add a new command in the main menu

Note
the command exection used a callbak
AppMainMenuItem * AppMainMenu::add_command_as_script ( const CoreString module_scripting,
const CoreString menu_path,
const CoreString script,
const CoreString shortcut = "",
const CoreString description = "" 
)
virtual

add a new command in the main menu

Note
the command execution used a script file
bool AppMainMenu::add_show_callback ( const CoreString menu_path,
AppMainMenu::MenuItemCallback  callback 
)
virtual

add a show callback on a command

Note
this callback is executing when menu is shown (only UI)
bool AppMainMenu::add_show_callback ( const CoreString menu_path,
const CoreString file_path 
)
virtual

add a show callback on a command

Note
this callback is executing when menu is shown (only UI)
bool AppMainMenu::run_file ( const CoreString file_path,
CoreString  force_working_directory = "" 
)

Run a Python script file.

Parameters
file_pathPython script file path.
force_working_directoryWorking directory to be used. If empty it will use the file's directory.
Returns
true if the script file was run, false otherwise.
bool AppMainMenu::run_script ( const CoreString script,
const CoreString engine_class_name 
)

Run script code using the given scripting engine class.

Parameters
scriptScript code to run.
engine_class_nameName of the scripting engine class that will run the script code.
Returns
true if script was executed, false otherwise.