profilesservices/FileList/Src/CFLDPopupList.h
changeset 68 13e71d907dc3
equal deleted inserted replaced
40:6465d5bb863a 68:13e71d907dc3
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  A thin CAknPopupList extension.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFLDPOPUPLIST_H
       
    21 #define CFLDPOPUPLIST_H
       
    22 
       
    23 // INTERNAL INCLUDES
       
    24 #include "MFLDFileListBoxObserver.h" // For TFileListSoftKeyState
       
    25 
       
    26 // EXTERNAL INCLUDES
       
    27 #include <aknPopup.h>
       
    28 #include <coemain.h> // For MCoeForegroundObserver
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MFLDFileObserver;
       
    32 class CFLDFileListModel;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  A thin CAknPopupList extension.
       
    38 *  Prevents closing the pop-up if the pop-up observer so wishes.
       
    39 *
       
    40 *  @lib filelist.lib
       
    41 *  @since 2.1
       
    42 */
       
    43 NONSHARABLE_CLASS( CFLDPopupList )
       
    44  : public CAknPopupList, public MCoeForegroundObserver, public MCoeFocusObserver
       
    45     {
       
    46 
       
    47 
       
    48     public: // New methods
       
    49 
       
    50 		/**
       
    51 		* Two-phased constructor.
       
    52 		* @param aListbox A parameter to CAknPopupList.
       
    53 		* @param aCbaResource A parameter to CAknPopupList.
       
    54         * @param aFileObserver File observer.
       
    55         * @param aListBoxObserver Listbox observer, can be NULL.
       
    56         * @param aModel Filelist Model.
       
    57 		* @param aType A parameter to CAknPopupList.
       
    58 		*/
       
    59 		static CFLDPopupList* NewL(
       
    60 			CEikListBox* aListBox,
       
    61 			TInt aCbaResource,
       
    62 			MFLDFileObserver& aFileObserver,
       
    63             MFLDFileListBoxObserver* aListBoxObserver,
       
    64 			CFLDFileListModel& aModel,
       
    65 			AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow );
       
    66 		
       
    67 		void ConstructL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType );
       
    68 
       
    69 
       
    70 		/**
       
    71         * Destructor.
       
    72         */	
       
    73 		virtual ~CFLDPopupList();
       
    74 
       
    75 		/**
       
    76 		* Returns Popuplist RWindow handle
       
    77 		*/
       
    78 		RWindow& PopupListWindow() const;
       
    79 
       
    80 		/**
       
    81 		* Populates icon array and updates ListBox
       
    82 		*/
       
    83 		void PopulateIconArrayL();
       
    84 
       
    85 		/**
       
    86 		* Cancels audio/video preview
       
    87 		*/
       
    88 		void CancelPreview();
       
    89 		
       
    90 		/**
       
    91 		* Handles pointer events of popups.
       
    92 		*/
       
    93 		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    94 		
       
    95 		/**
       
    96 		 * Returns FileListBoxObserver.
       
    97 		 */
       
    98 		MFLDFileListBoxObserver* GetFileListBoxObserver();
       
    99 
       
   100     private:	// From CAknPopupList
       
   101         void AttemptExitL( TBool aAccept );
       
   102         void HandleResourceChange(TInt aType);
       
   103         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   104         
       
   105 	private:	// From MCoeForegroundObserver
       
   106         void HandleGainingForeground();
       
   107         void HandleLosingForeground();        
       
   108 
       
   109 	private:	// From MCoeFocusObserver
       
   110         void HandleChangeInFocus();
       
   111     	void HandleDestructionOfFocusedItem();
       
   112 
       
   113 	private:
       
   114 
       
   115 		/**
       
   116 		* C++ constructor.
       
   117         * @param aFileObserver File observer.
       
   118         * @param aListBoxObserver Listbox observer, can be NULL.
       
   119         * @param aModel Filelist Model.
       
   120 		*/
       
   121 		CFLDPopupList(
       
   122 			MFLDFileObserver& aFileObserver,
       
   123             MFLDFileListBoxObserver* aListBoxObserver,
       
   124 			CFLDFileListModel& aModel );
       
   125 
       
   126 	private: // New methods
       
   127 
       
   128     private:    // Data
       
   129 
       
   130         /// File observer
       
   131         MFLDFileObserver& iFileObserver;
       
   132 
       
   133         /// Ref: Listbox observer
       
   134         MFLDFileListBoxObserver* iListBoxObserver;
       
   135 
       
   136 		/// FileList Model
       
   137 		CFLDFileListModel& iModel;
       
   138 
       
   139 
       
   140 		/// Current softkeystate
       
   141 		MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState;
       
   142 
       
   143 
       
   144 		TFileName iCurrentFileName;
       
   145 
       
   146 		// Have the checks in AttemptExitL been done already
       
   147 		TBool iExitChecksDone;
       
   148 		TPoint iPoint;
       
   149     };
       
   150 
       
   151 #endif      // CFLDPOPUPLIST_H
       
   152 
       
   153 // End of File