ifm::InterfaceManager Class Reference

List of all members.


Detailed Description

Manages docking for a Window.

Provides the interface that applications use to interact with and control the system.

Public Member Functions

void add_image (const std::string &name, const Bitmap &bitmap)
void add_toplevel_container_after (Container *container, Container *relative, ALIGNMENT where)
void add_toplevel_container_before (Container *container, Container *relative, ALIGNMENT where)
void add_toplevel_container_end (Container *container, ALIGNMENT where)
void add_toplevel_container_front (Container *container, ALIGNMENT where)
void automatic_interface_update (bool enable)
 Used to toggle on or off automatic interface updates when the size of the Managed Window changes.
void create_children (Container *container, const layout::Container &data)
Pointer< Componentcreate_component (const layout::Component &data)
void destroy_layout ()
Color get_color (component_type type, int part)
Componentget_component (const Point &position) const
const ContainerListget_containers () const
WidgetPtr get_content_widget () const
DockManagerget_dockmanager () const
Font get_font (int id) const
int get_font_height (int id) const
Bitmapget_image (const std::string &name) const
Rect get_interface_rect () const
layout::Layoutget_layout () const
WidgetPtr get_managed_widget () const
Size get_min_size () const
const PanelChildWidgetsget_panel_child_widgets () const
Rendererget_renderer () const
Themeget_theme () const
 InterfaceManager (const WidgetPtr &managed, const WidgetPtr &content)
 Constructs the interface manager to manage the given widget with the given content window in the center of the interface.
void refresh_interface ()
void remove_toplevel_container (Container *container)
void set_color (component_type type, int part, const Color &color)
void set_dockmanager (DockManager *manager)
 Sets the DockManager.
void set_font (int id, const Font &font)
void set_layout (const layout::Layout &)
 Realizes the given layout.
void set_renderer (Renderer *renderer)
 Sets the Renderer that will be used to render components.
void set_theme (Theme *theme)
 Sets the Theme that will define what colors to use when rendering Components.
void update_interface ()
void update_interface (const Rect &rect)
void update_min_size ()
 ~InterfaceManager ()

Private Types

typedef std::map
< component_type,
ComponentFactory * > 
ComponentFactories
typedef std::map< std::string,
Bitmap
ImageMap

Private Member Functions

void add_component (Component *component)
void add_toplevel_container (Pointer< Container > container, const ContainerList::iterator &where, ALIGNMENT alignment)
void cleanup ()
Componentget_component (const Point &position, Container *root) const
void initialize ()
 InterfaceManager (const InterfaceManager &)
bool on_left_down (const MouseEventData &data)
bool on_left_up (const MouseEventData &data)
bool on_mouse_move (const MouseEventData &data)
InterfaceManageroperator= (const InterfaceManager &)
void register_child_widget (WidgetID child, Panel *panel)
void remove_component (Component *component)
void unregister_child_widget (WidgetID child)

Private Attributes

ComponentPtrList m_components
 The list of all the components.
ContainerList m_containers
 The list of toplevel containers.
WidgetAdapter m_content
 The content widget appearing in the middle of the interface.
std::auto_ptr< DockManagerm_dockmanager
 The DockManager.
ComponentFactories m_factories
 Component factories.
std::auto_ptr< GuiData > m_gui_data
 Data used by the gui toolkit layer.
ImageMap m_images
Rect m_interface_rect
 The interface rect.
WidgetAdapter m_managed
 The widget to manage the interface for.
PanelChildWidgets m_panel_child_widgets
 The WidgetID->Panel association.
std::auto_ptr< Rendererm_renderer
 The Renderer used to render Components.
std::auto_ptr< Themem_theme
 The theme defining what colors to render components with.


Member Typedef Documentation

typedef std::map<std::string, Bitmap> ifm::InterfaceManager::ImageMap [private]


Constructor & Destructor Documentation

ifm::InterfaceManager::InterfaceManager ( const WidgetPtr managed,
const WidgetPtr content 
)

Constructs the interface manager to manage the given widget with the given content window in the center of the interface.

ifm::InterfaceManager::~InterfaceManager (  ) 

ifm::InterfaceManager::InterfaceManager ( const InterfaceManager  )  [private]


Member Function Documentation

void ifm::InterfaceManager::add_component ( Component component  )  [private]

