menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp
branchRCL_3
changeset 25 137ebc85284b
parent 0 f72a12da539e
equal deleted inserted replaced
23:7be2816dbabd 25:137ebc85284b
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <gulicon.h>
    19 #include <gulicon.h>
    26 //
    26 //
    27 EXPORT_C void CHnExtBmpIconHolder::SetGulIcon( CGulIcon* aGulIcon,
    27 EXPORT_C void CHnExtBmpIconHolder::SetGulIcon( CGulIcon* aGulIcon,
    28         CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer )
    28         CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer )
    29     {
    29     {
    30     __ASSERT_DEBUG( aGulIcon && aBmpBuffer, User::Invariant() );
    30     __ASSERT_DEBUG( aGulIcon && aBmpBuffer, User::Invariant() );
    31     
    31 
    32     if ( aGulIcon )
    32     if ( aGulIcon )
    33         {
    33         {
    34         __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() ); 
    34         __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() );
    35         CHnIconHolder::SetGulIcon( aGulIcon );
    35         CHnIconHolder::SetGulIcon( aGulIcon );
    36         aGulIcon->SetBitmapsOwnedExternally( ETrue );
    36         aGulIcon->SetBitmapsOwnedExternally( ETrue );
    37         if ( aBmpBuffer )
    37         if ( aBmpBuffer )
    38             {
    38             {
    39             iBmpBuffer = aBmpBuffer;
    39             iBmpBuffer = aBmpBuffer;
    54 CHnExtBmpIconHolder::~CHnExtBmpIconHolder()
    54 CHnExtBmpIconHolder::~CHnExtBmpIconHolder()
    55     {
    55     {
    56     if ( iBmpBuffer )
    56     if ( iBmpBuffer )
    57         {
    57         {
    58         iBmpBuffer->DecRef();
    58         iBmpBuffer->DecRef();
    59         }
    59          }
    60     if ( iMaskBuffer )
    60     if ( iMaskBuffer )
    61         {
    61         {
    62         iMaskBuffer->DecRef();
    62         iMaskBuffer->DecRef();
    63         }
    63         }
    64     }
    64     }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 void CHnExtBmpIconHolder::CleanBmpBuffer()
       
    71     {
       
    72     if ( iBmpBuffer )
       
    73         {
       
    74         iBmpBuffer->DecRef();
       
    75         iBmpBuffer = NULL;
       
    76         }
       
    77     if ( iMaskBuffer )
       
    78         {
       
    79         iMaskBuffer->DecRef();
       
    80         iMaskBuffer = NULL;
       
    81         }
       
    82     }