williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: PosLmCategorySerialization class definition williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EPOS_POSCATEGORYSERIALIZATION_H_ williamr@2: #define __EPOS_POSCATEGORYSERIALIZATION_H_ williamr@2: williamr@2: #include williamr@2: williamr@2: class CPosLandmarkCategory; williamr@2: williamr@2: /** williamr@2: * This class contains helper methods for landmark category serialization. williamr@2: * A landmark category can be packed into a buffer with PackL method and unpacked williamr@2: * back with UnpackL method. williamr@2: * williamr@2: * @lib eposlandmarks.lib williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: class PosLmCategorySerialization williamr@2: { williamr@2: public: williamr@2: /** Packs category object into a buffer. williamr@2: * williamr@2: * All the data is preserved when packing. Database information is not stored. williamr@2: * Packed category can be unpacked with @ref UnpackL method. williamr@2: * williamr@2: * @param aCategory The category to be packed. williamr@2: * @return The buffer with the category data packed. williamr@2: * Ownership is transferred to the client. williamr@2: */ williamr@2: IMPORT_C static HBufC8* PackL( const CPosLandmarkCategory& aCategory ); williamr@2: williamr@2: /** Unpacks a category object, packed with @ref PackL method, from buffer. williamr@2: * williamr@2: * All the data is preserved when packing, and restored exactly williamr@2: * when unpacking. It means that category ID is valid only for the database, williamr@2: * this category was read from. williamr@2: * williamr@2: * @param aBuffer The buffer containing category. williamr@2: * @return The category unpacked. Ownership is transferred to client. williamr@2: * @leave KErrCorrupt if buffer does not contain valid category package. williamr@2: */ williamr@2: IMPORT_C static CPosLandmarkCategory* UnpackL( const TDesC8& aBuffer ); williamr@2: }; williamr@2: williamr@2: #endif // __EPOS_POSCATEGORYSERIALIZATION_H_