ncdengine/inc/ncdnodeuserdata.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Contains MNcdNodeUserData
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_NODE_USER_DATA_H
       
    20 #define M_NCD_NODE_USER_DATA_H
       
    21 
       
    22 
       
    23 #include <e32cmn.h>
       
    24 
       
    25 #include "catalogsbase.h"
       
    26 #include "ncdinterfaceids.h"
       
    27 
       
    28 
       
    29 /**
       
    30  *  Provides functions to handle the user data of the node.
       
    31  *  User data is meant for clients side to save some custom information
       
    32  *  relating to a node. So, client can also read its own settings from engine
       
    33  *  by using functions provided by this interface. For example, if the
       
    34  *  client wants to set the node hidden and save this value to the node it may
       
    35  *  use user data functions.
       
    36  *
       
    37  *  The format of the data is entirely up to the client. The engine saves
       
    38  *  the user data as a single binary data entry.
       
    39  *
       
    40  *  
       
    41  */
       
    42 class MNcdNodeUserData : public virtual MCatalogsBase
       
    43     {
       
    44 
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    49      *
       
    50      * 
       
    51      */
       
    52     enum { KInterfaceUid = ENcdNodeUserDataUid };
       
    53 
       
    54     /**
       
    55      * Gives the user data that has been saved in database for the node.
       
    56      *
       
    57      * @return User data.
       
    58      * Ownership of the heap descriptor is transferred to the caller. If the
       
    59      * node has no user data set, a NULL pointer is returned.
       
    60      * @exception Leave System wide error codes.
       
    61      */
       
    62     virtual HBufC8* UserDataL() const = 0;
       
    63 
       
    64     /**
       
    65      * Sets user data for the node.
       
    66      * 
       
    67      * @param aData is the data that is saved to the node information. If NULL,
       
    68      *  clears the previously set user data. Ownership of aData is not transferred.
       
    69      * @exception Leave System wide error codes.
       
    70      */
       
    71     virtual void SetUserDataL( const TDesC8* aData ) = 0;    
       
    72 
       
    73 protected:
       
    74 
       
    75     /**
       
    76     * Destructor.
       
    77     *
       
    78     * @see MCatalogsBase::~MCatalogsBase
       
    79     */
       
    80     virtual ~MNcdNodeUserData() {}
       
    81 
       
    82     };
       
    83 
       
    84 
       
    85 #endif // M_NCD_NODE_USER_DATA_H