前の関連記事:LibreOffice5(148)ConfigurationAccessとConfigurationUpdateAccessのサービスとインターフェイスの比較
TypeDescriptionManagerのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
tcu.wtree(tdm)
まずTypeDescriptionManagerサービスを シングルトンでインスタンス化したもののサービスとインターフェイスです。thePathSettingsシングルトンと違ってtheTypeDescriptionManagerをAPIリファレンスで見つけることはできませんでしたが、OOoBasic/Generic/TypeDescription - ...?にシングルトンでインスタンス化する方法が載っていました。
TypeDescriptionManagerサービスをサービスマネージャーからインスタンスしてもNoneしか取得できませんでした。
└─.reflection.TypeDescriptionManager
├─.container.XHierarchicalNameAccess
│ any getByHierarchicalName( [in] string aName
│ ) raises ( .container.NoSuchElementException)
│ boolean hasByHierarchicalName( [in] string aName)
├─.container.XSet
│ │ boolean has( [in] any aElement)
│ │ void insert( [in] any aElement
│ │ ) raises ( .container.ElementExistException,
│ │ .lang.IllegalArgumentException)
│ │ void remove( [in] any aElement
│ │ ) raises ( .container.NoSuchElementException,
│ │ .lang.IllegalArgumentException)
│ └─.container.XEnumerationAccess
│ │ .container.XEnumeration createEnumeration()
│ └─.container.XElementAccess
│ type getElementType()
│ boolean hasElements()
├─.lang.XComponent
│ void addEventListener( [in] .lang.XEventListener xListener)
│ void dispose()
│ void removeEventListener( [in] .lang.XEventListener aListener)
└─.reflection.XTypeDescriptionEnumerationAccess
.reflection.XTypeDescriptionEnumeration createTypeDescriptionEnumeration( [in] string moduleName,
[in] [.uno.TypeClass] types,
[in] .reflection.TypeDescriptionSearchDepth depth
) raises ( .reflection.InvalidTypeNameException,
.reflection.NoSuchTypeNameException)。
├─.container.XHierarchicalNameAccess
│ any getByHierarchicalName( [in] string aName
│ ) raises ( .container.NoSuchElementException)
│ boolean hasByHierarchicalName( [in] string aName)
├─.container.XSet
│ │ boolean has( [in] any aElement)
│ │ void insert( [in] any aElement
│ │ ) raises ( .container.ElementExistException,
│ │ .lang.IllegalArgumentException)
│ │ void remove( [in] any aElement
│ │ ) raises ( .container.NoSuchElementException,
│ │ .lang.IllegalArgumentException)
│ └─.container.XEnumerationAccess
│ │ .container.XEnumeration createEnumeration()
│ └─.container.XElementAccess
│ type getElementType()
│ boolean hasElements()
├─.lang.XComponent
│ void addEventListener( [in] .lang.XEventListener xListener)
│ void dispose()
│ void removeEventListener( [in] .lang.XEventListener aListener)
└─.reflection.XTypeDescriptionEnumerationAccess
.reflection.XTypeDescriptionEnumeration createTypeDescriptionEnumeration( [in] string moduleName,
[in] [.uno.TypeClass] types,
[in] .reflection.TypeDescriptionSearchDepth depth
) raises ( .reflection.InvalidTypeNameException,
.reflection.NoSuchTypeNameException)。
サービスのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
service = tdm.getByHierarchicalName("com.sun.star.sheet.SpreadsheetDocument")
tcu.wtree(service)
サービス名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XPublished
│ boolean isPublished()
└─.reflection.XServiceTypeDescription2
│ [.reflection.XServiceConstructorDescription] getConstructors()
│ .reflection.XTypeDescription getInterface()
│ boolean isSingleInterfaceBased()
└─.reflection.XServiceTypeDescription
│ [.reflection.XInterfaceTypeDescription] getMandatoryInterfaces()
│ [.reflection.XServiceTypeDescription] getMandatoryServices()
│ [.reflection.XInterfaceTypeDescription] getOptionalInterfaces()
│ [.reflection.XServiceTypeDescription] getOptionalServices()
│ [.reflection.XPropertyTypeDescription] getProperties()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
│ boolean isPublished()
└─.reflection.XServiceTypeDescription2
│ [.reflection.XServiceConstructorDescription] getConstructors()
│ .reflection.XTypeDescription getInterface()
│ boolean isSingleInterfaceBased()
└─.reflection.XServiceTypeDescription
│ [.reflection.XInterfaceTypeDescription] getMandatoryInterfaces()
│ [.reflection.XServiceTypeDescription] getMandatoryServices()
│ [.reflection.XInterfaceTypeDescription] getOptionalInterfaces()
│ [.reflection.XServiceTypeDescription] getOptionalServices()
│ [.reflection.XPropertyTypeDescription] getProperties()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
プロパティのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
service = tdm.getByHierarchicalName("com.sun.star.sheet.SpreadsheetDocument")
prop = service.getProperties()[0]
tcu.wtree(prop)
サービスのTypeDescriptionオブジェクトのgetProperties()メソッドで取得できるオブジェクトです。
└─.reflection.XPropertyTypeDescription
│ short getPropertyFlags()
│ .reflection.XTypeDescription getPropertyTypeDescription()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
│ short getPropertyFlags()
│ .reflection.XTypeDescription getPropertyTypeDescription()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
インターフェイスのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
interface = tdm.getByHierarchicalName("com.sun.star.frame.XController2")
tcu.wtree(interface)
インターフェイス名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XInterfaceTypeDescription2
│ │ [.reflection.XTypeDescription] getBaseTypes()
│ │ [.reflection.XTypeDescription] getOptionalBaseTypes()
│ └─.reflection.XInterfaceTypeDescription
│ │ .reflection.XTypeDescription getBaseType()
│ │ [.reflection.XInterfaceMemberTypeDescription] getMembers()
│ │ .uno.Uik getUik()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
│ │ [.reflection.XTypeDescription] getBaseTypes()
│ │ [.reflection.XTypeDescription] getOptionalBaseTypes()
│ └─.reflection.XInterfaceTypeDescription
│ │ .reflection.XTypeDescription getBaseType()
│ │ [.reflection.XInterfaceMemberTypeDescription] getMembers()
│ │ .uno.Uik getUik()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
アトリビュートのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
from com.sun.star.uno.TypeClass import INTERFACE_ATTRIBUTE # enum
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
interface = tdm.getByHierarchicalName("com.sun.star.frame.XController2")
members = interface.getMembers()
for member in members:
if member.getTypeClass()==INTERFACE_ATTRIBUTE:
tcu.wtree(member)
return
インターフェイスのTypeDescriptionオブジェクトのgetMembers()メソッドからはアトリビュートとメソッドの2種類のTypeDescriptionオブジェクトが返ってきます。アトリビュートは、getTypeClass()メソッドの戻り値がenum TypeClassのINTERFACE_ATTRIBUTEのものです。
└─.reflection.XInterfaceAttributeTypeDescription2
│ [.reflection.XCompoundTypeDescription] getGetExceptions()
│ [.reflection.XCompoundTypeDescription] getSetExceptions()
│ boolean isBound()
└─.reflection.XInterfaceAttributeTypeDescription
│ .reflection.XTypeDescription getType()
│ boolean isReadOnly()
└─.reflection.XInterfaceMemberTypeDescription
│ string getMemberName()
│ long getPosition()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
│ [.reflection.XCompoundTypeDescription] getGetExceptions()
│ [.reflection.XCompoundTypeDescription] getSetExceptions()
│ boolean isBound()
└─.reflection.XInterfaceAttributeTypeDescription
│ .reflection.XTypeDescription getType()
│ boolean isReadOnly()
└─.reflection.XInterfaceMemberTypeDescription
│ string getMemberName()
│ long getPosition()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
メソッドのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
from com.sun.star.uno.TypeClass import INTERFACE_METHOD # enum
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
interface = tdm.getByHierarchicalName("com.sun.star.frame.XController2")
members = interface.getMembers()
for member in members:
if member.getTypeClass()==INTERFACE_METHOD:
tcu.wtree(member)
return
メソッドは、getTypeClass()メソッドの戻り値がenum TypeClassのINTERFACE_METHODのものです。
└─.reflection.XInterfaceMethodTypeDescription
│ [.reflection.XTypeDescription] getExceptions()
│ [.reflection.XMethodParameter] getParameters()
│ .reflection.XTypeDescription getReturnType()
│ boolean isOneway()
└─.reflection.XInterfaceMemberTypeDescription
│ string getMemberName()
│ long getPosition()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
│ [.reflection.XTypeDescription] getExceptions()
│ [.reflection.XMethodParameter] getParameters()
│ .reflection.XTypeDescription getReturnType()
│ boolean isOneway()
└─.reflection.XInterfaceMemberTypeDescription
│ string getMemberName()
│ long getPosition()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
例外のTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
exception = tdm.getByHierarchicalName("com.sun.star.lang.IndexOutOfBoundsException")
tcu.wtree(exception)
例外名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XCompoundTypeDescription
│ │ .reflection.XTypeDescription getBaseType()
│ │ [string] getMemberNames()
│ │ [.reflection.XTypeDescription] getMemberTypes()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
│ │ .reflection.XTypeDescription getBaseType()
│ │ [string] getMemberNames()
│ │ [.reflection.XTypeDescription] getMemberTypes()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
StructのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
struct = tdm.getByHierarchicalName("com.sun.star.beans.PropertyValue")
tcu.wtree(struct)
Struct名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XPublished
│ boolean isPublished()
└─.reflection.XStructTypeDescription
│ [.reflection.XTypeDescription] getTypeArguments()
│ [string] getTypeParameters()
└─.reflection.XCompoundTypeDescription
│ .reflection.XTypeDescription getBaseType()
│ [string] getMemberNames()
│ [.reflection.XTypeDescription] getMemberTypes()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
│ boolean isPublished()
└─.reflection.XStructTypeDescription
│ [.reflection.XTypeDescription] getTypeArguments()
│ [string] getTypeParameters()
└─.reflection.XCompoundTypeDescription
│ .reflection.XTypeDescription getBaseType()
│ [string] getMemberNames()
│ [.reflection.XTypeDescription] getMemberTypes()
└─.reflection.XTypeDescription
string getName()
.uno.TypeClass getTypeClass()
enumのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
enum = tdm.getByHierarchicalName("com.sun.star.uno.TypeClass")
tcu.wtree(enum)
enum名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XEnumTypeDescription
│ │ long getDefaultEnumValue()
│ │ [string] getEnumNames()
│ │ [long] getEnumValues()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
│ │ long getDefaultEnumValue()
│ │ [string] getEnumNames()
│ │ [long] getEnumValues()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
定数のTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
constants = tdm.getByHierarchicalName("com.sun.star.awt.FontType")
tcu.wtree(constants)
定数名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XConstantsTypeDescription
│ │ [.reflection.XConstantTypeDescription] getConstants()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
│ │ [.reflection.XConstantTypeDescription] getConstants()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
typedefのTypeDescriptionオブジェクトのサービスとインターフェイスの一覧
def macro():
ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。
smgr = ctx.getServiceManager() # サービスマネージャーの取得。
tcu = smgr.createInstanceWithContext("pq.Tcu", ctx) # サービス名か実装名でインスタンス化。
tdm = ctx.getByName('/singletons/com.sun.star.reflection.theTypeDescriptionManager')
typedef = tdm.getByHierarchicalName("com.sun.star.util.Color")
tcu.wtree(typedef)
typedef名をTypeDescriptionManagerに渡したときに取得できるオブジェクトです。
├─.reflection.XIndirectTypeDescription
│ │ .reflection.XTypeDescription getReferencedType()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
│ │ .reflection.XTypeDescription getReferencedType()
│ └─.reflection.XTypeDescription
│ string getName()
│ .uno.TypeClass getTypeClass()
└─.reflection.XPublished
boolean isPublished()
参考にしたサイト
OOoBasic/Generic/TypeDescription - ...?
TypeDescriptionの解説。
0 件のコメント:
コメントを投稿