src/hbplugins/inputmethods/hardwareinput/hbhardware12key.h
changeset 0 16d8024aca5e
child 1 f7ac710697a9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbPlugins module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 #ifndef _HbHardware12key_H 
       
    26 #define _HbHardware12key_H 
       
    27 
       
    28 #include <hbinputmethod.h>
       
    29 #include <hbinputpredictioncallback.h>
       
    30 
       
    31 
       
    32 class HbKeyMapFactory;
       
    33 class HbKeyMapData;
       
    34 class QTimer;
       
    35 class HbInputSctPortrait;
       
    36 class HbCandidateList;
       
    37 class HbPredictionEngine;
       
    38 class HbAction;
       
    39 
       
    40 
       
    41 // input mode handlers.
       
    42 class HbInputModeHandler;
       
    43 class HbHardwareInputPrediction12KeyHandler;
       
    44 class HbHardwareInputBasic12KeyHandler;
       
    45 class HbHardwareInputNumeric12KeyHandler;
       
    46 
       
    47 
       
    48 class HbHardware12key : public HbInputMethod
       
    49 {
       
    50     Q_OBJECT
       
    51 public:
       
    52     HbHardware12key();
       
    53     ~HbHardware12key();
       
    54 
       
    55 public: // From QInputContext
       
    56     QString identifierName();
       
    57     bool isComposing() const;
       
    58     QString language();
       
    59     void reset();
       
    60     void mouseHandler(int cursorPosition, QMouseEvent* event);
       
    61     bool usePrediction() const;
       
    62 public: // From HbInputMethod
       
    63     void listInputModes(QVector<HbInputModeProperties>& results);
       
    64     void focusReceived();
       
    65         void focusLost(bool focusSwitch);
       
    66     void inputLanguageChanged(int newLanguage); 
       
    67     void inputStateActivated(const HbInputState& newState);
       
    68     bool filterEvent(const QEvent *event);
       
    69 
       
    70 public: 
       
    71     void initializeModeHandlers();
       
    72     void closeCandidatePopup();
       
    73     void launchCandidatePopup(QStringList *candidates);
       
    74     int switchSpecialCharacterTable();
       
    75     void launchAutoCompletionPopup(QStringList *candidates);
       
    76     void closeAutoCompletionPopup();
       
    77     void switchMode(int keyCode);
       
    78     
       
    79 protected:
       
    80     void predictiveInputStatusChanged(int newStatus);
       
    81 
       
    82 public slots:
       
    83     void sctCharacterSelected(QChar character);
       
    84     void candidatePopupClosed(int closingKey);
       
    85 
       
    86 private:
       
    87     void switchToSctMode();
       
    88     void setSpecialCharacters();
       
    89     QPoint getCandidatePosition();
       
    90 
       
    91 private:
       
    92     HbKeyMapData*    mKeyData;
       
    93     HbInputModeType mInputMode;
       
    94     HbInputState mPrevInputState;
       
    95     HbInputSctPortrait* mSctKeypad;
       
    96 
       
    97     // Owned
       
    98     HbCandidateList* mCandidatePopup;
       
    99     HbInputFocusObject* mCurrentlyFocused;
       
   100 
       
   101     // Input mode handlers.
       
   102     HbInputModeHandler *mActiveModeHandler;
       
   103     HbHardwareInputPrediction12KeyHandler *mPredictionModeHandler;
       
   104     HbHardwareInputBasic12KeyHandler *mBasicModeHandler;
       
   105     HbHardwareInputNumeric12KeyHandler *mNumericModeHandler;
       
   106 };
       
   107 
       
   108 #endif // _HbHardware12key_H
       
   109 
       
   110 // End of file 
       
   111