rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvGraphicCOMAdapter Class Reference

Class that encapsulates an ActiveX so that it may be used as an IlvGraphic. More...

#include <ilviews/windows/comgadap.h>

Inheritance diagram for IlvGraphicCOMAdapter:
IlvGraphicAdapter< IlvCOMGraphicFacade > IlvGraphic

List of all members.

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 IlvGraphiccopy () 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 IlvClassInfogetClassInfo () 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 IlvValuequeryValue (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 IlvClassInfoHasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0))
 Checks for the existence of a property for this object's class hierarchy.
static IlvGraphicread (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

Detailed Description

Class that encapsulates an ActiveX so that it may be used as an IlvGraphic.

Library: ilvcom

See also:
IlvCOMGraphicFacade.
IlvGraphicAdapter.

Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.


Member Function Documentation

static void IlvGraphicCOMAdapter::AddProperty ( const IlSymbol key,
IlAny  value 
) [static]

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.

Parameters:
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.

Warning:
[note] 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.
Parameters:
t The transformer value. If 0, no transformation is performed.

Implements IlvGraphic.

virtual IlBoolean IlvGraphicCOMAdapter::applyValue ( const IlvValue val  )  [virtual]

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.

Parameters:
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.

Parameters:
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().

Returns:
The class name of the object. For example, for an 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.

Parameters:
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.
Returns:
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.

Returns:
A copy of the object.
See also:
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.

Parameters:
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.

Returns:
The reference streamer for the adaptee.

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.

Returns:
The array of symbols listing the accessor names in accessors, a corresponding array of accessor types in types, and the number of accessors in count.

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.

Returns:
A pointer to the class information object of the class of this object.

Reimplemented from IlvGraphic.

char const* IlvGraphicCOMAdapter::getDefaultInteractor (  )  const [virtual]

Gets the name of the default interactor for this object.

Returns:
A string that identifies the object interactor that is likely to be associated with this graphic class. If it returns 0, then there is no default interactor for this graphic class.

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.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
The property value associated with the proper name key, or 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.

Parameters:
event The event to be handled.
Returns:
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.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
A pointer to the ClassInfo that indicates a class where the key property exists, or 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).

Parameters:
classInfo The name of a class on which the object's class is tested.
Returns:
Either 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).

Parameters:
parentClass A string representing the parent class.
Returns:
Either 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.

Parameters:
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.
Returns:
S_OK if the interface is supported, E_NOINTERFACE if not.
virtual IlvValue& IlvGraphicCOMAdapter::queryValue ( IlvValue val  )  const [virtual]

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.

Returns:
The value of the accessor in val.

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);
 }
Parameters:
file The name of the file to be read from.
palette The name of the palette for the object.
See also:
DeclareTypeInfoRO, DeclareTypeInfo, IlvPredefinedIOMembers.
Warning:
[note] The read method is not capitalized like other static methods so that it is consistent with the write method.

Reimplemented from IlvGraphic.

static IlBoolean IlvGraphicCOMAdapter::RemoveProperty ( const IlSymbol key  )  [static]

Removes a property from this object's class.

This static function removes the indicated property to the class of this object.

Parameters:
key The key property to be removed.
Returns:
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.

Parameters:
key The key to be replaced.
value The value to be replaced.
Returns:
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).

Parameters:
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).

Parameters:
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.

Parameters:
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.

Parameters:
os The IlvOutputFile that is written to.
See also:
IlvGraphicAdapter::writeAdaptee
IlvWrite

Implements IlvGraphicAdapter< IlvCOMGraphicFacade >.

virtual void IlvGraphicCOMAdapter::writeAdaptee ( IlvOutputFile os  )  const [virtual]

Saves the data specific to the adaptee.

Parameters:
os The IlvOutputFile that is written to.

Implements IlvGraphicAdapter< IlvCOMGraphicFacade >.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.