telutils/keysequencerecognitionservice/src/keysequencerecognitionprovider.cpp
changeset 51 12bc758d6a02
parent 42 35488577e233
equal deleted inserted replaced
48:78df25012fda 51:12bc758d6a02
    23 #include "keysequencerecognitionprovider.h"
    23 #include "keysequencerecognitionprovider.h"
    24 #include "manufacturerkeysequencehandler.h"
    24 #include "manufacturerkeysequencehandler.h"
    25 #include "imeikeysequencehandler.h"
    25 #include "imeikeysequencehandler.h"
    26 #include "lifetimerkeysequencehandler.h"
    26 #include "lifetimerkeysequencehandler.h"
    27 #include "simcontrolkeysequencehandler.h"
    27 #include "simcontrolkeysequencehandler.h"
       
    28 #include "bluetoothkeysequencehandler.h"
    28 #include "keysequencerecognitionservicelog.h"
    29 #include "keysequencerecognitionservicelog.h"
    29 
    30 
    30 /*!
    31 /*!
    31   KeySequenceRecognitionProvider::KeySequenceRecognitionProvider.
    32   KeySequenceRecognitionProvider::KeySequenceRecognitionProvider.
    32  */
    33  */
    52     // Keysequencerecognitionprovider to be invisible in taskswitcher 
    53     // Keysequencerecognitionprovider to be invisible in taskswitcher 
    53     TsTaskSettings taskSettings;
    54     TsTaskSettings taskSettings;
    54     taskSettings.setVisibility(false);
    55     taskSettings.setVisibility(false);
    55 }
    56 }
    56 
    57 
    57 
       
    58 /*!
    58 /*!
    59   KeySequenceRecognitionProvider::~KeySequenceRecognitionProvider.
    59   KeySequenceRecognitionProvider::~KeySequenceRecognitionProvider.
    60  */
    60  */
    61 KeySequenceRecognitionProvider::~KeySequenceRecognitionProvider()
    61 KeySequenceRecognitionProvider::~KeySequenceRecognitionProvider()
    62 {
    62 {
    63     DPRINT_METHODENTRYEXIT;
    63     DPRINT_METHODENTRYEXIT;
    64 }
    64 }
    65 
       
    66 
    65 
    67 /*!
    66 /*!
    68   KeySequenceRecognitionProvider::keySequenceValidator.
    67   KeySequenceRecognitionProvider::keySequenceValidator.
    69  */
    68  */
    70 QString KeySequenceRecognitionProvider::keySequenceValidator()
    69 QString KeySequenceRecognitionProvider::keySequenceValidator()
    75         constructKeySequenceValidator();
    74         constructKeySequenceValidator();
    76     }
    75     }
    77     
    76     
    78     return m_keySequenceValidator;
    77     return m_keySequenceValidator;
    79 }
    78 }
    80 
       
    81 
    79 
    82 /*!
    80 /*!
    83   KeySequenceRecognitionProvider::executeKeySequence.
    81   KeySequenceRecognitionProvider::executeKeySequence.
    84  */
    82  */
    85 bool KeySequenceRecognitionProvider::executeKeySequence(
    83 bool KeySequenceRecognitionProvider::executeKeySequence(
    94         handled = (*it)->executeKeySequence(keySequence);
    92         handled = (*it)->executeKeySequence(keySequence);
    95     }
    93     }
    96     
    94     
    97     return handled;
    95     return handled;
    98 }
    96 }
    99 
       
   100 
    97 
   101 /*!
    98 /*!
   102   KeySequenceRecognitionProvider::setupLocalization.
    99   KeySequenceRecognitionProvider::setupLocalization.
   103  */
   100  */
   104 void KeySequenceRecognitionProvider::setupLocalization()
   101 void KeySequenceRecognitionProvider::setupLocalization()
   115     if (translatorLoaded) {
   112     if (translatorLoaded) {
   116         qApp->installTranslator(translator.data());
   113         qApp->installTranslator(translator.data());
   117         translator.take();
   114         translator.take();
   118     }
   115     }
   119 }
   116 }
   120 
       
   121 
   117 
   122 /*!
   118 /*!
   123   KeySequenceRecognitionProvider::constructKeySequenceHandlers.
   119   KeySequenceRecognitionProvider::constructKeySequenceHandlers.
   124  */
   120  */
   125 void KeySequenceRecognitionProvider::constructKeySequenceHandlers()
   121 void KeySequenceRecognitionProvider::constructKeySequenceHandlers()
   143     
   139     
   144     QScopedPointer<KeySequenceHandler> simControlHandler( 
   140     QScopedPointer<KeySequenceHandler> simControlHandler( 
   145         new SimControlKeySequenceHandler(this));
   141         new SimControlKeySequenceHandler(this));
   146     m_handlers.append(simControlHandler.data());
   142     m_handlers.append(simControlHandler.data());
   147     simControlHandler.take();
   143     simControlHandler.take();
       
   144 
       
   145     QScopedPointer<KeySequenceHandler> bluetoothHandler( 
       
   146         new BluetoothKeySequenceHandler(this));
       
   147     m_handlers.append(bluetoothHandler.data());
       
   148     bluetoothHandler.take();
   148 }
   149 }
   149 
       
   150 
   150 
   151 /*!
   151 /*!
   152   KeySequenceRecognitionProvider::constructKeySequenceValidator.
   152   KeySequenceRecognitionProvider::constructKeySequenceValidator.
   153  */
   153  */
   154 void KeySequenceRecognitionProvider::constructKeySequenceValidator()
   154 void KeySequenceRecognitionProvider::constructKeySequenceValidator()