application/inc/PodcastListView.h
branchsymbian1
changeset 336 3d6c1417e8bd
parent 65 bcd88ba95046
child 355 075b3a49cb55
equal deleted inserted replaced
296:80f1da5ac28b 336:3d6c1417e8bd
    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 };
    41 virtual void SizeChanged() = 0;
    42 
       
    43 class MPointerListener {
       
    44 public:
       
    45 virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0;
    42 virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0;
    46 };
    43 };
    47 
    44 
    48 class CPodcastListContainer : public CCoeControl
    45 class CPodcastListContainer : public CCoeControl
    49     {
    46     {
    54 		void SizeChanged();
    51 		void SizeChanged();
    55         TInt CountComponentControls() const;
    52         TInt CountComponentControls() const;
    56         CCoeControl* ComponentControl( TInt aIndex ) const;
    53         CCoeControl* ComponentControl( TInt aIndex ) const;
    57 		void HandleResourceChange(TInt aType);
    54 		void HandleResourceChange(TInt aType);
    58 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
    55 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
    59 		void SetKeyEventListener(MKeyEventListener *aKeyEventListener);
    56 		void SetContainerListener(MContainerListener *aContainerListener);
    60 		void SetPointerListener(MPointerListener *aPointerListener);
    57 		void SetListboxObserver(MEikListBoxObserver *aObserver);
    61 		
    58 		CEikColumnListBox* Listbox();
    62 		CEikFormattedCellListBox* Listbox();
    59 		void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons);
       
    60 		CArrayPtr<CGulIcon>* ListboxIcons();
       
    61 		void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray);
       
    62 		void SetEmptyText(const TDesC &aText);
    63 		void ScrollToVisible();
    63 		void ScrollToVisible();
    64     	void Draw(const TRect& aRect) const;
    64     	void Draw(const TRect& aRect) const;
    65     	
    65     	
    66     	void SetLongTapDetectedL(TBool aLongTapDetected);
    66     	void SetLongTapDetectedL(TBool aLongTapDetected);
    67 
       
    68     	CEikFormattedCellListBox * iListbox;		
       
    69 
    67 
    70 	protected:
    68 	protected:
    71 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
    69 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
    72 		virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    70 		virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    73 
    71 
    74 	private:
    72 	private:
    75 		MKeyEventListener* iKeyEventListener;
    73        	CAknSingleLargeStyleListBox * iListboxLandscape;
    76 		MPointerListener* iPointerListener;
    74         CAknDoubleLargeStyleListBox * iListboxPortrait;
       
    75 		MContainerListener* iContainerListener;
    77         CAknsBasicBackgroundControlContext* iBgContext;
    76         CAknsBasicBackgroundControlContext* iBgContext;
    78 		 TBool iLongTapDetected;
    77 		TBool iLongTapDetected;
       
    78         CEikColumnListBox * iListbox;
       
    79         TBool iLandscape;
    79 
    80 
    80 	};
    81 	};
    81 
    82 
    82 
    83 
    83 class CPodcastListView : public CAknView, public MAknToolbarObserver,
    84 class CPodcastListView : public CAknView, public MAknToolbarObserver,
    84 public MPointerListener, public MAknLongTapDetectorCallBack, 
    85 public MAknLongTapDetectorCallBack, public MEikListBoxObserver,
    85 public MProgressDialogCallback, public MKeyEventListener
    86 public MProgressDialogCallback, public MContainerListener
    86     {
    87     {
    87     public: 
    88     public: 
    88         ~CPodcastListView();
    89         ~CPodcastListView();
    89 		virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
    90 		virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
    90 		TBool IsVisible();
    91 		TBool IsVisible();
    91 		
    92 
    92 	protected:
    93 	protected:
    93 	    void ConstructL();
    94     	void SwitchListbox();
       
    95     	void ConstructL();
    94 		CPodcastListView();	
    96 		CPodcastListView();	
    95 
    97 
    96 		/** 
    98 		/** 
    97 		 * Handles a view activation and passes the message of type 
    99 		 * Handles a view activation and passes the message of type 
    98 		 * @c aCustomMessageId. This function is intended for overriding by 
   100 		 * @c aCustomMessageId. This function is intended for overriding by 
   123 		/** 
   125 		/** 
   124 		* Command handling function intended for overriding by sub classes. 
   126 		* Command handling function intended for overriding by sub classes. 
   125 		* Default implementation is empty.  
   127 		* Default implementation is empty.  
   126 		* @param aCommand ID of the command to respond to. 
   128 		* @param aCommand ID of the command to respond to. 
   127 		*/
   129 		*/
   128 		void HandleCommandL(TInt aCommand);
   130 		virtual void HandleCommandL(TInt aCommand);
   129 
   131 
   130 		void OfferToolbarEventL(TInt aCommand);
   132 		void OfferToolbarEventL(TInt aCommand);
   131 		void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar);
   133 		void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar);
   132 
   134 
   133 		virtual void UpdateListboxItemsL() = 0;
   135 		virtual void UpdateListboxItemsL() = 0;
   147 		// from MProgressDialogCallback		
   149 		// from MProgressDialogCallback		
   148 		void DialogDismissedL(TInt /*aButtonId*/) {}
   150 		void DialogDismissedL(TInt /*aButtonId*/) {}
   149 
   151 
   150 		// from MKeyEventListener
   152 		// from MKeyEventListener
   151 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
   153 		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   154 		virtual void SizeChanged() {};
       
   155 		void ResetContainer();
   152 
   156 
   153 		// from MPointerListener
   157 		// from MPointerListener
   154 		void PointerEventL(const TPointerEvent& aPointerEvent);
   158 		void PointerEventL(const TPointerEvent& aPointerEvent);
   155 
   159 
   156 	protected:
   160 	protected:
   160 
   164 
   161 		 /** Listbox flags which the listbox is created with*/
   165 		 /** Listbox flags which the listbox is created with*/
   162 		 TInt iListboxFlags;
   166 		 TInt iListboxFlags;
   163 		 
   167 		 
   164 		 CDesCArray* iItemArray;
   168 		 CDesCArray* iItemArray;
       
   169 		 CDesCArray* iItemArrayShort;
   165 		 RArray<TUint> iItemIdArray;
   170 		 RArray<TUint> iItemIdArray;
   166 		 
   171 		 		 
   167 		 TBuf<1024> iListboxFormatbuffer;
   172 		 TBuf<1024> iListboxFormatbuffer;
       
   173 		 TBuf<1024> iListboxFormatbufferShort;
   168 		 
   174 		 
   169 		 CAknToolbar *iToolbar;
   175 		 CAknToolbar *iToolbar;
   170 		 CAknStylusPopUpMenu* iStylusPopupMenu;
   176 		 CAknStylusPopUpMenu* iStylusPopupMenu;
   171 		 CAknLongTapDetector* iLongTapDetector;
   177 		 CAknLongTapDetector* iLongTapDetector;
   172 		 CAknWaitDialog *iWaitDialog;
   178 		 CAknWaitDialog *iWaitDialog;