phoneapp/phoneuiqtviewadapter/inc/phonenotecontroller.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:  Handles phone notes.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PHONENOTECONTROLLER_H
       
    19 #define PHONENOTECONTROLLER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QString>
       
    23 #include "tphonecmdparamnote.h"
       
    24 #include "phoneaction.h"
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 class TPhoneCommandParam;
       
    28 class TPhoneCmdParamQuery;
       
    29 class HbDeviceMessageBox;
       
    30 class HbDeviceProgressDialog;
       
    31 class HbProgressNote;
       
    32 class HbMessageBox;
       
    33 class HbAction;
       
    34 class QSignalMapper;
       
    35 class QTimer;
       
    36 
       
    37 
       
    38 class PhoneNoteController : public QObject
       
    39 {
       
    40     Q_OBJECT
       
    41     
       
    42 public:
       
    43 
       
    44     /*!
       
    45         \fn PhoneNoteController (QObject *parent)
       
    46     */
       
    47     PhoneNoteController(QObject *parent = 0);
       
    48         
       
    49     /*!
       
    50         Destructor
       
    51      */
       
    52     virtual ~PhoneNoteController ();
       
    53     
       
    54     /*!
       
    55         \fn void showGlobalNote ()
       
    56         
       
    57         This method shows global note.
       
    58 
       
    59     */
       
    60     void showGlobalNote(TPhoneCommandParam *commandParam);
       
    61 
       
    62     /*!
       
    63         \fn void showNote ()
       
    64         
       
    65         This method shows a note.
       
    66 
       
    67     */
       
    68     void showNote(TPhoneCommandParam *commandParam);
       
    69     
       
    70     /*!
       
    71         \fn void showNote ()
       
    72         
       
    73         This method shows a query.
       
    74 
       
    75     */
       
    76     void showQuery(TPhoneCommandParam *commandParam);
       
    77     
       
    78     /*!
       
    79         \fn void removeDtmfNote ()
       
    80         
       
    81         This method removes dtmf note.
       
    82 
       
    83     */
       
    84     void removeDtmfNote();
       
    85     
       
    86     /*!
       
    87         \fn void removeNote()
       
    88         
       
    89         This method removes notes.
       
    90 
       
    91     */
       
    92     void removeNote();
       
    93     
       
    94     /*!
       
    95         \fn void removeQuery()
       
    96         
       
    97         This method removes queries.
       
    98 
       
    99     */
       
   100     void removeQuery();
       
   101     
       
   102     /*!
       
   103         \fn void removeGlobalWaitNote()
       
   104         
       
   105         This method removes global wait note.
       
   106 
       
   107     */
       
   108     void removeGlobalWaitNote();
       
   109     
       
   110 signals:
       
   111 
       
   112     /*!
       
   113         \fn void command(int command)
       
   114         
       
   115         This signal is emitted when note action is handled.
       
   116     */
       
   117     void command (int command);
       
   118     
       
   119 private slots:
       
   120 
       
   121     /*!
       
   122         \fn void destroyDialog ()
       
   123         
       
   124         Slot is called when global note is closed.
       
   125     
       
   126     */
       
   127     void destroyDialog();
       
   128 
       
   129     /*!
       
   130         \fn void removeMappings ()
       
   131         
       
   132         Slot is called when note or query is closed.
       
   133     
       
   134     */
       
   135     void removeMappings();
       
   136     
       
   137     /*!
       
   138         \fn void queryCancelled ()
       
   139         
       
   140         Slot is called when query is canceled.
       
   141     
       
   142     */
       
   143     void queryCancelled();
       
   144   
       
   145     /*!
       
   146         \fn void queryTimeout ()
       
   147         
       
   148         Slot is called when query timeout expires.
       
   149     
       
   150     */
       
   151     void queryTimeout();
       
   152     
       
   153 private:
       
   154 
       
   155     /*!
       
   156         \fn QString globalNoteText()
       
   157         
       
   158         This method returns text for global note.
       
   159     */
       
   160     QString globalNoteText(TPhoneCommandParam *commandParam);
       
   161     
       
   162     
       
   163     /*!
       
   164         \fn void showDtmfNote()
       
   165         
       
   166         This method shows dtmf sending note.
       
   167     */
       
   168     void showDtmfNote(TPhoneCmdParamNote* noteParam);
       
   169     
       
   170     /*!
       
   171         \fn void showDefaultQuery()
       
   172         
       
   173         This method shows default query.
       
   174     */
       
   175     void showDefaultQuery(TPhoneCmdParamQuery* params);
       
   176 
       
   177     /*!
       
   178         \fn void showDefaultQuery()
       
   179         
       
   180         This method shows global wait note.
       
   181     */
       
   182     void showGlobalWaitNote(TPhoneCmdParamQuery* params);
       
   183     
       
   184 private:
       
   185 
       
   186     QTimer *m_timer;
       
   187     QList<HbDeviceMessageBox *> m_messageBoxList;
       
   188     HbDeviceProgressDialog *m_progressDialog;
       
   189     HbProgressNote *m_dtmfNote;
       
   190     HbMessageBox *m_queryNote;
       
   191     QSignalMapper *m_signalMapper;
       
   192     QList<HbAction*> m_actions;
       
   193     int m_queryCanceledCommand;
       
   194     int m_timeoutCommand;
       
   195     
       
   196 };
       
   197 
       
   198 #endif // PHONENOTECONTROLLER_H