epoc32/include/mw/epos_poslmcategoryserialization.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  PosLmCategorySerialization class definition
    15 *
    16 */
    17 
    18 
    19 #ifndef __EPOS_POSCATEGORYSERIALIZATION_H_
    20 #define __EPOS_POSCATEGORYSERIALIZATION_H_
    21 
    22 #include <e32base.h>
    23 
    24 class CPosLandmarkCategory;
    25 
    26 /**
    27  *  This class contains helper methods for landmark category serialization.
    28  *  A landmark category can be packed into a buffer with PackL method and unpacked
    29  *  back with UnpackL method.
    30  *
    31  *  @lib eposlandmarks.lib
    32  *  @since S60 3.1
    33  */
    34 class PosLmCategorySerialization
    35     {
    36     public:
    37         /** Packs category object into a buffer.
    38          *
    39          *  All the data is preserved when packing. Database information is not stored.
    40          *  Packed category can be unpacked with @ref UnpackL method.
    41          *
    42          *  @param aCategory The category to be packed.
    43          *  @return The buffer with the category data packed.
    44          *          Ownership is transferred to the client.
    45          */
    46         IMPORT_C static HBufC8* PackL( const CPosLandmarkCategory& aCategory );
    47 
    48         /** Unpacks a category object, packed with @ref PackL method, from buffer.
    49          *
    50          *  All the data is preserved when packing, and restored exactly
    51          *  when unpacking. It means that category ID is valid only for the database,
    52          *  this category was read from.
    53          *
    54          *  @param aBuffer The buffer containing category.
    55          *  @return The category unpacked. Ownership is transferred to client.
    56          *  @leave KErrCorrupt if buffer does not contain valid category package.
    57          */
    58         IMPORT_C static CPosLandmarkCategory* UnpackL( const TDesC8& aBuffer );
    59     };
    60 
    61 #endif // __EPOS_POSCATEGORYSERIALIZATION_H_