00001 /* 00002 * ============================================================================ 00003 * Name : akntitle.h 00004 * Part of : AVKON 00005 * 00006 * Description: 00007 * A default control in the status pane's title pane. 00008 * 00009 * Version: 00010 * 00011 * Copyright © 2002 Nokia Corporation. 00012 * This material, including documentation and any related 00013 * computer programs, is protected by copyright controlled by 00014 * Nokia Corporation. All rights are reserved. Copying, 00015 * including reproducing, storing, adapting or translating, any 00016 * or all of this material requires the prior written consent of 00017 * Nokia Corporation. This material also contains confidential 00018 * information which may not be disclosed to others without the 00019 * prior written consent of Nokia Corporation. 00020 * ============================================================================ 00021 */ 00022 00023 #ifndef AKNTITLE_H 00024 #define AKNTITLE_H 00025 00026 #include <AknControl.h> 00027 #include <coeccntx.h> 00028 00029 class CEikLabel; 00030 class CEikImage; 00031 class CAknTitlePaneExtension; 00032 class CAknTitlePaneLabel; 00033 class MAknTitlePaneObserver; 00034 00038 class CAknTitlePane : public CAknControl, public MCoeControlContext 00039 { 00040 public: 00044 IMPORT_C CAknTitlePane(); 00045 00049 IMPORT_C ~CAknTitlePane(); 00050 00054 IMPORT_C void ConstructL(); 00055 00059 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); 00060 00068 IMPORT_C void SetTextL(const TDesC& aText); 00069 00074 IMPORT_C void SetText(HBufC* aText); 00075 00089 IMPORT_C void SetTextL(const TDesC& aText, TBool aScroll); 00090 00100 IMPORT_C void SetText(HBufC* aText, TBool aScroll); 00101 00107 inline const TDesC* Text() const; 00108 00116 IMPORT_C void SetPicture(const CFbsBitmap* aBitmap, const CFbsBitmap* aMaskBitmap = NULL); 00117 00124 IMPORT_C void SetPictureFromFileL(const TDesC& aFileName, TInt aMainId, TInt aMaskId = -1); 00125 00139 IMPORT_C void SetSmallPicture(const CFbsBitmap* aBitmap, const CFbsBitmap* aMaskBitmap, TBool aVisible); 00140 00144 IMPORT_C void SetFromResourceL(TResourceReader& aReader); 00145 00150 IMPORT_C void SetTextToDefaultL(); 00151 00152 #start_since SINCE_3_1_SDK 00153 00163 IMPORT_C TInt MaxNumberOfVisibleTextRows() const; 00164 #end_since SINCE_3_1_SDK 00165 00166 #start_since SINCE_3_1_SDK 00167 00177 IMPORT_C void SetNumberOfVisibleTextRows(TInt aRows); 00178 #end_since SINCE_3_1_SDK 00179 00180 public: // from MCoeControlContext 00186 IMPORT_C virtual void PrepareContext(CWindowGc& aGc) const; 00187 00188 protected: // From CCoeControl 00189 00193 IMPORT_C virtual void SizeChanged(); 00194 00198 IMPORT_C virtual void PositionChanged(); 00199 00205 IMPORT_C virtual void HandleResourceChange(TInt aType); 00206 00211 IMPORT_C virtual TInt CountComponentControls() const; 00212 00218 IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const; 00219 00220 public: 00226 IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent ); 00227 00232 IMPORT_C void SetTitlePaneObserver( MAknTitlePaneObserver* aObserver); 00233 private: 00237 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00238 00239 public: 00240 00245 CEikLabel* TextLabel(); 00246 00247 private: 00248 void CommonConstructL(); 00249 TUid AppUid(); 00250 00251 TInt FormatTitlePaneLabelL( 00252 const TInt aOneLineLayoutWidth, const TInt aTwoLineLayoutWidth, 00253 const CFont* aOneLineFont, const CFont* aTwoLineFont); 00254 00255 void ReadFromResourceFileL(TResourceReader& aReader); 00256 void SetSmallPictureFromFileL(const TDesC& aFileName, TInt aMainId, TInt aMaskId = -1); 00257 00258 private: // From CCoeControl 00259 IMPORT_C virtual void Draw(const TRect& aRect) const; 00260 00261 protected: 00262 MAknTitlePaneObserver* iTitlePaneObserver; 00263 00264 private: 00265 void SizeChangedInNormalStatusPane(); 00266 void SizeChangedInExtendedStatusPane(); 00267 void SizeChangedInFlatStatusPane(); 00268 void SizeChangedInStaconPane(); 00269 RWindow* StatuspaneContainerWindow() const; 00270 void SetupTitleLabelEffectL(); 00271 void SetContainerWindowNonFading(TBool aNonFading); 00272 00273 void SetupStaconPaneScrollEffectL(); 00274 void SetupFlatStatusPaneScrollEffectL(); 00275 void SetupNormalStatusPaneScrollEffectL(); 00276 void SetupFlatStatusPaneFadeEffectL(); 00277 void SetupExtendedStatusPaneScrollEffectL(); 00278 void SetupNoEffectL(); 00279 00280 TBool TextFits(TAknTextLineLayout& aTextLayout); 00281 private: 00282 HBufC* iTitleText; 00283 HBufC* iDefaultTitleText; 00284 CAknTitlePaneLabel* iTitleLabel; 00285 TBool iImageShown; 00286 CAknTitlePaneExtension* iExtension; 00287 }; 00288 00289 00290 inline const TDesC* CAknTitlePane::Text() const 00291 { return(iTitleText); } 00292 00293 00294 // AKNTITLE_H 00295 #endif