ncdengine/inc/ncdnodeskin.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 MNcdNodeSkin interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_NODE_SKIN_H
       
    20 #define M_NCD_NODE_SKIN_H
       
    21 
       
    22 
       
    23 #include <e32cmn.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 #include "catalogsbase.h"
       
    27 #include "ncdinterfaceids.h"
       
    28 
       
    29 
       
    30 class MNcdFileDownloadOperation;
       
    31 class MNcdFileDownloadOperationObserver;
       
    32 
       
    33 
       
    34 /**
       
    35  *  This interface is provided for the node if the node contains a skin.
       
    36  *
       
    37  *  
       
    38  */
       
    39 class MNcdNodeSkin : public virtual MCatalogsBase
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    46      *
       
    47      * 
       
    48      */
       
    49     enum { KInterfaceUid = ENcdNodeSkinUid };
       
    50 
       
    51 
       
    52     /**
       
    53      * Gives the skin id. This id can be used by UI
       
    54      * to identify icons that have already been retrieved by LoadSkinL.
       
    55      * 
       
    56      * 
       
    57      * @return Id of the skin. If the protocol has not defined
       
    58      *  any value, an empty string is returned.
       
    59      */
       
    60     virtual const TDesC& SkinId() const = 0;
       
    61 
       
    62 
       
    63     /**
       
    64      * Returns the time stamp that informs when the skin was downloaded. 
       
    65      * The client may use this value to check if a new skin is wanted.
       
    66      *
       
    67      * 
       
    68      * @return Time when the skin vas downloaded. TTime is set to
       
    69      *  zero if the time stamp was not given by the protocol.
       
    70      */
       
    71     virtual TTime SkinTimeStamp() const = 0;
       
    72 
       
    73 
       
    74     /**
       
    75      * Downloads the skin file. The skin is not handled by the engine, the file
       
    76      * should be handled by the user of this interface as it sees fit.
       
    77      *
       
    78      * @note The reference count of the operation object is increased by one. 
       
    79      * So, Release function of the operation should be called when the operation 
       
    80      * is not needed anymore.
       
    81      *
       
    82      * @note The file will be moved to the target location after it has been 
       
    83      * fully downloaded. Any existing file with the same name will be overwritten.     
       
    84      *
       
    85      * 
       
    86      * @param aTargetFileName Full path and name for the target file.
       
    87      * @param aObserver Observer for the operation.
       
    88      * @return  Operation which can be monitored to check the
       
    89      *  processing of the skin loading. Counted, Release() must be called after use.
       
    90      * @exception Leave System wide error codes.
       
    91      *  KNcdErrorParallelOperationNotAllowed if a parallel client is running
       
    92      *  an operation for the same metadata. See MNcdOperation for full explanation.
       
    93      */ 
       
    94     virtual MNcdFileDownloadOperation* LoadSkinL( 
       
    95         const TDesC& aTargetFileName,
       
    96         MNcdFileDownloadOperationObserver& aObserver ) = 0;
       
    97 
       
    98 
       
    99 protected:
       
   100 
       
   101     /**
       
   102      * Destructor.
       
   103      * 
       
   104      * @see MCatalogsBase::~MCatalogsBase()
       
   105      */
       
   106     virtual ~MNcdNodeSkin() {}
       
   107     
       
   108     };
       
   109 
       
   110 
       
   111 #endif // M_NCD_NODE_SKIN_H