AknPreviewPopUpController.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : aknpreviewpopupcontroller.h
00004 *  Part of     : UI Framework Core / Avkon
00005 *  Description : Preview popup controller.
00006 *  Version     : 1.0
00007 *
00008 *  Copyright © 2005-2009 Nokia. All rights reserved.
00009 *  This material, including documentation and any related 
00010 *  computer programs, is protected by copyright controlled by 
00011 *  Nokia. All rights are reserved. Copying, including 
00012 *  reproducing, storing, adapting or translating, any 
00013 *  or all of this material requires the prior written consent of 
00014 *  Nokia. This material also contains confidential 
00015 *  information which may not be disclosed to others without the 
00016 *  prior written consent of Nokia.
00017 * ==============================================================================
00018 */
00019 
00020 #ifndef AKNPREVIEWPOPUPCONTROLLER_H
00021 #define AKNPREVIEWPOPUPCONTROLLER_H
00022 
00023 // INCLUDES
00024 #include <e32base.h>
00025 #include <e32std.h>
00026 #include <coecntrl.h>
00027 #include <aknpreviewpopupobserver.h>
00028 
00029 // FORWARD DECLARATIONS
00030 class MAknPreviewPopUpContentProvider;
00031 class CAknPreviewPopUp;
00032 
00033 // CLASS DECLARATION
00034 
00054 NONSHARABLE_CLASS( CAknPreviewPopUpController ) : public CTimer
00055     {
00056     public: // Type definitions
00057         enum TAknPreviewStyle
00058             {
00059             ELayoutDefault = 0x0001, // default graphics are used
00060             ELayoutSubMenu = 0x0002, // submenu graphics are used
00061             EPermanentMode = 0x0004, // popup stays visible infinitely
00062             EFixedMode     = 0x0008, // fixed position and size are used
00063             EExcludeFrames = 0x0010, // frames and heading area are excluded in fixed mode
00064             EAutoMirror    = 0x0020, // opening direction is automatically mirrored in left-to-right layouts
00065             EDontClose     = 0x0040  // popup not closed when pointer up received outside popup 
00066     };
00067             
00068         enum TAknPreviewPopUpContentSize
00069             {
00070             ESmall,
00071             ELarge
00072             };
00073             
00074     public: // Constructors and destructor
00075 
00082         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00083             MAknPreviewPopUpContentProvider& aContentProvider );
00084 
00091         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent );
00092         
00100         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00101             MAknPreviewPopUpContentProvider& aContentProvider,
00102             const TInt aStyle );
00103 
00111         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00112             const TInt aStyle );
00113             
00117         ~CAknPreviewPopUpController();
00118 
00119     public: // New functions
00120         
00129         IMPORT_C static TAknPreviewPopUpContentSize ContentSizeInLayout();
00130 
00136         IMPORT_C void SetPopUpShowDelay( const TTimeIntervalMicroSeconds32& aDelay );
00137         
00143         IMPORT_C void SetPopUpHideDelay( const TTimeIntervalMicroSeconds32& aDelay );
00144         
00151         IMPORT_C void ShowPopUp();
00152         
00156         IMPORT_C void HidePopUp();
00157         
00164         IMPORT_C void ContentReady();
00165         
00172         IMPORT_C void SetPosition( const TPoint& aPoint );
00173 
00182         IMPORT_C void SetPositionByHighlight( const TRect& aHighlightRect );
00183 
00189         IMPORT_C void AddObserverL( const MAknPreviewPopUpObserver& aObserver );
00190         
00195         IMPORT_C void RemoveObserver( const MAknPreviewPopUpObserver& aObserver );
00196         
00201         IMPORT_C void UpdateContentSize();
00202         
00206         IMPORT_C TSize Size() const;
00207         
00214         IMPORT_C void SetHeadingTextL( const TDesC& aText );
00215         
00220         void NotifyObservers( MAknPreviewPopUpObserver::TPreviewPopUpEvent aEvent );
00221       
00225         IMPORT_C void ResetTimer();
00226         
00227     protected: // Functions from base classes
00228         
00232         void DoCancel();
00233         
00237         void RunL();
00238         
00244         TInt RunError( TInt aError );
00245 
00246     private: // Constructors
00247 
00252         CAknPreviewPopUpController( 
00253             MAknPreviewPopUpContentProvider* aContentProvider );
00254 
00260         void ConstructL( CCoeControl& aContent, 
00261                          const TInt aStyle );
00262 
00263     private: // Data
00264         
00265             enum TPreviewState
00266                 {
00267                 EShowing,
00268                 EHiding,
00269                 EBuildingContent
00270                 };
00271                 
00272         // state of preview popup controller
00273         TPreviewState iState;
00274         
00275             // interface for asynchronous content building
00276         MAknPreviewPopUpContentProvider* iContentProvider; // Not owned
00277         
00278         // pointer to preview popup.
00279         CAknPreviewPopUp* iPopUp;
00280         
00281         // delay used before showing the preview popup
00282         TTimeIntervalMicroSeconds32 iPopUpShowDelay;
00283         
00284         // delay used before hiding the preview popup
00285         TTimeIntervalMicroSeconds32 iPopUpHideDelay;
00286         
00287         // array containing pointers to registered observers
00288         RPointerArray<MAknPreviewPopUpObserver> iObservers;
00289         
00290         // True if timer is being resetted and the DoCancel should not hide the popup
00291         TBool iResetting;
00292     };
00293 
00294 #endif // AKNPREVIEWPOPUPCONTROLLER_H
00295 
00296 //  End of File  

Copyright © Nokia Corporation 2001-2007
Back to top