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
00059 IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
00060
00068 IMPORT_C void SetTextL( const TDesC& aText );
00069
00075 IMPORT_C void SetText( HBufC* aText );
00076
00091 IMPORT_C void SetTextL( const TDesC& aText, TBool aScroll );
00092
00104 IMPORT_C void SetText( HBufC* aText, TBool aScroll );
00105
00112 inline const TDesC* Text() const;
00113
00123 IMPORT_C void SetPicture( const CFbsBitmap* aBitmap,
00124 const CFbsBitmap* aMaskBitmap = NULL );
00125
00133 IMPORT_C void SetPictureFromFileL( const TDesC& aFileName,
00134 TInt aMainId,
00135 TInt aMaskId = -1 );
00136
00151 IMPORT_C void SetSmallPicture( const CFbsBitmap* aBitmap,
00152 const CFbsBitmap* aMaskBitmap,
00153 TBool aVisible );
00154
00160 IMPORT_C void SetFromResourceL( TResourceReader& aReader );
00161
00166 IMPORT_C void SetTextToDefaultL();
00167
00181 IMPORT_C TInt MaxNumberOfVisibleTextRows() const;
00182
00192 IMPORT_C void SetNumberOfVisibleTextRows( TInt aRows );
00193
00194 public:
00195
00201 IMPORT_C virtual void PrepareContext( CWindowGc& aGc ) const;
00202
00203 protected:
00204
00208 IMPORT_C virtual void SizeChanged();
00209
00213 IMPORT_C virtual void PositionChanged();
00214
00221 IMPORT_C virtual void HandleResourceChange( TInt aType );
00222
00228 IMPORT_C virtual TInt CountComponentControls() const;
00229
00237 IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
00238
00239 public:
00240
00246 IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00247
00248 public:
00249
00255 IMPORT_C void SetTitlePaneObserver( MAknTitlePaneObserver* aObserver );
00256
00257 private:
00258
00259 IMPORT_C void* ExtensionInterface( TUid aInterface );
00260
00261 public:
00262
00267 CEikLabel* TextLabel();
00268
00273 CEikImage* TitleImage();
00274
00275 private:
00276
00277 void CommonConstructL();
00278 TUid AppUid();
00279
00280 TInt FormatTitlePaneLabelL( const TInt aOneLineLayoutWidth,
00281 const TInt aTwoLineLayoutWidth,
00282 const CFont* aOneLineFont,
00283 const CFont* aTwoLineFont );
00284
00285 void ReadFromResourceFileL( TResourceReader& aReader );
00286 void SetSmallPictureFromFileL( const TDesC& aFileName, TInt aMainId, TInt aMaskId = -1 );
00287
00288 private:
00289
00290 IMPORT_C virtual void Draw( const TRect& aRect ) const;
00291
00292 protected:
00293
00294 MAknTitlePaneObserver* iTitlePaneObserver;
00295
00296 private:
00297 void SizeChangedInNormalStatusPane();
00298 void SizeChangedInExtendedStatusPane();
00299 void SizeChangedInFlatStatusPane();
00300 void SizeChangedInStaconPane();
00301 RWindow* StatuspaneContainerWindow() const;
00302 void SetupTitleLabelEffectL();
00303 void SetContainerWindowNonFading( TBool aNonFading );
00304
00305 void SetupStaconPaneScrollEffectL();
00306 void SetupFlatStatusPaneScrollEffectL();
00307 void SetupNormalStatusPaneScrollEffectL();
00308 void SetupFlatStatusPaneFadeEffectL();
00309 void SetupExtendedStatusPaneScrollEffectL();
00310 void SetupNoEffectL();
00311
00312 TBool TextFits( TAknTextLineLayout& aTextLayout );
00313
00314 private:
00315
00316 HBufC* iTitleText;
00317 HBufC* iDefaultTitleText;
00318 CAknTitlePaneLabel* iTitleLabel;
00319 TBool iImageShown;
00320 CAknTitlePaneExtension* iExtension;
00321 };
00322
00323 inline const TDesC* CAknTitlePane::Text() const
00324 {
00325 return( iTitleText );
00326 }
00327
00328 #endif