Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Look & 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. | |
virtual IlvObjectLFHandler * | createObjectLFHandler (const IlvClassInfo *ci) const |
Creates and returns the object look & feel handler for specified class information. | |
IlvDisplay * | getDisplay () const |
Retrieves the IlvDisplay instance associated with this handler. | |
virtual const char * | getLookName () const =0 |
Returns the name of the look & feel handler. | |
IlvObjectLFHandler * | getObjectLFHandler (const IlvClassInfo *ci) const |
Returns the object look & feel handler for the specified class information. | |
void | removeObjectLFHandler (const IlvClassInfo *classinfo) |
Removes the object look and feel handler linked with the specified class information from this look and feel handler. | |
Static Public Member Functions | |
static IlvLookFeelHandler * | Create (IlSymbol *lookname, IlvDisplay *display) |
Creates and returns a look & feel handler that matches the specified name. | |
static const IlSymbol *const * | GetAvailableLooks (IlUInt &count, IlBoolean sortStrings=((IlBoolean) 1)) |
Returns an array containing the available look & feel handlers. | |
static IlvLookFeelHandler * | GetDefaultLookFeelHandler (IlvDisplay *display, IlBoolean b=((IlBoolean) 1)) |
Returns the default look & feel handler for the running platform. | |
static const IlSymbol *const * | GetDynamicLooks (IlUInt &count, IlBoolean sortStrings=((IlBoolean) 1)) |
Returns an array containing the look & feel handlers that can be dynamically loaded. | |
static const IlSymbol *const * | GetRegisteredLooks (IlUInt &count, IlBoolean sortStrings=((IlBoolean) 1)) |
Returns an array containing the registered look & feel handlers. | |
Friends | |
class | IlvDisplay |
Look & feel base class.
Library: display
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.
IlvObjectLFHandler
, IlvDisplay::setLookFeelHandler
. 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. |
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
.
lookname | The name of the look & feel handler to create. | |
display | The display connection. |
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.
ci | The class information. |
static const IlSymbol* const* IlvLookFeelHandler::GetAvailableLooks | ( | IlUInt & | count, | |
IlBoolean | sortStrings = ((IlBoolean) 1) | |||
) | [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.
count | The size of the returned array. | |
sortStrings | A Boolean value indicating whether the returned array should be sorted. |
GetDynamicLooks
, GetRegisteredLooks
. static IlvLookFeelHandler* IlvLookFeelHandler::GetDefaultLookFeelHandler | ( | IlvDisplay * | display, | |
IlBoolean | b = ((IlBoolean) 1) | |||
) | [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.
display | The display connection. | |
b | A Boolean value indicating 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 const IlSymbol* const* IlvLookFeelHandler::GetDynamicLooks | ( | IlUInt & | count, | |
IlBoolean | sortStrings = ((IlBoolean) 1) | |||
) | [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.
count | The size of the returned array. | |
sortStrings | A Boolean value indicating whether the returned array should be sorted. |
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.
Implemented in IlvBasicLFHandler, IlvMotifLFHandler, IlvVXLFHandler, IlvWindows95LFHandler, and IlvWindowsLFHandler.
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. If no object look & feel handler can be found for the specified class, a warning is emitted and 0
is returned.
ci | The class information object. |
static const IlSymbol* const* IlvLookFeelHandler::GetRegisteredLooks | ( | IlUInt & | count, | |
IlBoolean | sortStrings = ((IlBoolean) 1) | |||
) | [static] |
Returns an array containing the registered look & feel handlers.
count | The size of the returned array. | |
sortStrings | A Boolean value indicating 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. |
© Copyright 2012, 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.