author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 16 Oct 2010 15:36:19 +0100 | |
branch | 3rded |
changeset 275 | e2c3225833c3 |
parent 176 | 1c8b56cb6409 |
child 343 | 9c56bf585696 |
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 <aknprogressdialog.h> |
|
27 |
#include <aknwaitdialog.h> |
|
28 |
#include "PodcastModel.h" |
|
29 |
||
30 |
class CAknDoubleLargeStyleListBox; |
|
31 |
class CEikFormattedCellListBox; |
|
32 |
||
33 |
||
34 |
class MKeyEventListener { |
|
35 |
public: |
|
36 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0; |
|
37 |
}; |
|
38 |
||
39 |
class MPointerListener { |
|
40 |
public: |
|
41 |
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0; |
|
42 |
}; |
|
43 |
||
44 |
class CPodcastListContainer : public CCoeControl |
|
45 |
{ |
|
46 |
public: |
|
47 |
CPodcastListContainer(); |
|
48 |
~CPodcastListContainer(); |
|
49 |
void ConstructL( const TRect& aRect, TInt aListboxFlags ); |
|
50 |
void SizeChanged(); |
|
51 |
TInt CountComponentControls() const; |
|
52 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
53 |
void HandleResourceChange(TInt aType); |
|
54 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
55 |
void SetKeyEventListener(MKeyEventListener *aKeyEventListener); |
|
56 |
void SetPointerListener(MPointerListener *aPointerListener); |
|
57 |
||
58 |
CEikFormattedCellListBox* Listbox(); |
|
59 |
void ScrollToVisible(); |
|
60 |
void Draw(const TRect& aRect) const; |
|
13 | 61 |
|
26 | 62 |
CEikFormattedCellListBox * iListbox; |
2 | 63 |
|
64 |
protected: |
|
65 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
66 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
67 |
||
68 |
private: |
|
69 |
MKeyEventListener* iKeyEventListener; |
|
70 |
MPointerListener* iPointerListener; |
|
71 |
CAknsBasicBackgroundControlContext* iBgContext; |
|
26 | 72 |
|
2 | 73 |
}; |
74 |
||
75 |
||
175
cd124c4eb6b9
Started port to 3rd edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
76 |
class CPodcastListView : public CAknView, public MPointerListener, |
2 | 77 |
public MProgressDialogCallback, public MKeyEventListener |
78 |
{ |
|
79 |
public: |
|
80 |
~CPodcastListView(); |
|
48 | 81 |
TBool IsVisible(); |
82 |
||
2 | 83 |
protected: |
84 |
void ConstructL(); |
|
85 |
CPodcastListView(); |
|
86 |
||
87 |
/** |
|
88 |
* Handles a view activation and passes the message of type |
|
89 |
* @c aCustomMessageId. This function is intended for overriding by |
|
90 |
* sub classes. This function is called by @c AknViewActivatedL(). |
|
91 |
* @param aPrevViewId Specifies the view previously active. |
|
92 |
* @param aCustomMessageId Specifies the message type. |
|
93 |
* @param aCustomMessage The activation message. |
|
94 |
*/ |
|
95 |
void DoActivateL(const TVwsViewId& aPrevViewId, |
|
96 |
TUid aCustomMessageId, |
|
97 |
const TDesC8& aCustomMessage); |
|
98 |
||
99 |
/** |
|
100 |
* View deactivation function intended for overriding by sub classes. |
|
101 |
* This function is called by @c AknViewDeactivated(). |
|
102 |
*/ |
|
103 |
void DoDeactivate(); |
|
104 |
||
105 |
void HandleViewRectChange(); |
|
106 |
||
107 |
/** |
|
108 |
* Event handler for status pane size changes. |
|
109 |
* @c CAknView provides an empty implementation for sub classes that do |
|
110 |
* not want to handle this event. |
|
111 |
*/ |
|
112 |
void HandleStatusPaneSizeChange(); |
|
113 |
||
114 |
/** |
|
115 |
* Command handling function intended for overriding by sub classes. |
|
116 |
* Default implementation is empty. |
|
117 |
* @param aCommand ID of the command to respond to. |
|
118 |
*/ |
|
119 |
void HandleCommandL(TInt aCommand); |
|
120 |
||
121 |
virtual void UpdateListboxItemsL() = 0; |
|
122 |
||
123 |
void RunAboutDialogL(); |
|
124 |
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
|
125 |
void ShowOkMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
126 |
void ShowErrorMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
127 |
TInt ShowQueryMessageL(TDesC &aText); |
2 | 128 |
void ShowWaitDialogL(TDesC &aWaitText); |
129 |
void CloseWaitDialog(); |
|
130 |
||
131 |
// from MProgressDialogCallback |
|
132 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
133 |
||
134 |
// from MKeyEventListener |
|
135 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
136 |
||
137 |
// from MPointerListener |
|
138 |
void PointerEventL(const TPointerEvent& aPointerEvent); |
|
139 |
||
140 |
protected: |
|
141 |
CPodcastListContainer* iListContainer; |
|
142 |
/** Previous activated view */ |
|
143 |
TVwsViewId iPreviousView; |
|
144 |
||
145 |
/** Listbox flags which the listbox is created with*/ |
|
146 |
TInt iListboxFlags; |
|
147 |
||
148 |
CDesCArray* iItemArray; |
|
149 |
RArray<TUint> iItemIdArray; |
|
150 |
||
151 |
TBuf<1024> iListboxFormatbuffer; |
|
152 |
||
153 |
CAknWaitDialog *iWaitDialog; |
|
154 |
||
155 |
}; |
|
156 |
#endif // PODCASTBASEVIEWH |
|
157 |