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: PosLandmarkSerialization class definition williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EPOS_POSLANDMARKSERIALIZATION_H williamr@2: #define __EPOS_POSLANDMARKSERIALIZATION_H williamr@2: williamr@2: #include williamr@2: williamr@2: class CPosLandmark; williamr@2: williamr@2: /** williamr@2: * This class contains helper methods for landmark serialization. williamr@2: * A landmark 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 PosLandmarkSerialization williamr@2: { williamr@2: public: williamr@2: /** Packs landmark object into a buffer. williamr@2: * williamr@2: * All the data is preserved when packing. Database information is not stored. williamr@2: * Packed landmark can be unpacked with @ref UnpackL method. williamr@2: * williamr@2: * @param aLandmark The landmark to be packed. williamr@2: * @return The buffer with the landmark data packed. williamr@2: * Ownership is transferred to the client. williamr@2: */ williamr@2: IMPORT_C static HBufC8* PackL( const CPosLandmark& aLandmark ); williamr@2: williamr@2: /** Unpacks a landmark 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 landmark ID and williamr@2: * category IDs are valid only for the database, this landmark was read from. williamr@2: * williamr@2: * @param aBuffer The buffer containing landmark. williamr@2: * @return The landmark unpacked. Ownership is transferred to client. williamr@2: * @leave KErrCorrupt if buffer does not contain valid landmark package. williamr@2: */ williamr@2: IMPORT_C static CPosLandmark* UnpackL( const TDesC8& aBuffer ); williamr@2: }; williamr@2: williamr@2: #endif // __EPOS_POSLANDMARKSERIALIZATION_H