ncdengine/inc/ncdnodemetadata.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 MNcdNodeMetadata interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_NODE_METADATA_H
       
    20 #define M_NCD_NODE_METADATA_H
       
    21 
       
    22 
       
    23 #include <e32cmn.h>
       
    24 #include <e32std.h>
       
    25 
       
    26 #include "catalogsbase.h"
       
    27 #include "catalogsarray.h"
       
    28 #include "ncdinterfaceids.h"
       
    29 
       
    30 class MNcdNodeContainer;
       
    31 class MNcdLoadNodeOperation;
       
    32 class MNcdQuery;
       
    33 class CNcdKeyValuePair;
       
    34 
       
    35 
       
    36 /**
       
    37  *  Node metadata contains the basic information about the content.
       
    38  *  Mainly this interface provides functions that can be used to show
       
    39  *  various information about the node in the UI.
       
    40  *
       
    41  *  This interface can be queried from a node object after its metadata
       
    42  *  has been downloaded to the terminal. Metadata can be downloaded by
       
    43  *  calling the node object's MNcdNode::LoadL() method.
       
    44  *
       
    45  *  
       
    46  */
       
    47 class MNcdNodeMetadata : public virtual MCatalogsBase
       
    48     {
       
    49 
       
    50 public:
       
    51 
       
    52     /**
       
    53      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    54      *
       
    55      * 
       
    56      */
       
    57     enum { KInterfaceUid = ENcdNodeMetadataUid };
       
    58 
       
    59 
       
    60     /**
       
    61      * Gets the metadata id.
       
    62      *
       
    63      * 
       
    64      * @return Id of the node.
       
    65      */
       
    66     virtual const TDesC& Id() const = 0;
       
    67 
       
    68 
       
    69     /**
       
    70      * All nodes and their content are part of a namespace. Within the
       
    71      * namespace, identifiers are unique. This function returns the namespace
       
    72      * of this metadata and its contents. This namespace should always be same
       
    73      * as the namespace of the node that may own this metadata.
       
    74      *
       
    75      * 
       
    76      * @return The namespace identifier. If the protocol has not defined
       
    77      *         any value, an empty descriptor is returned.
       
    78      */
       
    79     virtual const TDesC& Namespace() const = 0;
       
    80 
       
    81 
       
    82     /**
       
    83      * Retrieves the node name in text format.
       
    84      *
       
    85      * 
       
    86      * @return Name of the node. If the protocol has not defined any value
       
    87      *         for name, an empty descriptor is returned.
       
    88      */
       
    89     virtual const TDesC& Name() const = 0;
       
    90 
       
    91 
       
    92     /**
       
    93      * Retrieves the node description in text format.
       
    94      * 
       
    95      * 
       
    96      * @return Description for the node. If the protocol has not defined
       
    97      *         any value for description, an empty descriptor is returned.
       
    98      */
       
    99     virtual const TDesC& Description() const = 0;
       
   100 
       
   101 
       
   102     /**
       
   103      * Gets the disclaimer for the node in a query format.
       
   104      *
       
   105      * @note Query is used here just to give disclaimer information. The metadata
       
   106      * object does not care how the query is handled by the caller. SetResponseL
       
   107      * of the query may be used but the given response is not saved into the database.
       
   108      * Instead the set response information is availabe only while the metadata object
       
   109      * is alive. Use MNcdNodeUserData interface object if information about acception 
       
   110      * or rejection of the disclaimer should be saved to the database.
       
   111      *
       
   112      * 
       
   113      * @return Disclaimer query for the node. If the protocol has not defined
       
   114      *         any value, then NULL is returned. When a disclaimer query is returned,
       
   115      *         the user should Release the query when the object is not needed anymore  
       
   116      *         because the Disclaimer reference count is increase by one.
       
   117      */
       
   118     virtual MNcdQuery* Disclaimer() const = 0;
       
   119 
       
   120 
       
   121     /**
       
   122      * Gets the action name for the item.
       
   123      *
       
   124      * For example, the action for an item could be "Open", "Launch" or "Play"
       
   125      * etc.
       
   126      *
       
   127      * 
       
   128      * @return Action name string for the item.
       
   129      */
       
   130     virtual const TDesC& ActionName() const = 0;
       
   131 
       
   132 
       
   133     /**
       
   134      * Determines if the node is specified to be "always visible" in the client
       
   135      * UI. What this actually means is determined by the UI client
       
   136      * implementation. The idea is to give maximum visibility and availability
       
   137      * to the item for the user.
       
   138      *
       
   139      * 
       
   140      * @return ETrue if the item should be always visible, EFalse otherwise.
       
   141      */
       
   142     virtual TBool IsAlwaysVisible() const = 0;
       
   143     
       
   144     /**
       
   145      * Retrieves the layout type in text format.
       
   146      *
       
   147      * 
       
   148      * @return The layout type or empty string if not defined.
       
   149      */
       
   150     virtual const TDesC& LayoutType() const = 0;
       
   151 
       
   152     /**
       
   153      * Gets the more info for the node in a query format. This is a message
       
   154      * with a body of text to be shown.
       
   155      *
       
   156      * @note Query is used here just to give more info information. The metadata
       
   157      * object does not care how the query is handled by the caller. SetResponseL
       
   158      * of the query may be used but the given response is not saved into the database.
       
   159      *
       
   160      * 
       
   161      * @return More info query for the node. If the protocol has not defined
       
   162      *         any value, then NULL is returned. When a query is returned,
       
   163      *         the user should Release the query when the object is not needed anymore  
       
   164      *         because the reference count is increased by one.
       
   165      */
       
   166     virtual MNcdQuery* MoreInfo() const = 0;
       
   167 
       
   168 
       
   169     /**
       
   170      * Gets the details of this node. Details are additional information that
       
   171      * can be used e.g. to categorize nodes. Details are represented as key-value
       
   172      * pairs, for example: "artist:artist_name" or "album:album_name".
       
   173      * 
       
   174      * 
       
   175      * @return An array containing all the details of this node.
       
   176      */
       
   177     virtual const RPointerArray< CNcdKeyValuePair >& Details() const = 0;
       
   178     
       
   179 protected:
       
   180 
       
   181     /**
       
   182     * Destructor.
       
   183     *
       
   184     * @see MCatalogsBase::~MCatalogsBase
       
   185     */
       
   186     virtual ~MNcdNodeMetadata() {}
       
   187     
       
   188     };
       
   189 
       
   190 
       
   191 #endif // M_NCD_NODE_METADATA_H