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-2007 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             };
00065             
00066         enum TAknPreviewPopUpContentSize
00067             {
00068             ESmall,
00069             ELarge
00070             };
00071             
00072     public: // Constructors and destructor
00073 
00080         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00081             MAknPreviewPopUpContentProvider& aContentProvider );
00082 
00089         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent );
00090         
00098         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00099             MAknPreviewPopUpContentProvider& aContentProvider,
00100             const TInt aStyle );
00101 
00109         IMPORT_C static CAknPreviewPopUpController* NewL( CCoeControl& aContent,
00110             const TInt aStyle );
00111             
00115         ~CAknPreviewPopUpController();
00116 
00117     public: // New functions
00118         
00127         IMPORT_C static TAknPreviewPopUpContentSize ContentSizeInLayout();
00128 
00134         IMPORT_C void SetPopUpShowDelay( const TTimeIntervalMicroSeconds32& aDelay );
00135         
00141         IMPORT_C void SetPopUpHideDelay( const TTimeIntervalMicroSeconds32& aDelay );
00142         
00149         IMPORT_C void ShowPopUp();
00150         
00154         IMPORT_C void HidePopUp();
00155         
00162         IMPORT_C void ContentReady();
00163         
00170         IMPORT_C void SetPosition( const TPoint& aPoint );
00171 
00180         IMPORT_C void SetPositionByHighlight( const TRect& aHighlightRect );
00181 
00187         IMPORT_C void AddObserverL( const MAknPreviewPopUpObserver& aObserver );
00188         
00193         IMPORT_C void RemoveObserver( const MAknPreviewPopUpObserver& aObserver );
00194         
00199         IMPORT_C void UpdateContentSize();
00200         
00204         IMPORT_C TSize Size() const;
00205         
00212         IMPORT_C void SetHeadingTextL( const TDesC& aText );
00213         
00218         void NotifyObservers( MAknPreviewPopUpObserver::TPreviewPopUpEvent aEvent );
00219       
00220     protected: // Functions from base classes
00221         
00225         void DoCancel();
00226         
00230         void RunL();
00231         
00237         TInt RunError( TInt aError );
00238 
00239     private: // Constructors
00240 
00245         CAknPreviewPopUpController( 
00246             MAknPreviewPopUpContentProvider* aContentProvider );
00247 
00253         void ConstructL( CCoeControl& aContent, 
00254                          const TInt aStyle );
00255 
00256     private: // Data
00257         
00258             enum TPreviewState
00259                 {
00260                 EShowing,
00261                 EHiding,
00262                 EBuildingContent
00263                 };
00264                 
00265         // state of preview popup controller
00266         TPreviewState iState;
00267         
00268             // interface for asynchronous content building
00269         MAknPreviewPopUpContentProvider* iContentProvider; // Not owned
00270         
00271         // pointer to preview popup.
00272         CAknPreviewPopUp* iPopUp;
00273         
00274         // delay used before showing the preview popup
00275         TTimeIntervalMicroSeconds32 iPopUpShowDelay;
00276         
00277         // delay used before hiding the preview popup
00278         TTimeIntervalMicroSeconds32 iPopUpHideDelay;
00279         
00280         // array containing pointers to registered observers
00281         RPointerArray<MAknPreviewPopUpObserver> iObservers;
00282     };
00283 
00284 // AKNPREVIEWPOPUPCONTROLLER_H
00285 #endif
00286 
00287 //  End of File

Copyright © Nokia Corporation 2001-2008
Back to top