MathPlayerDLL.idl
10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// MathPlayer.idl --- Copyright (c) 1987-2004 by Design Science, Inc.
// purpose: IDL source for MathPlayer.dll
// $Header: $
// This file will be processed by the MIDL tool to
// produce the type library (MathPlayer.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
#include "MathSpeechEnums.idl" // just want the enums since we define different interfaces
// ==================================================================================================
// Main interface for speech
[
object,
uuid(32F66A95-7614-11D4-BD11-00104BD3F987),
helpstring("IMathSpeech Interface"),
pointer_default(unique)
]
interface IMathSpeech : IDispatch {
// Get the MathPlayer Version Number
HRESULT GetVersion([out] BSTR *version);
// Set MathML to be used
HRESULT SetMathML([in] BSTR mathML);
// Call after setting up
HRESULT GetSpokenText([out] BSTR *spokenText);
// Resets all options such as Volume, Sync highlight colors, and braille language
HRESULT ResetState();
};
// ==================================================================================================
// Set/Get interfaces for options
[
object,
uuid(32F66A94-7614-11D4-BD11-00104BD3F987),
helpstring("IMathSpeechSettings Interface"),
pointer_default(unique)
]
interface IMathSpeechSettings : IMathSpeech {
// Set/Get what speech engine standard to use.
// This should be done before other values as those values are only meaning full given a standard
// Note: this clears any previous settings for volume, as they are not meaningful.
// Currently legal values are: None, SAPI4, SAPI5, Mac, SSML, HTML, Eloquence (case insensitive)
// E_INVALIDARG is returned if the specified speech engine isn't supported.
HRESULT SetSpeechTags([in] BSTR speechTags);
HRESULT GetSpeechTags([out] BSTR *speechTags);
//Set/Get Pitch (default 140hz)
//SAPI4: Relative pitch
// Number is relative to the default/current pitch
// 50 is 1/2 of the default/current pitch, 200 is 2 times the default/current pitch
// No range is specified by the spec
//SAPI5: Relative pitch
// Number is in range -24 to 24
// -24 is one octave below the default/current pitch, +24 is one octave above
// changes are logarithmetic -- a change of +/-1 corresponds to multiplying/dividing by 24th root of 2
//SSML: Relative pitch
// pitch in hertz (default/current man's voice is about 100hz, woman's 180hz)
// Note: other legal values for SSML are not supported, and all numbers are interpreted as relative changes
//ECI: Absolute pitch (relative pitch not supported by ECI)
// Range is 0 - 100 Guess is that 0 ~= 42hz, 100 ~= 422hz based on supported \"sapi\" values
HRESULT SetPitch([in] double pitch);
HRESULT GetPitch([out, retval] double* pitch);
//Set/Get Rate (default: 180 wpm)
//SAPI4: Relative rate
// Number is relative to the default/current rate
// 50 is 1/2 of the default/current rate, 200 is 2 times the default/current rate
// No range is specified by the spec
//SAPI5: Relative rate
// Number is in range -10 to 10
// -10 is 1/3 of the default/current speed; 10 3 times the default/current speech
// changes are logarithmetic -- a change of +/-1 corresponds to multiplying/dividing by 10th root of 3
//SSML: Relative rate
// 0.5 is 1/2 of the default/current rate, 2.0 is 2 times the default/current rate
// Note: other legal values for SSML are not supported, and all numbers are interpreted as relative changes
//ECI: Absolute rate (relative rate not supported by ECI)
// Range is 0 - 250 Guess is that 0 ~= 72words/min, 250 ~= 1297 words/min based on supported \"sapi\" values
HRESULT SetRate([in] double rate);
HRESULT GetRate([out, retval] double* rate);
//Set/Get Volume (default: full)
//SAPI4: Relative volume
// Number is relative to the default/current rate
// Range is 0 - 065535
//SAPI5: Relative volume
// Number is in range 0 to 100
//SSML: Relative volume
// Number is in range 0 to 100
// Note: other legal values for SSML are not supported, and all numbers are interpreted as relative changes
//ECI: Absolute volume (relative volume not supported by ECI)
// Range is 0 - 100
HRESULT SetVolume([in] double volume);
HRESULT GetVolume([out, retval] double* volume);
// Specific name of voice to use (currently not used)
HRESULT SetVoice([in] BSTR voice);
HRESULT GetVoice([out, retval] BSTR* voice);
// Target disability group for speech
HRESULT SetTargetGroup([in] BSTR target);
HRESULT GetTargetGroup([out, retval] BSTR* target);
// Set/Get the amount of verbosity that is used for speech
HRESULT SetVerbosity([in] long verbosity);
HRESULT GetVerbosity([out] long *verbosity);
// Language strings follow what is used in HTML: typically 'en' or 'en-gb'. Case doesn't matter.
// For the main language, see http://www.loc.gov/standards/iso639-2/php/code_list.php
// For the subregion, see http://www.iso.org/iso/english_country_names_and_code_elements
// If 'lang' is an empty string, then the language defined in the document is used.
// If the language or speech style is not supported, E_INVALIDARG is returned
HRESULT SetLanguage([in] BSTR lang);
HRESULT GetLanguage([out, retval] BSTR* lang);
// Name of speech style
HRESULT SetSpeechStyle([in] BSTR style);
HRESULT GetSpeechStyle([out, retval] BSTR* style);
// Currently supported subjects are: "Geometry", "ProbabilityAndStatistics", "Calculus"
// The bool flag says whether only the given value should be used or added to the subject list
// An empty string with only=VARIANT_TRUE will clear all the subjects
HRESULT SetSubjectArea([in] BSTR subject, VARIANT_BOOL only);
HRESULT GetSubjectArea([out, retval] BSTR* subject);
// Set the amount of sync highlighting to be done. It has one of three string values:
// "None" -- no sync highlighting (default)
// "Word" -- only highlight identifiers, numbers, operators, ...
// 2DNotations" -- highlight Words and 2D notations such as Fractions, Square roots, etc.
HRESULT SetHighlightAmount([in] BSTR highlightAmount);
HRESULT GetHighlightAmount([out] BSTR *highlightAmount);
};
// ==================================================================================================
// Synchronized highlighting
[
object,
uuid(32F66A97-7614-11D4-BD11-00104BD3F987),
helpstring("IMathSynchronization Interface"),
pointer_default(unique)
]
interface IMathSynchronization : IMathSpeech {
// FIX: need to get this working -- HandleBookmark probably belongs in app and SetExpressionID probably doesn't make sense anymore
// HRESULT SetExpressionID([in] IUnknown *exprID, [in] DomType domID);
HRESULT SetSyncStyle([in] HighlightStyleEnum style);
HRESULT SetSyncAmount([in] HighlightTypeEnum highlight, [in] long syncFlags);
HRESULT SetSyncColor([in] HighlightTypeEnum highlight, [in] long red, [in] long green, [in] long blue);
// HRESULT HandleBookmark([in] BSTR bookmark);
};
// ==================================================================================================
// Navigation
[
object,
uuid(32F66A98-7614-11D4-BD11-00104BD3F987),
helpstring("IMathNavigation Interface"),
pointer_default(unique)
]
interface IMathNavigation : IMathSpeech {
// These calls return S_OK if the command was handled. Other return values are:
// S_FALSE -- handled, but moved past start/end (i.e., we are done navigating the expr)
// E_INVALIDARG -- unknown/unhandled command/param combination or unknown/unhandled key
// what if exiting navigation
// E_FAIL -- some unspecified problem happened
// If S_OK or S_FALSE is returned (i.e., a success code), the resulting string should be spoken.
// The string may contain bookmarks, so those should be handled if they are handled for GetSpokenText()
HRESULT DoNavigateCommand([in] NavigationCommand command, [in] NavigationParam param, [out] BSTR *spokenText);
// Values for 'key' are the virtual key codes documented at
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
// These are the same codes used by JavaScript events (same for all browsers in Windows).
// A useful page that will tell you a code for a key press is:
// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
// Important key values (defined in WinUser.h) are:
// VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN (0x25, 0x27, 0x26, 0x28)
// VK_HOME, VK_END, VK_SPACE, VK_BACK, VK_RETURN, VK_ESCAPE
// Also the keys 0 - 9
HRESULT DoNavigateKeyPress([in] int key,
[in] VARIANT_BOOL shiftKey, [in] VARIANT_BOOL controlKey, [in] VARIANT_BOOL altKey, [in] VARIANT_BOOL metaKey,
[out] BSTR *spokenText);
// Get the MathML at the current focus (i.e., the MathML used to generate the speech)
HRESULT GetNavigationMathML([out] BSTR *mathml);
};
// ==================================================================================================
// Braille
[
object,
uuid(32F66A99-7614-11D4-BD11-00104BD3F987),
helpstring("IMathBraille Interface"),
pointer_default(unique)
]
interface IMathBraille : IDispatch {
HRESULT GetBraille([out] BSTR *braille);
HRESULT GetSupportedMathCodes([out] IEnumString **codeEnumerator);
HRESULT GetMathCode([out] BSTR *codeName);
HRESULT SetMathCode([in] BSTR codeName);
HRESULT GetBrailleWidth([out] long *width);
HRESULT SetBrailleWidth([in] long width);
HRESULT GetMathOptions([out] BSTR *options);
HRESULT SetMathOptions([in] BSTR options);
HRESULT GetTranslatorsThatSupportMathCode([in] BSTR codeName, [out] IEnumString **translatorNames);
HRESULT GetTranslatorInfo([in] BSTR name, [out] BSTR *version, [out] BSTR *description);
HRESULT GetTranslatorForMathCode([in] BSTR codeName, [out] BSTR *translatorName);
HRESULT SetTranslatorForMathCode([in] BSTR codeName, [in] BSTR translatorName);
};
[
uuid(32F66A90-7614-11D4-BD11-00104BD3F987),
version(1.0),
helpstring("MathPlayerDLL 1.0 Type Library")
]
library MathPlayer {
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(32F66A91-7614-11D4-BD11-00104BD3F987),
helpstring("MathPlayerDLL Class")
]
coclass MPInterface {
[default] interface IMathSpeech;
interface IMathSpeechSettings;
// interface IMathDocument;
interface IMathSynchronization;
interface IMathNavigation;
interface IMathBraille;
};
};