foobar2000 SDK
2015-08-03
|
#include <contextmenu.h>
Data Structures | |
class | contextmenu_item_node_impl |
Public Types | |
enum | t_flags { FLAG_CHECKED = 1, FLAG_DISABLED = 2, FLAG_GRAYED = 4, FLAG_DISABLED_GRAYED = FLAG_DISABLED|FLAG_GRAYED, FLAG_RADIOCHECKED = 8 } |
Public Types inherited from contextmenu_item | |
enum | t_enabled_state { FORCE_OFF, DEFAULT_OFF, DEFAULT_ON } |
Public Types inherited from service_base | |
typedef service_base | t_interface |
Public Member Functions | |
virtual void | context_command (unsigned p_index, metadb_handle_list_cref p_data, const GUID &p_caller)=0 |
virtual bool | context_get_display (unsigned p_index, metadb_handle_list_cref p_data, pfc::string_base &p_out, unsigned &p_displayflags, const GUID &p_caller) |
virtual t_enabled_state | get_enabled_state (unsigned p_index) |
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 |
Public Member Functions inherited from contextmenu_item | |
FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (contextmenu_item) | |
virtual void | get_item_default_path (unsigned p_index, pfc::string_base &p_out) |
GUID | get_parent_ () |
GUID | get_parent_fallback () |
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 () |
Private Member Functions | |
virtual bool | get_display_data (unsigned n, metadb_handle_list_cref data, pfc::string_base &p_out, unsigned &displayflags, const GUID &caller) |
contextmenu_item_node_root * | instantiate_item (unsigned p_index, metadb_handle_list_cref p_data, const GUID &p_caller) |
void | item_execute_simple (unsigned p_index, const GUID &p_node, metadb_handle_list_cref p_data, const GUID &p_caller) |
virtual bool | item_is_mappable_shortcut (unsigned p_index) |
Additional Inherited Members | |
Static Public Attributes inherited from contextmenu_item | |
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 |
Protected Member Functions inherited from service_base | |
service_base () | |
~service_base () | |
contextmenu_item implementation helper for implementing non-dynamically-generated context menu items; derive from this instead of from contextmenu_item directly if your menu items are static.
Definition at line 153 of file contextmenu.h.
Same as contextmenu_item_node::t_flags.
Enumerator | |
---|---|
FLAG_CHECKED | |
FLAG_DISABLED | |
FLAG_GRAYED | |
FLAG_DISABLED_GRAYED | |
FLAG_RADIOCHECKED |
Definition at line 157 of file contextmenu.h.
|
pure virtual |
Implemented in myitem.
|
inlinevirtual |
|
inlineprivatevirtual |
Definition at line 213 of file contextmenu.h.
|
inlinevirtual |
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.
Implements contextmenu_item.
Definition at line 168 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.
Implements contextmenu_item.
Implemented in myitem.
|
pure virtual |
|
pure virtual |
Retrieves human-readable name of the context menu item.
Implements contextmenu_item.
Implemented in myitem.
|
pure virtual |
Retrieves number of menu items provided by this contextmenu_item implementation.
Implements contextmenu_item.
Implemented in myitem.
|
inlineprivatevirtual |
Instantiates a context menu item (including sub-node tree for items that contain dynamically-generated sub-items).
Implements contextmenu_item.
Definition at line 195 of file contextmenu.h.
|
inlineprivatevirtual |
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.
Implements contextmenu_item.
Definition at line 201 of file contextmenu.h.
|
inlineprivatevirtual |
Definition at line 207 of file contextmenu.h.