Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Friends
IlvLookFeelHandler Class Referenceabstract

Look and feel base class. More...

#include <ilviews/base/look.h>

Inheritance diagram for IlvLookFeelHandler:
IlvBasicLFHandler IlvMotifLFHandler IlvWindowsLFHandler IlvVXLFHandler IlvWindows95LFHandler

Public Member Functions

void addObjectLFHandler (IlvObjectLFHandler *olfh)
 Adds the specified object look and feel handler to this look and feel handler. More...
 
virtual IlvObjectLFHandlercreateObjectLFHandler (const IlvClassInfo *ci) const
 Creates and returns the object look and feel handler for specified class information. More...
 
IlvDisplaygetDisplay () const
 Retrieves the IlvDisplay instance associated with this handler. More...
 
virtual const char * getLookName () const =0
 Returns the name of the look and feel handler. More...
 
IlvObjectLFHandlergetObjectLFHandler (const IlvClassInfo *ci) const
 Returns the object look and feel handler for the specified class information. More...
 
void removeObjectLFHandler (const IlvClassInfo *classinfo)
 Removes the object look and feel handler linked with the specified class information from this look and feel handler. More...
 

Static Public Member Functions

static IlvLookFeelHandlerCreate (IlSymbol *lookname, IlvDisplay *display)
 Creates and returns a look and feel handler that matches the specified name. More...
 
static const IlSymbol *const * GetAvailableLooks (IlUInt &count, IlBoolean sort=IlTrue)
 Returns an array containing the available look and feel handlers. More...
 
static IlvLookFeelHandlerGetDefaultLookFeelHandler (IlvDisplay *display, IlBoolean warn=IlTrue)
 Returns the default look and feel handler for the running platform. More...
 
static const IlSymbol *const * GetDynamicLooks (IlUInt &count, IlBoolean sort=IlTrue)
 Returns an array containing the look and feel handlers that can be dynamically loaded. More...
 
static const IlSymbol *const * GetRegisteredLooks (IlUInt &count, IlBoolean sort=IlTrue)
 Returns an array containing the registered look and feel handlers. More...
 

Friends

class IlvDisplay
 

Detailed Description

Look and feel base class.

Library: xviews or winviews or mviews (mutually exclusive)
IlvLookFeelHandler is the base class for look and feel handlers. A look and feel handler is responsible for supplying gadgets with specific object look and feel handlers of the class IlvObjectLFHandler. An object look and feel handler handles the way a specific gadget behaves and looks. For example, when drawing itself, a button asks the look and feel handler for the object look and feel handler linked with the IlvButton class. This object describes the interface through which the button will be drawn and controlled.

Four predefined look and feel handlers are provided:

Each of these classes is able to return a valid object look and feel handler for all Rogue Wave Views predefined gadgets. If you plan to create your own look and feel handler, you must provide an object look and feel handler for each gadget. However, it is possible to create a subclass of a predefined handler; by doing so, you inherit from it and only have to define what you want to change or add.

An instance of the IlvLookFeelHandler class is always available through the display connection. See IlvDisplay::getLookFeelHandler() for details. The default behavior for a gadget is to use this look and feel handler to obtain its object look and feel handler. However, each gadget can have its own look and feel handler. See the member function IlvGadget::setLookFeelHandler() for details.

You cannot create a look and feel handler by calling its constructor. Instead, use the IlvLookFeelHandler::Create() member function. Similarly, you cannot delete a look and feel handler. The display connection is responsible for deleting look and feel handlers. To set a new look and feel handler to a display connection, use the member function IlvDisplay::setLookFeelHandler().

It is possible to create a subclass.

See also
IlvObjectLFHandler, IlvDisplay::setLookFeelHandler().

Member Function Documentation

§ addObjectLFHandler()

void IlvLookFeelHandler::addObjectLFHandler ( IlvObjectLFHandler olfh)

Adds the specified object look and feel handler to this look and feel handler.

The previous object look and feel handler, if any, is deleted.

Parameters
olfhThe new object look and feel handler.
See also
removeObjectLFHandler().

§ Create()

static IlvLookFeelHandler* IlvLookFeelHandler::Create ( IlSymbol lookname,
IlvDisplay display 
)
static

Creates and returns a look and feel handler that matches the specified name.

Each look and feel handler has a specific name (see the member function IlvLookFeelHandler::getLookName()). This name can be used to create an instance of the corresponding look and feel handler. If no look and feel handler that matches the specified name can be found, the method returns 0.

