author | teknolog |
Sat, 24 Apr 2010 18:58:55 +0100 | |
changeset 85 | b03018fb3418 |
parent 50 | e7b10d6d7ba3 |
child 137 | 44d205147a83 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef PODCASTLISTVIEWH |
|
20 |
#define PODCASTLISTVIEWH |
|
21 |
||
22 |
#include <aknview.h> |
|
23 |
#include <aknlists.h> |
|
24 |
#include <eiklbo.h> |
|
25 |
#include <aknsbasicbackgroundcontrolcontext.h> |
|
26 |
#include <AknToolbarObserver.h> |
|
27 |
#include <AknToolbar.h> |
|
28 |
#include <aknlongtapdetector.h> |
|
29 |
#include <aknstyluspopupmenu.h> |
|
30 |
#include <aknprogressdialog.h> |
|
31 |
#include <aknwaitdialog.h> |
|
32 |
#include "PodcastModel.h" |
|
33 |
||
34 |
class CAknDoubleLargeStyleListBox; |
|
35 |
class CEikFormattedCellListBox; |
|
36 |
||
37 |
||
38 |
class MKeyEventListener { |
|
39 |
public: |
|
40 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0; |
|
41 |
}; |
|
42 |
||
43 |
class MPointerListener { |
|
44 |
public: |
|
45 |
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0; |
|
46 |
}; |
|
47 |
||
48 |
class CPodcastListContainer : public CCoeControl |
|
49 |
{ |
|
50 |
public: |
|
51 |
CPodcastListContainer(); |
|
52 |
~CPodcastListContainer(); |
|
53 |
void ConstructL( const TRect& aRect, TInt aListboxFlags ); |
|
54 |
void SizeChanged(); |
|
55 |
TInt CountComponentControls() const; |
|
56 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
57 |
void HandleResourceChange(TInt aType); |
|
58 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
59 |
void SetKeyEventListener(MKeyEventListener *aKeyEventListener); |
|
60 |
void SetPointerListener(MPointerListener *aPointerListener); |
|
61 |
||
62 |
CEikFormattedCellListBox* Listbox(); |
|
63 |
void ScrollToVisible(); |
|
64 |
void Draw(const TRect& aRect) const; |
|
13 | 65 |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
66 |
void SetLongTapDetectedL(TBool aLongTapDetected); |
26 | 67 |
|
68 |
CEikFormattedCellListBox * iListbox; |
|
2 | 69 |
|
70 |
protected: |
|
71 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
72 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
73 |
||
74 |
private: |
|
75 |
MKeyEventListener* iKeyEventListener; |
|
76 |
MPointerListener* iPointerListener; |
|
77 |
CAknsBasicBackgroundControlContext* iBgContext; |
|
26 | 78 |
TBool iLongTapDetected; |
79 |
||
2 | 80 |
}; |
81 |
||
82 |
||
83 |
class CPodcastListView : public CAknView, public MAknToolbarObserver, |
|
84 |
public MPointerListener, public MAknLongTapDetectorCallBack, |
|
85 |
public MProgressDialogCallback, public MKeyEventListener |
|
86 |
{ |
|
87 |
public: |
|
88 |
~CPodcastListView(); |
|
13 | 89 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; |
48 | 90 |
TBool IsVisible(); |
91 |
||
2 | 92 |
protected: |
93 |
void ConstructL(); |
|
94 |
CPodcastListView(); |
|
95 |
||
96 |
/** |
|
97 |
* Handles a view activation and passes the message of type |
|
98 |
* @c aCustomMessageId. This function is intended for overriding by |
|
99 |
* sub classes. This function is called by @c AknViewActivatedL(). |
|
100 |
* @param aPrevViewId Specifies the view previously active. |
|
101 |
* @param aCustomMessageId Specifies the message type. |
|
102 |
* @param aCustomMessage The activation message. |
|
103 |
*/ |
|
104 |
void DoActivateL(const TVwsViewId& aPrevViewId, |
|
105 |
TUid aCustomMessageId, |
|
106 |
const TDesC8& aCustomMessage); |
|
107 |
||
108 |
/** |
|
109 |
* View deactivation function intended for overriding by sub classes. |
|
110 |
* This function is called by @c AknViewDeactivated(). |
|
111 |
*/ |
|
112 |
void DoDeactivate(); |
|
113 |
||
114 |
void HandleViewRectChange(); |
|
115 |
||
116 |
/** |
|
117 |
* Event handler for status pane size changes. |
|
118 |
* @c CAknView provides an empty implementation for sub classes that do |
|
119 |
* not want to handle this event. |
|
120 |
*/ |
|
121 |
void HandleStatusPaneSizeChange(); |
|
122 |
||
123 |
/** |
|
124 |
* Command handling function intended for overriding by sub classes. |
|
125 |
* Default implementation is empty. |
|
126 |
* @param aCommand ID of the command to respond to. |
|
127 |
*/ |
|
128 |
void HandleCommandL(TInt aCommand); |
|
129 |
||
130 |
void OfferToolbarEventL(TInt aCommand); |
|
131 |
void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar); |
|
132 |
||
133 |
virtual void UpdateListboxItemsL() = 0; |
|
134 |
||
135 |
void RunAboutDialogL(); |
|
136 |
void SetEmptyTextL(TInt aResourceId); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
137 |
void ShowOkMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
138 |
void ShowErrorMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
139 |
TInt ShowQueryMessageL(TDesC &aText); |
2 | 140 |
void CloseToolbarExtension(); |
141 |
void ShowWaitDialogL(TDesC &aWaitText); |
|
142 |
void CloseWaitDialog(); |
|
143 |
||
144 |
// From MAknLongTapDetectorCallBack |
|
145 |
virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
|
146 |
||
147 |
// from MProgressDialogCallback |
|
148 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
149 |
||
150 |
// from MKeyEventListener |
|
151 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
152 |
||
153 |
// from MPointerListener |
|
154 |
void PointerEventL(const TPointerEvent& aPointerEvent); |
|
155 |
||
156 |
protected: |
|
157 |
CPodcastListContainer* iListContainer; |
|
158 |
/** Previous activated view */ |
|
159 |
TVwsViewId iPreviousView; |
|
160 |
||
161 |
/** Listbox flags which the listbox is created with*/ |
|
162 |
TInt iListboxFlags; |
|
163 |
||
164 |
CDesCArray* iItemArray; |
|
165 |
RArray<TUint> iItemIdArray; |
|
166 |
||
167 |
TBuf<1024> iListboxFormatbuffer; |
|
168 |
||
169 |
CAknToolbar *iToolbar; |
|
170 |
CAknStylusPopUpMenu* iStylusPopupMenu; |
|
171 |
CAknLongTapDetector* iLongTapDetector; |
|
172 |
CAknWaitDialog *iWaitDialog; |
|
173 |
||
174 |
}; |
|
175 |
#endif // PODCASTBASEVIEWH |
|
176 |