phonesrv_plat/dialpad_api/inc/dialpadkeyhandler.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: Dialpad key handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALPADKEYHANDLER_H
       
    19 #define DIALPADKEYHANDLER_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 class Dialpad;
       
    24 class DialpadVoiceMailboxEventFilter;
       
    25 class DialpadVideoMailboxEventFilter;
       
    26 class DialpadBluetoothEventFilter;
       
    27 class DialpadKeySequenceEventFilter;
       
    28 class DialpadEmergencyCallEventFilter;
       
    29 class DialpadHashEventFilter;
       
    30 class HbMainWindow;
       
    31 
       
    32 #ifdef BUILD_DIALPADKEYHANDLER
       
    33 #define DIALPADKEYHANDLER_EXPORT Q_DECL_EXPORT
       
    34 #else
       
    35 #define DIALPADKEYHANDLER_EXPORT Q_DECL_IMPORT
       
    36 #endif
       
    37 
       
    38 /*!
       
    39     DialpadKeyHandler
       
    40     Class provides key handling for dialpad component.
       
    41 
       
    42     @code
       
    43     Dialpad *dialpad = new Dialpad();
       
    44     DialpadKeyHandler *keyhandler = new DialpadKeyHandler(dialpad, this);
       
    45     @endcode
       
    46 */
       
    47 class DIALPADKEYHANDLER_EXPORT DialpadKeyHandler : public QObject
       
    48 {
       
    49     Q_OBJECT
       
    50 
       
    51 public:
       
    52     /*! Declares possible key event filters which can be used with the 
       
    53      * dialpad. */
       
    54     enum DialpadKeyEventFilter
       
    55     {
       
    56         /*! Enables calling to voice mailbox with a long '1' key press. */
       
    57         VoiceMailbox    = 0x0001,
       
    58         /*! Enables calling to video mailbox with a long '2' key press. */
       
    59         VideoMailBox    = 0x0002,
       
    60         /*! Enables switching bluetooth on/off with a long '*' key press. */
       
    61         Bluetooth       = 0x0004,
       
    62         /*! Enables handling of key sequences like *#06# for showing IMEI. */
       
    63         KeySequence     = 0x0008,
       
    64         /*! Forced handling for emergency call. */
       
    65         EmergencyCall   = 0x0010,
       
    66         /*! Enables and disables silent mode with a long '#' key press. */
       
    67         Hash    = 0x23
       
    68     };
       
    69     Q_DECLARE_FLAGS(DialpadKeyEventFilters, DialpadKeyEventFilter)
       
    70     
       
    71 public:
       
    72     /*! \deprecated DialpadKeyHandler(Dialpad*, HbMainWindow&, QObject*) is 
       
    73      * deprecated. 
       
    74      * Please use 
       
    75      *     DialpadKeyHandler(
       
    76      *         Dialpad*, 
       
    77      *         QFlags<DialpadKeyHandler::DialpadKeyEventFilter>, 
       
    78      *         QObject*) 
       
    79      * instead. */
       
    80     explicit DialpadKeyHandler(
       
    81         Dialpad *dialPad, 
       
    82         HbMainWindow& mainWindow, 
       
    83         QObject *parent = 0);
       
    84     
       
    85     explicit DialpadKeyHandler(
       
    86         Dialpad *dialPad, 
       
    87         DialpadKeyHandler::DialpadKeyEventFilters filters,
       
    88         QObject *parent = 0);
       
    89     virtual ~DialpadKeyHandler();
       
    90     
       
    91 private:
       
    92     HbMainWindow& mMainWindow;
       
    93     QScopedPointer<DialpadVoiceMailboxEventFilter> mVmbxFilter;
       
    94     QScopedPointer<DialpadVideoMailboxEventFilter> mVideoVmbxFilter;
       
    95     QScopedPointer<DialpadBluetoothEventFilter> mBtFilter;
       
    96     QScopedPointer<DialpadKeySequenceEventFilter> mKeySequenceFilter;
       
    97     QScopedPointer<DialpadEmergencyCallEventFilter> mEmergencyCallFilter;
       
    98     QScopedPointer<DialpadHashEventFilter> mHashFilter;
       
    99 };
       
   100 
       
   101 #endif // DIALPADKEYHANDLER_H