LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/vcl - cmdevt.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 105 0.0 %
Date: 2012-08-25 Functions: 0 48 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 20 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _VCL_CMDEVT_HXX
      30                 :            : #define _VCL_CMDEVT_HXX
      31                 :            : 
      32                 :            : #include <tools/gen.hxx>
      33                 :            : #include <tools/solar.h>
      34                 :            : #include <vcl/dllapi.h>
      35                 :            : #include <vcl/keycod.hxx>
      36                 :            : #include <vcl/font.hxx>
      37                 :            : 
      38                 :            : // ---------------------------
      39                 :            : // - CommandExtTextInputData -
      40                 :            : // ---------------------------
      41                 :            : 
      42                 :            : #define EXTTEXTINPUT_ATTR_GRAYWAVELINE          ((sal_uInt16)0x0100)
      43                 :            : #define EXTTEXTINPUT_ATTR_UNDERLINE             ((sal_uInt16)0x0200)
      44                 :            : #define EXTTEXTINPUT_ATTR_BOLDUNDERLINE         ((sal_uInt16)0x0400)
      45                 :            : #define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE       ((sal_uInt16)0x0800)
      46                 :            : #define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE      ((sal_uInt16)0x1000)
      47                 :            : #define EXTTEXTINPUT_ATTR_HIGHLIGHT             ((sal_uInt16)0x2000)
      48                 :            : #define EXTTEXTINPUT_ATTR_REDTEXT               ((sal_uInt16)0x4000)
      49                 :            : #define EXTTEXTINPUT_ATTR_HALFTONETEXT          ((sal_uInt16)0x8000)
      50                 :            : 
      51                 :            : #define EXTTEXTINPUT_CURSOR_INVISIBLE           ((sal_uInt16)0x0001)
      52                 :            : #define EXTTEXTINPUT_CURSOR_OVERWRITE           ((sal_uInt16)0x0002)
      53                 :            : 
      54                 :            : class VCL_DLLPUBLIC CommandExtTextInputData
      55                 :            : {
      56                 :            : private:
      57                 :            :     XubString           maText;
      58                 :            :     sal_uInt16*             mpTextAttr;
      59                 :            :     xub_StrLen          mnCursorPos;
      60                 :            :     xub_StrLen          mnDeltaStart;
      61                 :            :     xub_StrLen          mnOldTextLen;
      62                 :            :     sal_uInt16              mnCursorFlags;
      63                 :            :     sal_Bool                mbOnlyCursor;
      64                 :            : 
      65                 :            : public:
      66                 :            :                         CommandExtTextInputData( const XubString& rText,
      67                 :            :                                                  const sal_uInt16* pTextAttr,
      68                 :            :                                                  xub_StrLen nCursorPos,
      69                 :            :                                                  sal_uInt16 nCursorFlags,
      70                 :            :                                                  xub_StrLen nDeltaStart,
      71                 :            :                                                  xub_StrLen nOldTextLen,
      72                 :            :                                                  sal_Bool bOnlyCursor );
      73                 :            :                         CommandExtTextInputData( const CommandExtTextInputData& rData );
      74                 :            :                         ~CommandExtTextInputData();
      75                 :            : 
      76                 :          0 :     const XubString&    GetText() const { return maText; }
      77                 :          0 :     const sal_uInt16*       GetTextAttr() const { return mpTextAttr; }
      78                 :            :     sal_uInt16              GetCharTextAttr( sal_uInt16 nIndex ) const;
      79                 :          0 :     xub_StrLen          GetCursorPos() const { return mnCursorPos; }
      80                 :          0 :     sal_Bool                IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
      81                 :          0 :     sal_Bool                IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
      82                 :            :     sal_uInt16              GetCursorFlags() const { return mnCursorFlags; }
      83                 :            :     xub_StrLen          GetDeltaStart() const { return mnDeltaStart; }
      84                 :            :     xub_StrLen          GetOldTextLen() const { return mnOldTextLen; }
      85                 :          0 :     sal_Bool                IsOnlyCursorChanged() const { return mbOnlyCursor; }
      86                 :            : };
      87                 :            : 
      88                 :            : inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
      89                 :            : {
      90                 :            :     if ( mpTextAttr && (nIndex < maText.Len()) )
      91                 :            :         return mpTextAttr[nIndex];
      92                 :            :     else
      93                 :            :         return 0;
      94                 :            : }
      95                 :            : 
      96                 :            : // ---------------------------
      97                 :            : // - CommandInputContextData -
      98                 :            : // ---------------------------
      99                 :            : 
     100                 :            : class VCL_DLLPUBLIC CommandInputContextData
     101                 :            : {
     102                 :            : private:
     103                 :            :     LanguageType    meLanguage;
     104                 :            : 
     105                 :            : public:
     106                 :            :                     CommandInputContextData();
     107                 :            :                     CommandInputContextData( LanguageType eLang );
     108                 :            : 
     109                 :            :     LanguageType    GetLanguage() const { return meLanguage; }
     110                 :            : };
     111                 :            : 
     112                 :            : inline CommandInputContextData::CommandInputContextData()
     113                 :            : {
     114                 :            :     meLanguage = LANGUAGE_DONTKNOW;
     115                 :            : }
     116                 :            : 
     117                 :          0 : inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
     118                 :            : {
     119                 :          0 :     meLanguage = eLang;
     120                 :          0 : }
     121                 :            : 
     122                 :            : // --------------------
     123                 :            : // - CommandWheelData -
     124                 :            : // --------------------
     125                 :            : 
     126                 :            : #define COMMAND_WHEEL_SCROLL            ((sal_uInt16)0x0001)
     127                 :            : #define COMMAND_WHEEL_ZOOM              ((sal_uInt16)0x0002)
     128                 :            : #define COMMAND_WHEEL_DATAZOOM          ((sal_uInt16)0x0004)
     129                 :            : 
     130                 :            : #define COMMAND_WHEEL_PAGESCROLL        ((sal_uLong)0xFFFFFFFF)
     131                 :            : 
     132                 :            : class VCL_DLLPUBLIC CommandWheelData
     133                 :            : {
     134                 :            : private:
     135                 :            :     long            mnDelta;
     136                 :            :     long            mnNotchDelta;
     137                 :            :     sal_uLong           mnLines;
     138                 :            :     sal_uInt16          mnMode;
     139                 :            :     sal_uInt16          mnCode;
     140                 :            :     sal_Bool            mbHorz;
     141                 :            :     sal_Bool            mbDeltaIsPixel;
     142                 :            : 
     143                 :            : public:
     144                 :            :                     CommandWheelData();
     145                 :            :                     CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
     146                 :            :                                       sal_uLong nScrollLines,
     147                 :            :                                       sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
     148                 :            :                                       sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
     149                 :            : 
     150                 :          0 :     long            GetDelta() const { return mnDelta; }
     151                 :          0 :     long            GetNotchDelta() const { return mnNotchDelta; }
     152                 :          0 :     sal_uLong           GetScrollLines() const { return mnLines; }
     153                 :          0 :     sal_Bool            IsHorz() const { return mbHorz; }
     154                 :          0 :     sal_Bool            IsDeltaPixel() const { return mbDeltaIsPixel; }
     155                 :            : 
     156                 :          0 :     sal_uInt16          GetMode() const { return mnMode; }
     157                 :            : 
     158                 :          0 :     sal_uInt16          GetModifier() const
     159                 :          0 :                         { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
     160                 :          0 :     bool            IsShift() const
     161                 :          0 :                         { return ((mnCode & KEY_SHIFT) != 0); }
     162                 :          0 :     sal_Bool            IsMod1() const
     163                 :          0 :                         { return ((mnCode & KEY_MOD1) != 0); }
     164                 :          0 :     sal_Bool            IsMod2() const
     165                 :          0 :                         { return ((mnCode & KEY_MOD2) != 0); }
     166                 :            :     sal_Bool            IsMod3() const
     167                 :            :                         { return ((mnCode & KEY_MOD3) != 0); }
     168                 :            : };
     169                 :            : 
     170                 :            : inline CommandWheelData::CommandWheelData()
     171                 :            : {
     172                 :            :     mnDelta         = 0;
     173                 :            :     mnNotchDelta    = 0;
     174                 :            :     mnLines         = 0;
     175                 :            :     mnMode          = 0;
     176                 :            :     mnCode          = 0;
     177                 :            :     mbHorz          = sal_False;
     178                 :            :     mbDeltaIsPixel  = sal_False;
     179                 :            : }
     180                 :            : 
     181                 :          0 : inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
     182                 :            :                                            sal_uLong nScrollLines,
     183                 :            :                                            sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
     184                 :            :                                            sal_Bool bHorz, sal_Bool bDeltaIsPixel )
     185                 :            : {
     186                 :          0 :     mnDelta         = nWheelDelta;
     187                 :          0 :     mnNotchDelta    = nWheelNotchDelta;
     188                 :          0 :     mnLines         = nScrollLines;
     189                 :          0 :     mnMode          = nWheelMode;
     190                 :          0 :     mnCode          = nKeyModifier;
     191                 :          0 :     mbHorz          = bHorz;
     192                 :          0 :     mbDeltaIsPixel  = bDeltaIsPixel;
     193                 :          0 : }
     194                 :            : 
     195                 :            : // ---------------------
     196                 :            : // - CommandScrollData -
     197                 :            : // ---------------------
     198                 :            : 
     199                 :            : class VCL_DLLPUBLIC CommandScrollData
     200                 :            : {
     201                 :            : private:
     202                 :            :     long            mnDeltaX;
     203                 :            :     long            mnDeltaY;
     204                 :            : 
     205                 :            : public:
     206                 :            :                     CommandScrollData();
     207                 :            :                     CommandScrollData( long nDeltaX, long nDeltaY );
     208                 :            : 
     209                 :          0 :     long            GetDeltaX() const { return mnDeltaX; }
     210                 :          0 :     long            GetDeltaY() const { return mnDeltaY; }
     211                 :            : };
     212                 :            : 
     213                 :          0 : inline CommandScrollData::CommandScrollData()
     214                 :            : {
     215                 :          0 :     mnDeltaX    = 0;
     216                 :          0 :     mnDeltaY    = 0;
     217                 :          0 : }
     218                 :            : 
     219                 :          0 : inline CommandScrollData::CommandScrollData( long nDeltaX, long nDeltaY )
     220                 :            : {
     221                 :          0 :     mnDeltaX    = nDeltaX;
     222                 :          0 :     mnDeltaY    = nDeltaY;
     223                 :          0 : }
     224                 :            : 
     225                 :            : // --------------------
     226                 :            : // - CommandVoiceData -
     227                 :            : // --------------------
     228                 :            : 
     229                 :            : enum DictationCommandType
     230                 :            : {
     231                 :            :     VOICECOMMANDTYPE_DICTATION,
     232                 :            :     VOICECOMMANDTYPE_CONTROL
     233                 :            : };
     234                 :            : 
     235                 :            : class VCL_DLLPUBLIC CommandVoiceData
     236                 :            : {
     237                 :            : private:
     238                 :            :     XubString               maText;
     239                 :            :     sal_uInt16                  mnCommand;
     240                 :            :     DictationCommandType    meType;
     241                 :            : 
     242                 :            : public:
     243                 :            :                             CommandVoiceData();
     244                 :            :                             CommandVoiceData( const XubString& rStr,
     245                 :            :                                               DictationCommandType eType,
     246                 :            :                                               sal_uInt16 nCommand );
     247                 :            : 
     248                 :          0 :     const XubString&        GetText() const { return maText; }
     249                 :          0 :     sal_uInt16                  GetCommand() const { return mnCommand; }
     250                 :          0 :     DictationCommandType    GetType() const { return meType; }
     251                 :            : };
     252                 :            : 
     253                 :            : inline CommandVoiceData::CommandVoiceData()
     254                 :            : {
     255                 :            :     meType = VOICECOMMANDTYPE_DICTATION;
     256                 :            :     mnCommand = 0;
     257                 :            : }
     258                 :            : 
     259                 :            : inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
     260                 :            :                                            DictationCommandType eType,
     261                 :            :                                            sal_uInt16 nCommand ) :
     262                 :            :     maText( rStr ),
     263                 :            :     mnCommand( nCommand ),
     264                 :            :     meType( eType )
     265                 :            : {
     266                 :            : }
     267                 :            : 
     268                 :            : // ---------------------
     269                 :            : // - CommandModKeyData -
     270                 :            : // ---------------------
     271                 :            : 
     272                 :            : class VCL_DLLPUBLIC CommandModKeyData
     273                 :            : {
     274                 :            : private:
     275                 :            :     sal_uInt16          mnCode;
     276                 :            : 
     277                 :            : public:
     278                 :            :                     CommandModKeyData();
     279                 :            :                     CommandModKeyData( sal_uInt16 nCode );
     280                 :            : 
     281                 :            :     bool            IsShift()   const { return (mnCode & MODKEY_SHIFT) ? true : false; }
     282         [ #  # ]:          0 :     sal_Bool            IsMod1()    const { return (mnCode & MODKEY_MOD1) ? sal_True : sal_False; }
     283         [ #  # ]:          0 :     sal_Bool            IsMod2()    const { return (mnCode & MODKEY_MOD2) ? sal_True : sal_False; }
     284                 :            :     sal_Bool            IsMod3()    const { return (mnCode & MODKEY_MOD3) ? sal_True : sal_False; }
     285                 :            : 
     286                 :          0 :     sal_Bool            IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? sal_True : sal_False; }
     287                 :            :     sal_Bool            IsLeftMod1()  const { return (mnCode & MODKEY_LMOD1) ? sal_True : sal_False; }
     288                 :            :     sal_Bool            IsLeftMod2()  const { return (mnCode & MODKEY_LMOD2) ? sal_True : sal_False; }
     289                 :            :     sal_Bool            IsLeftMod3()  const { return (mnCode & MODKEY_LMOD3) ? sal_True : sal_False; }
     290                 :            : 
     291         [ #  # ]:          0 :     sal_Bool            IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? sal_True : sal_False; }
     292                 :            :     sal_Bool            IsRightMod1()  const { return (mnCode & MODKEY_RMOD1) ? sal_True : sal_False; }
     293                 :            :     sal_Bool            IsRightMod2()  const { return (mnCode & MODKEY_RMOD2) ? sal_True : sal_False; }
     294                 :            :     sal_Bool            IsRightMod3()  const { return (mnCode & MODKEY_RMOD3) ? sal_True : sal_False; }
     295                 :            : };
     296                 :            : 
     297                 :            : inline CommandModKeyData::CommandModKeyData()
     298                 :            : {
     299                 :            :     mnCode = 0L;
     300                 :            : }
     301                 :            : 
     302                 :          0 : inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
     303                 :            : {
     304                 :          0 :     mnCode = nCode;
     305                 :          0 : }
     306                 :            : 
     307                 :            : // --------------------
     308                 :            : // - CommanDialogData -
     309                 :            : // --------------------
     310                 :            : 
     311                 :            : #define SHOWDIALOG_ID_PREFERENCES       1
     312                 :            : #define SHOWDIALOG_ID_ABOUT             2
     313                 :            : 
     314                 :            : class VCL_DLLPUBLIC CommandDialogData
     315                 :            : {
     316                 :            :     int             m_nDialogId;
     317                 :            :     public:
     318                 :          0 :     CommandDialogData( int nDialogId = SHOWDIALOG_ID_PREFERENCES )
     319                 :          0 :     : m_nDialogId( nDialogId )
     320                 :          0 :     {}
     321                 :            : 
     322                 :          0 :     int GetDialogId() const { return m_nDialogId; }
     323                 :            : };
     324                 :            : 
     325                 :            : // --------------
     326                 :            : // Media Commands
     327                 :            : // --------------
     328                 :            : 
     329                 :            : #define MEDIA_COMMAND_CHANNEL_DOWN           ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
     330                 :            : #define MEDIA_COMMAND_CHANNEL_UP             ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
     331                 :            : #define MEDIA_COMMAND_NEXTTRACK              ((sal_Int16)3) // Go to next media track/slide.
     332                 :            : #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.
     333                 :            : #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.
     334                 :            : #define MEDIA_COMMAND_PLAY_PAUSE             ((sal_Int16)6) // Play or pause playback.
     335                 :            : #define MEDIA_COMMAND_PREVIOUSTRACK          ((sal_Int16)7) // Go to previous media track/slide.
     336                 :            : #define MEDIA_COMMAND_RECORD                 ((sal_Int16)8) // Begin recording the current stream.
     337                 :            : #define MEDIA_COMMAND_REWIND                 ((sal_Int16)9)// Go backward in a stream at a higher rate of speed.
     338                 :            : #define MEDIA_COMMAND_STOP                   ((sal_Int16)10)// Stop playback.
     339                 :            : #define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE      ((sal_Int16)11)// Toggle the microphone.
     340                 :            : #define MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN ((sal_Int16)12)// Increase microphone volume.
     341                 :            : #define MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE ((sal_Int16)13)// Mute the microphone.
     342                 :            : #define MEDIA_COMMAND_MICROPHONE_VOLUME_UP   ((sal_Int16)14)// Decrease microphone volume.
     343                 :            : #define MEDIA_COMMAND_VOLUME_DOWN            ((sal_Int16)15)// Lower the volume.
     344                 :            : #define MEDIA_COMMAND_VOLUME_MUTE            ((sal_Int16)16)// Mute the volume.
     345                 :            : #define MEDIA_COMMAND_VOLUME_UP              ((sal_Int16)17)// Raise the volume.
     346                 :            : #define MEDIA_COMMAND_MENU                   ((sal_Int16)18)// Button Menu pressed.
     347                 :            : #define MEDIA_COMMAND_MENU_HOLD              ((sal_Int16)19)// Button Menu (long) pressed.
     348                 :            : #define MEDIA_COMMAND_PLAY_HOLD              ((sal_Int16)20)// Button Play (long) pressed.
     349                 :            : #define MEDIA_COMMAND_NEXTTRACK_HOLD         ((sal_Int16)21)// Button Right holding pressed.
     350                 :            : #define MEDIA_COMMAND_PREVIOUSTRACK_HOLD     ((sal_Int16)22)// Button Left holding pressed.
     351                 :            : 
     352                 :            : 
     353                 :            : // ------------------------------
     354                 :            : // - CommandSelectionChangeData -
     355                 :            : // ------------------------------
     356                 :            : 
     357                 :            : class VCL_DLLPUBLIC CommandSelectionChangeData
     358                 :            : {
     359                 :            : private:
     360                 :            :     sal_uLong          mnStart;
     361                 :            :     sal_uLong          mnEnd;
     362                 :            : 
     363                 :            : public:
     364                 :            :     CommandSelectionChangeData();
     365                 :            :     CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
     366                 :            : 
     367                 :          0 :     sal_uLong          GetStart() const { return mnStart; }
     368                 :          0 :     sal_uLong          GetEnd() const { return mnEnd; }
     369                 :            : };
     370                 :            : 
     371                 :            : inline CommandSelectionChangeData::CommandSelectionChangeData()
     372                 :            : {
     373                 :            :     mnStart = mnEnd = 0;
     374                 :            : }
     375                 :            : 
     376                 :          0 : inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
     377                 :            :                                    sal_uLong nEnd )
     378                 :            : {
     379                 :          0 :     mnStart = nStart;
     380                 :          0 :     mnEnd = nEnd;
     381                 :          0 : }
     382                 :            : 
     383                 :            : // ----------------
     384                 :            : // - CommandEvent -
     385                 :            : // ----------------
     386                 :            : 
     387                 :            : #define COMMAND_CONTEXTMENU             ((sal_uInt16)1)
     388                 :            : #define COMMAND_STARTDRAG               ((sal_uInt16)2)
     389                 :            : #define COMMAND_WHEEL                   ((sal_uInt16)3)
     390                 :            : #define COMMAND_STARTAUTOSCROLL         ((sal_uInt16)4)
     391                 :            : #define COMMAND_AUTOSCROLL              ((sal_uInt16)5)
     392                 :            : #define COMMAND_VOICE                   ((sal_uInt16)6)
     393                 :            : #define COMMAND_STARTEXTTEXTINPUT       ((sal_uInt16)7)
     394                 :            : #define COMMAND_EXTTEXTINPUT            ((sal_uInt16)8)
     395                 :            : #define COMMAND_ENDEXTTEXTINPUT         ((sal_uInt16)9)
     396                 :            : #define COMMAND_INPUTCONTEXTCHANGE      ((sal_uInt16)10)
     397                 :            : #define COMMAND_CURSORPOS               ((sal_uInt16)11)
     398                 :            : #define COMMAND_PASTESELECTION          ((sal_uInt16)12)
     399                 :            : #define COMMAND_MODKEYCHANGE            ((sal_uInt16)13)
     400                 :            : #define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
     401                 :            : #define COMMAND_INPUTLANGUAGECHANGE     ((sal_uInt16)15)
     402                 :            : #define COMMAND_SHOWDIALOG              ((sal_uInt16)16)
     403                 :            : #define COMMAND_MEDIA                   ((sal_uInt16)17)
     404                 :            : #define COMMAND_SELECTIONCHANGE         ((sal_uInt16)18)
     405                 :            : #define COMMAND_PREPARERECONVERSION     ((sal_uInt16)19)
     406                 :            : 
     407                 :            : class VCL_DLLPUBLIC CommandEvent
     408                 :            : {
     409                 :            : private:
     410                 :            :     Point                               maPos;
     411                 :            :     void*                               mpData;
     412                 :            :     sal_uInt16                              mnCommand;
     413                 :            :     sal_Bool                                mbMouseEvent;
     414                 :            : 
     415                 :            : public:
     416                 :            :                                         CommandEvent();
     417                 :            :                                         CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
     418                 :            :                                                       sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
     419                 :            : 
     420                 :          0 :     sal_uInt16                              GetCommand() const { return mnCommand; }
     421                 :          0 :     const Point&                        GetMousePosPixel() const { return maPos; }
     422                 :          0 :     sal_Bool                                IsMouseEvent() const { return mbMouseEvent; }
     423                 :          0 :     void*                               GetData() const { return mpData; }
     424                 :            : 
     425                 :            :     const CommandExtTextInputData*      GetExtTextInputData() const;
     426                 :            :     const CommandInputContextData*      GetInputContextChangeData() const;
     427                 :            :     const CommandWheelData*             GetWheelData() const;
     428                 :            :     const CommandScrollData*            GetAutoScrollData() const;
     429                 :            :     const CommandVoiceData*             GetVoiceData() const;
     430                 :            :     const CommandModKeyData*            GetModKeyData() const;
     431                 :            :     const CommandDialogData*            GetDialogData() const;
     432                 :            :     sal_Int16                           GetMediaCommand() const;
     433                 :            :     const CommandSelectionChangeData*   GetSelectionChangeData() const;
     434                 :            : };
     435                 :            : 
     436                 :          0 : inline CommandEvent::CommandEvent()
     437                 :            : {
     438                 :          0 :     mpData          = NULL;
     439                 :          0 :     mnCommand       = 0;
     440                 :          0 :     mbMouseEvent    = sal_False;
     441                 :          0 : }
     442                 :            : 
     443                 :          0 : inline CommandEvent::CommandEvent( const Point& rMousePos,
     444                 :            :                                    sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
     445                 :          0 :             maPos( rMousePos )
     446                 :            : {
     447                 :          0 :     mpData          = (void*)pCmdData;
     448                 :          0 :     mnCommand       = nCmd;
     449                 :          0 :     mbMouseEvent    = bMEvt;
     450                 :          0 : }
     451                 :            : 
     452                 :          0 : inline const CommandExtTextInputData* CommandEvent::GetExtTextInputData() const
     453                 :            : {
     454         [ #  # ]:          0 :     if ( mnCommand == COMMAND_EXTTEXTINPUT )
     455                 :          0 :         return (const CommandExtTextInputData*)mpData;
     456                 :            :     else
     457                 :          0 :         return NULL;
     458                 :            : }
     459                 :            : 
     460                 :            : inline const CommandInputContextData* CommandEvent::GetInputContextChangeData() const
     461                 :            : {
     462                 :            :     if ( mnCommand == COMMAND_INPUTCONTEXTCHANGE )
     463                 :            :         return (const CommandInputContextData*)mpData;
     464                 :            :     else
     465                 :            :         return NULL;
     466                 :            : }
     467                 :            : 
     468                 :          0 : inline const CommandWheelData* CommandEvent::GetWheelData() const
     469                 :            : {
     470         [ #  # ]:          0 :     if ( mnCommand == COMMAND_WHEEL )
     471                 :          0 :         return (const CommandWheelData*)mpData;
     472                 :            :     else
     473                 :          0 :         return NULL;
     474                 :            : }
     475                 :            : 
     476                 :          0 : inline const CommandScrollData* CommandEvent::GetAutoScrollData() const
     477                 :            : {
     478         [ #  # ]:          0 :     if ( mnCommand == COMMAND_AUTOSCROLL )
     479                 :          0 :         return (const CommandScrollData*)mpData;
     480                 :            :     else
     481                 :          0 :         return NULL;
     482                 :            : }
     483                 :            : 
     484                 :          0 : inline const CommandVoiceData* CommandEvent::GetVoiceData() const
     485                 :            : {
     486         [ #  # ]:          0 :     if ( mnCommand == COMMAND_VOICE )
     487                 :          0 :         return (const CommandVoiceData*)mpData;
     488                 :            :     else
     489                 :          0 :         return NULL;
     490                 :            : }
     491                 :            : 
     492                 :            : inline const CommandModKeyData* CommandEvent::GetModKeyData() const
     493                 :            : {
     494                 :            :     if( mnCommand == COMMAND_MODKEYCHANGE )
     495                 :            :         return (const CommandModKeyData*)mpData;
     496                 :            :     else
     497                 :            :         return NULL;
     498                 :            : }
     499                 :            : 
     500                 :          0 : inline const CommandDialogData* CommandEvent::GetDialogData() const
     501                 :            : {
     502         [ #  # ]:          0 :     if( mnCommand == COMMAND_SHOWDIALOG )
     503                 :          0 :         return (const CommandDialogData*)mpData;
     504                 :            :     else
     505                 :          0 :         return NULL;
     506                 :            : }
     507                 :            : 
     508                 :          0 : inline sal_Int16 CommandEvent::GetMediaCommand() const
     509                 :            : {
     510         [ #  # ]:          0 :     if( mnCommand == COMMAND_MEDIA )
     511                 :          0 :         return *(const sal_Int16*)(mpData);
     512                 :            :     else
     513                 :          0 :         return 0;
     514                 :            : }
     515                 :            : 
     516                 :          0 : inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const
     517                 :            : {
     518         [ #  # ]:          0 :     if( mnCommand == COMMAND_SELECTIONCHANGE )
     519                 :          0 :     return (const CommandSelectionChangeData*)mpData;
     520                 :            :     else
     521                 :          0 :     return NULL;
     522                 :            : }
     523                 :            : 
     524                 :            : 
     525                 :            : #endif // _VCL_CMDEVT_HXX
     526                 :            : 
     527                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10