logsui/logsserviceextension/inc/clogsextensioncchhandler.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 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:  Class handling CCH connection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef     C_LOGSEXTENSIONCCHHANDLER_H
       
    20 #define     C_LOGSEXTENSIONCCHHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <cchclientserver.h>
       
    24 
       
    25 #include "mlogsextensioncchhandlerobserver.h"
       
    26 
       
    27 class RCCHServer;
       
    28 class RCCHClient;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 NONSHARABLE_CLASS( CLogsExtensionCchHandler ) : public CActive
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Two-phased constructor.
       
    38      *
       
    39      * @param aObserver Observer for CCH events
       
    40      * @param aServiceId, service id to monitor
       
    41      */
       
    42     static CLogsExtensionCchHandler* NewL( 
       
    43         MLogsExtensionCchHandlerObserver* aObserver,
       
    44         TUint aServiceId );
       
    45 
       
    46     /**
       
    47      * Two-phased constructor
       
    48      *
       
    49      * @param aObserver Observer for CCH events
       
    50      * @param aServiceId, service id to monitor
       
    51      */
       
    52     static CLogsExtensionCchHandler* NewLC( 
       
    53         MLogsExtensionCchHandlerObserver* aObserver,
       
    54         TUint aServiceId );
       
    55         
       
    56     /**
       
    57      * Standard C++ destructor
       
    58      */    
       
    59     ~CLogsExtensionCchHandler();
       
    60         
       
    61     /**
       
    62      * Resolves sub service state for given service id
       
    63      *
       
    64      * @since S60 3.2
       
    65      * @param aServiceId, service id
       
    66      * @param aCchErr, service error is stored here
       
    67      */                                    
       
    68     void ResolveSubServiceState( TUint aServiceId, TInt& aCchErr );
       
    69         
       
    70 private: // From CActive
       
    71 
       
    72     /**
       
    73      * From CActive
       
    74      * Called when asynchronous event occures
       
    75      *
       
    76      * @since S60 3.2
       
    77      */
       
    78     void RunL();
       
    79 
       
    80     /**
       
    81      * From CActive
       
    82      * Called when this active object is cancelled.
       
    83      *
       
    84      * @since S60 3.2
       
    85      */
       
    86     void DoCancel();
       
    87 
       
    88     /**
       
    89      * From CActive
       
    90      * Asynchronous error
       
    91      *
       
    92      * @since S60 3.2
       
    93      * @param aError, error code
       
    94      * @return TInt, error 
       
    95      */
       
    96     TInt RunError( TInt aError );
       
    97     
       
    98 private: // Implementation
       
    99 
       
   100     /**
       
   101      * Standard C++ constructor
       
   102      */    
       
   103     CLogsExtensionCchHandler();
       
   104         
       
   105     /**
       
   106      * Performs the 2nd phase of construction.
       
   107      *
       
   108      * @param aObserver, Observer
       
   109      * @param aServiceId, serviceId
       
   110      */        
       
   111     void ConstructL( 
       
   112         MLogsExtensionCchHandlerObserver* aObserver,
       
   113         TUint aServiceId );
       
   114 
       
   115     /**
       
   116      * Gets service state
       
   117      *
       
   118      * @since S60 3.2
       
   119      * @param aServiceSelection service selection for query
       
   120      * @param aServiceState service state (result)
       
   121      * @return TInt Standard Symbian error code
       
   122      */
       
   123     TInt GetServiceState( 
       
   124         TServiceSelection aServiceSelection, 
       
   125         TCCHSubserviceState& aServiceState );
       
   126 
       
   127 private: // Data
       
   128     
       
   129     /** 
       
   130      * NOT OWNED
       
   131      */
       
   132     MLogsExtensionCchHandlerObserver* iObserver;
       
   133 
       
   134     /**
       
   135      * Own: CCH Server
       
   136      */
       
   137     RCCHServer* iCchServer;
       
   138         
       
   139     /**
       
   140      * Own: CCH Client
       
   141      */
       
   142     RCCHClient* iCchClient;
       
   143         
       
   144     /**
       
   145      * Stores service status information
       
   146      */
       
   147     TPckgBuf<TServiceStatus> iServiceStatus;
       
   148         
       
   149     /**
       
   150      * Stores service selection (ie. sub services we are
       
   151      * interested in
       
   152      */
       
   153     TServiceSelection iServiceSelection;
       
   154 
       
   155     };
       
   156 
       
   157 #endif // C_LOGSEXTENSIONCCHHANDLER_H
       
   158 
       
   159 // End of file