foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Static Public Member Functions
user_interfaceabstract

#include <ui.h>

+ Inheritance diagram for user_interface:

Public Types

typedef BOOL(WINAPI * HookProc_t) (HWND wnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *ret)
 
- Public Types inherited from service_base
typedef service_base t_interface
 

Public Member Functions

virtual void activate ()=0
 
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (user_interface)
 
virtual GUID get_guid ()=0
 
virtual const char * get_name ()=0
 
virtual void hide ()=0
 
virtual HWND init (HookProc_t hook)=0
 
virtual bool is_visible ()=0
 
virtual void override_statusbar_text (const char *p_text)=0
 
virtual void revert_statusbar_text ()=0
 
virtual void show_now_playing ()=0
 
virtual void shutdown ()=0
 
- 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< user_interface > &p_out, const GUID &p_guid)
 

Additional Inherited Members

- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Entrypoint service for user interface modules. Implement when registering an UI module. Do not call existing implementations; only core enumerates / dispatches calls. To control UI behaviors from other components, use ui_control API.
Use user_interface_factory_t<> to register, e.g static user_interface_factory_t<myclass> g_myclass_factory;.

Definition at line 7 of file ui.h.

Member Typedef Documentation

typedef BOOL(WINAPI * user_interface::HookProc_t) (HWND wnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *ret)

HookProc usage:
in your windowproc, call HookProc first, and if it returns true, return LRESULT value it passed to you.

Definition at line 11 of file ui.h.

Member Function Documentation

virtual void user_interface::activate ( )
pure virtual

Activates main app window.

user_interface::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( user_interface  )
bool user_interface::g_find ( service_ptr_t< user_interface > &  p_out,
const GUID p_guid 
)
static

Definition at line 23 of file ui.cpp.

24 {
27  if (e.first(ptr)) do {
28  if (ptr->get_guid() == p_guid)
29  {
30  p_out = ptr;
31  return true;
32  }
33  } while(e.next(ptr));
34  return false;
35 }
bool first(service_ptr_t< t_query > &p_out)
Definition: service.h:581
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
virtual GUID user_interface::get_guid ( )
pure virtual

Retrieves GUID of your implementation, to be stored in configuration file etc.

virtual const char* user_interface::get_name ( )
pure virtual

Retrieves name (UTF-8 null-terminated string) of the UI module.

virtual void user_interface::hide ( )
pure virtual

Minimizes/hides main app window.

virtual HWND user_interface::init ( HookProc_t  hook)
pure virtual

Initializes the UI module - creates the main app window, etc. Failure should be signaled by appropriate exception (std::exception or a derivative).

virtual bool user_interface::is_visible ( )
pure virtual

Returns whether main window is visible / not minimized. Used for activate/hide command.

virtual void user_interface::override_statusbar_text ( const char *  p_text)
pure virtual

Overrides statusbar text with specified string. The parameter is a null terminated UTF-8 string. The override is valid until another override_statusbar_text() call or revert_statusbar_text() call.

virtual void user_interface::revert_statusbar_text ( )
pure virtual

Disables statusbar text override.

virtual void user_interface::show_now_playing ( )
pure virtual

Shows now-playing item somehow (e.g. system notification area popup).

virtual void user_interface::shutdown ( )
pure virtual

Deinitializes the UI module - destroys the main app window, etc.


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