ホーム › UI.Accessibility › ITextRangeProvider
ITextRangeProvider
COMメソッド 18
vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT Clone(ITextRangeProvider** pRetVal)
| pRetVal | ITextRangeProvider** | out | この範囲と同一の終点を持つ新しいテキスト範囲を受け取る ITextRangeProvider へのポインタのポインタである。 |
vtbl 4 HRESULT Compare(ITextRangeProvider* range, BOOL* pRetVal)
| range | ITextRangeProvider* | in | 比較対象のテキスト範囲を渡す ITextRangeProvider へのポインタである。 |
| pRetVal | BOOL* | out | 両範囲が同一の終点を持つ場合に TRUE を受け取る BOOL へのポインタである。 |
vtbl 5 HRESULT CompareEndpoints(TextPatternRangeEndpoint endpoint, ITextRangeProvider* targetRange, TextPatternRangeEndpoint targetEndpoint, INT* pRetVal)
| endpoint | TextPatternRangeEndpoint | in | この範囲側で比較対象とする終点(始端または終端)を指定する TextPatternRangeEndpoint 値である。 |
| targetRange | ITextRangeProvider* | in | 比較対象となる別のテキスト範囲を渡す ITextRangeProvider へのポインタである。 |
| targetEndpoint | TextPatternRangeEndpoint | in | 比較対象の範囲側で比較する終点を指定する TextPatternRangeEndpoint 値である。 |
| pRetVal | INT* | out | 二つの終点の前後関係を負・0・正で受け取る INT へのポインタである。 |
| unit | TextUnit | in | 範囲を拡張する基準となるテキスト単位(文字・語・行・段落等)を指定する TextUnit 値である。 |
vtbl 7 HRESULT FindAttribute(UIA_TEXTATTRIBUTE_ID attributeId, VARIANT val, BOOL backward, ITextRangeProvider** pRetVal)
| attributeId | UIA_TEXTATTRIBUTE_ID | in | 検索対象とするテキスト属性を示す UIA_TEXTATTRIBUTE_ID である。 |
| val | VARIANT | in | 属性に一致するかを判定する対象の値を渡す VARIANT である。 |
| backward | BOOL | in | TRUE を渡すと範囲の末尾から先頭に向かって後方検索を行う。 |
| pRetVal | ITextRangeProvider** | out | 属性が一致する部分範囲を受け取る ITextRangeProvider へのポインタのポインタであり、見つからない場合は NULL となる。 |
vtbl 8 HRESULT FindText(LPWSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider** pRetVal)
| text | LPWSTR | in | 検索する文字列を指定する LPWSTR である。 |
| backward | BOOL | in | TRUE を渡すと末尾から先頭に向かって後方検索を行う。 |
| ignoreCase | BOOL | in | TRUE を渡すと大文字と小文字を区別せずに検索する。 |
| pRetVal | ITextRangeProvider** | out | 一致したテキストを表す部分範囲を受け取る ITextRangeProvider へのポインタのポインタであり、見つからない場合は NULL となる。 |
vtbl 9 HRESULT GetAttributeValue(UIA_TEXTATTRIBUTE_ID attributeId, VARIANT* pRetVal)
| attributeId | UIA_TEXTATTRIBUTE_ID | in | 値を取得するテキスト属性を示す UIA_TEXTATTRIBUTE_ID である。 |
| pRetVal | VARIANT* | out | 属性の値を受け取る VARIANT へのポインタであり、範囲内で値が一様でない場合は混在を示す値となる。 |
| pRetVal | SAFEARRAY** | out | 範囲内の各テキスト行を囲む外接矩形の座標(left, top, width, height の並び)を表す DOUBLE 配列を受け取る SAFEARRAY へのポインタである。 |
vtbl 11 HRESULT GetEnclosingElement(IRawElementProviderSimple** pRetVal)
| pRetVal | IRawElementProviderSimple** | out | このテキスト範囲を内包する最も内側の要素を表すプロバイダーを受け取るポインタのポインタである。 |
| maxLength | INT | in | 取得する文字数の上限を指定し、-1 を渡すと範囲内の全テキストを取得する。 |
| pRetVal | LPWSTR* | out | 範囲内のテキストを文字列で受け取る LPWSTR へのポインタである。 |
| unit | TextUnit | in | 範囲を移動させる基準となるテキスト単位を指定する TextUnit 値である。 |
| count | INT | in | 移動する単位数を指定し、正の値は前方、負の値は後方への移動である。 |
| pRetVal | INT* | out | 実際に移動できた単位数を受け取る INT へのポインタである。 |
vtbl 14 HRESULT MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, INT count, INT* pRetVal)
| endpoint | TextPatternRangeEndpoint | in | 移動させる終点(始端または終端)を指定する TextPatternRangeEndpoint 値である。 |
| unit | TextUnit | in | 終点を移動させる基準となるテキスト単位を指定する TextUnit 値である。 |
| count | INT | in | 移動する単位数を指定し、正の値は前方、負の値は後方への移動である。 |
| pRetVal | INT* | out | 実際に移動できた単位数を受け取る INT へのポインタである。 |
vtbl 15 HRESULT MoveEndpointByRange(TextPatternRangeEndpoint endpoint, ITextRangeProvider* targetRange, TextPatternRangeEndpoint targetEndpoint)
| endpoint | TextPatternRangeEndpoint | in | 移動させるこの範囲側の終点を指定する TextPatternRangeEndpoint 値である。 |
| targetRange | ITextRangeProvider* | in | 移動先の基準となる別のテキスト範囲を渡す ITextRangeProvider へのポインタである。 |
| targetEndpoint | TextPatternRangeEndpoint | in | 移動先の基準とする対象範囲側の終点を指定する TextPatternRangeEndpoint 値である。 |
vtbl 16 HRESULT Select()
vtbl 17 HRESULT AddToSelection()
vtbl 18 HRESULT RemoveFromSelection()
| alignToTop | BOOL | in | TRUE を渡すと範囲を表示領域の上端に、FALSE を渡すと下端に揃えてスクロールする。 |
| pRetVal | SAFEARRAY** | out | この範囲に含まれる子要素を表すプロバイダーの配列を受け取る SAFEARRAY へのポインタである。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ITextRangeProvider "{5347AD7B-C355-46F8-AFF5-909033582F63}" #usecom global ITextRangeProvider IID_ITextRangeProvider "{}" #comfunc global ITextRangeProvider_Clone 3 sptr #comfunc global ITextRangeProvider_Compare 4 sptr,var #comfunc global ITextRangeProvider_CompareEndpoints 5 int,sptr,int,var #comfunc global ITextRangeProvider_ExpandToEnclosingUnit 6 int #comfunc global ITextRangeProvider_FindAttribute 7 int,int,int,sptr #comfunc global ITextRangeProvider_FindText 8 wstr,int,int,sptr #comfunc global ITextRangeProvider_GetAttributeValue 9 int,var #comfunc global ITextRangeProvider_GetBoundingRectangles 10 var #comfunc global ITextRangeProvider_GetEnclosingElement 11 sptr #comfunc global ITextRangeProvider_GetText 12 int,var #comfunc global ITextRangeProvider_Move 13 int,int,var #comfunc global ITextRangeProvider_MoveEndpointByUnit 14 int,int,int,var #comfunc global ITextRangeProvider_MoveEndpointByRange 15 int,sptr,int #comfunc global ITextRangeProvider_Select 16 #comfunc global ITextRangeProvider_AddToSelection 17 #comfunc global ITextRangeProvider_RemoveFromSelection 18 #comfunc global ITextRangeProvider_ScrollIntoView 19 int #comfunc global ITextRangeProvider_GetChildren 20 var ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ITextRangeProvider "{5347AD7B-C355-46F8-AFF5-909033582F63}" #usecom global ITextRangeProvider IID_ITextRangeProvider "{}" #comfunc global ITextRangeProvider_Clone 3 sptr #comfunc global ITextRangeProvider_Compare 4 sptr,sptr #comfunc global ITextRangeProvider_CompareEndpoints 5 int,sptr,int,sptr #comfunc global ITextRangeProvider_ExpandToEnclosingUnit 6 int #comfunc global ITextRangeProvider_FindAttribute 7 int,int,int,sptr #comfunc global ITextRangeProvider_FindText 8 wstr,int,int,sptr #comfunc global ITextRangeProvider_GetAttributeValue 9 int,sptr #comfunc global ITextRangeProvider_GetBoundingRectangles 10 sptr #comfunc global ITextRangeProvider_GetEnclosingElement 11 sptr #comfunc global ITextRangeProvider_GetText 12 int,sptr #comfunc global ITextRangeProvider_Move 13 int,int,sptr #comfunc global ITextRangeProvider_MoveEndpointByUnit 14 int,int,int,sptr #comfunc global ITextRangeProvider_MoveEndpointByRange 15 int,sptr,int #comfunc global ITextRangeProvider_Select 16 #comfunc global ITextRangeProvider_AddToSelection 17 #comfunc global ITextRangeProvider_RemoveFromSelection 18 #comfunc global ITextRangeProvider_ScrollIntoView 19 int #comfunc global ITextRangeProvider_GetChildren 20 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。