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 EAutoMirror = 0x0020,
00065 EDontClose = 0x0040
00066 };
00067
00068 enum TAknPreviewPopUpContentSize
00069 {
00070 ESmall,
00071 ELarge
00072 };
00073
00074 public:
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:
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:
00228
00232 void DoCancel();
00233
00237 void RunL();
00238
00244 TInt RunError( TInt aError );
00245
00246 private:
00247
00252 CAknPreviewPopUpController(
00253 MAknPreviewPopUpContentProvider* aContentProvider );
00254
00260 void ConstructL( CCoeControl& aContent,
00261 const TInt aStyle );
00262
00263 private:
00264
00265 enum TPreviewState
00266 {
00267 EShowing,
00268 EHiding,
00269 EBuildingContent
00270 };
00271
00272
00273 TPreviewState iState;
00274
00275
00276 MAknPreviewPopUpContentProvider* iContentProvider;
00277
00278
00279 CAknPreviewPopUp* iPopUp;
00280
00281
00282 TTimeIntervalMicroSeconds32 iPopUpShowDelay;
00283
00284
00285 TTimeIntervalMicroSeconds32 iPopUpHideDelay;
00286
00287
00288 RPointerArray<MAknPreviewPopUpObserver> iObservers;
00289
00290
00291 TBool iResetting;
00292 };
00293
00294 #endif // AKNPREVIEWPOPUPCONTROLLER_H
00295
00296