uifw/EikStd/coctlinc/aknbitmapresourceitem.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  Bitmap resource item
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_AKNBITMAPRESOURCEITEM_H
       
    21 #define C_AKNBITMAPRESOURCEITEM_H
       
    22 
       
    23 
       
    24 #include <e32def.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 #include "aknresourceitem.h"
       
    28 
       
    29 class CFbsBitmap;
       
    30 
       
    31 /**
       
    32 *  The bitmap resource item class.
       
    33 *
       
    34 *  Resource item for storing a RGB bitmap and a bitmap mask.
       
    35 *  Implements the MAknResourceItem interface.
       
    36 *
       
    37 *  @lib eikcoctl
       
    38 *  @since S60 v5.0
       
    39 */
       
    40 NONSHARABLE_CLASS( CAknBitmapResourceItem ) : public CBase, public MAknResourceItem
       
    41     {
       
    42 
       
    43 public:
       
    44 
       
    45     /**
       
    46      * NewL.
       
    47      * Two-phased constructor.
       
    48      * @return a pointer to the created instance of CAknBitmapResourceItem.
       
    49      */
       
    50     static CAknBitmapResourceItem* NewL( TInt aId );
       
    51 
       
    52     /**
       
    53      * ~CAknBitmapResourceItem
       
    54      * Virtual Destructor.
       
    55      */
       
    56     virtual ~CAknBitmapResourceItem();
       
    57 
       
    58     /**
       
    59      * Used to fetch the bitmaps (resources) this item holds.
       
    60      * The ownership of the bitmaps changes with this
       
    61      * method call, so caller must take care of the bitmaps destruction.
       
    62      * @param aBitmap Pointer to RGB bitmap
       
    63      * @param aMask Pointer to bitmap mask
       
    64      * @return ETrue if the bitmaps were found and valid.
       
    65      */
       
    66     TBool GetBitmaps( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
       
    67 
       
    68     /**
       
    69      * Sets the bitmaps of this item.
       
    70      * The ownership of the parameter bitmaps does not change
       
    71      * with this method call, instead new bitmaps are created with parameter
       
    72      * bitmaps handles. So caller must take care of the parameter bitmaps
       
    73      * destruction.
       
    74      * @param aBitmap Pointer to RGB bitmap
       
    75      * @param aMask Pointer to bitmap mask
       
    76      */
       
    77     void SetBitmapsL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    78 
       
    79 // from base class MAknResourceItem
       
    80 
       
    81     /**
       
    82      * From MAknResourceItem.
       
    83      * Duplicates the item and the resources it holds
       
    84      * and returns the created resource item.
       
    85      * @return Duplication result.
       
    86      */
       
    87     MAknResourceItem* DuplicateL();
       
    88 
       
    89     /**
       
    90      * From MAknResourceItem.
       
    91      * Returns the resource item id.
       
    92      * @return Resource item id.
       
    93      */
       
    94     TInt Id() const;
       
    95 
       
    96     /**
       
    97      * From MAknResourceItem.
       
    98      * Returns ETrue if the aType resource change applies
       
    99      * to this resource item. Otherwise EFalse.
       
   100      * @param aType Resource change type
       
   101      * @return ETrue if resource change applies to 
       
   102      * the resource item.
       
   103      */
       
   104     TBool Invalidate( TInt aType );
       
   105 
       
   106 private:
       
   107 
       
   108     /**
       
   109      * CAknBitmapResourceItem.
       
   110      * C++ default constructor.
       
   111      */
       
   112     CAknBitmapResourceItem( TInt aId );
       
   113 
       
   114 private: // data
       
   115 
       
   116     /**
       
   117      * Pointer to RGB resource bitmap.
       
   118      * Own.
       
   119      */
       
   120     CFbsBitmap* iBitmap;
       
   121 
       
   122     /**
       
   123      * Pointer to resource bitmap mask.
       
   124      * Own.
       
   125      */
       
   126     CFbsBitmap* iBitmapMask;
       
   127 
       
   128     /**
       
   129      * Resource id.
       
   130      */
       
   131     TInt iId;
       
   132 
       
   133     };
       
   134 
       
   135 #endif // C_AKNBITMAPRESOURCEITEM_H