00001 /* 00002 * ============================================================================ 00003 * Name : AknPopup.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * Support for Avkon Popped-up lists 00008 * 00009 * Version: 00010 * 00011 * Copyright © 2002 Nokia Corporation. 00012 * This material, including documentation and any related 00013 * computer programs, is protected by copyright controlled by 00014 * Nokia Corporation. All rights are reserved. Copying, 00015 * including reproducing, storing, adapting or translating, any 00016 * or all of this material requires the prior written consent of 00017 * Nokia Corporation. This material also contains confidential 00018 * information which may not be disclosed to others without the 00019 * prior written consent of Nokia Corporation. 00020 * ============================================================================ 00021 */ 00022 00023 #if !defined(__AKNPOPUP_H__) 00024 #define __AKNPOPUP_H__ 00025 00026 #include <coecntrl.h> 00027 #include <eikcmobs.h> 00028 #include <eiklbx.h> 00029 #include <aknpopuplayout.h> 00030 #include <aknintermediate.h> 00031 #include <aknpopupfader.h> 00032 00033 class CAknPopupHeadingPane; 00034 class CEikButtonGroupContainer; 00035 class CEikListBox; 00036 class CAknSearchField; 00037 class CAknPopupListExtension; 00038 00072 class CAknPopupList : public CEikBorderedControl, 00073 public MEikCommandObserver, 00074 public MEikListBoxObserver, 00075 public MCoeControlObserver, 00076 public MAknIntermediateState, 00077 public MAknFadedComponent 00078 { 00079 public: 00080 00091 IMPORT_C static CAknPopupList* NewL( 00092 CEikListBox* aListBox, 00093 TInt aCbaResource, 00094 AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow); 00095 00103 IMPORT_C TBool ExecuteLD(); 00104 00110 IMPORT_C void SetTitleL(const TDesC& aTitle); 00111 00116 IMPORT_C void CancelPopup(); 00117 public: // Access methods 00118 00124 IMPORT_C CEikButtonGroupContainer* ButtonGroupContainer(); 00130 IMPORT_C CAknPopupHeadingPane* Heading(); 00131 00137 IMPORT_C CAknPopupHeadingPane* Heading() const; 00138 00144 IMPORT_C CEikListBox* ListBox(); 00145 00151 IMPORT_C void SetMaximumHeight(TInt aItems); 00152 00159 IMPORT_C TBool EnableFind(TBool aEnable=ETrue); 00160 00166 IMPORT_C CAknSearchField* FindBox() const; 00167 public: 00175 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00176 protected: 00185 IMPORT_C void ProcessCommandL(TInt aCommandId); 00186 00196 IMPORT_C void HandleListBoxEventL(CEikListBox* aListBox, 00197 TListBoxEvent aEventType); 00206 IMPORT_C void HandleControlEventL(CCoeControl* aControl, 00207 TCoeEvent aEventType); 00208 protected: 00209 00213 IMPORT_C CAknPopupList(); 00214 00218 IMPORT_C ~CAknPopupList(); 00219 00227 IMPORT_C void ConstructL(CEikListBox* aListBox, 00228 TInt aCbaResource, 00229 AknPopupLayouts::TAknPopupLayouts aType ); 00230 00237 IMPORT_C virtual void AttemptExitL(TBool aAccept); 00238 00245 IMPORT_C virtual void SetupWindowLayout( 00246 AknPopupLayouts::TAknPopupLayouts aType); 00247 00253 IMPORT_C CEikListBox* ListBox() const; 00254 00261 IMPORT_C const TAknPopupWindowLayoutDef& Layout() const; 00262 00269 IMPORT_C TAknPopupWindowLayoutDef& Layout(); 00270 00271 protected: 00272 00282 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId); 00283 00284 protected: 00285 00293 IMPORT_C void HandleResourceChange(TInt aType); 00294 private: 00295 void FadeBehindPopup(TBool aFade); 00296 00297 00298 00299 private: 00300 // the following needs to be imported, because they need to be 00301 // used in virtual table of any derived class. 00302 IMPORT_C TSize MinimumSize(); 00303 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const; 00304 IMPORT_C TInt CountComponentControls() const; 00305 IMPORT_C void Draw(const TRect& aRect) const; 00306 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 00307 TEventCode aType); 00308 IMPORT_C void FocusChanged(TDrawNow aDrawNow); 00309 00310 IMPORT_C void CloseState(); 00311 // From MAknFadedComponent 00312 IMPORT_C virtual TInt CountFadedComponents(); 00313 IMPORT_C virtual CCoeControl* FadedComponent(TInt aIndex); 00314 00315 private: 00319 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00320 00321 private: 00322 void RemoveFindFiltering(); 00323 00324 protected: // these are protected to allow overriding virtual functions. 00325 CEikListBox* iListBox; 00326 00331 CEikButtonGroupContainer* iPopoutCba; 00332 00337 CAknPopupHeadingPane* iTitle; 00338 00340 TBool* iReturn; 00341 00343 TBool iMarkable; 00344 00346 TInt iCurrentResource; 00347 00349 AknPopupLayouts::TAknPopupLayouts iWindowType; 00350 00354 TAknPopupWindowLayoutDef iLayout; 00355 00356 00358 TBool iAppBroughtForwards; 00359 00361 TAknPopupFader iPopupFader; 00362 00364 CIdle *iIdle; 00365 00366 00368 CActiveSchedulerWait iWait; // owned, safe to use as direct member data. 00369 private: 00370 CAknPopupListExtension* iPopupListExtension; // owned 00371 }; 00372 00373 #endif 00374 00375 00376