11 FLAG_DISABLED_GRAYED = FLAG_DISABLED|FLAG_GRAYED,
12 FLAG_RADIOCHECKED = 8,
21 TYPE_POPUP = type_group,TYPE_COMMAND = type_command,TYPE_SEPARATOR = type_separator,
25 virtual t_type get_type() = 0;
28 virtual t_size get_children_count() = 0;
31 virtual GUID get_guid() = 0;
32 virtual bool is_mappable_shortcut() = 0;
109 virtual unsigned get_num_items() = 0;
113 virtual GUID get_item_guid(
unsigned p_index) = 0;
119 virtual bool get_item_description(
unsigned p_index,
pfc::string_base & p_out) = 0;
132 GUID get_parent_fallback();
138 static const GUID caller_active_playlist_selection, caller_active_playlist,
caller_playlist_manager, caller_now_playing, caller_keyboard_shortcut_list, caller_media_library_viewer;
148 virtual
double get_sort_priority() {
return 0;}
162 FLAG_DISABLED_GRAYED = FLAG_DISABLED|FLAG_GRAYED,
163 FLAG_RADIOCHECKED = 8,
169 virtual unsigned get_num_items() = 0;
173 PFC_ASSERT(p_index>=0 && p_index<get_num_items());
174 get_item_name(p_index,p_out);
177 virtual GUID get_item_guid(
unsigned p_index) = 0;
178 virtual bool get_item_description(
unsigned p_index,
pfc::string_base & p_out) = 0;
204 context_command(p_index,p_data,p_caller);
216 assert(n>=0 && n<get_num_items());
219 rv = context_get_display(n,data,p_out,displayflags,caller);
233 #define DECLARE_CONTEXT_MENU_ITEM(P_CLASSNAME,P_NAME,P_DEFAULTPATH,P_FUNC,P_GUID,P_DESCRIPTION) \ 235 class P_CLASSNAME : public contextmenu_item_simple { \ 237 unsigned get_num_items() {return 1;} \ 238 void get_item_name(unsigned p_index,pfc::string_base & p_out) {p_out = P_NAME;} \ 239 void get_item_default_path(unsigned p_index,pfc::string_base & p_out) {p_out = P_DEFAULTPATH;} \ 240 void context_command(unsigned p_index,metadb_handle_list_cref p_data,const GUID& p_caller) {P_FUNC(p_data);} \ 241 GUID get_item_guid(unsigned p_index) {return P_GUID;} \ 242 bool get_item_description(unsigned p_index,pfc::string_base & p_out) {if (P_DESCRIPTION[0] == 0) return false;p_out = P_DESCRIPTION; return true;} \ 244 static contextmenu_item_factory_t<P_CLASSNAME> g_##P_CLASSNAME##_factory; \ 267 virtual GUID get_guid() = 0;
268 virtual GUID get_parent() = 0;
269 virtual double get_sort_priority() = 0;
298 contextmenu_group_popup_impl(
const GUID & guid,
const GUID & parent,
const char * name,
double sortPriority = 0) : m_guid(guid), m_parent(parent), m_sortPriority(sortPriority), m_name(name) {}
virtual t_size get_count() const =0
Base class for all service classes. Provides interfaces for reference counter and querying for differ...