AknInfoPopupNoteController.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : AknInfoPopupNoteController.h
00004 *  Part of     : UI Framework / Avkon
00005 *  Interface   : Info popup note API
00006 *  Description : The interface of the info pop-up note
00007 *  Version     : %version: e003sa01#8 %
00008 *
00009 *  Copyright © 2005, 2006 Nokia.  All rights reserved.
00010 *  This material, including documentation and any related computer
00011 *  programs, is protected by copyright controlled by Nokia.  All
00012 *  rights are reserved.  Copying, including reproducing, storing,
00013 *  adapting or translating, any or all of this material requires the
00014 *  prior written consent of Nokia.  This material also contains
00015 *  confidential information which may not be disclosed to others
00016 *  without the prior written consent of Nokia.
00017 * ============================================================================
00018 */
00019 
00020 // ------------------------------------------------------------------------
00021 // How to use this info popup component (basic case):
00022 //
00023 //
00024 //  #include <AknInfoPopupNote.h>
00025 //  CAknInfoPopupNoteController* iPopupController;
00026 //  ...
00027 //  iPopupController = CAknInfoPopupNoteController::NewL();
00028 //  ...
00029 //  iPopupController->SetTextL( strTestText );
00030 //  iPopupController->ShowInfoPopupNote();
00031 //  ...
00032 //  delete iPopupController;
00033 // ------------------------------------------------------------------------
00034 
00035 
00036 #ifndef CAKNINFOPOPUPNOTECONTROLLER_H
00037 #define CAKNINFOPOPUPNOTECONTROLLER_H
00038 
00039 //  INCLUDES
00040 #include <e32base.h>
00041 #include <gulalign.h>
00042 #include "avkon.hrh"
00043 
00044 // FORWARD DECLARATIONS
00045 class CAknInfoPopupNote;
00046 class CAknInfoPopupNoteController;
00047 
00048 // CLASS DECLARATION
00049 
00056 class MAknInfoPopupNoteObserver
00057     {
00058     public:
00059 
00060         enum TAknInfoPopupNoteEvent
00061             {
00062             EInfoPopupNoteShown,
00063             EInfoPopupNoteHidden
00064             };
00065 
00072         virtual void HandleInfoPopupNoteEvent(
00073             CAknInfoPopupNoteController* aController,
00074             TAknInfoPopupNoteEvent aEvent ) = 0;
00075     };
00076 
00077 
00087 class CAknInfoPopupNoteController : public CTimer
00088     {
00089 public:
00095     enum TTone
00096         {
00098         ENoTone = 0,
00100         EConfirmationTone = EAvkonSIDConfirmationTone,
00102         EWarningTone = EAvkonSIDWarningTone,
00104         EErrorTone = EAvkonSIDErrorTone
00105         };
00106 
00107 public: // Constructors and destructor
00108 
00112     IMPORT_C static CAknInfoPopupNoteController* NewL();
00113 
00117     virtual ~CAknInfoPopupNoteController();
00118 
00119 public: // New functions
00120 
00126     IMPORT_C void SetTimeDelayBeforeShow( TInt aMilliSeconds );
00127 
00134     IMPORT_C void SetTimePopupInView( TInt aMilliSeconds );
00135 
00141     IMPORT_C void SetTextL( const TDesC& aText );
00142 
00147     IMPORT_C void ShowInfoPopupNote();
00148 
00152     IMPORT_C void HideInfoPopupNote();
00153 
00158     IMPORT_C void AddObserverL( const MAknInfoPopupNoteObserver& aObserver );
00159 
00164     IMPORT_C void RemoveObserver( const MAknInfoPopupNoteObserver& aObserver );
00165 
00173     IMPORT_C void SetPositionAndAlignment( const TPoint& aPosition,
00174                                            const TGulAlignmentValue& aAlignment );
00175 
00185     IMPORT_C void SetPositionByHighlight( const TRect& aHighlightRect );
00186 
00192     IMPORT_C void RestoreDefaultPosition();
00193 
00201     IMPORT_C void SetTooltipModeL( const TBool aTooltipMode );
00202 
00207     void NotifyObservers( MAknInfoPopupNoteObserver::TAknInfoPopupNoteEvent aEvent );
00208 
00213     IMPORT_C void SetTone( const TTone& aTone );
00214 
00221     IMPORT_C void HideWhenAppFaded( const TBool aHide );
00222 
00223 protected:
00224 
00228     void DoCancel();
00229 
00230 private: // From CActive
00231 
00235     void RunL();
00236 
00237 private:
00238 
00242     CAknInfoPopupNoteController();
00243 
00247     void ConstructL();
00248 
00252     void PlayTone();
00253 
00254 private: // Data
00255 
00256     enum TInfoPopupNoteState
00257         {
00258         EHidden,
00259         EWaitingToShow,
00260         EShowing
00261         };
00262 
00263     TInfoPopupNoteState iState;
00264 
00265     // Own. View object for popup's model-view-controller
00266     CAknInfoPopupNote* iPopup;
00267 
00268     // Array containing the observers of popup.
00269     RPointerArray<MAknInfoPopupNoteObserver> iObservers;
00270 
00271     // Delay before popup show
00272     TInt iTimeDelayBeforeShow; // in microseconds
00273 
00274     // How long popup is shown
00275     TInt iTimeInView; // in microseconds
00276 
00277     // Specifies the tone
00278     TTone iTone;
00279     };
00280 
00281 #endif // CAKNINFOPOPUPNOTECONTROLLER_H
00282 
00283 
00284 // End of File

Copyright © Nokia Corporation 2001-2007
Back to top