Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Class that encapsulates an ActiveX so that it may be used as an IlvGraphic. More...
#include <ilviews/windows/comgadap.h>
Public Member Functions | |
IlvGraphicCOMAdapter (IlvCOMGraphicFacade *facade, IlvRect const &bbox, IlBoolean owner=((IlBoolean) 1)) | |
Constructor. | |
IlvGraphicCOMAdapter (IlvRect const &bbox, char const *identifier, IlvDisplay *display) | |
Constructor. | |
virtual | ~IlvGraphicCOMAdapter () |
Destructor. | |
virtual void | applyTransform (IlvTransformer const *t) |
Applies a transformation function to the graphic object. | |
virtual IlBoolean | applyValue (const IlvValue &val) |
Apply an accessor. | |
virtual void | boundingBox (IlvRect &rect, IlvTransformer const *t=0) const |
Retrieves the bounding box of the graphic object. | |
const char * | className () const |
Returns the class name of an object. | |
IlBoolean | contains (IlvPoint const &p, IlvPoint const &tp, IlvTransformer const *t=0) const |
Checks whether a point is in the object. | |
virtual IlvGraphic * | copy () const |
Copies this object. | |
virtual void | draw (IlvPort *dst, IlvTransformer const *t=0, IlvRegion const *clip=0) const |
Draws the graphic object. | |
virtual void | getAccessors (const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count) const |
Retrieves the list of available accessors of an object. | |
virtual IlvClassInfo * | getClassInfo () const |
Gets class information. | |
char const * | getDefaultInteractor () const |
Gets the name of the default interactor for this object. | |
virtual IlBoolean | handleEvent (IlvEvent &event, IlvTransformer const *t=0) const |
Handles mouse and keyboard events. | |
IlBoolean | isSubtypeOf (const IlvClassInfo *c) const |
Checks whether this object's class is a subclass. | |
IlBoolean | isSubtypeOf (const char *t) const |
Checks whether this object's class is a subclass of a given parent class. | |
HRESULT | queryInterface (REFIID iid, void **ppvObject) const |
Encapsulates the IUnknown::QueryInterface COM API for the ActiveX associated with this view. | |
virtual IlvValue & | queryValue (IlvValue &val) const |
Retrieves the value of an accessor. | |
virtual void | setMode (IlvDrawMode mode) |
Sets the drawing mode of the object temporarily. | |
virtual void | setOverwrite (IlBoolean mode) |
Sets an overwrite mode that modifies how the drawing member functions operate. | |
virtual void | setPalette (IlvPalette *pal) |
Sets the palette of the object. | |
virtual void | write (IlvOutputFile &) const |
Writes out the object description. | |
virtual void | writeAdaptee (IlvOutputFile &os) const |
Saves the data specific to the adaptee. | |
Static Public Member Functions | |
static void | AddProperty (const IlSymbol *k, IlAny v) |
Adds a property to this object's class. | |
static IlAny | GetProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0)) |
Retrieves the property value associated with the key in this object's class. | |
static const IlvClassInfo * | HasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0)) |
Checks for the existence of a property for this object's class hierarchy. | |
static IlvGraphic * | read (IlvInputFile &, IlvPalette *pal) |
Reads an object description from a file. | |
static IlBoolean | RemoveProperty (const IlSymbol *key) |
Removes a property from this object's class. | |
static IlBoolean | ReplaceProperty (const IlSymbol *k, IlAny v) |
Replaces a property in this object's class. | |
Protected Member Functions | |
virtual IlvReferenceStreamer * | factory () const |
Creates an IlvReferenceStreamer . | |
Friends | |
class | IlvCOMGraphicFacade |
Class that encapsulates an ActiveX so that it may be used as an IlvGraphic.
Library: ilvcom
IlvCOMGraphicFacade
. IlvGraphicAdapter
. IlvGraphicCOMAdapter::IlvGraphicCOMAdapter | ( | IlvRect const & | bbox, | |
char const * | identifier, | |||
IlvDisplay * | display | |||
) |
Constructor.
This constructor initializes a graphic adapter object of an ActiveX, specified by an identifier.
bbox | The bounding box of the graphic object. | |
identifier | The identifier of the control. This string can be a CLSID (with braces), a ProgID , a URL, or raw HTML (prefixed with MSHTML: ). If either a URL or raw HTML is supplied, the Web browser will be loaded with this information. | |
display | The display instance. |
IlvGraphicCOMAdapter::IlvGraphicCOMAdapter | ( | IlvCOMGraphicFacade * | facade, | |
IlvRect const & | bbox, | |||
IlBoolean | owner = ((IlBoolean) 1) | |||
) |
Constructor.
This constructor initializes a graphic adapter object from an IlvCOMGraphicFacade.
facade | An IlvCOMGraphicFacade that encapsulates an ActiveX. | |
bbox | The bounding box of the graphic object. | |
owner | An IlBoolean that specifies whether the current object must release the ActiveX (by the mean of a reference counter managed by the IlvCOMGraphicFacade) or not. |
virtual IlvGraphicCOMAdapter::~IlvGraphicCOMAdapter | ( | ) | [virtual] |
Destructor.
The destructor releases the resources used by this object. In particular, if the owner flag of the constructor was IlTrue, it decrements the reference counter associated to the ActiveX.
Adds a property to this object's class.
This static function associates the given value with the given key for the class of this object only.
key | The key to be associated. | |
value | The value to be associated. |
Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::applyTransform | ( | IlvTransformer const * | t | ) | [virtual] |
Applies a transformation function to the graphic object.
Applies the transformer t
to the shape of the object. Unless the transformation is a scaling operation, the result of applying it to certain objects can be insignificant. For example, applying a non-scaling transformer to an IlvRectangle
object is meaningless, since the rectangle remains a rectangle. On the other hand, meaningful transformations can be applied to objects that are instances of types such as IlvLine
or IlvPolyPoints
.
applyTransform
is one of the most important method to be rewritten for classes derived from IlvGraphic
, since it is called by the resize
, move
, moveResize
, scale
, etc., methods.t | The transformer value. If 0, no transformation is performed. |
Implements IlvGraphic.
Apply an accessor.
This member function is called by changeValue
(s) functions and must not be called directly.
Moreover, no drawing operations are carried out here (and should not be). The drawing operations are called by the changeValue
(s) member functions, after having processed the call to applyValue
. If you add your own new IlvValue
, do not forget to override applyValue
as well as changeValue
and queryValue
, since applyValue
is called by changeValue
.
val | The new value of the accessor. |
Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::boundingBox | ( | IlvRect & | bbox, | |
IlvTransformer const * | t = 0 | |||
) | const [virtual] |
Retrieves the bounding box of the graphic object.
Sets bbox, the rectangle reference parameter, to be the bounding box of the object. Since the object can appear within a transformed environment (for example, in a multiview editor), an IlvTransformer
object occurs as an optional parameter in order to compute the bounding box in the coordinate system of the transformed environment. When there is no transformation, t is set to 0
.
bbox | The bounding box to be set. | |
t | A transformer value or 0 if there is no transformation. |
Implements IlvGraphic.
const char* IlvGraphicCOMAdapter::className | ( | ) | const |
Returns the class name of an object.
This method is equivalent to getClassInfo()->getClassName()
.
IlvRectangle
object, the className function returns "IlvRectangle"
. Reimplemented from IlvGraphic.
IlBoolean IlvGraphicCOMAdapter::contains | ( | IlvPoint const & | p, | |
IlvPoint const & | tp, | |||
IlvTransformer const * | t = 0 | |||
) | const [virtual] |
Checks whether a point is in the object.
Checks whether the coordinates are located in the shape of this object. A transformation parameter allows you to use the view's coordinate system for this test.
p | The point to be tested. | |
tp | The transformed point obtained by applying the transformer t to the point p. | |
t | A transformer value, or 0 if there is no transformation. |
IlTrue
when the point p lies inside the outline of the object. Reimplemented from IlvGraphic.
virtual IlvGraphic* IlvGraphicCOMAdapter::copy | ( | ) | const [virtual] |
Copies this object.
Allocates and returns a copy of this object. If the object is composite, the implementation of this member function makes a copy of the object's components.
IlvPredefinedIOMembers
. Implements IlvGraphic.
virtual void IlvGraphicCOMAdapter::draw | ( | IlvPort * | dst, | |
IlvTransformer const * | t = 0 , |
|||
IlvRegion const * | clip = 0 | |||
) | const [virtual] |
Draws the graphic object.
Draws the object in the given IlvPort
using the transformer t
which might have the value 0
. The clip
parameter, which can also be 0
, represents the clipping region relative to the transformed object.
dst | The destination port. | |
t | The transformer value. If 0, no transformation is performed. | |
clip | The clipping region, or 0 if none. |
Implements IlvGraphic.
virtual IlvReferenceStreamer* IlvGraphicCOMAdapter::factory | ( | ) | const [protected, virtual] |
Creates an IlvReferenceStreamer
.
The object returned by this function must be deleted.
Implements IlvGraphicAdapter< IlvCOMGraphicFacade >.
virtual void IlvGraphicCOMAdapter::getAccessors | ( | const IlSymbol *const ** | accessors, | |
const IlvValueTypeClass *const ** | types, | |||
IlUInt & | count | |||
) | const [virtual] |
Retrieves the list of available accessors of an object.
Retrieves the list of accessors of an object. accessors is the resulting array of symbols. Each symbol is the name of an accessor. types is the array of the types of accessors, count is the number of accessors. The existing types for accessors are the following:
IlvValueIntType
IlvValueUIntType
IlvValueStringType
IlvValueBooleanType
IlvValueColorType
IlvValueFontType
IlvValuePatternType
IlvValueColorPatternType
IlvValueGradientPatternType
IlvValueLineStyleType
IlvValueFillStyleType
IlvValueFillRuleType
IlvValueArcModeType
IlvValueDirectionType
IlvValueBitmapType
IlvValueFloatType
IlvValueDoubleType
IlvValueStringArrayType
IlvValueUIntArrayType
IlvValueMenuItemArrayType
IlvValueMatrixItemArrayType
IlvValueNotebookPageArrayType
The possible accessors for an object are described in the corresponding class.
Reimplemented from IlvGraphic.
virtual IlvClassInfo* IlvGraphicCOMAdapter::getClassInfo | ( | ) | const [virtual] |
Gets class information.
Returns a pointer to the IlvClassInfo
object associated with this object's class.
Reimplemented from IlvGraphic.
char const* IlvGraphicCOMAdapter::getDefaultInteractor | ( | ) | const [virtual] |
Gets the name of the default interactor for this object.
Reimplemented from IlvGraphic.
static IlAny IlvGraphicCOMAdapter::GetProperty | ( | const IlSymbol * | key, | |
IlBoolean | checkSuperClass = ((IlBoolean) 0) | |||
) | [static] |
Retrieves the property value associated with the key in this object's class.
Retrieves the property value associated with the property name key. If the property cannot be found in the class of this object, and if checkSuperClass is set to IlTrue
, then the function operates iteratively on each superclass until the property is found. If the property cannot be found, then 0
is returned.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvGraphic.
virtual IlBoolean IlvGraphicCOMAdapter::handleEvent | ( | IlvEvent & | event, | |
IlvTransformer const * | t = 0 | |||
) | const [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. Implements IlvGraphicAdapter< IlvCOMGraphicFacade >.
static const IlvClassInfo* IlvGraphicCOMAdapter::HasProperty | ( | const IlSymbol * | key, | |
IlBoolean | checkSuperClass = ((IlBoolean) 0) | |||
) | [static] |
Checks for the existence of a property for this object's class hierarchy.
Retrieves a pointer to the IlvClassInfo
that indicates a class where the key property exists. If the returned value is non-0
, then this property actually exists for this class. If this is not the case and if checkSuperClass is set to IlTrue
, then the function operates iteratively on each superclass until a match is found. If the property cannot be found, then 0
is returned.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvGraphic.
IlBoolean IlvGraphicCOMAdapter::isSubtypeOf | ( | const IlvClassInfo * | classInfo | ) | const |
Checks whether this object's class is a subclass.
This method is equivalent to getClassInfo()->isSubtypeOf(classInfo)
.
classInfo | The name of a class on which the object's class is tested. |
IlTrue
or IlFalse
, depending on whether or not this object's class is a subclass of the class indicated by classInfo. Reimplemented from IlvGraphic.
IlBoolean IlvGraphicCOMAdapter::isSubtypeOf | ( | const char * | parentClass | ) | const |
Checks whether this object's class is a subclass of a given parent class.
This method is equivalent to getClassInfo()->isSubtypeOf(parentClass)
.
parentClass | A string representing the parent class. |
IlTrue
or IlFalse
, depending on whether or not this object's class inherits parentClass attributes. The parentClass parameter should be a string representing the class name of an IlvGraphic
subclass. A call to this member function for a given class instance returns IlTrue
if given the name of its class. Reimplemented from IlvGraphic.
HRESULT IlvGraphicCOMAdapter::queryInterface | ( | REFIID | iid, | |
void ** | ppvObject | |||
) | const |
Encapsulates the IUnknown::QueryInterface COM API for the ActiveX associated with this view.
See the COM API documentation for more information.
Identifier | of the interface being requested. | |
Address | of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObject contains the requested interface pointer to the object. If the object does not support the interface specified in iid, *ppvObject is set to NULL. |
Retrieves the value of an accessor.
Retrieves the value of the accessor val. The queryValue
method can be used in the following way:
IlvValue arg("label"); char* label = (char*)labelObject->queryValue(arg);
See IlvValue
for more information.
Reimplemented from IlvGraphic.
static IlvGraphic* IlvGraphicCOMAdapter::read | ( | IlvInputFile & | file, | |
IlvPalette * | palette | |||
) | [static] |
Reads an object description from a file.
Reads an object description from the file input, given the palette graphic attributes. It reads the information that was saved by the member function write
to be able to create a new instance of this object. Usually, because of the availability of the constructor that expects an IlvInputFile
, read should be equivalent to:
IlvGraphic* MyClass::read(IlvInputFile& file, IlvPalette* palette) { return new MyClass(file, palette); }
In the following example, the static member function read
of the IlvLabel
class could have the following form:
IlvGraphic* IlvLabel::read(IlvInputFile& file, IlvPalette* pal) { IlvPoint pos; file.getStream() >> pos; // Read the position field return new IlvLabel(pal->getDisplay(), pos, IlvReadString(file.getStream()), pal); }
file | The name of the file to be read from. | |
palette | The name of the palette for the object. |
DeclareTypeInfoRO
, DeclareTypeInfo
, IlvPredefinedIOMembers
. read
method is not capitalized like other static methods so that it is consistent with the write
method. Reimplemented from IlvGraphic.
Removes a property from this object's class.
This static function removes the indicated property to the class of this object.
key | The key property to be removed. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvGraphic.
static IlBoolean IlvGraphicCOMAdapter::ReplaceProperty | ( | const IlSymbol * | key, | |
IlAny | value | |||
) | [static] |
Replaces a property in this object's class.
This static function replaces the indicated property value to the class of this object.
key | The key to be replaced. | |
value | The value to be replaced. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::setMode | ( | IlvDrawMode | mode | ) | [virtual] |
Sets the drawing mode of the object temporarily.
Changing the IlvDrawMode
attribute of an object is considered a temporary operation. You have to set the mode to its default value when you no longer need another mode different from the value IlvModeSet
. The drawing mode information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite
method for more details).
mode | The drawing mode to be set. |
Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::setOverwrite | ( | IlBoolean | over | ) | [virtual] |
Sets an overwrite mode that modifies how the drawing member functions operate.
Modifies the way the drawing member functions operate. The information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite
method for more details).
over | If IlFalse , sets selective hidden drawing operations. |
Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::setPalette | ( | IlvPalette * | palette | ) | [virtual] |
Sets the palette of the object.
Each of the graphic properties of this object is then taken from this IlvPalette
instance.
palette | The palette to be set. |
Reimplemented from IlvGraphic.
virtual void IlvGraphicCOMAdapter::write | ( | IlvOutputFile & | os | ) | const [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 IlvGraphicAdapter< IlvCOMGraphicFacade >.
virtual void IlvGraphicCOMAdapter::writeAdaptee | ( | IlvOutputFile & | os | ) | const [virtual] |
Saves the data specific to the adaptee.
os | The IlvOutputFile that is written to. |
Implements IlvGraphicAdapter< IlvCOMGraphicFacade >.
© 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.