Columns UI SDK  6.5
Public Member Functions | Static Public Member Functions | List of all members
ui_extension::window Class Referenceabstract

Interface for window service. More...

#include <window.h>

Inheritance diagram for ui_extension::window:
ui_extension::extension_base ui_extension::menu_window ui_extension::playlist_window ui_extension::splitter_window ui_extension::splitter_window_v2

Public Member Functions

virtual const bool get_is_single_instance () const =0
 Gets whether the panel is single instance or not. More...
 
virtual void get_category (pfc::string_base &out) const =0
 Gets the category of the extension. More...
 
virtual bool get_short_name (pfc::string_base &out) const
 Gets the short, presumably more user-friendly than the name returned by get_name, name of the panel. More...
 
virtual bool get_description (pfc::string_base &out) const
 Gets the description of the extension. More...
 
virtual unsigned get_type () const =0
 Gets the type of the extension. More...
 
virtual bool get_prefer_multiple_instances () const
 Gets whther the panel prefers to be created in multiple instances. More...
 
virtual bool is_available (const window_host_ptr &p_host) const =0
 Get availability of the extension. More...
 
virtual HWND create_or_transfer_window (HWND wnd_parent, const window_host_ptr &p_host, const ui_helpers::window_position_t &p_position=ui_helpers::window_position_null)=0
 Create or transfer extension window. More...
 
virtual void destroy_window ()=0
 Destroys the extension window. More...
 
virtual HWND get_wnd () const =0
 Gets extension window handle. More...
 
virtual void get_size_limits (size_limit_t &p_out) const
 Gets size limits of the window. More...
 
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (window)
 
- Public Member Functions inherited from ui_extension::extension_base
virtual const GUID & get_extension_guid () const =0
 Get unique ID of extension. More...
 
virtual void get_name (pfc::string_base &out) const =0
 Get a user-readable name of the extension. More...
 
virtual void set_config (stream_reader *p_reader, t_size p_size, abort_callback &p_abort)
 Set instance configuration data. More...
 
virtual void get_config (stream_writer *p_writer, abort_callback &p_abort) const
 Get instance configuration data. More...
 
virtual void import_config (stream_reader *p_reader, t_size p_size, abort_callback &p_abort)
 Set instance configuration data. This differs from set_config in that the data will be of that returned by export_config. More...
 
virtual void export_config (stream_writer *p_writer, abort_callback &p_abort) const
 Get instance configuration data. This differs from get_config, in that what is written is intended to be transferable between different foobar2000 installations on different computers (i.e. self-contained). More...
 
virtual bool have_config_popup () const
 Gets whether the extension has a modal configuration window. More...
 
virtual bool show_config_popup (HWND wnd_parent)
 Displays a modal configuartion dialog. More...
 
virtual void get_menu_items (menu_hook_t &p_hook)
 Retrieve menu items to be displayed in the host menu. More...
 

Static Public Member Functions

static bool create_by_guid (const GUID &guid, window_ptr &p_out)
 Creates extension by GUID. More...
 
static HWND g_on_tab (HWND wnd_focus)
 Helper function. Activates next or previous window. More...
 
static bool g_process_keydown_keyboard_shortcuts (WPARAM wp)
 Helper function. Processes keyboard shortcuts using keyboard_shortcut_manager_v2::process_keydown_simple(). Requires foobar2000 >= 0.9.5. More...
 

Detailed Description

Interface for window service.

Member Function Documentation

static bool ui_extension::window::create_by_guid ( const GUID &  guid,
window_ptr p_out 
)
inlinestatic

Creates extension by GUID.

Parameters
[in]guidGUID of a ui_extension
[out]p_outReceives a pointer to the window.
Returns
true if the window was found and instantiated. You may assume that if the method returns true, p_out is a valid pointer.
virtual HWND ui_extension::window::create_or_transfer_window ( HWND  wnd_parent,
const window_host_ptr p_host,
const ui_helpers::window_position_t p_position = ui_helpers::window_position_null 
)
pure virtual

Create or transfer extension window.

Create your window here.

In the case of single instance panels, if your window is already created, you must (in the same order):

  • Hide your window. i.e:
    ShowWindow(wnd, SW_HIDE)
  • Set the parent window to to wnd_parent. I.e.
    SetParent(get_wnd(), wnd_parent)
  • Move your window to the new window position. I.e.:
    SetWindowPos(get_wnd(), NULL, p_position.x, p_position.y, p_position.cx, p_position.cy, SWP_NOZORDER);
  • Call relinquish_ownership() on your current host.

