menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMEXTBMPICONHOLDER_H
       
    20 #define MMEXTBMPICONHOLDER_H
       
    21 
       
    22 #include "hniconholder.h"
       
    23 
       
    24 class CLiwBitmapBuffer;
       
    25 
       
    26 /**
       
    27  * This is an extended version of @c CHnIconHolder which holds a CGulIcon that does
       
    28  * not own the bitmaps and CLiwBitmapBuffer objects that do.
       
    29  *
       
    30  * Such class was needed because some of the bitmaps for icons are obtained from
       
    31  * CLiwBitmapBuffer objects and there is no way to transfer ownership of that
       
    32  * bitmaps from them. It is not possible to make copies of that bitmaps either,
       
    33  * because some of them are not CFbsBitmaps but CAknBitmaps.
       
    34  */
       
    35 class CHnExtBmpIconHolder: public CHnIconHolder
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Sets the icon to be stored in this icon holder along with the bitmap buffers.
       
    40      * This method should be called only once. If you want to store another icon
       
    41      * simply call Close() on this icon holder and then create a new icon holder
       
    42      * to store the new icon.
       
    43      *
       
    44      * @param aGulIcon Icon to store in this icon holder.
       
    45      * @param aBmpBuffer The buffer that owns the primary bitmap.
       
    46      * @param aMaskBuffer The buffer that owns the mask bitmap.
       
    47      */
       
    48     IMPORT_C void SetGulIcon( CGulIcon* aGulIcon, CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer );
       
    49 
       
    50     /**
       
    51      * Clean both liw bitmap buffer and liw maskbitmap buffer.
       
    52      * Allows set new mask and new bitmap for the icon.
       
    53      */
       
    54     virtual void CleanBmpBuffer();
       
    55 
       
    56     /**
       
    57      * Standard C++ virtual destructor.
       
    58      */
       
    59     virtual ~CHnExtBmpIconHolder();
       
    60 
       
    61 private: // data
       
    62 
       
    63     /**
       
    64      * Liw bitmap buffer that owns the primary bitmap for the icon.
       
    65      * Co-owns (CLiwBitmapBuffer are ref-counted).
       
    66      */
       
    67     CLiwBitmapBuffer* iBmpBuffer;
       
    68 
       
    69     /**
       
    70      * Liw bitmap buffer that owns the mask bitmap for the icon.
       
    71      * Co-owns (CLiwBitmapBuffer are ref-counted).
       
    72      */
       
    73     CLiwBitmapBuffer* iMaskBuffer;
       
    74     };
       
    75 
       
    76 #endif // MMEXTBMPICONHOLDER_H