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 & 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 & 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 & feel handler. More...
 
IlvObjectLFHandlergetObjectLFHandler (const IlvClassInfo *ci) const
 Returns the object look & 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 & 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 & feel handlers. More...
 
static IlvLookFeelHandlerGetDefaultLookFeelHandler (IlvDisplay *display, IlBoolean warn=IlTrue)
 Returns the default look & feel handler for the running platform. More...
 
static const IlSymbol *const * GetDynamicLooks (IlUInt &count, IlBoolean sort=IlTrue)
 Returns an array containing the look & 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 & feel handlers. More...
 

Friends

class IlvDisplay
 

Detailed Description

Look & feel base class.

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

Each of these classes is able to return a valid object look & feel handler for all Rogue Wave Views predefined gadgets. If you plan to create your own look & feel handler, you must provide an object look & 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 & feel handler to obtain its object look & feel handler. However, each gadget can have its own look & feel handler. See the member function IlvGadget::setLookFeelHandler() for details.

You cannot create a look & feel handler by calling its constructor. Instead, use the IlvLookFeelHandler::Create() member function. Similarly, you cannot delete a look & feel handler. The display connection is responsible for deleting look & feel handlers. To set a new look & 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 & feel handler that matches the specified name.

Each look & 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 & feel handler. If no look & feel handler that matches the specified name can be found, the method returns 0.

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

§ createObjectLFHandler()

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

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

The method looks first into the object look & feel handlers defined in this look & 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 & feel handler.

§ GetAvailableLooks()

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

Returns an array containing the available look & feel handlers.

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

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

§ GetDefaultLookFeelHandler()

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

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

If such a look & 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 & feel handler. If such resources are not set, the default behavior is to create a Motif look & feel for Unix platforms, and a Windows look & 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 & 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 & feel handlers that can be dynamically loaded.

The dynamic look & feel handlers are read from Rogue Wave Views Module Description (.imd) files. They are not necessarily registered yet. To register or load a look & 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 & feel handlers.

§ getLookName()

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

Returns the name of the look & feel handler.

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

Returns
The name of the look & feel handler.

Implemented in IlvBasicLFHandler.

§ getObjectLFHandler()

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

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

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

Parameters
ciThe class information object.
Returns
The object look & feel handler for the specified class. information. If no object look & 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 & feel handlers.

Parameters
countThe size of the returned array.
sortIndicates whether the returned array should be sorted.
Returns
An array containing the registered look & 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 2017, 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.