omadmadapters/connmoadapter/inc/ConnMoAdapter.h
changeset 45 0f9fc722d255
parent 44 137912d1a556
equal deleted inserted replaced
44:137912d1a556 45:0f9fc722d255
       
     1 /*
       
     2 * ==============================================================================
       
     3 *  Name        : ConnMoAdapter.h
       
     4 *  Part of     : ConnMoAdapter
       
     5 *  Interface   : ecom / ConnMOAdapter
       
     6 *  Description : Connection Management Object
       
     7 *  Version     : $Revision: 61 $ $Modtime: 29.09.05 8:17 $
       
     8 *
       
     9 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
    10 * All rights reserved.
       
    11 * This component and the accompanying materials are made available
       
    12 * under the terms of "Eclipse Public License v1.0"
       
    13 * which accompanies this distribution, and is available
       
    14 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    15 *
       
    16 * Initial Contributors:
       
    17 * Nokia Corporation - initial contribution.
       
    18 *
       
    19 * Contributors:
       
    20 * 
       
    21 * Description:
       
    22 *
       
    23 * ==============================================================================
       
    24 */
       
    25 
       
    26 #ifndef CONNMOADAPTER_H_
       
    27 #define CONNMOADAPTER_H_
       
    28 
       
    29 // ------------------------------------------------------------------------------------------------
       
    30 // Includes
       
    31 // ------------------------------------------------------------------------------------------------
       
    32 #include <smldmadapter.h>
       
    33 #include <cmmanagerext.h>
       
    34 
       
    35 class CNapBranch;
       
    36 class CProxyBranch;
       
    37 class CAddBuffer;
       
    38 class CBranchBase;
       
    39 
       
    40 _LIT8( KCMDdfNAP,                   "NAP" );
       
    41 _LIT8( KCMDdfProxy,                 "Proxy" );
       
    42 
       
    43 /**
       
    44  * Implements ConnMO partition of the DM tree
       
    45  */
       
    46 class CConnMoAdapter : public CSmlDmAdapter
       
    47     {
       
    48 public:
       
    49 
       
    50     static CConnMoAdapter* NewL(MSmlDmCallback* aDmCallback );
       
    51     static CConnMoAdapter* NewLC(MSmlDmCallback* aDmCallback );
       
    52 
       
    53     virtual ~CConnMoAdapter(); 
       
    54     
       
    55     // Adapter Interface inherited from CSmlDmAdapter
       
    56     void DDFVersionL( CBufBase& aVersion );
       
    57     void DDFStructureL( MSmlDmDDFObject& aDDF );
       
    58     
       
    59     void UpdateLeafObjectL( const TDesC8& aURI, 
       
    60                             const TDesC8& aLUID,
       
    61                             const TDesC8& aObject, 
       
    62                             const TDesC8& aType,
       
    63                             TInt aStatusRef );
       
    64     
       
    65     void UpdateLeafObjectL( const TDesC8& aURI, 
       
    66                             const TDesC8& aLUID,
       
    67                             RWriteStream*& aStream, 
       
    68                             const TDesC8& aType,
       
    69                             TInt aStatusRef );
       
    70     
       
    71     void DeleteObjectL( const TDesC8& aURI, 
       
    72                         const TDesC8& aLUID,
       
    73                         TInt aStatusRef );
       
    74     
       
    75     void FetchLeafObjectL( const TDesC8& aURI, 
       
    76                            const TDesC8& aLUID,
       
    77                            const TDesC8& aType, 
       
    78                            TInt aResultsRef,
       
    79                            TInt aStatusRef );
       
    80     
       
    81     void FetchLeafObjectSizeL( const TDesC8& aURI, 
       
    82                                const TDesC8& aLUID,
       
    83                                const TDesC8& aType, 
       
    84                                TInt aResultsRef,
       
    85                                TInt aStatusRef );
       
    86     
       
    87     void ChildURIListL( const TDesC8& aURI, 
       
    88                         const TDesC8& aLUID,
       
    89                         const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
       
    90                         TInt aResultsRef, TInt aStatusRef );
       
    91     
       
    92     void AddNodeObjectL( const TDesC8& aURI, 
       
    93                          const TDesC8& aParentLUID,
       
    94                          TInt aStatusRef );
       
    95 
       
    96     void ExecuteCommandL( const TDesC8& aURI, 
       
    97                           const TDesC8& aLUID,
       
    98                           const TDesC8& aArgument, 
       
    99                           const TDesC8& aType,
       
   100                           TInt aStatusRef );
       
   101 
       
   102     void ExecuteCommandL( const TDesC8& aURI, 
       
   103                           const TDesC8& aLUID,
       
   104                           RWriteStream*& aStream, 
       
   105                           const TDesC8& aType,
       
   106                           TInt aStatusRef );
       
   107 
       
   108     void CopyCommandL( const TDesC8& aTargetURI, 
       
   109                        const TDesC8& aTargetLUID,
       
   110                        const TDesC8& aSourceURI, 
       
   111                        const TDesC8& aSourceLUID,
       
   112                        const TDesC8& aType, 
       
   113                        TInt aStatusRef );
       
   114 
       
   115     void StartAtomicL(); 
       
   116     void CommitAtomicL();
       
   117     void RollbackAtomicL();
       
   118     TBool StreamingSupport( TInt& aItemSize );
       
   119     void StreamCommittedL();
       
   120     void CompleteOutstandingCmdsL();
       
   121     
       
   122 private:
       
   123     
       
   124     //-----------------------------------------------------------------------------
       
   125     // Private functions
       
   126     //-----------------------------------------------------------------------------
       
   127     void ConstructL();
       
   128     CConnMoAdapter( TAny* aEcomArguments );
       
   129     
       
   130     CBranchBase* GetBranch( const TDesC8& aUri );
       
   131     
       
   132     MSmlDmDDFObject& AddBaseUriL( MSmlDmDDFObject& aRootDDF);
       
   133     
       
   134     MSmlDmDDFObject& AddBranchL( MSmlDmDDFObject& aRootDDF, 
       
   135                                 const TDesC8& aNodeName);
       
   136     
       
   137     //-----------------------------------------------------------------------------
       
   138     // Private member variables
       
   139     //-----------------------------------------------------------------------------
       
   140     /** Callback to framework */
       
   141     MSmlDmCallback*     iCallBack;
       
   142     
       
   143     /** branches of ConnMo structure */
       
   144     CNapBranch*         iNapBranch;
       
   145     CProxyBranch*       iProxyBranch;
       
   146     
       
   147     /** Buffer for node addition */
       
   148     CAddBuffer*         iBuffer;
       
   149     
       
   150     /** CmMager for manipulating CM settings */
       
   151     RCmManagerExt       iCmManager;
       
   152     };
       
   153 
       
   154 
       
   155 #endif /* CONNMOADAPTER_H_ */