foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions
ui_elementabstract

#include <ui_element.h>

+ Inheritance diagram for ui_element:

Public Member Functions

virtual ui_element_children_enumerator_ptr enumerate_children (ui_element_config::ptr cfg)=0
 
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (ui_element)
 
virtual ui_element_config::ptr get_default_configuration ()=0
 
virtual bool get_description (pfc::string_base &p_out)
 
virtual bool get_element_group (pfc::string_base &p_out)
 
virtual GUID get_guid ()=0
 
virtual t_ui_icon get_icon ()
 
virtual void get_name (pfc::string_base &p_out)=0
 
virtual GUID get_subclass ()=0
 
virtual ui_element_config::ptr import (ui_element_config::ptr cfg)
 
virtual ui_element_instance_ptr instantiate (HWND p_parent, ui_element_config::ptr cfg, ui_element_instance_callback_ptr p_callback)=0
 
virtual bool is_user_addable ()
 
- 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 Member Functions

static bool g_find (service_ptr_t< ui_element > &out, const GUID &id)
 
static bool g_get_name (pfc::string_base &p_out, const GUID &p_guid)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Entrypoint interface for each UI element implementation.

Definition at line 367 of file ui_element.h.

Member Function Documentation

virtual ui_element_children_enumerator_ptr ui_element::enumerate_children ( ui_element_config::ptr  cfg)
pure virtual

Implemented by container elements only. Returns NULL for non-container elements.
Allows caller to parse and edit child element structure of container elements.

Implemented in ui_element_impl< ImplementBumpableElem< CMyElemWindow >, ui_element_v2 >.

ui_element::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( ui_element  )
bool ui_element::g_find ( service_ptr_t< ui_element > &  out,
const GUID id 
)
static

Definition at line 90 of file ui_element.cpp.

90  {
91  return service_by_guid(out, id);
92 }
static bool service_by_guid(service_ptr_t< what > &out, const GUID &theID)
Definition: service.h:738
bool ui_element::g_get_name ( pfc::string_base p_out,
const GUID p_guid 
)
static

Definition at line 94 of file ui_element.cpp.

94  {
95  ui_element::ptr ptr; if (!g_find(ptr,p_guid)) return false;
96  ptr->get_name(p_out); return true;
97 }
static bool g_find(service_ptr_t< ui_element > &out, const GUID &id)
Definition: ui_element.cpp:90
virtual ui_element_config::ptr ui_element::get_default_configuration ( )
pure virtual

Retrieves default configuration of the element.

Implemented in ui_element_impl< ImplementBumpableElem< CMyElemWindow >, ui_element_v2 >.

virtual bool ui_element::get_description ( pfc::string_base p_out)
inlinevirtual

Retrieves a human-readable description of the element.

Reimplemented in ui_element_impl< ImplementBumpableElem< CMyElemWindow >, ui_element_v2 >.

Definition at line 401 of file ui_element.h.

401 {return false;}
bool ui_element::get_element_group ( pfc::string_base p_out)
virtual

Retrieves a human-readable description of the element's function to use for grouping in the element list. The default implementation relies on get_subclass() return value.

Definition at line 74 of file ui_element.cpp.

74  {
76 }
bool ui_element_subclass_description(const GUID &id, pfc::string_base &p_out)
Definition: ui_element.cpp:54
virtual GUID get_subclass()=0
Retrieves subclass GUID of the element. Typically one of ui_element_subclass_* values, but you can create your own custom subclasses. Subclass GUIDs are used for various purposes such as focusing an UI element that provides specific functionality.
virtual GUID ui_element::get_guid ( )
pure virtual
virtual t_ui_icon ui_element::get_icon ( )
inlinevirtual

Returns an icon to show in available UI element lists, etc. Returns NULL when there is no icon to display.

Definition at line 398 of file ui_element.h.

398 {return NULL;}
virtual void ui_element::get_name ( pfc::string_base p_out)
pure virtual

Retrieves a simple human-readable name of the element.

Implemented in ui_element_impl< ImplementBumpableElem< CMyElemWindow >, ui_element_v2 >.

virtual GUID ui_element::get_subclass ( )
pure virtual

Retrieves subclass GUID of the element. Typically one of ui_element_subclass_* values, but you can create your own custom subclasses. Subclass GUIDs are used for various purposes such as focusing an UI element that provides specific functionality.

Implemented in ui_element_impl< ImplementBumpableElem< CMyElemWindow >, ui_element_v2 >.

virtual ui_element_config::ptr ui_element::import ( ui_element_config::ptr  cfg)
inlinevirtual

In certain cases, an UI element can import settings of another UI element (eg. vertical<=>horizontal splitter, tabs<=>splitters) when user directly replaces one of such elements with another. Overriding this function allows special handling of such cases.
Implementation hint: when implementing a multi-child container, you probably want to takeover child elements replacing another container element; use enumerate_children() on the element the configuration belongs to to grab those.

Returns
A new ui_element_config on success, a null pointer when the input data could not be parsed / is in an unknown format.

Definition at line 392 of file ui_element.h.

392 {return NULL;}
virtual ui_element_instance_ptr ui_element::instantiate ( HWND  p_parent,
ui_element_config::ptr  cfg,
ui_element_instance_callback_ptr  p_callback 
)
pure virtual

Instantiates the element using specified settings.

virtual bool ui_element::is_user_addable ( )
inlinevirtual

Override this to return false when your element is for internal use only and should not be user-addable.

Definition at line 395 of file ui_element.h.

395 {return true;}

The documentation for this class was generated from the following files: