2005/5/9

     
 

class ComObject

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdkx::com::ComObject Class Reference

#include <ComObject.h>

Inheritance diagram for acdkx::com::ComObject:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Proxy to a scriptable COM ojbect.

With a ComObject a ActiveX acdk::lang::Object can be used, quite similar it can be done in Visual Basic or other Windows Host scripting languages.

C++ acdk RComObject obj = ComObject::New(Word.Application);

obj->poke(Visible, ScriptVar(true)); RComObject docs = obj->peekI(Documents); RComObject doc = docs->invokeI(Add, ); RComObject sel = obj->peekI(ActiveWindow)->peekI(Selection); RString s(This is ACDK); sel->invokev(TypeText, S, RString(This is )); sel->peekI(Font)->poke(Bold, true); sel->invokev(TypeText, S, RString(ACDK )); sel->peekI(Font)->poke(Bold, false); sel->invokev(TypeText, S, RString(instrumenting Word!));

Thread::sleep(3000);

obj->invokev(Quit, i, 0);

This class can also used in scripting enviromnents: (defun say-word-hello () (set cls (invoke (invoke-static 'acdk.lang.ClassLoader 'getSystemClassLoader) 'findClass 'acdkx.com::ComObject)) (set app (invoke-static 'acdkx.com::ComObject 'New Word.Application)) (poke app 'Visible T) (set doc (invoke (peek app 'Documents) 'Add)) (set sel (peek (peek app 'ActiveWindow) 'Selection)) (invoke sel 'TypeText This is ) (poke (peek sel 'Font) 'Bold 1) (invoke sel 'TypeText ACDK) (poke (peek sel 'Font) 'Bold 0) (invoke sel 'TypeText instrumenting Word through acdklisp) (sleep 3000) (invoke app 'Quit 0) )


Public Member Functions

virtual::acdk::lang::dmi::ClazzInfo * getClazzInfo ()
 not using the standard meta info, becuase this class is used as a proxy

static::acdk::lang::dmi::ClazzInfo * clazzInfo ()
 return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc

virtual::acdk::lang::RClass getClass ()
static::acdk::lang::RClass GetClass ()
static::acdk::lang::RObject create_array (int length=0)
static::acdk::lang::RObject create_array_array (int firstLength=0, int secondLength=0)
virtual void getCollectableFields (FieldReferences &fields)
 retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set.

virtual::acdk::lang::dmi::SysFields getInternalFields (int flags, const::acdk::lang::dmi::ClazzInfo *clazz=0)
virtual::acdk::lang::dmi::ScriptVar getMember (IN(RString) fieldname,::acdk::lang::dmi::DmiClient &dc, int flags, const::acdk::lang::dmi::ClazzInfo *type_requested=0)
virtual void setMember (IN(RString) fieldname, const::acdk::lang::dmi::ScriptVar &newval,::acdk::lang::dmi::DmiClient &dc, int flags)
 ComObject (IN(RIDispatch) id=0)
 Internal to wrapp a IDispatch interface with ComObject.

 ComObject (IN(RString) classname)
virtual acdk::lang::dmi::ScriptVar New (IN(RString) classname, acdk::lang::dmi::ScriptVarArray &args)
static::acdk::lang::dmi::ScriptVar New (IN(RString) classname)
 creates a new COM acdk::lang::Object.

void unwrapAcdkObject (bool flag)
 Should an wrapped ACDK acdk::lang::Object parameter be unwrapped or not If flag is false, the DMI interface returns ComObject's (except String) otherwise the type will be casted.

bool unwrapAcdkObject ()
::IDispatch * getIDispatch ()

Static Public Member Functions

const::acdk::lang::dmi::ClazzMethodInfo * _invoke_dynamic (::acdk::lang::Object *This, IN(RString) fname,::acdk::lang::dmi::ScriptVar &ret,::acdk::lang::dmi::ScriptVarArray &args,::acdk::lang::dmi::DmiClient &dc, IN(::acdk::lang::RStringArray) namedArgs, int flags, const::acdk::lang::dmi::ClazzInfo *clazzinfo, const::acdk::lang::dmi::ClazzMethodInfo *methinf)
const::acdk::lang::dmi::ClazzMethodInfo * _invoke_static (IN(RString) fname,::acdk::lang::dmi::ScriptVar &ret,::acdk::lang::dmi::ScriptVarArray &args,::acdk::lang::dmi::DmiClient &dc, IN(::acdk::lang::RStringArray) namedArgs, int flags, const::acdk::lang::dmi::ClazzInfo *clazzinfo, const::acdk::lang::dmi::ClazzMethodInfo *methinf)

Private Attributes

static::acdk::lang::dmi::ClazzInfo _clazzInfo
::RIDispatch _idispatch
bool _unwrapDmiObject


Constructor & Destructor Documentation

acdkx::com::ComObject::ComObject IN(RIDispatch id = 0  )  [inline]
 

Internal to wrapp a IDispatch interface with ComObject.

See also:
ComObject::New

acdkx::com::ComObject::ComObject IN(RString classname  ) 
 


Member Function Documentation

const ::acdk::lang::dmi::ClazzMethodInfo* acdkx::com::ComObject::_invoke_dynamic ::acdk::lang::Object This,
IN(RString fname,
::acdk::lang::dmi::ScriptVar ret,
::acdk::lang::dmi::ScriptVarArray args,
::acdk::lang::dmi::DmiClient dc,
IN(::acdk::lang::RStringArray namedArgs,
int  flags,
const::acdk::lang::dmi::ClazzInfo *  clazzinfo,
const::acdk::lang::dmi::ClazzMethodInfo *  methinf
[static]
 

const ::acdk::lang::dmi::ClazzMethodInfo* acdkx::com::ComObject::_invoke_static IN(RString fname,
::acdk::lang::dmi::ScriptVar ret,
::acdk::lang::dmi::ScriptVarArray args,
::acdk::lang::dmi::DmiClient dc,
IN(::acdk::lang::RStringArray namedArgs,
int  flags,
const::acdk::lang::dmi::ClazzInfo *  clazzinfo,
const::acdk::lang::dmi::ClazzMethodInfo *  methinf
[static]
 

static ::acdk::lang::dmi::ClazzInfo* acdkx::com::ComObject::clazzInfo  )  [inline]
 

return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc

Reimplemented from acdk::lang::ObjectBase.

static ::acdk::lang::RObject acdkx::com::ComObject::create_array int  length = 0  )  [inline]
 

static ::acdk::lang::RObject acdkx::com::ComObject::create_array_array int  firstLength = 0,
int  secondLength = 0
[inline]
 

static ::acdk::lang::RClass acdkx::com::ComObject::GetClass  )  [inline]
 

Reimplemented from acdk::lang::Object.

virtual ::acdk::lang::RClass acdkx::com::ComObject::getClass  )  [inline, virtual]
 

Reimplemented from acdk::lang::Object.

virtual ::acdk::lang::dmi::ClazzInfo* acdkx::com::ComObject::getClazzInfo  )  [inline, virtual]
 

not using the standard meta info, becuase this class is used as a proxy

Implements acdk::lang::dmi::StdDispatch.

virtual void acdkx::com::ComObject::getCollectableFields FieldReferences fields  )  [inline, virtual]
 

retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set.

Reimplemented from acdk::lang::ObjectBase.

::IDispatch* acdkx::com::ComObject::getIDispatch  )  [inline]
 

virtual ::acdk::lang::dmi::SysFields acdkx::com::ComObject::getInternalFields int  flags,
const ::acdk::lang::dmi::ClazzInfo clazz = 0
[inline]
 

virtual ::acdk::lang::dmi::ScriptVar acdkx::com::ComObject::getMember IN(RString fieldname,
::acdk::lang::dmi::DmiClient dc,
int  flags,
const::acdk::lang::dmi::ClazzInfo *  type_requested = 0
 

static ::acdk::lang::dmi::ScriptVar acdkx::com::ComObject::New IN(RString classname  ) 
 

creates a new COM acdk::lang::Object.

Parameters:
classname is the name of COM object like Word.Application

Reimplemented from acdk::lang::dmi::StdDispatch.

virtual acdk::lang::dmi::ScriptVar acdkx::com::ComObject::New IN(RString classname,
acdk::lang::dmi::ScriptVarArray args
[virtual]
 

virtual void acdkx::com::ComObject::setMember IN(RString fieldname,
const::acdk::lang::dmi::ScriptVar &  newval,
::acdk::lang::dmi::DmiClient dc,
int  flags
[virtual]
 

bool acdkx::com::ComObject::unwrapAcdkObject  )  [inline]
 

void acdkx::com::ComObject::unwrapAcdkObject bool  flag  )  [inline]
 

Should an wrapped ACDK acdk::lang::Object parameter be unwrapped or not If flag is false, the DMI interface returns ComObject's (except String) otherwise the type will be casted.


Member Data Documentation

::acdk::lang::dmi::ClazzInfo acdkx::com::ComObject::_clazzInfo [private]
 

::RIDispatch acdkx::com::ComObject::_idispatch [private]
 

bool acdkx::com::ComObject::_unwrapDmiObject [private]