00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AKNNOTECONTROL_H
00024 #define AKNNOTECONTROL_H
00025
00026
00027 #include <AknControl.h>
00028 #include <aknutils.h>
00029
00030 #include <aknprogresstimer.h>
00031 #include <aknbitmapanimation.h>
00032
00033
00034 class CEikImage;
00035 class CEikLabel;
00036 class CEikProgressInfo;
00037 class CAknNoteAttributes;
00038 class CAknTextControl;
00039 class TAknWindowLineLayout;
00040
00041
00042
00052 class CAknNoteControl : public CAknControl
00053 {
00054 friend class CAknNoteAttributes;
00055
00056 public:
00057
00061 IMPORT_C CAknNoteControl();
00062
00066 IMPORT_C virtual ~CAknNoteControl();
00067
00073 void ConstructFromResourceL(TResourceReader& aRes);
00074
00075 public:
00076
00087 IMPORT_C void SetImageL(CEikImage* aImage);
00088
00098 IMPORT_C void SetAnimationL(TInt aResource);
00099
00109 IMPORT_C void SetIconL(CEikImage* aIcon);
00110
00118 IMPORT_C void SetFinalProgressValue(TInt aValue);
00119
00128 IMPORT_C TInt IncrementBarsAndDraw(TInt aIncrement);
00129
00135 IMPORT_C void CreateProgressBarL();
00136
00144 IMPORT_C CEikProgressInfo* GetProgressInfo();
00145
00151 IMPORT_C void StartAnimationL();
00152
00162 IMPORT_C TInt CancelAnimation();
00163
00172 IMPORT_C void ResetText();
00173
00181 IMPORT_C void SetTextL(const TDesC& aText);
00182
00201 IMPORT_C void SetTextL(const TDesC& aText,TInt aLineNum);
00202
00216 IMPORT_C void SetTextNumberL(const TInt aNumber);
00217
00233 IMPORT_C void SetTextPluralityL(const TBool aIsPlural);
00234
00240 IMPORT_C TInt NumberOfLines() const;
00241
00242 public:
00243
00259 IMPORT_C void Layout();
00260
00267 void WindowLayout( TAknWindowLineLayout& aLayout ) const;
00268
00277 IMPORT_C TInt NoteHeight() const;
00278
00288 IMPORT_C TInt NoteWidth() const;
00289
00290 public:
00291
00296 TSize MinimumSize();
00297
00302 CAknNoteAttributes* Attributes() const;
00303
00309 void Reset();
00310
00314 void CreateDefaultImageL();
00315
00316 public:
00317 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00318
00319 public:
00329 class TIndex
00330 {
00331 public:
00332
00340 TIndex(TInt aNumberOfLines,
00341 TBool aHasNti = EFalse,
00342 TSize aImageSize = TSize(0,0));
00343
00344 public:
00345
00350 TInt Lines() const;
00351
00352 public:
00353
00363 TInt WNPWindowTextsLine1(TInt aLineNum) const;
00364
00374 TInt NWIPWindowTextsLine1L(TInt aLineNum) const;
00375
00390 TInt NWIPWindowTextsLine1R(TInt aLineNum) const;
00391
00401 TInt NWIPWindowTextsLine1B(TInt aLineNum) const;
00402
00420 TInt NWIPWindowTextsLine1W(TInt aLineNum) const;
00421
00428 TInt PopupNoteWindow() const;
00429
00438 TInt PopupNoteWaitWindow() const;
00439
00440 private:
00441 void SelfTest() const;
00442 TInt ImageWidthIndex() const;
00443 TInt ImageHeightIndex() const;
00444 TInt HasNtiIndex() const;
00445
00446 private:
00447 TInt iNumberOfLines;
00448 TBool iHasNti;
00449 TSize iImageSize;
00450 };
00451
00452 private:
00453
00454 void Draw(const TRect& aRect) const;
00455 void SizeChanged();
00456 void DoLayout();
00457 TInt CountComponentControls() const;
00458 CCoeControl* ComponentControl(TInt anIndex) const;
00459 private:
00463 IMPORT_C void* ExtensionInterface( TUid aInterface );
00464 private:
00465
00466 TInt NumberTypeIndicationIndex() const;
00467 TInt ImageWidthIndex() const;
00468
00469 TInt AnimationIndex();
00470 void AnimationNoteLayout();
00471
00472
00473 void GeneralNoteLayout();
00474 void GeneralNoteLabelLayout();
00475 void GeneralNoteIconLayout();
00476
00477
00478 void ProgressNoteLayout();
00479 void ProgressNoteLabelLayout();
00480 void ProgressNoteProgressBarLayout();
00481 void ProgressNoteIconLayout();
00482 void ProgressNoteNumberTypeIndicationLayout();
00483
00484
00485 void ImageNoteLayout();
00486 void ImageNoteLabelLayout();
00487 void ImageNoteImageLayout();
00488 void ImageNoteShadowLayout();
00489 void ImageNoteNumberTypeIndicationLayout();
00490
00491 TAknWindowLineLayout GetImageLayout(const TSize& aSize);
00492 TAknWindowLineLayout GetImageShadowLayout(const TSize& aSize);
00493
00494 TRect LayoutRect() const;
00495 void SetLineWidthsL();
00496
00497
00498 void ReduceImageIfNeeded();
00499
00500 void ParseTextL();
00501
00502 private:
00503 CAknTextControl* TextControl() const;
00504
00505 CEikImage* Image() const;
00506 CEikImage* Icon() const;
00507
00508 CEikProgressInfo* ProgressBar() const;
00509
00510 CAknProgressTimer* Timer() const;
00511 CAknBitmapAnimation* Animation() const;
00512
00513 TBitFlags& Flags() const;
00514
00515 private:
00516 TInt iNoteLayout;
00517 TAknLayoutRect iShadowRect;
00518 TBool iImageHasShadow;
00519
00520 CAknNoteAttributes* iAttributes;
00521 CArrayFixFlat<TInt>* iLineWidths;
00522
00523 public:
00529 IMPORT_C void SetDynamicTextL(const TDesC& aText);
00530
00534 IMPORT_C void UpdateAndFormatLabelsL(const TDesC& aLabels);
00535
00539 IMPORT_C void UpdateLabelsL(const TDesC& aLabel1,
00540 const TDesC& aLabel2=KNullDesC,
00541 const TDesC& aLabel3=KNullDesC);
00545 IMPORT_C void UpdateLabels(const TDesC& aLabel1,
00546 const TDesC& aLabel2=KNullDesC,
00547 const TDesC& aLabel3=KNullDesC);
00548
00554 IMPORT_C void SetLabelReserveLengthL(TInt aLength1=0,
00555 TInt aLength2=0,
00556 TInt aLength3=0);
00557
00558 protected:
00559
00571 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00572
00573 public:
00574
00583 IMPORT_C void SetBgRect(const TRect& aRect,
00584 const TPoint& aPos,
00585 TBool aOwnerNotDialog = EFalse);
00586
00591 TInt NoteLayout() const;
00592 };
00593
00594 #endif // AKNNOTECONTROL_H