Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Frame class to adapt any object as an IlvGraphic
.
More...
#include <ilviews/graphics/adapter.h>
Public Member Functions | |
IlvGraphicAdapter (ADAPTEE *obj, IlBoolean owner=((IlBoolean) 0)) | |
Constructor. | |
virtual | ~IlvGraphicAdapter ()=0 |
Destructor. | |
ADAPTEE *const | getAdaptee () const |
Returns a const pointer to the adaptee. | |
virtual IlBoolean | handleEvent (IlvEvent &event, const IlvTransformer *t=0) const =0 |
Handles mouse and keyboard events. | |
IlBoolean | isOwner () const |
Returns the ownership property. | |
void | setAdaptee (ADAPTEE *adaptee, IlBoolean owner) |
Sets the adpatee. | |
virtual void | write (IlvOutputFile &os) const =0 |
Writes out the object description. | |
Protected Member Functions | |
IlvGraphicAdapter () | |
Constructor. | |
virtual void | afterSetAdaptee () |
This virtual member function is called after the adaptee is set. | |
virtual void | beforeSetAdaptee () |
Is called before the adaptee is set. | |
virtual IlvReferenceStreamer * | factory () const =0 |
Creates an IlvReferenceStreamer . | |
virtual void | writeAdaptee (IlvOutputFile &os) const =0 |
Saves the data specific to the adaptee. |
Frame class to adapt any object as an IlvGraphic
.
Library: views
This template class is intended to be used as a base class (it is a pure abstract class). The parameter of the template ADAPTEE specifies the type of the adpatee object.
Among the member functions inherited from IlvGraphic
, the following ones have to be defined:
virtual void boundingBox(IlvRect& rect, const IlvTransformer* t = 0) const virtual IlBoolean contains(const IlvPoint& p, const IlvPoint& tp, const IlvTransformer* t = 0) const; virtual void draw(IlvPort* dst, const IlvTransformer* t = 0, const IlvRegion* clip = 0) const; virtual void applyTransform(const IlvTransformer* t);
The following member functions are likely to be redefined:
virtual void drawPalette(const IlvPalette* pal, IlvPort* dst, const IlvTransformer* t = 0, const IlvRegion* clip = 0) const; virtual void setBackground(IlvColor* c); virtual void setForeground(IlvColor* c); virtual void setFont(IlvFont* f); virtual void setColorPattern(IlvColorPattern* b); virtual void setGradientPattern(IlvGradientPattern* g); virtual void setPattern(IlvPattern* p); virtual void setMode(IlvDrawMode m); virtual void setArcMode(IlvArcMode m); virtual void setFillRule(IlvFillRule m); virtual void setFillStyle(IlvFillStyle f); virtual void setLineStyle(IlvLineStyle* style); virtual void setLineWidth(IlUShort width); virtual void setOverwrite(IlBoolean overwrite); virtual void setAlpha(IlvIntensity alpha); virtual void setAntialiasingMode(IlvAntialiasingMode mode); virtual IlBoolean zoomable() const; virtual void setPalette(IlvPalette* pal); virtual void print(ILVSTDPREF ostream&, int level = 0) const;
IlvGraphicAdapter< ADAPTEE >::IlvGraphicAdapter | ( | ADAPTEE * | obj, | |
IlBoolean | owner = ((IlBoolean)0) | |||
) |
Constructor.
Initializes the data members specific to the class.
obj | A pointer to an ADAPTEE (type given as parameter of the template) IlvGraphic . The type of the object is given as parameter to the template. | |
owner | An IlBoolean. The default value is IlFalse, that means that the adaptee is not owned. |
IlvGraphicAdapter< ADAPTEE >::~IlvGraphicAdapter | ( | ) | [pure virtual] |
Destructor.
The adaptee is unlocked. If the reference counter is null and has the property owner set to true - that means at least one of the adapters that share this adaptee is owner - then the adaptee is deleted.
IlvGraphicAdapter< ADAPTEE >::IlvGraphicAdapter | ( | ) | [protected] |
Constructor.
This protected constructor may only be used by a derived class.
virtual IlvReferenceStreamer* IlvGraphicAdapter< ADAPTEE >::factory | ( | ) | const [protected, pure virtual] |
Creates an IlvReferenceStreamer
.
The object returned by this function must be deleted.
Implemented in IlvGraphicCOMAdapter.
ADAPTEE* const IlvGraphicAdapter< ADAPTEE >::getAdaptee | ( | ) | const |
Returns a const pointer to the adaptee.
The type is given by the parameter of the template.
virtual IlBoolean IlvGraphicAdapter< ADAPTEE >::handleEvent | ( | IlvEvent & | event, | |
const IlvTransformer * | t = 0 | |||
) | const [pure virtual] |
Handles mouse and keyboard events.
The function returns IlFalse
if the event has not been dealt with.
event | The event to be handled. |
IlTrue
if the event is handled, IlFalse
otherwise. Implemented in IlvGraphicCOMAdapter.
IlBoolean IlvGraphicAdapter< ADAPTEE >::isOwner | ( | ) | const |
Returns the ownership property.
IlTrue
when the object has the ownership of the adaptee, IlFalse
otherwise. void IlvGraphicAdapter< ADAPTEE >::setAdaptee | ( | ADAPTEE * | adaptee, | |
IlBoolean | owner | |||
) |
Sets the adpatee.
First, this function calls the virtual member function beforeSetAdaptee
.
Second it calls the factory of IlvOwnership in order to get an owner object. The previous object, if any, is automatically unlocked through a reference counter mechanism.
Third, it calls the virtual member function afterSetAdaptee
.
adaptee | A pointer to an ADAPTEE (type given as parameter of the template). | |
owner | An IlBoolean that specifies the ownership of the adaptee. |
void IlvGraphicAdapter< ADAPTEE >::write | ( | IlvOutputFile & | os | ) | const [pure virtual] |
Writes out the object description.
This member function uses a IlvReferenceStreamer to save the adaptee through a call to template<class OBJECT> void IlvWrite(IlvOwnership<OBJECT>&, IlvOutputFile&, IlvReferenceStreamer&)
.
The derived classes must save their data after having called this function.
os | The IlvOutputFile that is written to. |
Implements IlvGraphic.
Implemented in IlvGraphicCOMAdapter.
virtual void IlvGraphicAdapter< ADAPTEE >::writeAdaptee | ( | IlvOutputFile & | os | ) | const [protected, pure virtual] |
Saves the data specific to the adaptee.
os | The IlvOutputFile that is written to. |
Implemented in IlvGraphicCOMAdapter.
© 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.