convergedconnectionhandler/cchclientapi/inc/cchserviceimplasynchroniser.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-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 CCHSERVICEIMPLASYNCHRONISER_H
       
    19 #define CCHSERVICEIMPLASYNCHRONISER_H
       
    20 
       
    21 #include <e32base.h>	// For CActive, link against: euser.lib
       
    22 #include <e32std.h>		// For RTimer, link against: euser.lib
       
    23 //from cchclient
       
    24 #include <cchtypes.h>
       
    25 #include "cchimpl.h"
       
    26 #include "cch.h"
       
    27 
       
    28 class CCchImpl;
       
    29 
       
    30 #ifdef CCHAPI_USE_CCHUI
       
    31 class CCchUiPrivateApi;
       
    32 #else 
       
    33 #define CCchUiPrivateApi TInt 
       
    34 #endif
       
    35 
       
    36 
       
    37 
       
    38 NONSHARABLE_CLASS ( CCchServiceImplAsynchroniser) : public CActive
       
    39     {
       
    40 public:
       
    41 
       
    42     enum TCchServiceImplState
       
    43         {
       
    44         EIdle = 0,
       
    45         EEnabling = 1,
       
    46         EDisabling = 2 
       
    47         };
       
    48     // Cancel and destroy
       
    49     ~CCchServiceImplAsynchroniser();
       
    50 
       
    51     // Two-phased constructor.
       
    52     static CCchServiceImplAsynchroniser* NewL(CCchImpl& aCch, TInt iServiceId, CCchUiPrivateApi& aCchUi);
       
    53 
       
    54     // Two-phased constructor.
       
    55     static CCchServiceImplAsynchroniser* NewLC(CCchImpl& aCch, TInt iServiceId, CCchUiPrivateApi& aCchUi);
       
    56 
       
    57     void Enable( TCCHSubserviceType aType );
       
    58     
       
    59     void Disable( TCCHSubserviceType aType );
       
    60 
       
    61 private:
       
    62     // C++ constructor
       
    63     CCchServiceImplAsynchroniser(CCchImpl& aCch, TInt iServiceId, CCchUiPrivateApi& aCchUi);
       
    64 
       
    65     // Second-phase constructor
       
    66     void ConstructL();
       
    67 
       
    68 private:
       
    69     // From CActive
       
    70     // Handle completion
       
    71     void RunL();
       
    72 
       
    73     // How to cancel me
       
    74     void DoCancel();
       
    75 
       
    76     // Override to handle leaves from RunL(). Default implementation causes
       
    77     // the active scheduler to panic.
       
    78     TInt RunError(TInt aError);
       
    79 
       
    80 private:
       
    81     CCchImpl& iCch;
       
    82     TInt iServiceId;
       
    83     CCchUiPrivateApi& iCchUi; 
       
    84     TCchServiceImplState iState;
       
    85     };
       
    86 
       
    87 #endif // CCHSERVICEIMPLASYNCHRONISER_H