ui_extension::window Class Reference

Interface for window service. More...

#include <window.h>

Inheritance diagram for ui_extension::window:

ui_extension::extension_base service_base ui_extension::menu_window ui_extension::playlist_window ui_extension::splitter_window List of all members.

Public Member Functions

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.
virtual void destroy_window ()=0
 Destroys the extension window.
virtual void get_category (pfc::string_base &out) const =0
 Gets the category of the extension.
virtual bool get_description (pfc::string_base &out) const
 Gets the description of the extension.
virtual const bool get_is_single_instance () const =0
 Gets whether the panel is single instance or not.
virtual bool get_prefer_multiple_instances () const
 Gets whther the panel prefers to be created in multiple instances.
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.
virtual void get_size_limits (size_limit_t &p_out) const
 Gets size limits of the window.
virtual unsigned get_type () const =0
 Gets the type of the extension.
virtual HWND get_wnd () const =0
 Gets extension window handle.
virtual bool is_available (const window_host_ptr &p_host) const =0
 Get availability of the extension.

Static Public Member Functions

static bool create_by_guid (const GUID &guid, window_ptr &p_out)
 Creates extension by GUID.
static HWND g_on_tab (HWND wnd_focus)
 Helper function. Activates next or previous window.

Public Attributes

 window

Detailed Description

Interface for window service.


Member Function Documentation

static bool ui_extension::window::create_by_guid const GUID &  guid,
window_ptr p_out
[inline, static]
 

Creates extension by GUID.

Parameters:
[in] guid GUID of a ui_extension
[out] p_out Receives 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_parent Handle to the window to use as the parent for your window
[in] p_host Pointer to the host that creates the extension. This parameter may not be NULL.
[in] p_position Initial position of the window
Returns:
Window handle of the panel window

HWND ui_extension::window::g_on_tab HWND  wnd_focus  )  [static]
 

Helper function. Activates next or previous window.

Parameters:
[in] wnd_focus Window you want the next or previous window handle respective to.
Returns:
The handle to the window that was activated, or NULL if none was.

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] out receives the category of the panel, utf-8 encoded

virtual bool ui_extension::window::get_description pfc::string_base &  out  )  const [inline, virtual]
 

Gets the description of the extension.

Parameters:
[out] out receives 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 [inline, virtual]
 

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 [inline, virtual]
 

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

Parameters:
[out] out receives 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 [inline, virtual]
 

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_out Receives 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 files:
Generated on Fri Apr 28 15:02:31 2006 for Columns UI SDK by  doxygen 1.4.6-NO