author | Sebastian Brannstrom <sebastianb@symbian.org> |
Tue, 19 Oct 2010 14:02:32 +0100 | |
branch | RCL_3 |
changeset 259 | af83e0ffbf4b |
parent 243 | 44d205147a83 |
child 302 | cf14797d0023 |
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 |
||
61 |
CEikFormattedCellListBox* Listbox(); |
|
62 |
void ScrollToVisible(); |
|
63 |
void Draw(const TRect& aRect) const; |
|
13 | 64 |
|
26 | 65 |
CEikFormattedCellListBox * iListbox; |
2 | 66 |
|
67 |
protected: |
|
68 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
69 |
||
70 |
private: |
|
71 |
MKeyEventListener* iKeyEventListener; |
|
72 |
CAknsBasicBackgroundControlContext* iBgContext; |
|
73 |
}; |
|
74 |
||
75 |
||
76 |
class CPodcastListView : public CAknView, public MAknToolbarObserver, |
|
77 |
public MProgressDialogCallback, public MKeyEventListener |
|
78 |
{ |
|
79 |
public: |
|
80 |
~CPodcastListView(); |
|
13 | 81 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; |
48 | 82 |
TBool IsVisible(); |
83 |
||
2 | 84 |
protected: |
85 |
void ConstructL(); |
|
86 |
CPodcastListView(); |
|
87 |
||
88 |
/** |
|
89 |
* Handles a view activation and passes the message of type |
|
90 |
* @c aCustomMessageId. This function is intended for overriding by |
|
91 |
* sub classes. This function is called by @c AknViewActivatedL(). |
|
92 |
* @param aPrevViewId Specifies the view previously active. |
|
93 |
* @param aCustomMessageId Specifies the message type. |
|
94 |
* @param aCustomMessage The activation message. |
|
95 |
*/ |
|
96 |
void DoActivateL(const TVwsViewId& aPrevViewId, |
|
97 |
TUid aCustomMessageId, |
|
98 |
const TDesC8& aCustomMessage); |
|
99 |
||
100 |
/** |
|
101 |
* View deactivation function intended for overriding by sub classes. |
|
102 |
* This function is called by @c AknViewDeactivated(). |
|
103 |
*/ |
|
104 |
void DoDeactivate(); |
|
105 |
||
106 |
void HandleViewRectChange(); |
|
107 |
||
108 |
/** |
|
109 |
* Event handler for status pane size changes. |
|
110 |
* @c CAknView provides an empty implementation for sub classes that do |
|
111 |
* not want to handle this event. |
|
112 |
*/ |
|
113 |
void HandleStatusPaneSizeChange(); |
|
114 |
||
115 |
/** |
|
116 |
* Command handling function intended for overriding by sub classes. |
|
117 |
* Default implementation is empty. |
|
118 |
* @param aCommand ID of the command to respond to. |
|
119 |
*/ |
|
120 |
void HandleCommandL(TInt aCommand); |
|
121 |
||
122 |
void OfferToolbarEventL(TInt aCommand); |
|
123 |
void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar); |
|
124 |
||
125 |
virtual void UpdateListboxItemsL() = 0; |
|
126 |
||
127 |
void RunAboutDialogL(); |
|
128 |
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
|
129 |
void ShowOkMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
130 |
void ShowErrorMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
131 |
TInt ShowQueryMessageL(TDesC &aText); |
2 | 132 |
void CloseToolbarExtension(); |
133 |
void ShowWaitDialogL(TDesC &aWaitText); |
|
134 |
void CloseWaitDialog(); |
|
243
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
50
diff
changeset
|
135 |
|
2 | 136 |
// from MProgressDialogCallback |
137 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
138 |
||
139 |
// from MKeyEventListener |
|
140 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
141 |
||
142 |
protected: |
|
143 |
CPodcastListContainer* iListContainer; |
|
144 |
/** Previous activated view */ |
|
145 |
TVwsViewId iPreviousView; |
|
146 |
||
147 |
/** Listbox flags which the listbox is created with*/ |
|
148 |
TInt iListboxFlags; |
|
149 |
||
150 |
CDesCArray* iItemArray; |
|
151 |
RArray<TUint> iItemIdArray; |
|
152 |
||
153 |
TBuf<1024> iListboxFormatbuffer; |
|
154 |
||
155 |
CAknToolbar *iToolbar; |
|
156 |
CAknWaitDialog *iWaitDialog; |
|
157 |
}; |
|
158 |
#endif // PODCASTBASEVIEWH |
|
159 |