diff -r fd64c38c277d -r b46a585f6909 phonebookengines_old/contactsmodel/cntmodel/inc/CCntPackager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines_old/contactsmodel/cntmodel/inc/CCntPackager.h Fri Jun 11 13:29:23 2010 +0300 @@ -0,0 +1,100 @@ +/** +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +/** + @file + @internalComponent + @released +*/ + + +#ifndef __CCNTPACKAGER_H__ +#define __CCNTPACKAGER_H__ + +#include +#include + +class CContactItem; +class CCntFilter; +class CContactItemViewDef; +class CContactViewDef; +class CContactTextDef; +class CContentType; +class CContactIdArray; +class CViewContact; + + +/** +The CCntPackager class provides methods for packing and unpacking objects used +in IPC (inter-process communications) messages. + +The class contains a dynamically allocated buffer for accommodating different +kinds of object that will be sent over the process boundaries. +*/ +NONSHARABLE_CLASS(CCntPackager) : public CBase + { +public: + IMPORT_C static CCntPackager* NewL(); + IMPORT_C ~CCntPackager(); + IMPORT_C TPtr8 PackL(const CContactItem& aItem); + IMPORT_C TPtr8 PackL(const CContactItem& aItem, TInt& aSize); + IMPORT_C TPtr8 PackL(const CContentType& aItem); + IMPORT_C TPtr8 PackL(const CContactTextDef& aItem); + IMPORT_C TPtr8 PackL(const CContactItemViewDef& aItem); + IMPORT_C TPtr8 PackL(const CContactViewDef& aItem); + IMPORT_C TPtr8 PackL(const CContactIdArray& aItem); + IMPORT_C TPtr8 PackL(const CCntFilter& aItem); + IMPORT_C TPtr8 PackL(const CViewContact& aItem); + IMPORT_C TPtr8 PackL(const CDesCArray& aItem); + IMPORT_C TPtr8 PackL(const CArrayFix& aItem); + IMPORT_C TPtr8 PackL(const CArrayFixFlat& aItem); + + IMPORT_C CContactItem* UnpackCntItemLC() const; + IMPORT_C CContentType* UnpackCntContentTypeLC() const; + IMPORT_C CContactTextDef* UnpackCntTextDefLC() const; + IMPORT_C CContactItemViewDef* UnpackCntItemViewDefLC() const; + IMPORT_C CContactViewDef* UnpackCntViewDefLC() const; + IMPORT_C CContactIdArray* UnpackCntIdArrayLC() const; + IMPORT_C CCntFilter* UnpackCntFilterLC() const; + IMPORT_C CViewContact* UnpackViewContactLC() const; + IMPORT_C CDesCArray* UnpackDesCArrayLC() const; + IMPORT_C CArrayFix* UnpackCArrayFixLC() const; + IMPORT_C CArrayFixFlat* UnpackTUidArrayLC() const; + + IMPORT_C void Clear(); + IMPORT_C void SetBufferFromMessageL(const RMessage2& aMessage, TUint aMessageSlot=0); + + IMPORT_C const TDesC8& GetTransmittingBuffer() const; + IMPORT_C TDes8& GetReceivingBufferL(TInt aSize=0); + +private: + CCntPackager(); + void ConstructL(); + void ResetPointer(); + +private: + CBufFlat* iBuffer; + TInt iMaxBufferSize; + + mutable TPtr8 transPtr; + TPtr8 recPtr; + }; + + +#endif // __CCNTPACKAGER_H__