uigraphics/AknIcon/inc/AknBitmap.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002 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:   CAknBitmap class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef AKN_BITMAP_H
       
    22 #define AKN_BITMAP_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <fbs.h>
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CAknIconManager;
       
    32 struct TAknIconInitData;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * class CAknBitmap.
       
    38 * @since 2.8
       
    39 */
       
    40 const TUint KExtensionId = 0x1020735A;
       
    41 NONSHARABLE_CLASS(CAknBitmap) : public CFbsBitmap
       
    42 	{
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         static CAknBitmap* NewL( CAknIconManager& aManager );
       
    46         
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         ~CAknBitmap();
       
    51 
       
    52     public: // New functions
       
    53 
       
    54         void AddToPointerListL();
       
    55         void RemoveFromPointerList();
       
    56         inline CAknIconManager* Manager() const {return iManager;}
       
    57         TBool SharedByIconSrv();
       
    58         void SetSharedByIconSrv();
       
    59         TBool MaskDestroyed();
       
    60         void SetMaskDestroyed();
       
    61 
       
    62         // Resets handles and frees all resources allocated to them
       
    63         void Reset();
       
    64     	void SetAppIcon();
       
    65     	TBool IsAppIcon() const;   
       
    66     	void SetEnsuredSize(const TSize& aSize);
       
    67     	TBool IsEnsuredSize(const TSize& aSize) const;      
       
    68     	
       
    69     	inline static CAknBitmap* DynamicCast(CFbsBitmap* aBitmap);
       
    70     	inline static CAknBitmap* DynamicCast(const CFbsBitmap* aBitmap);
       
    71     	         
       
    72     private:
       
    73 
       
    74         CAknBitmap();
       
    75         void ConstructL( CAknIconManager& aManager );
       
    76         TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
       
    77 
       
    78     private:    // Data
       
    79 
       
    80         TInt iFlags;
       
    81         CAknIconManager* iManager;
       
    82         TSize iEnsuredSize;
       
    83 
       
    84     private:
       
    85         friend class RAknIconSrvClient;
       
    86         friend class CAknIconManager;
       
    87     };
       
    88 
       
    89 #if 0
       
    90 #ifdef __CW32__
       
    91 #if  __option(RTTI)
       
    92 #define RTTI_ON
       
    93 #else
       
    94 #warning RTTI is off
       
    95 #endif
       
    96 #else
       
    97 #ifdef __RTTI 
       
    98 #define RTTI_ON
       
    99 #else
       
   100 #warning RTTI is off
       
   101 #endif
       
   102 #endif
       
   103 #else
       
   104 #define RTTI_ON
       
   105 #endif
       
   106 
       
   107 inline CAknBitmap* CAknBitmap::DynamicCast(CFbsBitmap* aBitmap)
       
   108 	{
       
   109 	#ifdef RTTI_ON
       
   110 	return dynamic_cast<CAknBitmap*>(aBitmap);
       
   111 	#else
       
   112 	TAny* p = NULL;
       
   113 	CAknBitmap* bmp = static_cast<CAknBitmap*>(aBitmap);
       
   114 	return bmp != NULL && KErrNone == bmp->Extension_(KExtensionId, p, NULL) ?
       
   115 		bmp : NULL;
       
   116 	#endif
       
   117 	}
       
   118 	
       
   119 
       
   120 inline CAknBitmap* CAknBitmap::DynamicCast(const CFbsBitmap* aBitmap)
       
   121 	{
       
   122 	return CAknBitmap::DynamicCast(const_cast<CFbsBitmap*>(aBitmap));	
       
   123 	}
       
   124 
       
   125 #endif      // AKN_BITMAP_H
       
   126             
       
   127 // End of File