accessoryservices/accessoryserver/inc/Server/AccSrvHandlerBase.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  A base class for active handlers
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CACCSRVHANDLERBASE_H
       
    21 #define CACCSRVHANDLERBASE_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class MAccSrvConnectionControllerObserver;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  Base class for asynchronous handlers.
       
    41 *  Class is meant only for inheritance.
       
    42 *
       
    43 *  @lib AccServer.lib
       
    44 *  @since S60 3.1
       
    45 */
       
    46 NONSHARABLE_CLASS( CAccSrvHandlerBase ) : public CActive
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CAccSrvHandlerBase();
       
    54 
       
    55     public: // New functions
       
    56 
       
    57         /**
       
    58         * Function provided by this active object for starting asynchronous handling.
       
    59         *
       
    60         * @since S60 3.1
       
    61         * @return void
       
    62         */
       
    63         void IssueRequest();
       
    64 
       
    65     protected:  // Functions from base classes
       
    66 
       
    67         /**
       
    68         * From CActive
       
    69         * Handles an active object's request completion event.
       
    70         *
       
    71         * @since S60 3.1
       
    72         * @return void
       
    73         */
       
    74         virtual void RunL()=0;
       
    75 
       
    76         /**
       
    77         * Implements cancellation of an outstanding request.
       
    78         * This function is called as part of the active object's Cancel().
       
    79         *
       
    80         * @since S60 3.1
       
    81         * @return void
       
    82         */
       
    83         void DoCancel();
       
    84 
       
    85 
       
    86         /**
       
    87         * From CActive
       
    88         * The active scheduler calls this function if this active object's
       
    89         * RunL() function leaves.
       
    90         *
       
    91         * @since S60 3.1
       
    92         * @param aError The leave code
       
    93         * @return KErrNone, when error has been handled
       
    94         */
       
    95         virtual TInt RunError( TInt aError );
       
    96 
       
    97     protected:  // New functions
       
    98 
       
    99         /**
       
   100         * C++ default constructor.
       
   101         */
       
   102         CAccSrvHandlerBase();
       
   103 
       
   104         /**
       
   105         * Constructor with notify handling.
       
   106         */
       
   107         CAccSrvHandlerBase( MAccSrvConnectionControllerObserver* aCallback );
       
   108 
       
   109     protected:  // Functions from base classes
       
   110 
       
   111     private:
       
   112 
       
   113     public:     // Data
       
   114 
       
   115     protected:  // Data
       
   116 
       
   117         MAccSrvConnectionControllerObserver* iCallback; //not owned
       
   118 
       
   119     private:    // Data
       
   120 
       
   121     public:     // Friend classes
       
   122 
       
   123     protected:  // Friend classes
       
   124 
       
   125     private:    // Friend classes
       
   126 
       
   127 };
       
   128 
       
   129 #endif      // CACCSRVHANDLERBASE_H
       
   130 
       
   131 // End of File