S60 3rd Edition API Reference: akninfopopupnotecontroller.h Source File

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 #start_since SINCE_3_1_SDK
00043 #include "avkon.hrh"
00044 #end_since SINCE_3_1_SDK
00045 
00046 // FORWARD DECLARATIONS
00047 class CAknInfoPopupNote;
00048 class CAknInfoPopupNoteController;
00049 
00050 // CLASS DECLARATION
00051 
00058 class MAknInfoPopupNoteObserver
00059     {
00060     public:
00061 
00062         enum TAknInfoPopupNoteEvent
00063             {
00064             EInfoPopupNoteShown,
00065             EInfoPopupNoteHidden
00066             };
00067 
00074         virtual void HandleInfoPopupNoteEvent(
00075             CAknInfoPopupNoteController* aController,
00076             TAknInfoPopupNoteEvent aEvent ) = 0;
00077     };
00078 
00079 
00089 class CAknInfoPopupNoteController : public CTimer
00090     {
00091 public:
00092 #start_since SINCE_3_1_SDK
00093 
00099     enum TTone
00100         {
00102         ENoTone = 0,
00104         EConfirmationTone = EAvkonSIDConfirmationTone,
00106         EWarningTone = EAvkonSIDWarningTone,
00108         EErrorTone = EAvkonSIDErrorTone
00109         };
00110 #end_since SINCE_3_1_SDK
00111 public: // Constructors and destructor
00112 
00116     IMPORT_C static CAknInfoPopupNoteController* NewL();
00117 
00121     virtual ~CAknInfoPopupNoteController();
00122 
00123 public: // New functions
00124 
00130     IMPORT_C void SetTimeDelayBeforeShow( TInt aMilliSeconds );
00131 
00137     IMPORT_C void SetTimePopupInView( TInt aMilliSeconds );
00138 
00144     IMPORT_C void SetTextL( const TDesC& aText );
00145 
00150     IMPORT_C void ShowInfoPopupNote();
00151 
00155     IMPORT_C void HideInfoPopupNote();
00156 
00161     IMPORT_C void AddObserverL( const MAknInfoPopupNoteObserver& aObserver );
00162 
00167     IMPORT_C void RemoveObserver( const MAknInfoPopupNoteObserver& aObserver );
00168 
00176     IMPORT_C void SetPositionAndAlignment( const TPoint& aPosition,
00177                                            const TGulAlignmentValue& aAlignment );
00178 
00188     IMPORT_C void SetPositionByHighlight( const TRect& aHighlightRect );
00189 
00195     IMPORT_C void RestoreDefaultPosition();
00196 
00204     IMPORT_C void SetTooltipModeL( const TBool aTooltipMode );
00205 
00210     void NotifyObservers( MAknInfoPopupNoteObserver::TAknInfoPopupNoteEvent aEvent );
00211 
00212 #start_since SINCE_3_1_SDK
00213 
00218     IMPORT_C void SetTone( const TTone& aTone );
00219 #end_since SINCE_3_1_SDK
00220 #start_since SINCE_3_1_SDK
00221 
00229     IMPORT_C void HideWhenAppFaded( const TBool aHide );
00230 #end_since SINCE_3_1_SDK
00231 
00232 protected:
00233 
00234 
00235 private: // From CActive
00236 
00240     void RunL();
00241 
00242 private:
00243 
00247     CAknInfoPopupNoteController();
00248 
00252     void ConstructL();
00253 
00257     void PlayTone();
00258 
00259 private: // Data
00260 
00261     enum TInfoPopupNoteState
00262         {
00263         EHidden,
00264         EWaitingToShow,
00265         EShowing
00266         };
00267 
00268     TInfoPopupNoteState iState;
00269 
00270     // Own. View object for popup's model-view-controller
00271     CAknInfoPopupNote* iPopup;
00272 
00273     // Array containing the observers of popup.
00274     RPointerArray<MAknInfoPopupNoteObserver> iObservers;
00275 
00276     // Delay before popup show
00277     TInt iTimeDelayBeforeShow; // in microseconds
00278 
00279     // How long popup is shown
00280     TInt iTimeInView; // in microseconds
00281 
00282     // Specifies the tone
00283     TTone iTone;
00284     };
00285 
00286 // CAKNINFOPOPUPNOTECONTROLLER_H
00287 #endif
00288 
00289 
00290 // End of File

Copyright © Nokia Corporation 2001-2007
Back to top