telutils/keysequencerecognitionservice/inc/manufacturerkeysequencehandler.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*!
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Implements manufacturer key sequence handling.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MANUFACTURERKEYSEQUENCEHANDLER_H
       
    19 #define MANUFACTURERKEYSEQUENCEHANDLER_H
       
    20 
       
    21 #include <xqappmgr.h>
       
    22 #include "keysequencehandler.h"
       
    23 
       
    24 class XQAiwRequest;
       
    25 
       
    26 class InterfaceDescription
       
    27 {
       
    28 public:
       
    29     InterfaceDescription() 
       
    30         :
       
    31         m_service(""),
       
    32         m_interface(""),
       
    33         m_method("") {}
       
    34     
       
    35     InterfaceDescription(
       
    36         const QString &service, 
       
    37         const QString &interface, 
       
    38         const QString &method) 
       
    39     :
       
    40     m_service(service),
       
    41     m_interface(interface),
       
    42     m_method(method) {}
       
    43 
       
    44 public:
       
    45     QString m_service;
       
    46     QString m_interface;
       
    47     QString m_method;
       
    48 };
       
    49 
       
    50 class ManufacturerKeySequenceHandler : public KeySequenceHandler
       
    51 {
       
    52     Q_OBJECT
       
    53 
       
    54 public:
       
    55 
       
    56     ManufacturerKeySequenceHandler(QObject *parent = 0);
       
    57     ~ManufacturerKeySequenceHandler();
       
    58     
       
    59     bool executeKeySequence(
       
    60         const QString &keySequence);
       
    61 
       
    62 private:
       
    63     bool issueServiceRequest(
       
    64         const InterfaceDescription &description);
       
    65 
       
    66 private slots:
       
    67     void requestOk(const QVariant &returnValue);
       
    68     void requestError(int error, const QString& errorMessage);
       
    69 
       
    70 private:
       
    71     XQApplicationManager m_aiwManager;
       
    72     QMap<QString, InterfaceDescription> m_codeToInterfaceMappings;
       
    73     QPointer<XQAiwRequest> m_currentRequest;
       
    74 };
       
    75 
       
    76 #endif // MANUFACTURERKEYSEQUENCEHANDLER_H