localconnectivityservice/locod/inc/locodserviceman.h
branchRCL_3
changeset 19 0aa8cc770c8a
equal deleted inserted replaced
18:453dfc402455 19:0aa8cc770c8a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Defines the service manager class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef T_LOCODSERVICEMAN_H
       
    20 #define T_LOCODSERVICEMAN_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <cenrepnotifyhandler.h>          
       
    24 #include <CoreApplicationUIsSDKCRKeys.h>
       
    25 #include <startupdomainpskeys.h>
       
    26 #include <locodbearerpluginobserver.h>
       
    27 #include <locodservicepluginobserver.h>
       
    28 
       
    29 class CLocodService;
       
    30 
       
    31 /**
       
    32  *  The service plugin manager.
       
    33  *
       
    34  *  It loads, unloads service plugins on demand and manages a service availability
       
    35  *  according to bearer status.
       
    36  *  @euser.lib
       
    37  *  @since S60 v3.2
       
    38  */
       
    39 class CLocodServiceMan : 
       
    40     public CActive, 
       
    41     public MLocodBearerPluginObserver, 
       
    42     public MLocodServicePluginObserver
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      *  Factory method, leave the object in cleanupstack.
       
    48      *
       
    49      *  @lib ?library
       
    50      *  @since S60 v3.2
       
    51      */
       
    52     static CLocodServiceMan* NewL();
       
    53 
       
    54     ~CLocodServiceMan();
       
    55 
       
    56 public:
       
    57 
       
    58 private:
       
    59     
       
    60     // From CActive
       
    61     
       
    62     void RunL();
       
    63     
       
    64     void DoCancel();
       
    65     
       
    66     TInt RunError(TInt aReason);
       
    67 
       
    68 private:
       
    69 
       
    70     // From MLocodBearerPluginObserver
       
    71     /**
       
    72      * This is a callback function used by the plugins to inform when the
       
    73      * bearer's availability changes.
       
    74      *
       
    75      * @since S60 v3.2
       
    76      * @param  aBearer the bearer which calls this nothification
       
    77      * @param  aStatus the status of this bearer, ETrue if it is available;
       
    78      *                 EFalse otherwise.
       
    79      */
       
    80     void NotifyBearerStatus(TLocodBearer aBearer, 
       
    81         TBool aStatus);
       
    82         
       
    83     // From MLocodServicePluginObserver
       
    84     /**
       
    85      * This is a callback function used by the plugins to inform when
       
    86      * managing the service have completed.  The parameters passed should be
       
    87      * identical to the ones used when the plugin's ManageService() was called,
       
    88      * plus this service plugin's implemnetation UID and the completion status.
       
    89      *
       
    90      * @since  S60 v3.2
       
    91      * @param  aBearer the bearer identification passed in ManageService()
       
    92      * @param  aStatus the status of this bearer passed in ManageService()
       
    93      * @param  aServiceImplUid, the implementation UID of this service plugin.
       
    94      * @param  err     KErrNone if the operation succeeded; otherwise a Symbian
       
    95      *                 error code.
       
    96      */
       
    97     void ManageServiceCompleted(TLocodBearer aBearer, 
       
    98         TBool aStatus,
       
    99         TUid aServiceImplUid,
       
   100         TInt err);
       
   101 
       
   102 private:
       
   103 
       
   104     CLocodServiceMan();
       
   105 
       
   106     void ConstructL();
       
   107     
       
   108     void LoadServicesL();    
       
   109 
       
   110 private: // data
       
   111     RPointerArray<CLocodService> iServices;
       
   112     TInt iBearerStatus;
       
   113     TUid iUidDun;  // DUN id
       
   114     };
       
   115 
       
   116 
       
   117 #endif // T_LOCODSERVICEMAN_H