Other rules you should follow are:

  • Ensure you are using the correct window styles. The window MUST have the WS_CHILD window style. It MUST NOT have the WS_POPUP, WS_CAPTION styles.
  • The window must be created hidden.
  • Use WS_EX_CONTROLPARENT if you have child windows that receive keyboard input, and you want them to be included in tab operations in the host window.
  • Do not directly create a common control as your window. You must create a window to contain any common controls, and any other controls that communicate to the parent window via WM_COMMAND and WM_NOTIFY window messages.
  • Under NO CIRCUMSTANCES may you subclass the host window.
  • If you are not hosting any panels yourself, you may dialog manage your window if you wish.
  • The window MUST have a dialog item ID of 0.
Precondition
May only be called if is_available() returned true.
Parameters
[in]wnd_parentHandle to the window to use as the parent for your window
[in]p_hostPointer to the host that creates the extension. This parameter may not be NULL.
[in]p_positionInitial position of the window
Returns
Window handle of the panel window
virtual void ui_extension::window::destroy_window ( )
pure virtual

Destroys the extension window.

ui_extension::window::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( window  )
static HWND ui_extension::window::g_on_tab ( HWND  wnd_focus)
static

Helper function. Activates next or previous window.

Parameters
[in]wnd_focusWindow you want the next or previous window handle respective to.
Returns
The handle to the window that was activated, or NULL if none was.
static bool ui_extension::window::g_process_keydown_keyboard_shortcuts ( WPARAM  wp)
static

Helper function. Processes keyboard shortcuts using keyboard_shortcut_manager_v2::process_keydown_simple(). Requires foobar2000 >= 0.9.5.

Parameters
[in]wpKey down message WPARAM value.
Returns
If a shortcut was executed.
virtual void ui_extension::window::get_category ( pfc::string_base &  out) const
pure virtual

Gets the category of the extension.

Categories you may use are "Toolbars", "Panels", "Splitters", "Playlist views" and "Visualisations"

Parameters
[out]outreceives the category of the panel, utf-8 encoded
virtual bool ui_extension::window::get_description ( pfc::string_base &  out) const
inlinevirtual

Gets the description of the extension.

Parameters
[out]outreceives the description of the extension, e.g. "Drop-down list for displaying and changing the current playback order"
Returns
true if the extension has a description
virtual const bool ui_extension::window::get_is_single_instance ( ) const
pure virtual

Gets whether the panel is single instance or not.

Note
Do not explicitly override. The service factory implements this method.
virtual bool ui_extension::window::get_prefer_multiple_instances ( ) const
inlinevirtual

Gets whther the panel prefers to be created in multiple instances.

For example, a spacer panel.

Returns
true iff the panel prefers to be created in multiple instances
virtual bool ui_extension::window::get_short_name ( pfc::string_base &  out) const
inlinevirtual

Gets the short, presumably more user-friendly than the name returned by get_name, name of the panel.

Parameters
[out]outreceives the short name of the extension, e.g. "Order" instead of "Playback order", or "Playlists" instead of "Playlist switcher"
Returns
true if the extension has a short name
virtual void ui_extension::window::get_size_limits ( size_limit_t p_out) const
inlinevirtual

Gets size limits of the window.

Override if you like, or just handle WM_GETMINMAXINFO.

Note
This function is reserved for future use. Handle WM_GETMINMAXINFO for now instead.
Parameters
[out]p_outReceives the size limits of the window.
virtual unsigned ui_extension::window::get_type ( ) const
pure virtual

Gets the type of the extension.

Returns
a combination of ui_extension::type_* flags
See also
ui_extension::window_type_t
virtual HWND ui_extension::window::get_wnd ( ) const
pure virtual

Gets extension window handle.

Precondition
May only be called on hosted extensions.
Returns
Window handle of the extension window
virtual bool ui_extension::window::is_available ( const window_host_ptr p_host) const
pure virtual

Get availability of the extension.

This method is called before create_or_transfer() to test, if this call will be legal. If this instance is already hosted, it should check whether the given host's GUID equals its current host's GUID, and should return false, if it does. This is mostly important for single instance extensions.

Extensions that support multiple instances can generally return true.

Returns
whether this instance can be created in or moved to the given host

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