foobar2000 SDK
2015-08-03
|
#include <contextmenu.h>
Public Types | |
enum | t_enabled_state { FORCE_OFF, DEFAULT_OFF, DEFAULT_ON } |
Public Types inherited from service_base | |
typedef service_base | t_interface |
Public Member Functions | |
FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (contextmenu_item) | |
virtual t_enabled_state | get_enabled_state (unsigned p_index)=0 |
virtual void | get_item_default_path (unsigned p_index, pfc::string_base &p_out) |
virtual bool | get_item_description (unsigned p_index, pfc::string_base &p_out)=0 |
virtual GUID | get_item_guid (unsigned p_index)=0 |
virtual void | get_item_name (unsigned p_index, pfc::string_base &p_out)=0 |
virtual unsigned | get_num_items ()=0 |
GUID | get_parent_ () |
GUID | get_parent_fallback () |
virtual contextmenu_item_node_root * | instantiate_item (unsigned p_index, metadb_handle_list_cref p_data, const GUID &p_caller)=0 |
virtual void | item_execute_simple (unsigned p_index, const GUID &p_node, metadb_handle_list_cref p_data, const GUID &p_caller)=0 |
bool | item_get_display_data (pfc::string_base &p_out, unsigned &displayflags, unsigned p_index, const GUID &p_node, metadb_handle_list_cref p_data, const GUID &p_caller) |
bool | item_get_display_data_root (pfc::string_base &p_out, unsigned &displayflags, unsigned p_index, metadb_handle_list_cref p_data, const GUID &p_caller) |
Public Member Functions inherited from service_base | |
template<typename outPtr_t > | |
bool | cast (outPtr_t &outPtr) |
virtual int | service_add_ref ()=0 throw () |
virtual bool | service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid) |
template<class T > | |
bool | service_query_t (service_ptr_t< T > &p_out) |
virtual int | service_release ()=0 throw () |
Static Public Attributes | |
static const GUID | caller_active_playlist |
static const GUID | caller_active_playlist_selection |
static const GUID | caller_keyboard_shortcut_list |
static const GUID | caller_media_library_viewer |
static const GUID | caller_now_playing |
static const GUID | caller_playlist = caller_active_playlist_selection |
static const GUID | caller_playlist_manager |
static const GUID | caller_undefined |
Additional Inherited Members | |
Protected Member Functions inherited from service_base | |
service_base () | |
~service_base () | |
Service class for declaring context menu commands.
See contextmenu_item_simple for implementation helper without dynamic menu generation features.
All methods are valid from main app thread only.
Definition at line 100 of file contextmenu.h.
Enumerator | |
---|---|
FORCE_OFF | |
DEFAULT_OFF | |
DEFAULT_ON |
Definition at line 102 of file contextmenu.h.
contextmenu_item::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT | ( | contextmenu_item | ) |
|
pure virtual |
Controls default state of context menu preferences for this item:
Return DEFAULT_ON to show this item in the context menu by default - useful for most cases.
Return DEFAULT_OFF to hide this item in the context menu by default - useful for rarely used utility commands.
Return FORCE_OFF to hide this item by default and prevent the user from making it visible (very rarely used).
Values returned by this method should be constant for this context menu item and not change later. Do not use this to conditionally hide the item - return false from get_display_data() instead.
Implemented in contextmenu_item_simple.
|
inlinevirtual |
Obsolete since v1.0, don't use or override in new components.
Definition at line 117 of file contextmenu.h.
|
pure virtual |
Retrieves item's description to show in the status bar. Set p_out to the string to be displayed and return true if you provide a description, return false otherwise.
Implemented in contextmenu_item_simple, and myitem.
|
pure virtual |
Retrieves GUID of the context menu item.
Implemented in contextmenu_item_simple, and myitem.
|
pure virtual |
Retrieves human-readable name of the context menu item.
Implemented in contextmenu_item_simple, and myitem.
|
pure virtual |
Retrieves number of menu items provided by this contextmenu_item implementation.
Implemented in contextmenu_item_simple, and myitem.
GUID contextmenu_item::get_parent_ | ( | ) |
Definition at line 54 of file menu_item.cpp.
GUID contextmenu_item::get_parent_fallback | ( | ) |
Definition at line 43 of file menu_item.cpp.
|
pure virtual |
Instantiates a context menu item (including sub-node tree for items that contain dynamically-generated sub-items).
Implemented in contextmenu_item_simple.
|
pure virtual |
Executes the menu item command without going thru the instantiate_item path. For items with dynamically-generated sub-items, p_node is identifies of the sub-item command to execute.
Implemented in contextmenu_item_simple.
bool contextmenu_item::item_get_display_data | ( | pfc::string_base & | p_out, |
unsigned & | displayflags, | ||
unsigned | p_index, | ||
const GUID & | p_node, | ||
metadb_handle_list_cref | p_data, | ||
const GUID & | p_caller | ||
) |
Definition at line 30 of file menu_item.cpp.
bool contextmenu_item::item_get_display_data_root | ( | pfc::string_base & | p_out, |
unsigned & | displayflags, | ||
unsigned | p_index, | ||
metadb_handle_list_cref | p_data, | ||
const GUID & | p_caller | ||
) |
Definition at line 5 of file menu_item.cpp.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Deprecated - use caller_active_playlist_selection instead.
Definition at line 136 of file contextmenu.h.
|
static |
Definition at line 138 of file contextmenu.h.
|
static |
Definition at line 139 of file contextmenu.h.