phoneapp/phoneuiqtviewadapter/inc/phoneuiqtbuttonscontroller.h
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*!
       
     2 * Copyright (c) 2009 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:  Buttons controller for storing and getting
       
    15 *               buttons' states
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef PHONEUIQTBUTTONSCONTROLLER_H
       
    20 #define PHONEUIQTBUTTONSCONTROLLER_H
       
    21 
       
    22 #include <QObject>
       
    23 
       
    24 class PhoneUIQtButtonsController : public QObject
       
    25 {
       
    26     Q_OBJECT
       
    27 
       
    28 public:
       
    29     
       
    30     enum PhoneButtonFlag
       
    31     {
       
    32         Hold            = 0x02, // Hold
       
    33         Ihf             = 0x04, // Ihf
       
    34         Wired           = 0x08, // Wired
       
    35         Btaa            = 0x10  // Btaa
       
    36     };
       
    37     Q_DECLARE_FLAGS(PhoneButtonFlags, PhoneButtonFlag)
       
    38 
       
    39     /**
       
    40      * Constructor
       
    41      */
       
    42     PhoneUIQtButtonsController ();
       
    43 
       
    44     /**
       
    45      * Destructor
       
    46      */
       
    47     virtual ~PhoneUIQtButtonsController ();
       
    48 
       
    49     /*!
       
    50         \fn void PhoneUIQtButtonsController::setButtonFlags (PhoneButtonFlags flag,bool set)
       
    51         
       
    52         This method is called when audio path or hold status is changed
       
    53     */
       
    54     void setButtonFlags (PhoneButtonFlags flag,bool set);
       
    55 
       
    56     /*!
       
    57         \fn bool PhoneUIQtButtonsController::getButtonFlags (PhoneButtonFlags flag)
       
    58         
       
    59         This method is called when audio path or hold status is enquired
       
    60     */
       
    61     inline bool getButtonFlags (PhoneButtonFlags flag) {return m_buttonFlags & flag;};
       
    62 
       
    63 private:
       
    64     PhoneButtonFlags m_buttonFlags;
       
    65 };
       
    66 
       
    67 Q_DECLARE_OPERATORS_FOR_FLAGS(PhoneUIQtButtonsController::PhoneButtonFlags)
       
    68 
       
    69 #endif // PHONEUIQTBUTTONSCONTROLLER_H