Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Look and feel base class. More...
#include <ilviews/base/look.h>
Public Member Functions | |
void | addObjectLFHandler (IlvObjectLFHandler *olfh) |
Adds the specified object look and feel handler to this look and feel handler. More... | |
virtual IlvObjectLFHandler * | createObjectLFHandler (const IlvClassInfo *ci) const |
Creates and returns the object look and feel handler for specified class information. More... | |
IlvDisplay * | getDisplay () 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... | |
IlvObjectLFHandler * | getObjectLFHandler (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 IlvLookFeelHandler * | Create (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 IlvLookFeelHandler * | GetDefaultLookFeelHandler (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 |
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:
IlvMotifLFHandler
IlvWindowsLFHandler
IlvWindows95LFHandler
IlvWindowsXPLFHandler
IlvVXLFHandler
IlvCSSLFHandler
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.
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.
olfh | The new object look and feel handler. |
removeObjectLFHandler()
.
|
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
.
lookname | The name of the look and feel handler to create. |
display | The display connection. |
|
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.
ci | The class information. |
|
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.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
GetDynamicLooks()
, GetRegisteredLooks()
.
|
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.
display | The display connection. |
warn | Indicates whether the method should warn the user if a default look cannot be found. |
IlvDisplay* IlvLookFeelHandler::getDisplay | ( | ) | const |
Retrieves the IlvDisplay
instance associated with this handler.
|
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.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
|
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.
Implemented in IlvBasicLFHandler.
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.
ci | The class information object. |
0
is returned.
|
static |
Returns an array containing the registered look and feel handlers.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
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.
classinfo | The class information of the object look and feel handler to remove. |
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.