00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKNPREVIEWPOPUPCONTROLLER_H
00021 #define AKNPREVIEWPOPUPCONTROLLER_H
00022
00023
00024 #include <e32base.h>
00025 #include <e32std.h>
00026 #include <coecntrl.h>
00027 #include <aknpreviewpopupobserver.h>
00028
00029
00030 class MAknPreviewPopUpContentProvider;
00031 class CAknPreviewPopUp;
00032
00033
00034
00054 NONSHARABLE_CLASS( CAknPreviewPopUpController ) : public CTimer
00055 {
00056 public:
00057 enum TAknPreviewStyle
00058 {
00059 ELayoutDefault = 0x0001,
00060 ELayoutSubMenu = 0x0002,
00061 EPermanentMode = 0x0004,
00062 EFixedMode = 0x0008,
00063 EExcludeFrames = 0x0010
00064 };
00065
00066 enum TAknPreviewPopUpContentSize
00067 {
00068 ESmall,
00069 ELarge
00070 };
00071
00072 public:
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:
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:
00221
00225 void DoCancel();
00226
00230 void RunL();
00231
00237 TInt RunError( TInt aError );
00238
00239 private:
00240
00245 CAknPreviewPopUpController(
00246 MAknPreviewPopUpContentProvider* aContentProvider );
00247
00253 void ConstructL( CCoeControl& aContent,
00254 const TInt aStyle );
00255
00256 private:
00257
00258 enum TPreviewState
00259 {
00260 EShowing,
00261 EHiding,
00262 EBuildingContent
00263 };
00264
00265
00266 TPreviewState iState;
00267
00268
00269 MAknPreviewPopUpContentProvider* iContentProvider;
00270
00271
00272 CAknPreviewPopUp* iPopUp;
00273
00274
00275 TTimeIntervalMicroSeconds32 iPopUpShowDelay;
00276
00277
00278 TTimeIntervalMicroSeconds32 iPopUpHideDelay;
00279
00280
00281 RPointerArray<MAknPreviewPopUpObserver> iObservers;
00282 };
00283
00284
00285 #endif
00286
00287