phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h
changeset 12 ae8abd0db65c
child 15 d7fc66ccd6fb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
       
     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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef PSETCALLDIVERTINGWRAPPER_H_
       
    19 #define PSETCALLDIVERTINGWRAPPER_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <QList>
       
    23 #include <QStringList>
       
    24 #include <psetwrappertypes.h>
       
    25 
       
    26 // Forward declarations 
       
    27 class CPsetCallDiverting;
       
    28 class CPsetContainer;
       
    29 class PSetCallDivertingWrapperPrivate;
       
    30 class CPhCltEmergencyCall;
       
    31 class CDesC16ArrayFlat;
       
    32 class TDesC16;
       
    33 
       
    34 // Call diverting command
       
    35 class PSCallDivertingCommand
       
    36 {
       
    37 public:
       
    38     //member data
       
    39     //Divert condition
       
    40     PsCallDivertingCondition iCondition;
       
    41     //Divert setting
       
    42     PsCallDivertingSetting iSetting;
       
    43     //Divert status
       
    44     PsCallDivertingStatus iStatus;
       
    45     //Divert service group
       
    46     PsServiceGroup iServiceGroup;
       
    47     //Diverted-to number
       
    48     QString iNumber;
       
    49     //Delay time before starting diverting
       
    50     int iNoReplyTimer;
       
    51 };
       
    52 
       
    53 // Call diverting command
       
    54 class PSCallDivertingStatus
       
    55 {
       
    56 public:
       
    57     //member data
       
    58     //Divert condition
       
    59     PsCallDivertingCondition iCondition;
       
    60     // (RMobileCall::TMobileService)
       
    61     // RMobileCall::EServiceUnspecified if not available
       
    62     int iServiceGroup;
       
    63     //Divert status
       
    64     PsCallDivertingStatus iStatus;
       
    65     //Diverted-to number
       
    66     QString iNumber;
       
    67     /** The "No Reply" time-out (in seconds) registered for the call forwarding no reply 
       
    68     condition.
       
    69 
       
    70     Equals to -1 if this value is not applicable. In GSM mode, will be between 
       
    71     5 and 30 and in steps of 5 if this value is applicable. */
       
    72     int iTimeout;
       
    73 };
       
    74 
       
    75 #ifdef BUILD_PSETWRAPPER
       
    76 #define PSETWRAPPER_EXPORT Q_DECL_EXPORT
       
    77 #else
       
    78 #define PSETWRAPPER_EXPORT Q_DECL_IMPORT
       
    79 #endif
       
    80 
       
    81 class PSETWRAPPER_EXPORT PSetCallDivertingWrapper : public QObject
       
    82 {
       
    83 Q_OBJECT
       
    84 
       
    85 public:
       
    86 
       
    87     explicit PSetCallDivertingWrapper(CPsetContainer &psetContainer,
       
    88             QObject *parent = NULL);
       
    89 
       
    90     virtual ~PSetCallDivertingWrapper();
       
    91 
       
    92 public:
       
    93     // Functions (adaptees):  
       
    94 
       
    95     /**
       
    96      * Sets call diverting to the network.
       
    97      *
       
    98      * @param aSetting New settings for the call diverting.
       
    99      * @param aBsc Basic service group concerned.
       
   100      * @return  Error code.
       
   101      */
       
   102     int setCallDiverting(PSCallDivertingCommand& aSetting,
       
   103             int aBasicServiceGroup);
       
   104 
       
   105     /**
       
   106      * Checks the call diverting status from network.
       
   107      */
       
   108     void getCallDivertingStatus(const PsServiceGroup aServiceGroup,
       
   109             const PsCallDivertingCondition aCondition, int aBsc);
       
   110 
       
   111     /**
       
   112      * Cancels the call diverting-request process.
       
   113      */
       
   114     void cancelProcess();
       
   115 
       
   116     /**
       
   117      * Retrieve the default (last forwarded-to) numbers. 
       
   118      */
       
   119     void getDefaultNumbers(QStringList &aDefNumbers); // QStringList
       
   120 
       
   121     /**
       
   122      * Sets new number to the default numbers (last forwarded-to) list.
       
   123      */
       
   124     void setNewDefaultNumber(QString aNumber);
       
   125 
       
   126     /**
       
   127      * Get voicemailbox number.
       
   128      */
       
   129     void getVoiceMailBoxNumber(QString &aNumber);
       
   130 
       
   131 
       
   132 signals: // Notify via signals     
       
   133 
       
   134     void handleDivertingChanged(const PSCallDivertingCommand& aSetting,
       
   135             bool aPlural);
       
   136 
       
   137     void handleDivertingStatus(QList<PSCallDivertingStatus*>& diverList,
       
   138             bool aPlural);
       
   139 
       
   140     void handleDivertingError(int aReason);
       
   141 
       
   142     void handleCFRequesting(bool aOngoing, bool aInterrupted);
       
   143     
       
   144     void requestDone();
       
   145 
       
   146 private:
       
   147     
       
   148     int validateDivertNumber(const TDesC16& aDivertTo) const;
       
   149     bool findPlus(const TDesC16& aDivertTo) const;
       
   150 
       
   151 private:
       
   152     // Data: 
       
   153     // Phone setting handlers, own
       
   154     CPsetCallDiverting* m_psetCallDiverting;
       
   155 
       
   156     // Owned: Phone client emergency number session.
       
   157     CPhCltEmergencyCall* m_emergencyCall;
       
   158 
       
   159     // Own
       
   160     CDesC16ArrayFlat* m_DefaultNumberListCDes;
       
   161     QStringList m_DefaultnumberListQSList;
       
   162 
       
   163     // Own
       
   164     PSetCallDivertingWrapperPrivate* m_Priv;
       
   165     friend class PSetCallDivertingWrapperPrivate;
       
   166 };
       
   167 
       
   168 #endif /* PSETCALLDIVERTINGWRAPPER_H_ */