extras/about/inc/AboutResource.h
branchRCL_3
changeset 22 bec11adf88f9
equal deleted inserted replaced
21:10c6e6d6e4d9 22:bec11adf88f9
       
     1 /*
       
     2 * Copyright (c) 2010 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: Resource for About resource loader.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ABOUTRESOURCE_H
       
    19 #define ABOUTRESOURCE_H
       
    20 
       
    21 // INCLUDES
       
    22 #include "about.hrh"
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29  *  CAboutResource
       
    30  *  This class's main purpose is transfer data between container and loader
       
    31  */
       
    32 class CAboutResource : public CBase
       
    33     {
       
    34 public:
       
    35     // Constructors and destructor
       
    36 
       
    37     /**
       
    38      * Destructor.
       
    39      */
       
    40     ~CAboutResource();
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     static CAboutResource* NewL();
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50     static CAboutResource* NewLC();
       
    51 
       
    52 private:
       
    53 
       
    54     /**
       
    55      * Constructor for performing 1st stage construction
       
    56      */
       
    57     CAboutResource();
       
    58 
       
    59 public:
       
    60 
       
    61     /**
       
    62      * Get the index number of resource
       
    63      * @return get the the count of the resource item
       
    64      */
       
    65     TInt ResourceIndex();
       
    66     
       
    67     /**
       
    68      * Set the index number of rsource
       
    69      * @param aIndex the index which you want to set
       
    70      */
       
    71     void SetResourceIndex( const TInt aIndex );
       
    72 
       
    73     /**
       
    74      * Get the image's id
       
    75      * @return  get the pic's id which you want to display
       
    76      */
       
    77     TInt BitmapId();
       
    78 
       
    79     /**
       
    80      * Set the loaded image's id
       
    81      * @param aBitmapId set the pic's id which you want to display
       
    82      */
       
    83     void SetBitmapId( const TInt aBitmapId );
       
    84 
       
    85     /**
       
    86      * Get the string's type which need to be loaded 
       
    87      * @return TAboutItemType get the resource type defineed in .rh file
       
    88      */
       
    89     TAboutItemType ResourceType();
       
    90 
       
    91     /**
       
    92      * Set the string's type which need to be loaded 
       
    93      * @param aType set the resource type
       
    94      */
       
    95     void SetResourceType( const TAboutItemType aType );
       
    96 
       
    97     /**
       
    98      * Get about text or about image path
       
    99      * @return HBufC a buffer for transter data
       
   100      */
       
   101     HBufC* ResourceItem();
       
   102 
       
   103     /**
       
   104      * Set about text or about image path
       
   105      * @param aItem a buffer for transter data
       
   106      */
       
   107     void SetResourceItem( HBufC* aItem );
       
   108     
       
   109 private:
       
   110 
       
   111     // The index of the resource
       
   112     TInt iResourceIndex;
       
   113     
       
   114     // Id for the bitmap
       
   115     TInt iBitmapId;
       
   116     
       
   117     // Resource item content
       
   118     HBufC* iResourceItem;
       
   119     
       
   120     // Resource item type
       
   121     TAboutItemType iResourceType;
       
   122     };
       
   123 
       
   124 #endif // ABOUTRESOURCE_H