ximpfw/presence/srcpresencedatamodel/presenceinfo/presenceinfofieldvaluebinaryimp.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     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:  Implementation of presence info field binary value object.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPRESENCEINFOFIELDVALUEBINARYIMP_H
       
    19 #define CPRESENCEINFOFIELDVALUEBINARYIMP_H
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <s32strm.h> // RWriteStream, RReadStream
       
    23 #include <ximpbase.h>
       
    24 #include <ximpdatamodelifids.hrh>
       
    25 #include "presenceinfo.h"
       
    26 #include "ximpapidataobjbase.h"
       
    27 #include "presenceinfofieldvaluebinary.h"
       
    28 #include "presenceapiobjbase.h"
       
    29 
       
    30 /**
       
    31  * Implementation of presence info field binary value object.
       
    32  *
       
    33  *
       
    34  *
       
    35  *
       
    36  * @ingroup ximpdatamodelapi
       
    37  * @since S60 v3.2
       
    38  */
       
    39 NONSHARABLE_CLASS( CPresenceInfoFieldValueBinaryImp ): public CXIMPApiDataObjBase, 
       
    40     public MPresenceInfoFieldValueBinary
       
    41     {
       
    42 public:
       
    43 
       
    44     /** The class ID. */
       
    45     enum { KClassId = PRIMP_CLSID_CPRESENCEINFOFIELDVALUEBINARYIMP };
       
    46 
       
    47 public:
       
    48 
       
    49     /**
       
    50      * @param aMaxLength NPresenceInfo::KPrValueLengthUnlimited to not enforce
       
    51      * length limits
       
    52      */
       
    53     IMPORT_C static CPresenceInfoFieldValueBinaryImp* NewLC(
       
    54             TInt aMaxLength = NPresenceInfo::KValueLengthUnlimited );
       
    55 
       
    56     virtual ~CPresenceInfoFieldValueBinaryImp();
       
    57 
       
    58 private:
       
    59 
       
    60     CPresenceInfoFieldValueBinaryImp( TInt aMaxLength );
       
    61     CPresenceInfoFieldValueBinaryImp();
       
    62 
       
    63     void ConstructL();
       
    64 
       
    65     /**
       
    66      * @see CXIMPApiDataObjBase
       
    67      */
       
    68     XIMPIMP_DECLARE_DATAOBJ_BASE_PRIV_METHODS
       
    69 
       
    70 public: // From MXIMPBase
       
    71 
       
    72     /**
       
    73      * Implementation of MXIMPBase interface methods
       
    74      * @see MXIMPBase
       
    75      */
       
    76     XIMPIMP_DECLARE_IF_BASE_METHODS
       
    77 
       
    78     /**
       
    79      * @see CXIMPApiDataObjBase
       
    80      */
       
    81     XIMPIMP_DECLARE_DATAOBJ_BASE_METHODS
       
    82 
       
    83 public: // New functions
       
    84 
       
    85     /**
       
    86      * Internalizes object data from given stream.
       
    87      * @param aStream Stream to read.
       
    88      */
       
    89     IMPORT_C void InternalizeL( RReadStream& aStream );
       
    90 
       
    91 
       
    92 public: // from MPresenceInfoFieldValueBinary
       
    93 
       
    94     /**
       
    95      * @see MPresenceInfoFieldValueBinary
       
    96      */
       
    97     TInt MaxLength() const;
       
    98 
       
    99     /**
       
   100      * @see MPresenceInfoFieldValueBinary
       
   101      */
       
   102     TPtrC8 BinaryValue() const;
       
   103 
       
   104     /**
       
   105      * @see MPresenceInfoFieldValueBinary
       
   106      */
       
   107     const TPtrC8 MimeType() const;
       
   108 
       
   109     /**
       
   110      * @see MPresenceInfoFieldValueBinary
       
   111      */
       
   112     void SetBinaryValueL(
       
   113             const TDesC8& aValue );
       
   114 
       
   115     /**
       
   116      * @see MPresenceInfoFieldValueBinary
       
   117      */
       
   118     void SetMimeTypeL(
       
   119             const TDesC8& aMimeType );
       
   120 
       
   121 private: // data
       
   122 
       
   123     // owned. field value
       
   124     RBuf8 iValue;
       
   125 
       
   126     // owned. mime type
       
   127     RBuf8 iMimeType;
       
   128 
       
   129     // maximum length of field value
       
   130     TInt iMaxLength;
       
   131     };
       
   132 
       
   133 #endif // CPRESENCEINFOFIELDVALUEBINARYIMP_H
       
   134 
       
   135 
       
   136