phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertquery.h
changeset 72 c76a0b1755b9
equal deleted inserted replaced
64:6aaf0276100e 72:c76a0b1755b9
       
     1 /*
       
     2  * cpdivertquery.h
       
     3  *
       
     4  *  Created on: Aug 10, 2010
       
     5  *      Author: jahelaak
       
     6  */
       
     7 
       
     8 #ifndef CPDIVERTQUERY_H_
       
     9 #define CPDIVERTQUERY_H_
       
    10 
       
    11 #include <qobject.h>
       
    12 #include <psetcalldivertingwrapper.h>
       
    13 
       
    14 class HbAction;
       
    15 class QString;
       
    16 class HbListWidget;
       
    17 class HbDialog;
       
    18 
       
    19 class CpDivertQuery : public QObject
       
    20 {
       
    21     Q_OBJECT
       
    22     
       
    23     // Activate divert phases
       
    24     enum ActivateDivertPhases
       
    25     {
       
    26         NonePhase,
       
    27         PopUpVoiceNumberListQueryPhase,
       
    28         PopUpTimerQueryPhase
       
    29     };
       
    30     
       
    31 public:
       
    32     CpDivertQuery(PSetCallDivertingWrapper &callDivertingWrapper);
       
    33     virtual ~CpDivertQuery();
       
    34     
       
    35     
       
    36     void show(
       
    37             const QString &heading,
       
    38             PSCallDivertingCommand command,
       
    39             bool needTimeOutInfo);
       
    40     
       
    41 signals:
       
    42     void result(PSCallDivertingCommand &command);
       
    43     void cancelled(PSCallDivertingCommand &command);
       
    44     void handleDivertingError(int aReason);
       
    45     
       
    46 private slots:
       
    47     void voiceNumberListQueryClosed(HbAction* action);
       
    48     void popUpNumberEditorClosed(HbAction* action);
       
    49     void popUpTimerQueryClosed(HbAction* action);
       
    50 
       
    51 private:
       
    52     /**
       
    53      Show to user divert number query list.
       
    54      */
       
    55     void popUpVoiceNumberListQuery(
       
    56             const QString& heading, PsServiceGroup serviceGroup);
       
    57     
       
    58     /**
       
    59      Show to user number query.
       
    60      */
       
    61     void popUpNumberEditor(const QString& heading);
       
    62     
       
    63     /**
       
    64      Show to user divert time out query list.
       
    65      */
       
    66     void popUpTimerQuery();
       
    67     
       
    68     
       
    69     void nextPhaseForActivateDivert(bool ok);
       
    70     
       
    71 private:
       
    72     
       
    73     /**
       
    74      Creates dialog with default parameters
       
    75      */
       
    76     HbDialog* createDialog( const QString& heading ) const;
       
    77 
       
    78     /**
       
    79      Adds item to given list widget
       
    80      */
       
    81     void addItemToListWidget(HbListWidget* w,
       
    82         const QString& item, const QString& data) const;
       
    83 
       
    84     /**
       
    85      Adds item to given list widget
       
    86      */
       
    87     void addItemToListWidget(HbListWidget* w,
       
    88         const QString& item, const int& data) const;
       
    89     
       
    90 private:
       
    91     PSetCallDivertingWrapper &m_callDivertingWrapper;
       
    92     ActivateDivertPhases m_activateDivertPhase;
       
    93     PSCallDivertingCommand m_divertCommand;
       
    94     bool m_needTimeOutInfo;
       
    95     HbDialog *m_dialog;
       
    96 };
       
    97 
       
    98 #endif /* CPDIVERTQUERY_H_ */