ncdengine/provider/client/inc/ncdnodecontentinfoproxy.h
changeset 0 ba25891c3a9e
child 11 3ba40be8e484
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 CNcdNodeContentInfoProxy class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_NCDNODECONTENTINFOPROXY_H
       
    20 #define C_NCDNODECONTENTINFOPROXY_H
       
    21 
       
    22 
       
    23 // For the streams
       
    24 #include <s32mem.h>
       
    25 
       
    26 #include "ncdinterfacebaseproxy.h"
       
    27 #include "ncdnodecontentinfo.h"
       
    28 
       
    29 class CNcdNodeMetadataProxy;
       
    30 
       
    31 
       
    32 /**
       
    33  *  This class implements the functionality for the
       
    34  *  MNcdNodeContentInfo interfaces. The interface is provided for
       
    35  *  API users.
       
    36  *
       
    37  *  @since S60 v3.2
       
    38  */
       
    39 class CNcdNodeContentInfoProxy : public CNcdInterfaceBaseProxy, 
       
    40                                  public MNcdNodeContentInfo
       
    41     {
       
    42 
       
    43 public:
       
    44 
       
    45     /**
       
    46      * @param aSession The session between the client proxy and the
       
    47      * corresponding server object.
       
    48      * @param aHandle The handle which identifies the server object
       
    49      * that this proxy uses.
       
    50      * @param aMetadata Owns and uses the information of this proxy.
       
    51      * The metadata also keeps track of the refence counts of its objects. 
       
    52      * And handles the deletion of these objects when the total reference 
       
    53      * count reaches zero.
       
    54      * @return CNcdNodeContentInfoProxy* Pointer to the created object 
       
    55      * of this class.
       
    56      */
       
    57     static CNcdNodeContentInfoProxy* NewL(
       
    58         MCatalogsClientServer& aSession,
       
    59         TInt aHandle,
       
    60         CNcdNodeMetadataProxy& aMetadata );
       
    61 
       
    62     /**
       
    63      * @param aSession The session between the client proxy and the
       
    64      * corresponding server object.
       
    65      * @param aHandle The handle which identifies the server object
       
    66      * that this proxy uses.
       
    67      * @param aMetadata Owns and uses the information of this proxy.
       
    68      * The metadata also keeps track of the refence counts of its objects. 
       
    69      * And handles the deletion of these objects when the total reference 
       
    70      * count reaches zero.
       
    71      * @return CNcdNodeContentInfoProxy* Pointer to the created object 
       
    72      * of this class.
       
    73      */
       
    74     static CNcdNodeContentInfoProxy* NewLC(
       
    75         MCatalogsClientServer& aSession, 
       
    76         TInt aHandle,
       
    77         CNcdNodeMetadataProxy& aMetadata );
       
    78 
       
    79 
       
    80     /**
       
    81      * Destructor.
       
    82      * The destructor is set public. So, the node that owns this object may
       
    83      * delete it directly when the reference count of the node reaches zero
       
    84      * and the destructor of the node is called.
       
    85      */
       
    86     virtual ~CNcdNodeContentInfoProxy();
       
    87 
       
    88 
       
    89     /**
       
    90      * Gets the data for descriptors from the server side. This function is
       
    91      * called to update proxy data. The function uses the protected virtual
       
    92      * internalize functions. So, the child classes may provide their own
       
    93      * implementations for internalizations of certain metadata.
       
    94      */
       
    95     void InternalizeL();
       
    96     
       
    97 
       
    98 public: // MNcdNodeContent
       
    99 
       
   100     /**
       
   101      * @see MNcdNodeContent::Purpose
       
   102      */ 
       
   103     TUint Purpose() const;    
       
   104     
       
   105     /**
       
   106      * @see MNcdNodeContent::MimeType
       
   107      */ 
       
   108     const TDesC& MimeType() const;
       
   109     
       
   110     /**
       
   111      * @see MNcdNodeContent::Uid
       
   112      */ 
       
   113     TUid Uid() const;
       
   114     
       
   115     /**
       
   116      * @see MNcdNodeContent::Version
       
   117      */ 
       
   118     const TDesC& Version() const;
       
   119 
       
   120     /**
       
   121      * @see MNcdNodeContent::Size
       
   122      */     
       
   123     virtual TInt Size() const;
       
   124 
       
   125 protected:
       
   126 
       
   127     /**
       
   128      * Constructor
       
   129      *
       
   130      * @param aSession The session between the client proxy and the
       
   131      * corresponding server object.
       
   132      * @param aHandle The handle which identifies the server object
       
   133      * that this proxy uses.
       
   134      * @param aMetadata Owns and uses the information of this proxy.
       
   135      * The metadata also keeps track of the refence counts of its objects. 
       
   136      * And handles the deletion of these objects when the total reference 
       
   137      * count reaches zero.
       
   138      * @return CNcdNodeContentInfoProxy* Pointer to the created object 
       
   139      * of this class.
       
   140      */
       
   141     CNcdNodeContentInfoProxy(
       
   142         MCatalogsClientServer& aSession,
       
   143         TInt aHandle,
       
   144         CNcdNodeMetadataProxy& aMetadata );
       
   145 
       
   146     /**
       
   147      * ConstructL
       
   148      */
       
   149     virtual void ConstructL();
       
   150     
       
   151     
       
   152     // These functions are used to update the data of this class object
       
   153 
       
   154     /**
       
   155      * @param aStream This stream will contain all the data content for
       
   156      * this class object. The stream is gotten from the server side. The
       
   157      * memeber variables will be updated according to the data from
       
   158      * the stream. 
       
   159      */
       
   160     virtual void InternalizeDataL( RReadStream& aStream );
       
   161 
       
   162 
       
   163 private:
       
   164 
       
   165     // Prevent if not implemented
       
   166     CNcdNodeContentInfoProxy( const CNcdNodeContentInfoProxy& aObject );
       
   167     CNcdNodeContentInfoProxy& operator =( const CNcdNodeContentInfoProxy& aObject );
       
   168     
       
   169     
       
   170 private: // data
       
   171 
       
   172     TUint iPurpose;
       
   173     HBufC* iMimeType;
       
   174     TUid iUid;
       
   175     HBufC* iVersion;
       
   176     TInt iSize;
       
   177     
       
   178     };
       
   179 
       
   180 
       
   181 #endif // C_NCDNODECONTENTINFOPROXY_H