messagingfw/msgsrvnstore/server/inc/CMsvAttributeManager.h
changeset 22 bde600d88860
parent 0 8e480a14352b
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CMSVATTRIBUTEMANAGER_H__
       
    17 #define __CMSVATTRIBUTEMANAGER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 class CMsvAttachment;
       
    22 class RReadStream;
       
    23 class RWriteStream;
       
    24 
       
    25 class CDesC8Attribute : public CBase
       
    26 	{
       
    27 public:
       
    28 	CDesC8Attribute();
       
    29 	~CDesC8Attribute();
       
    30 
       
    31 public:
       
    32 	TUid iUid;
       
    33 	HBufC8* iAttribute;
       
    34 	};
       
    35 
       
    36 class TIntAttribute
       
    37 	{
       
    38 public:
       
    39 	TUid iUid;
       
    40 	TInt iAttribute;
       
    41 	};
       
    42 
       
    43 class CMsvAttributeManager : public CBase
       
    44 	{
       
    45 public:
       
    46 	static CMsvAttributeManager* NewL(CMsvAttachment& aAttachment);
       
    47 	~CMsvAttributeManager();
       
    48 	
       
    49 	void CloneL(CMsvAttributeManager& aAttributeManager);
       
    50 
       
    51 	void InternalizeL(RReadStream& aStream);
       
    52 	void ExternalizeL(RWriteStream& aStream) const;
       
    53 
       
    54 	void SetDesC8AttributeL(TUid aAttributeId, const TDesC8& aAttribute);
       
    55 	TInt GetDesC8Attribute(TUid aAttributeId, TPtrC8& aAttribute) const;
       
    56 	void RemoveDesC8Attribute(TUid aAttributeId);
       
    57 	
       
    58 	void SetIntAttributeL(TUid aAttributeId, TInt aAttribute);
       
    59 	TInt GetIntAttribute(TUid aAttributeId, TInt& aAttribute) const;
       
    60 	void RemoveIntAttribute(TUid aAttributeId);
       
    61 
       
    62 private:
       
    63 	CMsvAttributeManager(CMsvAttachment& aAttachment);
       
    64 	
       
    65 	TInt FindDesC8Attribute(TUid aUid) const;
       
    66 	TInt FindIntAttribute(TUid aUid) const;
       
    67 	
       
    68 private:
       
    69 	CMsvAttachment& iAttachment;
       
    70 	RPointerArray<CDesC8Attribute> iDesC8Attributes;
       
    71 	RArray<TIntAttribute> iIntAttributes;
       
    72 	};
       
    73 	
       
    74 #endif // __CMSVATTRIBUTEMANAGER_H__