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#7 %
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 
00133     IMPORT_C void SetTimePopupInView( TInt aMilliSeconds );
00134 
00140     IMPORT_C void SetTextL( const TDesC& aText );
00141 
00146     IMPORT_C void ShowInfoPopupNote();
00147 
00151     IMPORT_C void HideInfoPopupNote();
00152 
00157     IMPORT_C void AddObserverL( const MAknInfoPopupNoteObserver& aObserver );
00158 
00163     IMPORT_C void RemoveObserver( const MAknInfoPopupNoteObserver& aObserver );
00164 
00172     IMPORT_C void SetPositionAndAlignment( const TPoint& aPosition,
00173                                            const TGulAlignmentValue& aAlignment );
00174 
00184     IMPORT_C void SetPositionByHighlight( const TRect& aHighlightRect );
00185 
00191     IMPORT_C void RestoreDefaultPosition();
00192 
00200     IMPORT_C void SetTooltipModeL( const TBool aTooltipMode );
00201 
00206     void NotifyObservers( MAknInfoPopupNoteObserver::TAknInfoPopupNoteEvent aEvent );
00207 
00212     IMPORT_C void SetTone( const TTone& aTone );
00213 
00220     IMPORT_C void HideWhenAppFaded( const TBool aHide );
00221 
00222 protected:
00223 
00227     void DoCancel();
00228 
00229 private: // From CActive
00230 
00234     void RunL();
00235 
00236 private:
00237 
00241     CAknInfoPopupNoteController();
00242 
00246     void ConstructL();
00247 
00251     void PlayTone();
00252 
00253 private: // Data
00254 
00255     enum TInfoPopupNoteState
00256         {
00257         EHidden,
00258         EWaitingToShow,
00259         EShowing
00260         };
00261 
00262     TInfoPopupNoteState iState;
00263 
00264     // Own. View object for popup's model-view-controller
00265     CAknInfoPopupNote* iPopup;
00266 
00267     // Array containing the observers of popup.
00268     RPointerArray<MAknInfoPopupNoteObserver> iObservers;
00269 
00270     // Delay before popup show
00271     TInt iTimeDelayBeforeShow; // in microseconds
00272 
00273     // How long popup is shown
00274     TInt iTimeInView; // in microseconds
00275 
00276     // Specifies the tone
00277     TTone iTone;
00278     };
00279 
00280 // CAKNINFOPOPUPNOTECONTROLLER_H
00281 #endif
00282 
00283 
00284 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top