Add the given component to the components list.

void ifm::InterfaceManager::add_image ( const std::string &  name,
const Bitmap bitmap 
)

void ifm::InterfaceManager::add_toplevel_container ( Pointer< Container container,
const ContainerList::iterator &  where,
ALIGNMENT  alignment 
) [private]

Adds the given Container as a top level container. The placement of the container within the top level container list depends on the where parameter. The place where the container appears in the layout depends on the value of the alignment parameter.

void ifm::InterfaceManager::add_toplevel_container_after ( Container container,
Container relative,
ALIGNMENT  where 
)

Adds a Container as a top level container and puts it after the relative container in the list so that the Container will appear closer to the content widget than the relative container.

void ifm::InterfaceManager::add_toplevel_container_before ( Container container,
Container relative,
ALIGNMENT  where 
)

Adds a Container as a top level container and puts it before the relative container in the list so that the Container will appear closer to the outside edge than the relative container.

void ifm::InterfaceManager::add_toplevel_container_end ( Container container,
ALIGNMENT  where 
)

Adds a Container as a top level container and puts it at the end of the list. Such a container will appear along the edge of the Content Widget.

void ifm::InterfaceManager::add_toplevel_container_front ( Container container,
ALIGNMENT  where 
)

Adds a Container as a top level container and puts it at the front of the list. Such a container will appear along the outer most edge of the Managed Widget.

void ifm::InterfaceManager::automatic_interface_update ( bool  enable  ) 

Used to toggle on or off automatic interface updates when the size of the Managed Window changes.

Note:
Implemented by the gui toolkit layer

void ifm::InterfaceManager::cleanup (  )  [private]

Performs any special cleanup needed.

Note:
Implemented by the gui toolkit layer

void ifm::InterfaceManager::create_children ( Container container,
const layout::Container data 
)

Creates the children for a Container.

Pointer< Component > ifm::InterfaceManager::create_component ( const layout::Component data  ) 

Creates a component. The type of component created depends on the m_type value of the ComponentData.

void ifm::InterfaceManager::destroy_layout (  ) 

Destroys the current layout, removing all Components. Does not update the interface.

Color ifm::InterfaceManager::get_color ( component_type  type,
int  part 
)

If a color is not explicitly defined for this component type and part combination, the default color from the ALL component type will be returned.

Returns:
The color for the given part for the given component type.

Component * ifm::InterfaceManager::get_component ( const Point position,
Container root 
) const [private]

Returns:
The child Component of the root which occupies the given position.

Component * ifm::InterfaceManager::get_component ( const Point position  )  const

Parameters:
position The position in screen coordinates.
Returns:
The Component occupying the given position or 0 if no such Component exists.

const ContainerList & ifm::InterfaceManager::get_containers (  )  const

Returns:
The list of top level Containers.

WidgetPtr ifm::InterfaceManager::get_content_widget (  )  const

Returns:
The content widget.

DockManager * ifm::InterfaceManager::get_dockmanager (  )  const

Returns:
The current DockManager.

Font ifm::InterfaceManager::get_font ( int  id  )  const

Returns:
The Font used to render the given font id.

int ifm::InterfaceManager::get_font_height ( int  id  )  const

Returns:
The height of text rendered using the Font for the given font id.

Bitmap * ifm::InterfaceManager::get_image ( const std::string &  name  )  const

Rect ifm::InterfaceManager::get_interface_rect (  )  const

Returns:
The current interface rect.

layout::Layout * ifm::InterfaceManager::get_layout (  )  const

Returns:
A Layout object representing the current state of the interface.

WidgetPtr ifm::InterfaceManager::get_managed_widget (  )  const

Returns:
The Widget being managed.

Size ifm::InterfaceManager::get_min_size (  )  const

Returns:
The minimum size for the layout.

const PanelChildWidgets & ifm::InterfaceManager::get_panel_child_widgets (  )  const

Returns:
The PanelChildWidgets map associating WidgetIDs with the Panel that is interested in that WidgetID.

Renderer * ifm::InterfaceManager::get_renderer (  )  const

Returns:
The Renderer being used to render Components.

Theme * ifm::InterfaceManager::get_theme (  )  const

Returns:
The current Theme.

void ifm::InterfaceManager::initialize (  )  [private]

