application/inc/PodcastListView.h
branchtwolistboxes
changeset 313 0f30a75610de
parent 302 cf14797d0023
child 314 e7776f6a2198
equal deleted inserted replaced
312:2faae209e72b 313:0f30a75610de
    33 
    33 
    34 class CAknDoubleLargeStyleListBox;
    34 class CAknDoubleLargeStyleListBox;
    35 class CEikFormattedCellListBox;
    35 class CEikFormattedCellListBox;
    36 
    36 
    37 
    37 
    38 class MKeyEventListener {
    38 class MContainerListener {
    39 public:
    39 public:
    40 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0;
    40 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0;
       
    41 virtual void SizeChanged() = 0;
    41 };
    42 };
    42 
    43 
    43 class MPointerListener {
    44 class MPointerListener {
    44 public:
    45 public:
    45 virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0;
    46 virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0;
    54 		void SizeChanged();
    55 		void SizeChanged();
    55         TInt CountComponentControls() const;
    56         TInt CountComponentControls() const;
    56         CCoeControl* ComponentControl( TInt aIndex ) const;
    57         CCoeControl* ComponentControl( TInt aIndex ) const;
    57 		void HandleResourceChange(TInt aType);
    58 		void HandleResourceChange(TInt aType);
    58 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
    59 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
    59 		void SetKeyEventListener(MKeyEventListener *aKeyEventListener);
    60 		void SetContainerListener(MContainerListener *aContainerListener);
    60 		
    61 		
    61 		CEikFormattedCellListBox* Listbox();
    62 		CEikColumnListBox* Listbox();
       
    63 		void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons);
       
    64 		CArrayPtr<CGulIcon>* ListboxIcons();
       
    65 		void SetTextArray(CDesCArray* aArray);
    62 		void ScrollToVisible();
    66 		void ScrollToVisible();
    63     	void Draw(const TRect& aRect) const;
    67     	void Draw(const TRect& aRect) const;   	
    64     	
    68     	TBool IsLandscape();
    65     	CEikFormattedCellListBox * iListbox;		
       
    66 
       
    67 	protected:
    69 	protected:
    68 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
    70 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
    69 
    71 
    70 	private:
    72 	private:
    71 		MKeyEventListener* iKeyEventListener;
    73 		MContainerListener* iContainerListener;
    72         CAknsBasicBackgroundControlContext* iBgContext;
    74         CAknsBasicBackgroundControlContext* iBgContext;
       
    75         
       
    76        	CAknSingleLargeStyleListBox * iListboxLandscape;
       
    77         CAknDoubleLargeStyleListBox * iListboxPortrait;
       
    78         CEikColumnListBox * iListbox;
       
    79         TBool iLandscape;
    73 	};
    80 	};
    74 
    81 
    75 
    82 
    76 class CPodcastListView : public CAknView, public MAknToolbarObserver,
    83 class CPodcastListView : public CAknView, public MAknToolbarObserver,
    77 public MProgressDialogCallback, public MKeyEventListener
    84 public MProgressDialogCallback, public MContainerListener
    78     {
    85     {
    79     public: 
    86     public: 
    80         ~CPodcastListView();
    87         ~CPodcastListView();
    81 		virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
    88 		virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
    82 		TBool IsVisible();
    89 		TBool IsVisible();
    83 		
    90 		
    84 	protected:
    91 	protected:
    85 	    void ConstructL();
    92     	void SwitchListbox();
       
    93     	void ConstructL();
    86 		CPodcastListView();	
    94 		CPodcastListView();	
    87 
    95 
    88 		/** 
    96 		/** 
    89 		 * Handles a view activation and passes the message of type 
    97 		 * Handles a view activation and passes the message of type 
    90 		 * @c aCustomMessageId. This function is intended for overriding by 
    98 		 * @c aCustomMessageId. This function is intended for overriding by 
   134 		void CloseWaitDialog();
   142 		void CloseWaitDialog();
   135 	 
   143 	 
   136 		// from MProgressDialogCallback		
   144 		// from MProgressDialogCallback		
   137 		void DialogDismissedL(TInt /*aButtonId*/) {}
   145 		void DialogDismissedL(TInt /*aButtonId*/) {}
   138 
   146 
   139 		// from MKeyEventListener
   147 		// from MContainerListener
   140 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
   148 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
   141 
   149 		virtual void SizeChanged() = 0;
       
   150 		void ResetContainer();
       
   151 		
   142 	protected:
   152 	protected:
   143 		 CPodcastListContainer* iListContainer;
   153 		 CPodcastListContainer* iListContainer;
   144 		 /** Previous activated view */
   154 		 /** Previous activated view */
   145 		 TVwsViewId iPreviousView;
   155 		 TVwsViewId iPreviousView;
   146 
   156 
   152 		 
   162 		 
   153 		 TBuf<1024> iListboxFormatbuffer;
   163 		 TBuf<1024> iListboxFormatbuffer;
   154 		 
   164 		 
   155 		 CAknToolbar *iToolbar;
   165 		 CAknToolbar *iToolbar;
   156 		 CAknWaitDialog *iWaitDialog;
   166 		 CAknWaitDialog *iWaitDialog;
       
   167 		 TBool flipFlop;
       
   168 		 CArrayPtr< CGulIcon >* iIconArray;
   157     };
   169     };
   158 #endif // PODCASTBASEVIEWH
   170 #endif // PODCASTBASEVIEWH
   159 
   171