foobar2000 SDK  2015-01-14
Public Types | Public Member Functions
ui_element_v2abstract

#include <ui_element.h>

+ Inheritance diagram for ui_element_v2:

Public Types

enum  {
  KFlagSupportsBump = 1 << 0, KFlagHavePopupCommand = 1 << 1, KFlagHaveFullscreen = 1 << 2, KFlagPopupCommandHidden = 1 << 3,
  KFlagsVisualisation = KFlagHavePopupCommand | KFlagHaveFullscreen
}
 
- Public Types inherited from service_base
typedef service_base t_interface
 

Public Member Functions

virtual bool bump ()=0
 
virtual t_uint32 get_flags ()=0
 
virtual bool get_menu_command_description (pfc::string_base &out)
 
virtual GUID get_menu_command_id ()
 
virtual void get_menu_command_name (pfc::string_base &out)
 
virtual bool get_popup_specs (SIZE &defSize, pfc::string_base &title)
 
- Public Member Functions inherited from ui_element
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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ui_element
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)
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Extended interface for a UI element implementation.

Definition at line 413 of file ui_element.h.

Member Enumeration Documentation

anonymous enum
Enumerator
KFlagSupportsBump 

Indicates that bump() method is supported.

KFlagHavePopupCommand 

Tells UI backend to auto-generate a menu command activating your element - bumping an existing instance if possible, spawning a popup otherwise. Currently menu commands are generated for ui_element_subclass_playback_visualisation, ui_element_subclass_media_library_viewers and ui_element_subclass_utility subclasses, in relevant menus.

KFlagHaveFullscreen 

Tells backend that your element supports fullscreen mode (typically set only for visualisations).

KFlagPopupCommandHidden 
KFlagsVisualisation 

Definition at line 415 of file ui_element.h.

415  {
417  KFlagSupportsBump = 1 << 0,
420  KFlagHavePopupCommand = 1 << 1,
422  KFlagHaveFullscreen = 1 << 2,
423 
424  KFlagPopupCommandHidden = 1 << 3,
425 
427  };
Tells UI backend to auto-generate a menu command activating your element - bumping an existing instan...
Definition: ui_element.h:420
Tells backend that your element supports fullscreen mode (typically set only for visualisations).
Definition: ui_element.h:422
Indicates that bump() method is supported.
Definition: ui_element.h:417

Member Function Documentation

virtual bool ui_element_v2::bump ( )
pure virtual

Called only when get_flags() return value has KFlagSupportsBump bit set. Returns true when an existing instance of this element has been "bumped" - brought to user's attention in some way, false when there's no instance to bump or none of existing instances could be bumped for whatever reason.

Implemented in ui_element_impl_withpopup< CMyElemWindow >.

virtual t_uint32 ui_element_v2::get_flags ( )
pure virtual
virtual bool ui_element_v2::get_menu_command_description ( pfc::string_base out)
inlinevirtual

Override to use another description for our menu command. Relevant only when KFlagHavePopupCommand is set.

Definition at line 437 of file ui_element.h.

437  {
438  pfc::string8 name; get_name(name);
439  out = pfc::string_formatter() << "Activates " << name << " window.";
440  return true;
441  }
virtual void get_name(pfc::string_base &p_out)=0
Retrieves a simple human-readable name of the element.
string8_fastalloc string_formatter
Definition: string_base.h:614
virtual GUID ui_element_v2::get_menu_command_id ( )
inlinevirtual

Override to use another GUID for our menu command. Relevant only when KFlagHavePopupCommand is set.

Definition at line 434 of file ui_element.h.

434 {return get_guid();}
virtual GUID get_guid()=0
Retrieves GUID of the element.
virtual void ui_element_v2::get_menu_command_name ( pfc::string_base out)
inlinevirtual

Override to use another name for our menu command. Relevant only when KFlagHavePopupCommand is set.

Definition at line 444 of file ui_element.h.

444 {get_name(out);}
virtual void get_name(pfc::string_base &p_out)=0
Retrieves a simple human-readable name of the element.
virtual bool ui_element_v2::get_popup_specs ( SIZE &  defSize,
pfc::string_base title 
)
inlinevirtual

Relevant only when KFlagHavePopupCommand is set.

Parameters
defSizeDefault window size @ 96DPI. If screen DPI is different, it will be rescaled appropriately.
titleWindow title to use.
Returns
True when implemented, false when not - caller will automatically determine default size and window title then.

Definition at line 449 of file ui_element.h.

449 {return false;}

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