cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h
changeset 20 9c97ad6591ae
child 23 7ec726f93df1
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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 * Cache side object representing a connection method.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CMMCONNMETHODSTRUCT_H_
       
    21 #define CMMCONNMETHODSTRUCT_H_
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "cmmserverdefs.h"
       
    26 
       
    27 class CCmmConnMethodInstance;
       
    28 class CCmPluginBaseEng;
       
    29 
       
    30 
       
    31 /**
       
    32  * TODO
       
    33  */
       
    34 NONSHARABLE_CLASS( CCmmConnMethodStruct ) : public CBase
       
    35     {
       
    36 public:
       
    37     static CCmmConnMethodStruct* NewL( const TUint32& aConnMethodId );
       
    38     static CCmmConnMethodStruct* NewLC( const TUint32& aConnMethodId );
       
    39     ~CCmmConnMethodStruct();
       
    40 
       
    41 private:
       
    42     CCmmConnMethodStruct( TUint32 aConnMethodId );
       
    43     void ConstructL();
       
    44 
       
    45 public:
       
    46     /**
       
    47      * Return the reference count.
       
    48      */
       
    49     TInt GetReferenceCounter();
       
    50 
       
    51     /**
       
    52      * Increase the reference counter by one.
       
    53      */
       
    54     void IncrementReferenceCounter();
       
    55 
       
    56     /**
       
    57      * Return the connection method ID.
       
    58      */
       
    59     TUint32 GetId() const;
       
    60 
       
    61     /**
       
    62      * Set the connection method ID.
       
    63      */
       
    64     void SetId( const TUint32& aConnMethodId );
       
    65 
       
    66     /**
       
    67      * Return bearer type.
       
    68      */
       
    69     TUint32 GetBearerType() const;
       
    70 
       
    71     /**
       
    72      * Gets the current status of this connection method struct.
       
    73      */
       
    74     TCmmConnMethodStatus GetStatus() const;
       
    75 
       
    76     /**
       
    77      * Sets a new status value.
       
    78      */
       
    79     void SetStatus( const TCmmConnMethodStatus& aStatus );
       
    80 
       
    81     /**
       
    82      * TODO
       
    83      * 
       
    84      */
       
    85     void RefreshConnMethodInstanceL(
       
    86             CCmmConnMethodInstance& aConnMethodInstance );
       
    87 
       
    88     /**
       
    89      * Decrease the reference counter by one. Return the remaining number of
       
    90      * references.
       
    91      */
       
    92     TInt SessionInstanceClosed(); //TODO, rename to ConnMethodInstanceClosed ?
       
    93 
       
    94     /**
       
    95      * Set the connection method plugin. Updates status and sets reference
       
    96      * counter to 1.
       
    97      */
       
    98     void SetPlugin(
       
    99             CCmPluginBaseEng* aPlugin,
       
   100             TUint32 aBearerType,
       
   101             TCmmConnMethodStatus aStatus );
       
   102 
       
   103     /**
       
   104      * Returns the connection method plugin.
       
   105      */
       
   106     CCmPluginBaseEng* GetPlugin();
       
   107 
       
   108     /**
       
   109      * Called after this connection method has been updated and database
       
   110      * transaction has completed successfully. Sets the internal state of this
       
   111      * connection method structure to reflect the new valid state.
       
   112      */
       
   113     void UpdateSuccessful();
       
   114 
       
   115     /**
       
   116      * Called after this connection method has been deleted and database
       
   117      * transaction has completed successfully. Sets the internal state of this
       
   118      * connection method structure to reflect the new deleted state.
       
   119      */
       
   120     void DeleteSuccessful( const TUint32& aNewSecondaryId );
       
   121 
       
   122 private:
       
   123     // The connection method plugin.
       
   124     CCmPluginBaseEng* iConnMethodPlugin; // Owned.
       
   125 
       
   126     // Total number of handles that the clients have to this connection method.
       
   127     TInt iReferenceCounter;
       
   128 
       
   129     // Connection method ID.
       
   130     // For new connection methods, while no valid database ID is available,
       
   131     // will be assigned a temporary ID that will have a value above
       
   132     // above KTemporaryIdCounterStart.
       
   133     TUint32 iConnMethodId;
       
   134 
       
   135     // Connection method bearer type.
       
   136     TUint32 iBearerType;
       
   137 
       
   138     // Current status of this connection method.
       
   139     TCmmConnMethodStatus iStatus;
       
   140 
       
   141     //TODO
       
   142     //TCmmRecordStatus iRecordStatus;
       
   143     };
       
   144 
       
   145 #endif // CMMCONNMETHODSTRUCT_H_
       
   146 
       
   147 // End of file