00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef C_AKNTITLE_H
00020 #define C_AKNTITLE_H
00021
00022 #include <akncontrol.h>
00023 #include <coeccntx.h>
00024
00025 class CEikLabel;
00026 class CEikImage;
00027 class CAknTitlePaneExtension;
00028 class CAknTitlePaneLabel;
00029 class MAknTitlePaneObserver;
00030 class TAknTextLineLayout;
00031
00037 class CAknTitlePane : public CAknControl, public MCoeControlContext
00038 {
00039 public:
00043 IMPORT_C CAknTitlePane();
00044
00048 IMPORT_C ~CAknTitlePane();
00049
00053 IMPORT_C void ConstructL();
00054
00058 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
00059
00067 IMPORT_C void SetTextL(const TDesC& aText);
00068
00073 IMPORT_C void SetText(HBufC* aText);
00074
00088 IMPORT_C void SetTextL(const TDesC& aText, TBool aScroll);
00089
00099 IMPORT_C void SetText(HBufC* aText, TBool aScroll);
00100
00106 inline const TDesC* Text() const;
00107
00115 IMPORT_C void SetPicture(const CFbsBitmap* aBitmap, const CFbsBitmap* aMaskBitmap = NULL);
00116
00123 IMPORT_C void SetPictureFromFileL(const TDesC& aFileName, TInt aMainId, TInt aMaskId = -1);
00124
00138 IMPORT_C void SetSmallPicture(const CFbsBitmap* aBitmap, const CFbsBitmap* aMaskBitmap, TBool aVisible);
00139
00143 IMPORT_C void SetFromResourceL(TResourceReader& aReader);
00144
00149 IMPORT_C void SetTextToDefaultL();
00150
00161 IMPORT_C TInt MaxNumberOfVisibleTextRows() const;
00162
00172 IMPORT_C void SetNumberOfVisibleTextRows(TInt aRows);
00173
00174 public:
00180 IMPORT_C virtual void PrepareContext(CWindowGc& aGc) const;
00181
00182 protected:
00183
00187 IMPORT_C virtual void SizeChanged();
00188
00192 IMPORT_C virtual void PositionChanged();
00193
00199 IMPORT_C virtual void HandleResourceChange(TInt aType);
00200
00205 IMPORT_C virtual TInt CountComponentControls() const;
00206
00212 IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
00213
00214 public:
00220 IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00221
00226 IMPORT_C void SetTitlePaneObserver( MAknTitlePaneObserver* aObserver);
00227 private:
00231 IMPORT_C void* ExtensionInterface( TUid aInterface );
00232
00233 public:
00234
00239 CEikLabel* TextLabel();
00240
00241 private:
00242 void CommonConstructL();
00243 TUid AppUid();
00244
00245 TInt FormatTitlePaneLabelL(
00246 const TInt aOneLineLayoutWidth, const TInt aTwoLineLayoutWidth,
00247 const CFont* aOneLineFont, const CFont* aTwoLineFont);
00248
00249 void ReadFromResourceFileL(TResourceReader& aReader);
00250 void SetSmallPictureFromFileL(const TDesC& aFileName, TInt aMainId, TInt aMaskId = -1);
00251
00252 private:
00253 IMPORT_C virtual void Draw(const TRect& aRect) const;
00254
00255 protected:
00256 MAknTitlePaneObserver* iTitlePaneObserver;
00257
00258 private:
00259 void SizeChangedInNormalStatusPane();
00260 void SizeChangedInExtendedStatusPane();
00261 void SizeChangedInFlatStatusPane();
00262 void SizeChangedInStaconPane();
00263 RWindow* StatuspaneContainerWindow() const;
00264 void SetupTitleLabelEffectL();
00265 void SetContainerWindowNonFading(TBool aNonFading);
00266
00267 void SetupStaconPaneScrollEffectL();
00268 void SetupFlatStatusPaneScrollEffectL();
00269 void SetupNormalStatusPaneScrollEffectL();
00270 void SetupFlatStatusPaneFadeEffectL();
00271 void SetupExtendedStatusPaneScrollEffectL();
00272 void SetupNoEffectL();
00273
00274 TBool TextFits(TAknTextLineLayout& aTextLayout);
00275 private:
00276 HBufC* iTitleText;
00277 HBufC* iDefaultTitleText;
00278 CAknTitlePaneLabel* iTitleLabel;
00279 TBool iImageShown;
00280 CAknTitlePaneExtension* iExtension;
00281 };
00282
00283
00284 inline const TDesC* CAknTitlePane::Text() const
00285 { return(iTitleText); }
00286
00287
00288 #endif