ホーム › Media.Speech › ISpRecoGrammar
ISpRecoGrammar
COMメソッド 18
vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。
| pullGrammarId | ULONGLONG* | inout | この文法のIDを受け取るポインタ。 |
vtbl 12 HRESULT GetRecoContext(ISpRecoContext** ppRecoCtxt)
| ppRecoCtxt | ISpRecoContext** | out | この文法が属する認識コンテキストISpRecoContextを受け取るポインタ。 |
vtbl 13 HRESULT LoadCmdFromFile(LPWSTR pszFileName, SPLOADOPTIONS Options)
| pszFileName | LPWSTR | in | 読み込むコマンド&コントロール文法ファイルのパスまたはURL。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。静的/動的を指定する。 |
vtbl 14 HRESULT LoadCmdFromObject(GUID* rcid, LPWSTR pszGrammarName, SPLOADOPTIONS Options)
| rcid | GUID* | in | 文法を提供するオブジェクトのCLSID。 |
| pszGrammarName | LPWSTR | in | 読み込む文法の名前。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。 |
vtbl 15 HRESULT LoadCmdFromResource(HMODULE hModule, LPWSTR pszResourceName, LPWSTR pszResourceType, WORD wLanguage, SPLOADOPTIONS Options)
| hModule | HMODULE | in | リソースを含むモジュールのハンドル。NULLで現在のモジュールを使用する。 |
| pszResourceName | LPWSTR | in | リソース名。MAKEINTRESOURCEでID指定も可能。 |
| pszResourceType | LPWSTR | in | リソースの種類を示す文字列。 |
| wLanguage | WORD | in | リソースの言語ID。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。 |
vtbl 16 HRESULT LoadCmdFromMemory(SPBINARYGRAMMAR* pGrammar, SPLOADOPTIONS Options)
| pGrammar | SPBINARYGRAMMAR* | in | メモリ上のバイナリ文法を示すSPBINARYGRAMMARへのポインタ。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。 |
vtbl 17 HRESULT LoadCmdFromProprietaryGrammar(GUID* rguidParam, LPWSTR pszStringParam, void* pvDataPrarm, DWORD cbDataSize, SPLOADOPTIONS Options)
| rguidParam | GUID* | in | 独自文法エンジンを識別するGUID。 |
| pszStringParam | LPWSTR | in | 文法に渡す文字列パラメータ。NULL可。 |
| pvDataPrarm | void* | in | 文法に渡すバイナリデータ。NULL可。 |
| cbDataSize | DWORD | in | pvDataPrarmのバイト数。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。 |
vtbl 18 HRESULT SetRuleState(LPWSTR pszName, void* pReserved, SPRULESTATE NewState)
| pszName | LPWSTR | inoptional | 状態を変更するルールの名前。NULLで全ルールを対象にできる。 |
| pReserved | void* | inout | 予約済み引数。NULLを指定する。 |
| NewState | SPRULESTATE | in | 設定するルールの状態を示すSPRULESTATE列挙値。アクティブ/非アクティブを指定する。 |
vtbl 19 HRESULT SetRuleIdState(DWORD ulRuleId, SPRULESTATE NewState)
| ulRuleId | DWORD | in | 状態を変更するルールのID。0で全ルールを対象にできる。 |
| NewState | SPRULESTATE | in | 設定するルールの状態を示すSPRULESTATE列挙値。 |
vtbl 20 HRESULT LoadDictation(LPWSTR pszTopicName, SPLOADOPTIONS Options)
| pszTopicName | LPWSTR | inoptional | 読み込むディクテーショントピック名。NULLで既定トピックを使用する。 |
| Options | SPLOADOPTIONS | in | 読み込み方法を指定するSPLOADOPTIONS列挙値。 |
vtbl 21 HRESULT UnloadDictation()
vtbl 22 HRESULT SetDictationState(SPRULESTATE NewState)
| NewState | SPRULESTATE | in | ディクテーションの状態を示すSPRULESTATE列挙値。アクティブ/非アクティブを指定する。 |
vtbl 23 HRESULT SetWordSequenceData(LPWSTR pText, DWORD cchText, SPTEXTSELECTIONINFO* pInfo)
| pText | LPWSTR | inoptional | 語シーケンス用の文脈テキスト(二重NULL終端)。 |
| cchText | DWORD | in | pTextの文字数。 |
| pInfo | SPTEXTSELECTIONINFO* | in | テキスト選択範囲を示すSPTEXTSELECTIONINFOへのポインタ。 |
vtbl 24 HRESULT SetTextSelection(SPTEXTSELECTIONINFO* pInfo)
| pInfo | SPTEXTSELECTIONINFO* | in | 現在のテキスト選択/挿入位置を示すSPTEXTSELECTIONINFOへのポインタ。 |
vtbl 25 HRESULT IsPronounceable(LPWSTR pszWord, SPWORDPRONOUNCEABLE* pWordPronounceable)
| pszWord | LPWSTR | in | 発音可能か判定する語。 |
| pWordPronounceable | SPWORDPRONOUNCEABLE* | inout | 判定結果を受け取るSPWORDPRONOUNCEABLE列挙値ポインタ。 |
vtbl 26 HRESULT SetGrammarState(SPGRAMMARSTATE eGrammarState)
| eGrammarState | SPGRAMMARSTATE | in | 文法全体の状態を示すSPGRAMMARSTATE列挙値。有効/無効を指定する。 |
| pStream | IStream* | in | 文法を保存する先のIStream。 |
| ppszCoMemErrorText | LPWSTR* | outoptional | 保存時のエラーテキストを受け取るポインタ。NULL可、CoTaskMemFreeで解放する。 |
vtbl 28 HRESULT GetGrammarState(SPGRAMMARSTATE* peGrammarState)
| peGrammarState | SPGRAMMARSTATE* | inout | 現在の文法状態を受け取るSPGRAMMARSTATEポインタ。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ISpRecoGrammar "{2177DB29-7F45-47D0-8554-067E91C80502}" #usecom global ISpRecoGrammar IID_ISpRecoGrammar "{}" #comfunc global ISpRecoGrammar_GetGrammarId 11 var #comfunc global ISpRecoGrammar_GetRecoContext 12 sptr #comfunc global ISpRecoGrammar_LoadCmdFromFile 13 wstr,int #comfunc global ISpRecoGrammar_LoadCmdFromObject 14 var,wstr,int #comfunc global ISpRecoGrammar_LoadCmdFromResource 15 sptr,wstr,wstr,int,int #comfunc global ISpRecoGrammar_LoadCmdFromMemory 16 var,int #comfunc global ISpRecoGrammar_LoadCmdFromProprietaryGrammar 17 var,wstr,sptr,int,int #comfunc global ISpRecoGrammar_SetRuleState 18 wstr,sptr,int #comfunc global ISpRecoGrammar_SetRuleIdState 19 int,int #comfunc global ISpRecoGrammar_LoadDictation 20 wstr,int #comfunc global ISpRecoGrammar_UnloadDictation 21 #comfunc global ISpRecoGrammar_SetDictationState 22 int #comfunc global ISpRecoGrammar_SetWordSequenceData 23 wstr,int,var #comfunc global ISpRecoGrammar_SetTextSelection 24 var #comfunc global ISpRecoGrammar_IsPronounceable 25 wstr,var #comfunc global ISpRecoGrammar_SetGrammarState 26 int #comfunc global ISpRecoGrammar_SaveCmd 27 sptr,var #comfunc global ISpRecoGrammar_GetGrammarState 28 var ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ISpRecoGrammar "{2177DB29-7F45-47D0-8554-067E91C80502}" #usecom global ISpRecoGrammar IID_ISpRecoGrammar "{}" #comfunc global ISpRecoGrammar_GetGrammarId 11 sptr #comfunc global ISpRecoGrammar_GetRecoContext 12 sptr #comfunc global ISpRecoGrammar_LoadCmdFromFile 13 wstr,int #comfunc global ISpRecoGrammar_LoadCmdFromObject 14 sptr,wstr,int #comfunc global ISpRecoGrammar_LoadCmdFromResource 15 sptr,wstr,wstr,int,int #comfunc global ISpRecoGrammar_LoadCmdFromMemory 16 sptr,int #comfunc global ISpRecoGrammar_LoadCmdFromProprietaryGrammar 17 sptr,wstr,sptr,int,int #comfunc global ISpRecoGrammar_SetRuleState 18 wstr,sptr,int #comfunc global ISpRecoGrammar_SetRuleIdState 19 int,int #comfunc global ISpRecoGrammar_LoadDictation 20 wstr,int #comfunc global ISpRecoGrammar_UnloadDictation 21 #comfunc global ISpRecoGrammar_SetDictationState 22 int #comfunc global ISpRecoGrammar_SetWordSequenceData 23 wstr,int,sptr #comfunc global ISpRecoGrammar_SetTextSelection 24 sptr #comfunc global ISpRecoGrammar_IsPronounceable 25 wstr,sptr #comfunc global ISpRecoGrammar_SetGrammarState 26 int #comfunc global ISpRecoGrammar_SaveCmd 27 sptr,sptr #comfunc global ISpRecoGrammar_GetGrammarState 28 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。