Parameters
looknameThe name of the look and feel handler to create.
displayThe display connection.
Returns
A new look and feel handler whose name is lookname.

§ createObjectLFHandler()

virtual IlvObjectLFHandler* IlvLookFeelHandler::createObjectLFHandler ( const IlvClassInfo ci) const
virtual

Creates and returns the object look and feel handler for specified class information.

The method looks first into the object look and feel handlers defined in this look and feel handler. If such an object cannot be found, the superclass is asked to provide one, and so on.

Parameters
ciThe class information.
Returns
A new object look and feel handler.

§ GetAvailableLooks()

static const IlSymbol* const* IlvLookFeelHandler::GetAvailableLooks ( IlUInt count,
IlBoolean  sort = IlTrue 
)
static

Returns an array containing the available look and feel handlers.

The available look and feel handlers is the union of the registered and dynamic look and feel handlers.

Parameters
countThe size of the returned array.
sortIndicates whether the returned array should be sorted.
Returns
An array containing the available look and feel handlers.
See also
GetDynamicLooks(), GetRegisteredLooks().

§ GetDefaultLookFeelHandler()

static IlvLookFeelHandler* IlvLookFeelHandler::GetDefaultLookFeelHandler ( IlvDisplay display,
IlBoolean  warn = IlTrue 
)
static

Returns the default look and feel handler for the running platform.

If such a look and feel handler has already been created for the specified display, it is returned. Otherwise, a new instance is created and returned. This method uses the environment variable "ILVLOOK", or the resource "look" to create the default look and feel handler. If such resources are not set, the default behavior is to create a VX look and feel for Unix platforms, and a Windows look and feel on Windows platforms.

Parameters
displayThe display connection.
warnIndicates whether the method should warn the user if a default look cannot be found.
Returns
A look and feel handler depending on the running platform.

§ getDisplay()

IlvDisplay* IlvLookFeelHandler::getDisplay ( ) const

Retrieves the IlvDisplay instance associated with this handler.

Returns
The display instance associated with this handler.

§ GetDynamicLooks()

static const IlSymbol* const* IlvLookFeelHandler::GetDynamicLooks ( IlUInt count,
IlBoolean  sort = IlTrue 
)
static

Returns an array containing the look and feel handlers that can be dynamically loaded.

The dynamic look and feel handlers are read from Rogue Wave Views Module Description (.imd) files. They are not necessarily registered yet. To register or load a look and feel handler returned by this method, use the static method IlvLookFeelHandler::Create(). Note that this method can be used only when dynamic loading of modules is enabled, that is, when using shared libraries. See the section IlvModule: The Dynamic Module Class of the User Manual for details.

Parameters
countThe size of the returned array.
sortIndicates whether the returned array should be sorted.
Returns
An array containing the available look and feel handlers.

§ getLookName()

virtual const char* IlvLookFeelHandler::getLookName ( ) const
pure virtual

Returns the name of the look and feel handler.

Usually, you do not have to declare this method explicitely, since the macro DeclareLookFeelTypeInfo() does it.

Returns
The name of the look and feel handler.

Implemented in IlvBasicLFHandler.

§ getObjectLFHandler()

IlvObjectLFHandler* IlvLookFeelHandler::getObjectLFHandler ( const IlvClassInfo ci) const

Returns the object look and feel handler for the specified class information.

This method is called each time a gadget needs to get its object look and feel handler. The class information specified by ci indicates which object look and feel handler to return.

Parameters
ciThe class information object.
Returns
The object look and feel handler for the specified class. information. If no object look and feel handler can be found for the specified class, a warning is emitted and 0 is returned.

§ GetRegisteredLooks()

static const IlSymbol* const* IlvLookFeelHandler::GetRegisteredLooks ( IlUInt count,
IlBoolean  sort = IlTrue 
)
static

Returns an array containing the registered look and feel handlers.

Parameters
countThe size of the returned array.
sortIndicates whether the returned array should be sorted.
Returns
An array containing the registered look and feel handlers.

§ removeObjectLFHandler()

void IlvLookFeelHandler::removeObjectLFHandler ( const IlvClassInfo classinfo)

Removes the object look and feel handler linked with the specified class information from this look and feel handler.

Parameters
classinfoThe class information of the object look and feel handler to remove.
See also
addObjectLFHandler().

© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.