idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnbitmapadapter.h
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Implements Xuikon image component.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _XNBITMAPADAPTER_H
       
    21 #define _XNBITMAPADAPTER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "xncontroladapter.h"
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CXnNodePluginIf;
       
    29 class CXnImageDecoder;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 *  @ingroup group_xnbitmapfactory
       
    34 *  @lib xn3bitmapfactory.dll
       
    35 *  @since Series 60 3.1
       
    36 */
       
    37 class CXnBitmapAdapter : public CXnControlAdapter
       
    38    {
       
    39 public:
       
    40 	/**
       
    41 	 * 2 phase construction.
       
    42 	 */
       
    43 	static CXnBitmapAdapter* NewL(CXnNodePluginIf& aNode);
       
    44 
       
    45 	/**
       
    46 	 * Destructor.
       
    47 	 */
       
    48 	virtual ~CXnBitmapAdapter();
       
    49 	
       
    50 
       
    51 public: // New functions
       
    52     /**
       
    53     * Sets content bitmaps. Ownership is transferred.
       
    54     * @since Series 60 3.1
       
    55     * @param aBitmap Bitmap to draw
       
    56     * @param aMask Mask to use
       
    57     */        
       
    58     void SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask);   
       
    59 
       
    60     /**
       
    61     * Sets content bitmaps from file.
       
    62     * @since S60 5.2
       
    63     * @param aFilename Bitmap filename.    
       
    64     */            
       
    65     void SetContentBitmaps( TFileName& aFilename );
       
    66     
       
    67     /**
       
    68     * Gets content bitmaps. Ownership not is transferred.
       
    69     * @since Series 60 3.1
       
    70     * @param aBitmap Bitmap to draw
       
    71     * @param aMask Mask to use
       
    72     */        
       
    73     void ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask);
       
    74    
       
    75 public: // From Base classes 
       
    76     /**
       
    77     * From CXnControlAdapter Handles the property changes.
       
    78     * @since Series 60 3.1
       
    79     * @return void.
       
    80     */    
       
    81     void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL);
       
    82     
       
    83     /**
       
    84     * From CCoeControl Handles the skin change
       
    85     * @since Series 60 3.2
       
    86     * @return void.
       
    87     */
       
    88     void SkinChanged();
       
    89 
       
    90 protected:
       
    91 	/**
       
    92     * Size change notification
       
    93     */ 
       
    94     void SizeChanged();    
       
    95 	
       
    96 private:
       
    97 	CXnBitmapAdapter(CXnNodePluginIf& aNode);
       
    98 	void ConstructL(CXnNodePluginIf& aNode);
       
    99 
       
   100     void InitializeBitmapsL();
       
   101 private: // Data
       
   102     // UI node, not owned
       
   103     CXnNodePluginIf& iNode;
       
   104     // Image decoder, owned
       
   105     CXnImageDecoder* iDecoder;
       
   106     // Whether the bitmaps has been loaded or not.
       
   107     mutable TBool iAreBitmapsLoaded;
       
   108     // Whether the data API has been used or not.
       
   109     TBool iAreBitmapsSet;
       
   110     // Path of the bitmap, owned
       
   111     HBufC* iPath;
       
   112     // The size of the current bitmap
       
   113     TSize iBitmapSize;
       
   114 	// The path of the fallback image, owned
       
   115     HBufC* iFallbackPath;
       
   116 	// Whether fallback path has changed and bitmaps need to be reloaded
       
   117     TBool iFallbackPathChange;
       
   118    };
       
   119 
       
   120 
       
   121 
       
   122 #endif      // XNBITMAPADAPTER_H
       
   123             
       
   124 // End of File