phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     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     //Divert service group
       
    61     PsServiceGroup iServiceGroup;
       
    62     //Divert status
       
    63     PsCallDivertingStatus iStatus;
       
    64     //Diverted-to number
       
    65     QString iNumber;
       
    66     /** The "No Reply" time-out (in seconds) registered for the call forwarding no reply 
       
    67     condition.
       
    68 
       
    69     Equals to -1 if this value is not applicable. In GSM mode, will be between 
       
    70     5 and 30 and in steps of 5 if this value is applicable. */
       
    71     int iTimeout;
       
    72 };
       
    73 
       
    74 #ifdef BUILD_PSETWRAPPER
       
    75 #define PSETWRAPPER_EXPORT Q_DECL_EXPORT
       
    76 #else
       
    77 #define PSETWRAPPER_EXPORT Q_DECL_IMPORT
       
    78 #endif
       
    79 
       
    80 class PSETWRAPPER_EXPORT PSetCallDivertingWrapper : public QObject
       
    81 {
       
    82 Q_OBJECT
       
    83 
       
    84 public:
       
    85 
       
    86     explicit PSetCallDivertingWrapper(CPsetContainer &psetContainer,
       
    87             QObject *parent = NULL);
       
    88 
       
    89     virtual ~PSetCallDivertingWrapper();
       
    90 
       
    91 public:
       
    92     // Functions (adaptees):  
       
    93 
       
    94     /**
       
    95      * Sets call diverting to the network.
       
    96      *
       
    97      * @param aSetting New settings for the call diverting.
       
    98      * @param aBsc Basic service group concerned.
       
    99      * @return  Error code.
       
   100      */
       
   101     int setCallDiverting(PSCallDivertingCommand& aSetting,
       
   102             int aBasicServiceGroup);
       
   103 
       
   104     /**
       
   105      * Checks the call diverting status from network.
       
   106      */
       
   107     void getCallDivertingStatus(const PsServiceGroup aServiceGroup,
       
   108             const PsCallDivertingCondition aCondition, int aBsc);
       
   109 
       
   110     /**
       
   111      * Cancels the call diverting-request process.
       
   112      */
       
   113     void cancelProcess();
       
   114 
       
   115     /**
       
   116      * Retrieve the default (last forwarded-to) numbers. 
       
   117      */
       
   118     void getDefaultNumbers(QStringList &aDefNumbers); // QStringList
       
   119 
       
   120     /**
       
   121      * Sets new number to the default numbers (last forwarded-to) list.
       
   122      */
       
   123     void setNewDefaultNumber(QString aNumber);
       
   124 
       
   125     /**
       
   126      * Get voicemailbox number.
       
   127      * @param aNumber empty if not set
       
   128      * @return -1 if not supported
       
   129      */
       
   130     int getVoiceMailBoxNumber(QString &aNumber, PsService aService);
       
   131     
       
   132     /**
       
   133      * Query voicemailbox number.
       
   134      * @param aNumber empty if not set
       
   135      * @return -1 if not supported
       
   136      */
       
   137     int queryVoiceMailBoxNumber(QString &aNumber, PsService aService);
       
   138 
       
   139     /**
       
   140      * Get CPsetCallDiverting reference.
       
   141      */
       
   142     CPsetCallDiverting & getCPsetCallDiverting() const;
       
   143 
       
   144 signals: // Notify via signals     
       
   145 
       
   146     void handleDivertingChanged(const PSCallDivertingCommand& aSetting,
       
   147             bool aPlural);
       
   148 
       
   149     void handleDivertingStatus(QList<PSCallDivertingStatus*>& diverList,
       
   150             bool aPlural);
       
   151 
       
   152     void handleDivertingError(int aReason);
       
   153 
       
   154     void handleCFRequesting(bool aOngoing, bool aInterrupted);
       
   155     
       
   156     void requestDone();
       
   157 
       
   158 private:
       
   159     
       
   160     int validateDivertNumber(const TDesC16& aDivertTo) const;
       
   161     bool findPlus(const TDesC16& aDivertTo) const;
       
   162 
       
   163 private:
       
   164     // Data: 
       
   165     // Phone setting handlers, own
       
   166     CPsetCallDiverting* m_psetCallDiverting;
       
   167 
       
   168     // Owned: Phone client emergency number session.
       
   169     CPhCltEmergencyCall* m_emergencyCall;
       
   170 
       
   171     // Own
       
   172     CDesC16ArrayFlat* m_DefaultNumberListCDes;
       
   173     QStringList m_DefaultnumberListQSList;
       
   174 
       
   175     // Own
       
   176     PSetCallDivertingWrapperPrivate* m_Priv;
       
   177     friend class PSetCallDivertingWrapperPrivate;
       
   178 };
       
   179 
       
   180 #endif /* PSETCALLDIVERTINGWRAPPER_H_ */