callcontinuity/vcchotrigger/inc/vcchotrigger.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:   Definition of the class which handles handover triggering.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_VCCHOTRIGGER_H
       
    21 #define C_VCCHOTRIGGER_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <wlanmgmtcommon.h>
       
    27 
       
    28 #include "vccsignallevelobserver.h"
       
    29 #include "vcccchobserver.h"
       
    30 #include "vcchopolicy.h"
       
    31 #include "vccunittesting.h"
       
    32 
       
    33 class CVccUiPsProperty;
       
    34 class CVccWlanSignalLevelHandler;
       
    35 class CVccGsmSignalLevelHandler;
       
    36 class CVccHoPolicyReader;
       
    37 class CVccCchMonitor;
       
    38 class CVccEngPsProperty;
       
    39 class CVccPerformer;
       
    40 
       
    41 /**
       
    42  *  This class handles the triggering of the handover from
       
    43  *  one network to another.
       
    44  *
       
    45  *
       
    46  *  @code
       
    47  *   CMyClass::ConstructL()
       
    48  *       {
       
    49  *       iHoTrigger = CVccHoTrigger::NewL();
       
    50  *       }
       
    51  *
       
    52  *   CMyClass::FunctionL()
       
    53  *       {
       
    54  *       iHoTrigger->Start();
       
    55  *       }
       
    56  *
       
    57  *   CMyClass::DomainChanged()
       
    58  *       {
       
    59  *       // Use swapped the domain of an active call
       
    60  *       iHoTrigger->SetCurrentDomain( iActiveCallDomain );
       
    61  *       }
       
    62  *
       
    63  *   CMyClass::CallPutToHold()
       
    64  *       {
       
    65  *       // Stop all network monitoring.
       
    66  *       iHoTrigger->Stop();
       
    67  *       }
       
    68  *
       
    69  *   CMyClass::CallActivated()
       
    70  *       {
       
    71  *       // Start all network monitors
       
    72  *       iHoTrigger->Start();
       
    73  *       }
       
    74  *
       
    75  *   CMyClass::~CMyClass()
       
    76  *       {
       
    77  *       delete iHoTrigger;
       
    78  *       }
       
    79  *
       
    80  *  @endcode
       
    81  *
       
    82  *  @lib vcchotrigger.lib
       
    83  *  @since S60 v3.2
       
    84  */
       
    85 class CVccHoTrigger : public CBase,
       
    86                       public MVccSignalLevelObserver,
       
    87                       public MVccCchObserver
       
    88     {
       
    89 
       
    90 public:
       
    91 
       
    92 
       
    93     /** Domain types */
       
    94     enum TCallDomainType
       
    95         {
       
    96         /** PS domain */
       
    97         ECallDomainTypePS,
       
    98         /** CS domain */
       
    99         ECallDomainTypeCS
       
   100         };
       
   101 
       
   102 
       
   103     /**
       
   104      * Two-phased constructor.
       
   105      */
       
   106     IMPORT_C static CVccHoTrigger* NewL();
       
   107 
       
   108     /**
       
   109      * Destructor.
       
   110      */
       
   111     virtual ~CVccHoTrigger();
       
   112 
       
   113 
       
   114     /**
       
   115      * Stop all network monitors
       
   116      *
       
   117      * @since S60 v3.2
       
   118      */
       
   119     IMPORT_C void Stop();
       
   120     
       
   121     /**
       
   122      * Stop all network monitors
       
   123      *
       
   124      * @since S60 v3.2
       
   125      */
       
   126     IMPORT_C void Stop( CVccPerformer& aStopper );
       
   127 
       
   128     /**
       
   129      * Start all network monitors
       
   130      *
       
   131      * @since S60 v3.2
       
   132      */
       
   133     IMPORT_C void Start( CVccPerformer& aWhoStartedMe, TBool aCsOriginated );
       
   134 
       
   135     /**
       
   136      * Set the current domain of the active call
       
   137      *
       
   138      * @since S60 v3.2
       
   139      * @param aDomainType is the domain of the current (active) call.
       
   140      */
       
   141     IMPORT_C void SetCurrentDomainType( TCallDomainType aDomainType );
       
   142 
       
   143     /**
       
   144      * Set the preferred domain of the active call
       
   145      * 
       
   146      * @since S60 v3.2
       
   147      * @param aDomainType is the callīs preferred domain type.
       
   148      */
       
   149     IMPORT_C void SetPreferredDomainType( TVccHoPolicyPreferredDomain aDomainType );
       
   150 
       
   151     
       
   152     /**
       
   153      * Set immediate domain transfer setting
       
   154      * 
       
   155      * @since S60 v3.2
       
   156      * @param aDomainType is the callīs preferred domain type.
       
   157      */
       
   158     IMPORT_C void SetImmediateDomainTransfer( TBool aImmediateDT );
       
   159         
       
   160 // from base class MVccSignalLevelObserver
       
   161 
       
   162     /**
       
   163      * @see MVccSignalLevelObserver::WlanSignalChanged()
       
   164      */
       
   165     void WlanSignalChanged( TInt32 aSignalStrength,
       
   166             TSignalStrengthClass aClass );
       
   167 
       
   168     /**
       
   169      * @see MVccSignalLevelObserver::GsmSignalChanged()
       
   170      */
       
   171     void GsmSignalChanged( TInt32 aSignalStrength,
       
   172             TSignalStrengthClass aClass );
       
   173 
       
   174 // from base class MVccCchMonitorObserver
       
   175 
       
   176     /**
       
   177      * @see MVccCchMonitorObserver::CchServiceStatusChanged
       
   178      */
       
   179     void CchServiceStatusChanged( TServiceStatus aStatus );
       
   180     
       
   181 public:
       
   182     /**
       
   183      * When manual handover is started no automatic handovers should
       
   184      * be made.
       
   185      *
       
   186      * @since S60 3.2
       
   187      */
       
   188     IMPORT_C void ManualHoCallStarted();
       
   189 
       
   190     /**
       
   191      * After manual handover call has been released, automatic
       
   192      * handovers can be made again.
       
   193      *
       
   194      * @since S60 3.2
       
   195      */
       
   196     IMPORT_C void ManualHoCallReleased();
       
   197 
       
   198     /**
       
   199      * During conference call HO is not allowed
       
   200      *
       
   201      * @since S60 3.2
       
   202      */
       
   203     IMPORT_C void HoNotAllowedL();
       
   204     
       
   205     /**
       
   206      * After conference call HO is allowed again
       
   207      *
       
   208      * @since S60 3.2
       
   209      */
       
   210     IMPORT_C void HoAllowed();
       
   211     
       
   212     /**
       
   213      * Reads the settings to get the info if ho is allowed when cs originated call
       
   214      * @since s60 3.2
       
   215      */
       
   216     IMPORT_C void ReadHoAllowedWhenCsOriginatedSettingL();
       
   217     
       
   218 private:
       
   219 
       
   220     /**
       
   221      * C++ constructor
       
   222      *
       
   223      * @since S60 v3.2
       
   224      */
       
   225     CVccHoTrigger();
       
   226 
       
   227     /**
       
   228      * Symbian second-phase constructor
       
   229      *
       
   230      * @since S60 v3.2
       
   231      */
       
   232     void ConstructL();
       
   233     
       
   234     /**
       
   235      * Check if PS or CS are available (to do handover).
       
   236      * 
       
   237      * @since S60 v3.2
       
   238      * @return ETrue if service is available, else return EFalse
       
   239      */
       
   240     TBool ServicesAvailable();
       
   241     
       
   242     /**
       
   243      * Update (write) service status state to P&S.
       
   244      * 
       
   245      * @since S60 v3.2
       
   246      */
       
   247     void UpdatePsKeysL();
       
   248 
       
   249     /**
       
   250      * Initiates the actual handover if its ok to start ho.
       
   251      * 
       
   252      * @since S60 v3.2
       
   253      */
       
   254     void TriggerHo();
       
   255     
       
   256     /**
       
   257      * Initiate immediate ho.
       
   258      * 
       
   259      * @since S60 v3.2
       
   260      * @return ETrue if immediate HO was initiated, EFalse otherwise
       
   261      */
       
   262     TBool DoImmediateHo();
       
   263 
       
   264 private: // data
       
   265 
       
   266 
       
   267     /**
       
   268      * VCC P&S key manager for UI side
       
   269      * Own.
       
   270      */
       
   271     CVccUiPsProperty* iProperty;
       
   272     
       
   273     /**
       
   274      * PS property writer to write TVccHoStatus values
       
   275      * Own.
       
   276      */
       
   277     CVccEngPsProperty* iEngPsProperty;
       
   278 
       
   279     /**
       
   280      * VCC Wlan signal level observer
       
   281      * Own.
       
   282      */
       
   283     CVccWlanSignalLevelHandler* iWlanSignalLevelHandler;
       
   284 
       
   285     /**
       
   286      * VCC GSM signal level observer
       
   287      * Own.
       
   288      */
       
   289     CVccGsmSignalLevelHandler* iGsmSignalLevelHandler;
       
   290 
       
   291     /**
       
   292      * Call domain type
       
   293      */
       
   294     TCallDomainType iDomainType;
       
   295 
       
   296 
       
   297     /**
       
   298      * GSM signal class
       
   299      */
       
   300     TSignalStrengthClass iGsmClass;
       
   301 
       
   302     /**
       
   303      * Previous GSM signal class
       
   304      */
       
   305     TSignalStrengthClass iPreviousGsmClass;
       
   306     
       
   307     /**
       
   308      * WLAN signal class.
       
   309      */
       
   310     TSignalStrengthClass iWlanClass;
       
   311     
       
   312     /**
       
   313      * Previous WLAN signal class.
       
   314      */
       
   315     TSignalStrengthClass iPreviousWlanClass;
       
   316     
       
   317     /**
       
   318      * CenRep reader for VCC HO policy
       
   319      * Own.
       
   320      */
       
   321     CVccHoPolicyReader* iHoPolicyReader;
       
   322     
       
   323     /** VCC HO policy */
       
   324     TVccHoPolicy iPolicy;
       
   325     
       
   326     /**
       
   327      * CCH monitor.
       
   328      * Own
       
   329      */
       
   330     CVccCchMonitor* iCchMonitor;
       
   331     
       
   332     /**
       
   333      * CCH status (PS service availability)
       
   334      */
       
   335     MVccCchObserver::TServiceStatus iCchServiceStatus;
       
   336     
       
   337     /**
       
   338      * CS status (i.e. signal level)
       
   339      */
       
   340     TInt iCsSignalLevel;
       
   341     
       
   342     /**
       
   343      * Are we stopped or active (i.e. monitoring)
       
   344      */
       
   345     TBool iStarted;
       
   346     
       
   347     /**
       
   348      * Has manual ho been made
       
   349      */
       
   350     TBool iManualHoDone;
       
   351     
       
   352     /**
       
   353      * Ho allowed or not (conference, video, data, multimedia sharing)
       
   354      */
       
   355     TBool iHoNotAllowed;
       
   356     
       
   357     /**
       
   358      * Performer that started trigger
       
   359      * Not own.
       
   360      */
       
   361     CVccPerformer* iWhoStartedMe;
       
   362     
       
   363     /*
       
   364      * Is ho allowed if the originating domain of the 
       
   365      * original call was CS
       
   366      */
       
   367     TBool iHoAllowedIfCsOriginated;
       
   368     
       
   369     friend class T_CVccPerformer;
       
   370     
       
   371     VCC_UNITTEST( UT_CVccHoTrigger )
       
   372     };
       
   373 
       
   374 #endif //  C_VCCHOTRIGGER_H