Performs any special initialization needed.

Note:
Implemented by the gui toolkit layer

bool ifm::InterfaceManager::on_left_down ( const MouseEventData data  )  [private]

Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

bool ifm::InterfaceManager::on_left_up ( const MouseEventData data  )  [private]

Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

bool ifm::InterfaceManager::on_mouse_move ( const MouseEventData data  )  [private]

Called by Components when an event happened that they did not process. The event will be forwarded to the current DockManager and ResizeManager plugins so that they can have a chance to process the events.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

InterfaceManager& ifm::InterfaceManager::operator= ( const InterfaceManager  )  [private]

void ifm::InterfaceManager::refresh_interface (  ) 

Refreshes the interface by rerendering all components.

void ifm::InterfaceManager::register_child_widget ( WidgetID  child,
Panel panel 
) [private]

Called by Panels so that they will be notified when their Child Widget is created or destroyed based on its WidgetID.

void ifm::InterfaceManager::remove_component ( Component component  )  [private]

Remove a component from the components list.

void ifm::InterfaceManager::remove_toplevel_container ( Container container  ) 

Removes the given container from the top level container list.

void ifm::InterfaceManager::set_color ( component_type  type,
int  part,
const Color color 
)

Specify the color value used to render the specified part for the given type of components. Not all parts are used by all components.

ALL may be passed for the component type. In this case, the default color this part will be set. If a component type does not have a color explicitly defined for the given part, this default value will be used.

Parameters:
type The type of component
part The part
color The color value

void ifm::InterfaceManager::set_dockmanager ( DockManager manager  ) 

Sets the DockManager.

The DockManager implements docking functionality. Replacing the default DockManager to change the feel of your application.

Note:
Takes ownership of the pointer, do not delete it. The pointer will be deleted when the InterfaceManager is destroyed.

void ifm::InterfaceManager::set_font ( int  id,
const Font font 
)

Specify the Font to use for the given font id. You should update the interface for the changes to be in effect, a simple refresh will not work completely because the height of the Font might have changed so the components will need to be repositioned.

void ifm::InterfaceManager::set_layout ( const layout::Layout layout  ) 

Realizes the given layout.

Any existing layout will be destroyed. The interface will be updated to display the new layout.

void ifm::InterfaceManager::set_renderer ( Renderer renderer  ) 

Sets the Renderer that will be used to render components.

The interface will not be refreshed to reflect the new Renderer, call refresh_interface to redraw Components.

Any existing Renderer will be deleted.

Note:
Takes ownership of the pointer, do not delete it. The pointer will be deleted when the InterfaceManager is destroyed.

void ifm::InterfaceManager::set_theme ( Theme theme  ) 

Sets the Theme that will define what colors to use when rendering Components.

The interface will not be refreshed to reflect the new Theme, call refresh_interface to redraw Components.

Any existing Theme will be deleted.

Note:
Takes ownership of the pointer, do not delete it. The pointer will be deleted when the InterfaceManager is destroyed.

void ifm::InterfaceManager::unregister_child_widget ( WidgetID  child  )  [private]

Called by Panels when they are being destroyed so that they will no longer be notified when their Child Widget is created or destroyed

void ifm::InterfaceManager::update_interface (  ) 

Updates the layout using the Rect previously passed to update_interface(const Rect&).

void ifm::InterfaceManager::update_interface ( const Rect rect  ) 

Updates the positioning of all Components to fit within the given Rect.

void ifm::InterfaceManager::update_min_size (  ) 

Updates the minimum size of the managed window. Call this function after you change the minimum size of a managed widget or the content widget in order to update the minimum size of the managed window properly.


Member Data Documentation

The list of all the components.

The list of toplevel containers.

The content widget appearing in the middle of the interface.

Component factories.

std::auto_ptr<GuiData> ifm::InterfaceManager::m_gui_data [private]

Data used by the gui toolkit layer.

The interface rect.

The widget to manage the interface for.

The WidgetID->Panel association.

std::auto_ptr<Renderer> ifm::InterfaceManager::m_renderer [private]

The Renderer used to render Components.

std::auto_ptr<Theme> ifm::InterfaceManager::m_theme [private]

The theme defining what colors to render components with.


doxygen Get IFM - Interface Management System at SourceForge.net. Fast, secure and Free Open Source software downloads