1*0d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*0d63794cSAndrew Rist * distributed with this work for additional information
6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance
9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at
10*0d63794cSAndrew Rist *
11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*0d63794cSAndrew Rist *
13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*0d63794cSAndrew Rist * software distributed under the License is distributed on an
15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the
17*0d63794cSAndrew Rist * specific language governing permissions and limitations
18*0d63794cSAndrew Rist * under the License.
19*0d63794cSAndrew Rist *
20*0d63794cSAndrew Rist *************************************************************/
21*0d63794cSAndrew Rist
22*0d63794cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef _VCL_CMDEVT_HXX
25cdf0e10cSrcweir #define _VCL_CMDEVT_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <vcl/sv.h>
29cdf0e10cSrcweir #include <vcl/dllapi.h>
30cdf0e10cSrcweir #include <vcl/keycod.hxx>
31cdf0e10cSrcweir #include <vcl/font.hxx>
32cdf0e10cSrcweir
33cdf0e10cSrcweir // ---------------------------
34cdf0e10cSrcweir // - CommandExtTextInputData -
35cdf0e10cSrcweir // ---------------------------
36cdf0e10cSrcweir
37cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
38cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
39cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
40cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
41cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
42cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
43cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
44cdf0e10cSrcweir #define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
45cdf0e10cSrcweir
46cdf0e10cSrcweir #define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
47cdf0e10cSrcweir #define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
48cdf0e10cSrcweir
49cdf0e10cSrcweir class VCL_DLLPUBLIC CommandExtTextInputData
50cdf0e10cSrcweir {
51cdf0e10cSrcweir private:
52cdf0e10cSrcweir XubString maText;
53cdf0e10cSrcweir sal_uInt16* mpTextAttr;
54cdf0e10cSrcweir xub_StrLen mnCursorPos;
55cdf0e10cSrcweir xub_StrLen mnDeltaStart;
56cdf0e10cSrcweir xub_StrLen mnOldTextLen;
57cdf0e10cSrcweir sal_uInt16 mnCursorFlags;
58cdf0e10cSrcweir sal_Bool mbOnlyCursor;
59cdf0e10cSrcweir
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir CommandExtTextInputData();
62cdf0e10cSrcweir CommandExtTextInputData( const XubString& rText,
63cdf0e10cSrcweir const sal_uInt16* pTextAttr,
64cdf0e10cSrcweir xub_StrLen nCursorPos,
65cdf0e10cSrcweir sal_uInt16 nCursorFlags,
66cdf0e10cSrcweir xub_StrLen nDeltaStart,
67cdf0e10cSrcweir xub_StrLen nOldTextLen,
68cdf0e10cSrcweir sal_Bool bOnlyCursor );
69cdf0e10cSrcweir CommandExtTextInputData( const CommandExtTextInputData& rData );
70cdf0e10cSrcweir ~CommandExtTextInputData();
71cdf0e10cSrcweir
GetText() const72cdf0e10cSrcweir const XubString& GetText() const { return maText; }
GetTextAttr() const73cdf0e10cSrcweir const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
74cdf0e10cSrcweir sal_uInt16 GetCharTextAttr( sal_uInt16 nIndex ) const;
GetCursorPos() const75cdf0e10cSrcweir xub_StrLen GetCursorPos() const { return mnCursorPos; }
IsCursorVisible() const76cdf0e10cSrcweir sal_Bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
IsCursorOverwrite() const77cdf0e10cSrcweir sal_Bool IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
GetCursorFlags() const78cdf0e10cSrcweir sal_uInt16 GetCursorFlags() const { return mnCursorFlags; }
GetDeltaStart() const79cdf0e10cSrcweir xub_StrLen GetDeltaStart() const { return mnDeltaStart; }
GetOldTextLen() const80cdf0e10cSrcweir xub_StrLen GetOldTextLen() const { return mnOldTextLen; }
IsOnlyCursorChanged() const81cdf0e10cSrcweir sal_Bool IsOnlyCursorChanged() const { return mbOnlyCursor; }
82cdf0e10cSrcweir };
83cdf0e10cSrcweir
GetCharTextAttr(sal_uInt16 nIndex) const84cdf0e10cSrcweir inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
85cdf0e10cSrcweir {
86cdf0e10cSrcweir if ( mpTextAttr && (nIndex < maText.Len()) )
87cdf0e10cSrcweir return mpTextAttr[nIndex];
88cdf0e10cSrcweir else
89cdf0e10cSrcweir return 0;
90cdf0e10cSrcweir }
91cdf0e10cSrcweir
92cdf0e10cSrcweir // ---------------------------
93cdf0e10cSrcweir // - CommandInputContextData -
94cdf0e10cSrcweir // ---------------------------
95cdf0e10cSrcweir
96cdf0e10cSrcweir class VCL_DLLPUBLIC CommandInputContextData
97cdf0e10cSrcweir {
98cdf0e10cSrcweir private:
99cdf0e10cSrcweir LanguageType meLanguage;
100cdf0e10cSrcweir
101cdf0e10cSrcweir public:
102cdf0e10cSrcweir CommandInputContextData();
103cdf0e10cSrcweir CommandInputContextData( LanguageType eLang );
104cdf0e10cSrcweir
GetLanguage() const105cdf0e10cSrcweir LanguageType GetLanguage() const { return meLanguage; }
106cdf0e10cSrcweir };
107cdf0e10cSrcweir
CommandInputContextData()108cdf0e10cSrcweir inline CommandInputContextData::CommandInputContextData()
109cdf0e10cSrcweir {
110cdf0e10cSrcweir meLanguage = LANGUAGE_DONTKNOW;
111cdf0e10cSrcweir }
112cdf0e10cSrcweir
CommandInputContextData(LanguageType eLang)113cdf0e10cSrcweir inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
114cdf0e10cSrcweir {
115cdf0e10cSrcweir meLanguage = eLang;
116cdf0e10cSrcweir }
117cdf0e10cSrcweir
118cdf0e10cSrcweir // --------------------
119cdf0e10cSrcweir // - CommandWheelData -
120cdf0e10cSrcweir // --------------------
121cdf0e10cSrcweir
122cdf0e10cSrcweir #define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
123cdf0e10cSrcweir #define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
124cdf0e10cSrcweir #define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
125cdf0e10cSrcweir
126cdf0e10cSrcweir #define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
127cdf0e10cSrcweir
128cdf0e10cSrcweir class VCL_DLLPUBLIC CommandWheelData
129cdf0e10cSrcweir {
130cdf0e10cSrcweir private:
131cdf0e10cSrcweir long mnDelta;
132cdf0e10cSrcweir long mnNotchDelta;
133cdf0e10cSrcweir sal_uLong mnLines;
134cdf0e10cSrcweir sal_uInt16 mnMode;
135cdf0e10cSrcweir sal_uInt16 mnCode;
136cdf0e10cSrcweir sal_Bool mbHorz;
137cdf0e10cSrcweir sal_Bool mbDeltaIsPixel;
138cdf0e10cSrcweir
139cdf0e10cSrcweir public:
140cdf0e10cSrcweir CommandWheelData();
141cdf0e10cSrcweir CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
142cdf0e10cSrcweir sal_uLong nScrollLines,
143cdf0e10cSrcweir sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
144cdf0e10cSrcweir sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
145cdf0e10cSrcweir
GetDelta() const146cdf0e10cSrcweir long GetDelta() const { return mnDelta; }
GetNotchDelta() const147cdf0e10cSrcweir long GetNotchDelta() const { return mnNotchDelta; }
GetScrollLines() const148cdf0e10cSrcweir sal_uLong GetScrollLines() const { return mnLines; }
IsHorz() const149cdf0e10cSrcweir sal_Bool IsHorz() const { return mbHorz; }
IsDeltaPixel() const150cdf0e10cSrcweir sal_Bool IsDeltaPixel() const { return mbDeltaIsPixel; }
151cdf0e10cSrcweir
GetMode() const152cdf0e10cSrcweir sal_uInt16 GetMode() const { return mnMode; }
153cdf0e10cSrcweir
GetModifier() const154cdf0e10cSrcweir sal_uInt16 GetModifier() const
155cdf0e10cSrcweir { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
IsShift() const156cdf0e10cSrcweir sal_Bool IsShift() const
157cdf0e10cSrcweir { return ((mnCode & KEY_SHIFT) != 0); }
IsMod1() const158cdf0e10cSrcweir sal_Bool IsMod1() const
159cdf0e10cSrcweir { return ((mnCode & KEY_MOD1) != 0); }
IsMod2() const160cdf0e10cSrcweir sal_Bool IsMod2() const
161cdf0e10cSrcweir { return ((mnCode & KEY_MOD2) != 0); }
IsMod3() const162cdf0e10cSrcweir sal_Bool IsMod3() const
163cdf0e10cSrcweir { return ((mnCode & KEY_MOD3) != 0); }
164cdf0e10cSrcweir };
165cdf0e10cSrcweir
CommandWheelData()166cdf0e10cSrcweir inline CommandWheelData::CommandWheelData()
167cdf0e10cSrcweir {
168cdf0e10cSrcweir mnDelta = 0;
169cdf0e10cSrcweir mnNotchDelta = 0;
170cdf0e10cSrcweir mnLines = 0;
171cdf0e10cSrcweir mnMode = 0;
172cdf0e10cSrcweir mnCode = 0;
173cdf0e10cSrcweir mbHorz = sal_False;
174cdf0e10cSrcweir mbDeltaIsPixel = sal_False;
175cdf0e10cSrcweir }
176cdf0e10cSrcweir
CommandWheelData(long nWheelDelta,long nWheelNotchDelta,sal_uLong nScrollLines,sal_uInt16 nWheelMode,sal_uInt16 nKeyModifier,sal_Bool bHorz,sal_Bool bDeltaIsPixel)177cdf0e10cSrcweir inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
178cdf0e10cSrcweir sal_uLong nScrollLines,
179cdf0e10cSrcweir sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
180cdf0e10cSrcweir sal_Bool bHorz, sal_Bool bDeltaIsPixel )
181cdf0e10cSrcweir {
182cdf0e10cSrcweir mnDelta = nWheelDelta;
183cdf0e10cSrcweir mnNotchDelta = nWheelNotchDelta;
184cdf0e10cSrcweir mnLines = nScrollLines;
185cdf0e10cSrcweir mnMode = nWheelMode;
186cdf0e10cSrcweir mnCode = nKeyModifier;
187cdf0e10cSrcweir mbHorz = bHorz;
188cdf0e10cSrcweir mbDeltaIsPixel = bDeltaIsPixel;
189cdf0e10cSrcweir }
190cdf0e10cSrcweir
191cdf0e10cSrcweir // ---------------------
192cdf0e10cSrcweir // - CommandScrollData -
193cdf0e10cSrcweir // ---------------------
194cdf0e10cSrcweir
195cdf0e10cSrcweir class VCL_DLLPUBLIC CommandScrollData
196cdf0e10cSrcweir {
197cdf0e10cSrcweir private:
198cdf0e10cSrcweir long mnDeltaX;
199cdf0e10cSrcweir long mnDeltaY;
200cdf0e10cSrcweir
201cdf0e10cSrcweir public:
202cdf0e10cSrcweir CommandScrollData();
203cdf0e10cSrcweir CommandScrollData( long nDeltaX, long nDeltaY );
204cdf0e10cSrcweir
GetDeltaX() const205cdf0e10cSrcweir long GetDeltaX() const { return mnDeltaX; }
GetDeltaY() const206cdf0e10cSrcweir long GetDeltaY() const { return mnDeltaY; }
207cdf0e10cSrcweir };
208cdf0e10cSrcweir
CommandScrollData()209cdf0e10cSrcweir inline CommandScrollData::CommandScrollData()
210cdf0e10cSrcweir {
211cdf0e10cSrcweir mnDeltaX = 0;
212cdf0e10cSrcweir mnDeltaY = 0;
213cdf0e10cSrcweir }
214cdf0e10cSrcweir
CommandScrollData(long nDeltaX,long nDeltaY)215cdf0e10cSrcweir inline CommandScrollData::CommandScrollData( long nDeltaX, long nDeltaY )
216cdf0e10cSrcweir {
217cdf0e10cSrcweir mnDeltaX = nDeltaX;
218cdf0e10cSrcweir mnDeltaY = nDeltaY;
219cdf0e10cSrcweir }
220cdf0e10cSrcweir
221cdf0e10cSrcweir // --------------------
222cdf0e10cSrcweir // - CommandVoiceData -
223cdf0e10cSrcweir // --------------------
224cdf0e10cSrcweir
225cdf0e10cSrcweir enum DictationCommandType
226cdf0e10cSrcweir {
227cdf0e10cSrcweir VOICECOMMANDTYPE_DICTATION,
228cdf0e10cSrcweir VOICECOMMANDTYPE_CONTROL
229cdf0e10cSrcweir };
230cdf0e10cSrcweir
231cdf0e10cSrcweir class VCL_DLLPUBLIC CommandVoiceData
232cdf0e10cSrcweir {
233cdf0e10cSrcweir private:
234cdf0e10cSrcweir XubString maText;
235cdf0e10cSrcweir sal_uInt16 mnCommand;
236cdf0e10cSrcweir DictationCommandType meType;
237cdf0e10cSrcweir
238cdf0e10cSrcweir public:
239cdf0e10cSrcweir CommandVoiceData();
240cdf0e10cSrcweir CommandVoiceData( const XubString& rStr,
241cdf0e10cSrcweir DictationCommandType eType,
242cdf0e10cSrcweir sal_uInt16 nCommand );
243cdf0e10cSrcweir
GetText() const244cdf0e10cSrcweir const XubString& GetText() const { return maText; }
GetCommand() const245cdf0e10cSrcweir sal_uInt16 GetCommand() const { return mnCommand; }
GetType() const246cdf0e10cSrcweir DictationCommandType GetType() const { return meType; }
247cdf0e10cSrcweir };
248cdf0e10cSrcweir
CommandVoiceData()249cdf0e10cSrcweir inline CommandVoiceData::CommandVoiceData()
250cdf0e10cSrcweir {
251cdf0e10cSrcweir meType = VOICECOMMANDTYPE_DICTATION;
252cdf0e10cSrcweir mnCommand = 0;
253cdf0e10cSrcweir }
254cdf0e10cSrcweir
CommandVoiceData(const XubString & rStr,DictationCommandType eType,sal_uInt16 nCommand)255cdf0e10cSrcweir inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
256cdf0e10cSrcweir DictationCommandType eType,
257cdf0e10cSrcweir sal_uInt16 nCommand ) :
258cdf0e10cSrcweir maText( rStr ),
259cdf0e10cSrcweir mnCommand( nCommand ),
260cdf0e10cSrcweir meType( eType )
261cdf0e10cSrcweir {
262cdf0e10cSrcweir }
263cdf0e10cSrcweir
264cdf0e10cSrcweir // ---------------------
265cdf0e10cSrcweir // - CommandModKeyData -
266cdf0e10cSrcweir // ---------------------
267cdf0e10cSrcweir
268cdf0e10cSrcweir class VCL_DLLPUBLIC CommandModKeyData
269cdf0e10cSrcweir {
270cdf0e10cSrcweir private:
271cdf0e10cSrcweir sal_uInt16 mnCode;
272cdf0e10cSrcweir
273cdf0e10cSrcweir public:
274cdf0e10cSrcweir CommandModKeyData();
275cdf0e10cSrcweir CommandModKeyData( sal_uInt16 nCode );
276cdf0e10cSrcweir
IsShift() const277cdf0e10cSrcweir sal_Bool IsShift() const { return (mnCode & MODKEY_SHIFT) ? sal_True : sal_False; }
IsMod1() const278cdf0e10cSrcweir sal_Bool IsMod1() const { return (mnCode & MODKEY_MOD1) ? sal_True : sal_False; }
IsMod2() const279cdf0e10cSrcweir sal_Bool IsMod2() const { return (mnCode & MODKEY_MOD2) ? sal_True : sal_False; }
IsMod3() const280cdf0e10cSrcweir sal_Bool IsMod3() const { return (mnCode & MODKEY_MOD3) ? sal_True : sal_False; }
281cdf0e10cSrcweir
IsLeftShift() const282cdf0e10cSrcweir sal_Bool IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? sal_True : sal_False; }
IsLeftMod1() const283cdf0e10cSrcweir sal_Bool IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? sal_True : sal_False; }
IsLeftMod2() const284cdf0e10cSrcweir sal_Bool IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? sal_True : sal_False; }
IsLeftMod3() const285cdf0e10cSrcweir sal_Bool IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? sal_True : sal_False; }
286cdf0e10cSrcweir
IsRightShift() const287cdf0e10cSrcweir sal_Bool IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? sal_True : sal_False; }
IsRightMod1() const288cdf0e10cSrcweir sal_Bool IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? sal_True : sal_False; }
IsRightMod2() const289cdf0e10cSrcweir sal_Bool IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? sal_True : sal_False; }
IsRightMod3() const290cdf0e10cSrcweir sal_Bool IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? sal_True : sal_False; }
291cdf0e10cSrcweir };
292cdf0e10cSrcweir
CommandModKeyData()293cdf0e10cSrcweir inline CommandModKeyData::CommandModKeyData()
294cdf0e10cSrcweir {
295cdf0e10cSrcweir mnCode = 0L;
296cdf0e10cSrcweir }
297cdf0e10cSrcweir
CommandModKeyData(sal_uInt16 nCode)298cdf0e10cSrcweir inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
299cdf0e10cSrcweir {
300cdf0e10cSrcweir mnCode = nCode;
301cdf0e10cSrcweir }
302cdf0e10cSrcweir
303cdf0e10cSrcweir // --------------------
304cdf0e10cSrcweir // - CommanDialogData -
305cdf0e10cSrcweir // --------------------
306cdf0e10cSrcweir
307cdf0e10cSrcweir #define SHOWDIALOG_ID_PREFERENCES 1
308cdf0e10cSrcweir #define SHOWDIALOG_ID_ABOUT 2
309cdf0e10cSrcweir
310cdf0e10cSrcweir class VCL_DLLPUBLIC CommandDialogData
311cdf0e10cSrcweir {
312cdf0e10cSrcweir int m_nDialogId;
313cdf0e10cSrcweir public:
CommandDialogData(int nDialogId=SHOWDIALOG_ID_PREFERENCES)314cdf0e10cSrcweir CommandDialogData( int nDialogId = SHOWDIALOG_ID_PREFERENCES )
315cdf0e10cSrcweir : m_nDialogId( nDialogId )
316cdf0e10cSrcweir {}
317cdf0e10cSrcweir
GetDialogId() const318cdf0e10cSrcweir int GetDialogId() const { return m_nDialogId; }
319cdf0e10cSrcweir };
320cdf0e10cSrcweir
321cdf0e10cSrcweir // --------------
322cdf0e10cSrcweir // Media Commands
323cdf0e10cSrcweir // --------------
324cdf0e10cSrcweir
325cdf0e10cSrcweir #define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
326cdf0e10cSrcweir #define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
327cdf0e10cSrcweir #define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide.
328cdf0e10cSrcweir #define MEDIA_COMMAND_PAUSE ((sal_Int16)4) // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state.
329cdf0e10cSrcweir #define MEDIA_COMMAND_PLAY ((sal_Int16)5) // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state.
330cdf0e10cSrcweir #define MEDIA_COMMAND_PLAY_PAUSE ((sal_Int16)6) // Play or pause playback.
331cdf0e10cSrcweir #define MEDIA_COMMAND_PREVIOUSTRACK ((sal_Int16)7) // Go to previous media track/slide.
332cdf0e10cSrcweir #define MEDIA_COMMAND_RECORD ((sal_Int16)8) // Begin recording the current stream.
333cdf0e10cSrcweir #define MEDIA_COMMAND_REWIND ((sal_Int16)9)// Go backward in a stream at a higher rate of speed.
334cdf0e10cSrcweir #define MEDIA_COMMAND_STOP ((sal_Int16)10)// Stop playback.
335cdf0e10cSrcweir #define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE ((sal_Int16)11)// Toggle the microphone.
336cdf0e10cSrcweir #define MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN ((sal_Int16)12)// Increase microphone volume.
337cdf0e10cSrcweir #define MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE ((sal_Int16)13)// Mute the microphone.
338cdf0e10cSrcweir #define MEDIA_COMMAND_MICROPHONE_VOLUME_UP ((sal_Int16)14)// Decrease microphone volume.
339cdf0e10cSrcweir #define MEDIA_COMMAND_VOLUME_DOWN ((sal_Int16)15)// Lower the volume.
340cdf0e10cSrcweir #define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume.
341cdf0e10cSrcweir #define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume.
342cdf0e10cSrcweir #define MEDIA_COMMAND_MENU ((sal_Int16)18)// Button Menu pressed.
343cdf0e10cSrcweir #define MEDIA_COMMAND_MENU_HOLD ((sal_Int16)19)// Button Menu (long) pressed.
344cdf0e10cSrcweir #define MEDIA_COMMAND_PLAY_HOLD ((sal_Int16)20)// Button Play (long) pressed.
345cdf0e10cSrcweir #define MEDIA_COMMAND_NEXTTRACK_HOLD ((sal_Int16)21)// Button Right holding pressed.
346cdf0e10cSrcweir #define MEDIA_COMMAND_PREVIOUSTRACK_HOLD ((sal_Int16)22)// Button Left holding pressed.
347cdf0e10cSrcweir
348cdf0e10cSrcweir
349cdf0e10cSrcweir // ------------------------------
350cdf0e10cSrcweir // - CommandSelectionChangeData -
351cdf0e10cSrcweir // ------------------------------
352cdf0e10cSrcweir
353cdf0e10cSrcweir class VCL_DLLPUBLIC CommandSelectionChangeData
354cdf0e10cSrcweir {
355cdf0e10cSrcweir private:
356cdf0e10cSrcweir sal_uLong mnStart;
357cdf0e10cSrcweir sal_uLong mnEnd;
358cdf0e10cSrcweir
359cdf0e10cSrcweir public:
360cdf0e10cSrcweir CommandSelectionChangeData();
361cdf0e10cSrcweir CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
362cdf0e10cSrcweir
GetStart() const363cdf0e10cSrcweir sal_uLong GetStart() const { return mnStart; }
GetEnd() const364cdf0e10cSrcweir sal_uLong GetEnd() const { return mnEnd; }
365cdf0e10cSrcweir };
366cdf0e10cSrcweir
CommandSelectionChangeData()367cdf0e10cSrcweir inline CommandSelectionChangeData::CommandSelectionChangeData()
368cdf0e10cSrcweir {
369cdf0e10cSrcweir mnStart = mnEnd = 0;
370cdf0e10cSrcweir }
371cdf0e10cSrcweir
CommandSelectionChangeData(sal_uLong nStart,sal_uLong nEnd)372cdf0e10cSrcweir inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
373cdf0e10cSrcweir sal_uLong nEnd )
374cdf0e10cSrcweir {
375cdf0e10cSrcweir mnStart = nStart;
376cdf0e10cSrcweir mnEnd = nEnd;
377cdf0e10cSrcweir }
378cdf0e10cSrcweir
379cdf0e10cSrcweir // ----------------
380cdf0e10cSrcweir // - CommandEvent -
381cdf0e10cSrcweir // ----------------
382cdf0e10cSrcweir
383cdf0e10cSrcweir #define COMMAND_CONTEXTMENU ((sal_uInt16)1)
384cdf0e10cSrcweir #define COMMAND_STARTDRAG ((sal_uInt16)2)
385cdf0e10cSrcweir #define COMMAND_WHEEL ((sal_uInt16)3)
386cdf0e10cSrcweir #define COMMAND_STARTAUTOSCROLL ((sal_uInt16)4)
387cdf0e10cSrcweir #define COMMAND_AUTOSCROLL ((sal_uInt16)5)
388cdf0e10cSrcweir #define COMMAND_VOICE ((sal_uInt16)6)
389cdf0e10cSrcweir #define COMMAND_STARTEXTTEXTINPUT ((sal_uInt16)7)
390cdf0e10cSrcweir #define COMMAND_EXTTEXTINPUT ((sal_uInt16)8)
391cdf0e10cSrcweir #define COMMAND_ENDEXTTEXTINPUT ((sal_uInt16)9)
392cdf0e10cSrcweir #define COMMAND_INPUTCONTEXTCHANGE ((sal_uInt16)10)
393cdf0e10cSrcweir #define COMMAND_CURSORPOS ((sal_uInt16)11)
394cdf0e10cSrcweir #define COMMAND_PASTESELECTION ((sal_uInt16)12)
395cdf0e10cSrcweir #define COMMAND_MODKEYCHANGE ((sal_uInt16)13)
396cdf0e10cSrcweir #define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
397cdf0e10cSrcweir #define COMMAND_INPUTLANGUAGECHANGE ((sal_uInt16)15)
398cdf0e10cSrcweir #define COMMAND_SHOWDIALOG ((sal_uInt16)16)
399cdf0e10cSrcweir #define COMMAND_MEDIA ((sal_uInt16)17)
400cdf0e10cSrcweir #define COMMAND_SELECTIONCHANGE ((sal_uInt16)18)
401cdf0e10cSrcweir #define COMMAND_PREPARERECONVERSION ((sal_uInt16)19)
402cdf0e10cSrcweir #define COMMAND_USER ((sal_uInt16)4096)
403cdf0e10cSrcweir
404cdf0e10cSrcweir class VCL_DLLPUBLIC CommandEvent
405cdf0e10cSrcweir {
406cdf0e10cSrcweir private:
407cdf0e10cSrcweir Point maPos;
408cdf0e10cSrcweir void* mpData;
409cdf0e10cSrcweir sal_uInt16 mnCommand;
410cdf0e10cSrcweir sal_Bool mbMouseEvent;
411cdf0e10cSrcweir
412cdf0e10cSrcweir public:
413cdf0e10cSrcweir CommandEvent();
414cdf0e10cSrcweir CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
415cdf0e10cSrcweir sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
416cdf0e10cSrcweir
GetCommand() const417cdf0e10cSrcweir sal_uInt16 GetCommand() const { return mnCommand; }
GetMousePosPixel() const418cdf0e10cSrcweir const Point& GetMousePosPixel() const { return maPos; }
IsMouseEvent() const419cdf0e10cSrcweir sal_Bool IsMouseEvent() const { return mbMouseEvent; }
GetData() const420cdf0e10cSrcweir void* GetData() const { return mpData; }
421cdf0e10cSrcweir
422cdf0e10cSrcweir const CommandExtTextInputData* GetExtTextInputData() const;
423cdf0e10cSrcweir const CommandInputContextData* GetInputContextChangeData() const;
424cdf0e10cSrcweir const CommandWheelData* GetWheelData() const;
425cdf0e10cSrcweir const CommandScrollData* GetAutoScrollData() const;
426cdf0e10cSrcweir const CommandVoiceData* GetVoiceData() const;
427cdf0e10cSrcweir const CommandModKeyData* GetModKeyData() const;
428cdf0e10cSrcweir const CommandDialogData* GetDialogData() const;
429cdf0e10cSrcweir sal_Int16 GetMediaCommand() const;
430cdf0e10cSrcweir const CommandSelectionChangeData* GetSelectionChangeData() const;
431cdf0e10cSrcweir };
432cdf0e10cSrcweir
CommandEvent()433cdf0e10cSrcweir inline CommandEvent::CommandEvent()
434cdf0e10cSrcweir {
435cdf0e10cSrcweir mpData = NULL;
436cdf0e10cSrcweir mnCommand = 0;
437cdf0e10cSrcweir mbMouseEvent = sal_False;
438cdf0e10cSrcweir }
439cdf0e10cSrcweir
CommandEvent(const Point & rMousePos,sal_uInt16 nCmd,sal_Bool bMEvt,const void * pCmdData)440cdf0e10cSrcweir inline CommandEvent::CommandEvent( const Point& rMousePos,
441cdf0e10cSrcweir sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
442cdf0e10cSrcweir maPos( rMousePos )
443cdf0e10cSrcweir {
444cdf0e10cSrcweir mpData = (void*)pCmdData;
445cdf0e10cSrcweir mnCommand = nCmd;
446cdf0e10cSrcweir mbMouseEvent = bMEvt;
447cdf0e10cSrcweir }
448cdf0e10cSrcweir
GetExtTextInputData() const449cdf0e10cSrcweir inline const CommandExtTextInputData* CommandEvent::GetExtTextInputData() const
450cdf0e10cSrcweir {
451cdf0e10cSrcweir if ( mnCommand == COMMAND_EXTTEXTINPUT )
452cdf0e10cSrcweir return (const CommandExtTextInputData*)mpData;
453cdf0e10cSrcweir else
454cdf0e10cSrcweir return NULL;
455cdf0e10cSrcweir }
456cdf0e10cSrcweir
GetInputContextChangeData() const457cdf0e10cSrcweir inline const CommandInputContextData* CommandEvent::GetInputContextChangeData() const
458cdf0e10cSrcweir {
459cdf0e10cSrcweir if ( mnCommand == COMMAND_INPUTCONTEXTCHANGE )
460cdf0e10cSrcweir return (const CommandInputContextData*)mpData;
461cdf0e10cSrcweir else
462cdf0e10cSrcweir return NULL;
463cdf0e10cSrcweir }
464cdf0e10cSrcweir
GetWheelData() const465cdf0e10cSrcweir inline const CommandWheelData* CommandEvent::GetWheelData() const
466cdf0e10cSrcweir {
467cdf0e10cSrcweir if ( mnCommand == COMMAND_WHEEL )
468cdf0e10cSrcweir return (const CommandWheelData*)mpData;
469cdf0e10cSrcweir else
470cdf0e10cSrcweir return NULL;
471cdf0e10cSrcweir }
472cdf0e10cSrcweir
GetAutoScrollData() const473cdf0e10cSrcweir inline const CommandScrollData* CommandEvent::GetAutoScrollData() const
474cdf0e10cSrcweir {
475cdf0e10cSrcweir if ( mnCommand == COMMAND_AUTOSCROLL )
476cdf0e10cSrcweir return (const CommandScrollData*)mpData;
477cdf0e10cSrcweir else
478cdf0e10cSrcweir return NULL;
479cdf0e10cSrcweir }
480cdf0e10cSrcweir
GetVoiceData() const481cdf0e10cSrcweir inline const CommandVoiceData* CommandEvent::GetVoiceData() const
482cdf0e10cSrcweir {
483cdf0e10cSrcweir if ( mnCommand == COMMAND_VOICE )
484cdf0e10cSrcweir return (const CommandVoiceData*)mpData;
485cdf0e10cSrcweir else
486cdf0e10cSrcweir return NULL;
487cdf0e10cSrcweir }
488cdf0e10cSrcweir
GetModKeyData() const489cdf0e10cSrcweir inline const CommandModKeyData* CommandEvent::GetModKeyData() const
490cdf0e10cSrcweir {
491cdf0e10cSrcweir if( mnCommand == COMMAND_MODKEYCHANGE )
492cdf0e10cSrcweir return (const CommandModKeyData*)mpData;
493cdf0e10cSrcweir else
494cdf0e10cSrcweir return NULL;
495cdf0e10cSrcweir }
496cdf0e10cSrcweir
GetDialogData() const497cdf0e10cSrcweir inline const CommandDialogData* CommandEvent::GetDialogData() const
498cdf0e10cSrcweir {
499cdf0e10cSrcweir if( mnCommand == COMMAND_SHOWDIALOG )
500cdf0e10cSrcweir return (const CommandDialogData*)mpData;
501cdf0e10cSrcweir else
502cdf0e10cSrcweir return NULL;
503cdf0e10cSrcweir }
504cdf0e10cSrcweir
GetMediaCommand() const505cdf0e10cSrcweir inline sal_Int16 CommandEvent::GetMediaCommand() const
506cdf0e10cSrcweir {
507cdf0e10cSrcweir if( mnCommand == COMMAND_MEDIA )
508cdf0e10cSrcweir return *(const sal_Int16*)(mpData);
509cdf0e10cSrcweir else
510cdf0e10cSrcweir return 0;
511cdf0e10cSrcweir }
512cdf0e10cSrcweir
GetSelectionChangeData() const513cdf0e10cSrcweir inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const
514cdf0e10cSrcweir {
515cdf0e10cSrcweir if( mnCommand == COMMAND_SELECTIONCHANGE )
516cdf0e10cSrcweir return (const CommandSelectionChangeData*)mpData;
517cdf0e10cSrcweir else
518cdf0e10cSrcweir return NULL;
519cdf0e10cSrcweir }
520cdf0e10cSrcweir
521cdf0e10cSrcweir
522cdf0e10cSrcweir #endif // _VCL_CMDEVT_HXX
523