00001 /* 00002 * ============================================================================ 00003 * Name : AknNoteDialog.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * Provides the CAknDialog-derived interface to Avkon Notes. 00008 * Version: 00009 * 00010 * Copyright © 2002 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. All rights are reserved. Copying, 00014 * including reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia Corporation. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia Corporation. 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef __AKNNOTEDIALOG__ 00023 #define __AKNNOTEDIALOG__ 00024 00025 #include <eikdialg.h> 00026 #include "avkon.hrh" 00027 class CEikImage; 00028 class CAknKeySoundSystem; 00029 class CAknNoteControl; 00030 class CAknNoteAttributes; 00031 class CAknNoteDialogExtension; 00032 00033 00042 class CAknNoteDialog : public CEikDialog 00043 { 00044 00045 public: 00046 00050 enum TTimeout { 00051 00057 EUndefinedTimeout = 0, 00059 ENoTimeout = 0, 00061 EShortTimeout = 1500000, 00063 ELongTimeout = 3000000 00064 #start_since SINCE_3_1_SDK 00065 00066 ,EShortestTimeout = 500000 00067 #end_since SINCE_3_1_SDK 00068 }; 00069 00076 enum TTone { 00077 00079 ENoTone = 0, 00080 00082 EConfirmationTone = EAvkonSIDConfirmationTone, 00083 00085 EWarningTone = EAvkonSIDWarningTone, 00086 00088 EErrorTone = EAvkonSIDErrorTone 00089 }; 00090 00091 public: 00092 00100 IMPORT_C CAknNoteDialog(); 00101 00111 IMPORT_C CAknNoteDialog(const TTone& aTone, 00112 const TTimeout& aTimeout = ENoTimeout); 00113 00128 IMPORT_C CAknNoteDialog(CEikDialog** aSelfPtr, 00129 const TTone& aTone = ENoTone, 00130 const TTimeout& aTimeout = ENoTimeout); 00131 00138 IMPORT_C virtual ~CAknNoteDialog(); 00139 00146 IMPORT_C void SetTimeout(const TTimeout& aTimeout); 00147 00154 IMPORT_C void SetTone(const TTone& aTone); 00155 00172 IMPORT_C void SetTextWrapping(TBool aEnabled); 00173 00190 IMPORT_C void SetTextProcessing(TBool aEnabled); 00191 00201 IMPORT_C void SetImageL(CEikImage* aImage); 00202 00214 IMPORT_C void SetIconL(CEikImage* aIcon); 00215 00225 IMPORT_C void SetTextNumberL(TInt aNumber); 00226 00237 IMPORT_C void SetTextPluralityL(const TBool isPlural); 00238 00252 IMPORT_C void SetTextL(const TDesC& aLabel); 00253 00271 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 00272 TEventCode aType); 00273 00282 IMPORT_C void HandleResourceChange(TInt aType); 00283 00297 IMPORT_C void LayoutAndDraw(); 00298 00309 IMPORT_C virtual TInt RunLD(); 00310 00311 00317 IMPORT_C void ExitSleepingDialog(); 00318 00319 protected: 00320 00335 IMPORT_C void SetSizeAndPosition(const TSize& aSize); 00336 00353 IMPORT_C void PreLayoutDynInitL(void); 00354 00368 IMPORT_C void PostLayoutDynInitL(); 00369 00381 IMPORT_C void PlayTone(); 00382 00396 IMPORT_C void ReportUserActivity() const; 00397 00411 IMPORT_C static TInt StaticDeleteL(TAny* aThis); 00412 00426 IMPORT_C CAknNoteAttributes* ControlAttributes(); 00427 00435 IMPORT_C void TransferControlAttributes(); 00436 00448 IMPORT_C CAknKeySoundSystem* SoundSystem() const; 00449 00462 IMPORT_C CAknNoteControl* NoteControl(); 00463 00464 private: 00465 00466 void DbgCheckSelfPtr(CEikDialog** aSelfPtr); 00467 00468 protected: 00469 00473 CPeriodic* iTimer; 00474 00478 TInt iTimeoutInMicroseconds; 00479 00485 CEikDialog** iSelfPtr; 00486 00490 TTone iTone; 00491 00495 CAknNoteAttributes* iControlAttributes; 00496 00497 private: 00498 00499 //TInt iSpare; 00500 CAknNoteDialogExtension* iNoteExtension; 00501 00502 public: 00503 00518 IMPORT_C TInt ExecuteDlgLD(const TTimeout aTimeout, 00519 const TTone aTone, 00520 TInt aResourceID); 00521 00535 IMPORT_C TInt ExecuteDlgLD(const TTone aTone,TInt aResourceID); 00536 00550 IMPORT_C TInt ExecuteDlgLD(TInt aResourceId, TInt aNoteControlId=0); 00551 00562 IMPORT_C TInt RunDlgLD(const TTimeout aTimeout,const TTone aTone); 00563 00573 IMPORT_C TInt RunDlgLD(const TTone aTone); 00574 IMPORT_C TInt RunDlgLD(); 00583 00593 IMPORT_C TInt RunDlgLD(TInt aNoteControlId); 00594 00604 IMPORT_C void SetCurrentLabelL(TInt aControlId,const TDesC& aLabel); 00605 00606 private: 00607 00608 IMPORT_C virtual void CEikDialog_Reserved_1(); 00609 00610 IMPORT_C virtual void CEikDialog_Reserved_2(); 00611 00612 private: // new virtual function. 00613 00614 IMPORT_C virtual void CAknNoteDialog_Reserved(); 00615 00616 protected: 00617 00618 // This method id reserved for CEikAlert usage 00624 IMPORT_C void SetNoMemoryAllocation(); 00625 00626 00627 private: // from eikdialog 00628 00629 IMPORT_C void SizeChanged(); 00630 00631 void SetSkinBackGroundRect(); 00632 00633 private: 00634 00635 void CreateExtensionL(); 00636 00637 static TInt CallbackStartAnimationL(TAny* aThis); 00638 00639 public: 00640 00648 IMPORT_C virtual void HandlePointerEventL( 00649 const TPointerEvent& aPointerEvent); 00650 00651 private: 00652 00656 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00657 }; 00658 00659 00660 // __AKNNOTEDIALOG__ 00661 #endif 00662 00663 // End of file