ncdengine/provider/client/inc/ncdnodeuserdataproxy.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   Contains CNcdNodeUserDataProxy class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_NCD_NODE_USER_DATA_PROXY_H
       
    20 #define C_NCD_NODE_USER_DATA_PROXY_H
       
    21 
       
    22 
       
    23 #include "ncdinterfacebaseproxy.h"
       
    24 #include "ncdnodeuserdata.h"
       
    25 
       
    26 class CNcdNodeMetadataProxy;
       
    27 
       
    28 
       
    29 /**
       
    30  *  This class implements the functionality for the
       
    31  *  MNcdNodeUserData interfaces. The interface is provided for
       
    32  *  API users.
       
    33  *
       
    34  *  @since S60 v3.2
       
    35  */
       
    36 class CNcdNodeUserDataProxy : public CNcdInterfaceBaseProxy, 
       
    37                               public MNcdNodeUserData
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * @param aSession The session between the client proxy and the
       
    44      * corresponding server object.
       
    45      * @param aHandle The handle which identifies the server object
       
    46      * that this proxy uses.
       
    47      * @param aNodeMetadata Owns and uses the information of this proxy.
       
    48      * The metadata also keeps track of the refence counts of its objects. 
       
    49      * And handles the deletion of these objects when the total reference 
       
    50      * count reaches zero.
       
    51      * @return CNcdNodeUserDataProxy* Pointer to the created object 
       
    52      * of this class.
       
    53      */
       
    54     static CNcdNodeUserDataProxy* NewL(
       
    55         MCatalogsClientServer& aSession,
       
    56         TInt aHandle,
       
    57         CNcdNodeMetadataProxy& aNodeMetadata );
       
    58 
       
    59     /**
       
    60      * @param aSession The session between the client proxy and the
       
    61      * corresponding server object.
       
    62      * @param aHandle The handle which identifies the server object
       
    63      * that this proxy uses.
       
    64      * @param aNodeMetadata Owns and uses the information of this proxy.
       
    65      * The node also keeps track of the refence counts of its objects. 
       
    66      * And handles the deletion of these objects when the total reference 
       
    67      * count reaches zero.
       
    68      * @return CNcdNodeUserDataProxy* Pointer to the created object 
       
    69      * of this class.
       
    70      */
       
    71     static CNcdNodeUserDataProxy* NewLC(
       
    72         MCatalogsClientServer& aSession, 
       
    73         TInt aHandle,
       
    74         CNcdNodeMetadataProxy& aNodeMetadata );
       
    75 
       
    76 
       
    77     /**
       
    78      * Destructor.
       
    79      * The destructor is set public. So, the node that owns the UserData may
       
    80      * delete it directly when the reference count of the node reaches zero
       
    81      * and the destructor of the node is called.
       
    82      */
       
    83     virtual ~CNcdNodeUserDataProxy();
       
    84      
       
    85 
       
    86 public: // MNcdNodeUserData
       
    87 
       
    88     /**
       
    89      * @see MNcdNodeUserData::UserDataL
       
    90      */
       
    91     virtual HBufC8* UserDataL() const;
       
    92 
       
    93     /**
       
    94      * @see MNcdNodeUserData::SetUserDataL
       
    95      */
       
    96     virtual void SetUserDataL( const TDesC8* aData );    
       
    97 
       
    98 
       
    99 protected:
       
   100 
       
   101     /**
       
   102      * Constructor
       
   103      *
       
   104      * @param aSession The session between the client proxy and the
       
   105      * corresponding server object.
       
   106      * @param aHandle The handle which identifies the server object
       
   107      * that this proxy uses.
       
   108      * @param aNodeMetadata Owns and uses the information of this proxy.
       
   109      * The node also keeps track of the refence counts of its objects. 
       
   110      * And handles the deletion of these objects when the total reference 
       
   111      * count reaches zero.
       
   112      * @return CNcdNodeUserDataProxy* Pointer to the created object 
       
   113      * of this class.
       
   114      */
       
   115     CNcdNodeUserDataProxy(
       
   116         MCatalogsClientServer& aSession,
       
   117         TInt aHandle,
       
   118         CNcdNodeMetadataProxy& aNodeMetadata );
       
   119 
       
   120     /**
       
   121      * ConstructL
       
   122      */
       
   123     virtual void ConstructL();
       
   124     
       
   125     
       
   126     /**
       
   127      * @return CNcdNodeProxy& Gives the node proxy that owns this class object.
       
   128      * This node may be given for the operations. So, the operations may
       
   129      * inform the node about the progress of or about the completion of the
       
   130      * operation.
       
   131      */
       
   132     CNcdNodeMetadataProxy& NodeMetadata() const;
       
   133 
       
   134 
       
   135 private:
       
   136 
       
   137     // Prevent if not implemented
       
   138     CNcdNodeUserDataProxy( const CNcdNodeUserDataProxy& aObject );
       
   139     CNcdNodeUserDataProxy& operator =( const CNcdNodeUserDataProxy& aObject );
       
   140     
       
   141     
       
   142 private: // data
       
   143 
       
   144     CNcdNodeMetadataProxy& iNodeMetadata;
       
   145 
       
   146     };
       
   147 
       
   148 
       
   149 #endif // C_NCD_NODE_USER_DATA_PROXY_H