author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 13 Nov 2010 11:53:11 +0000 | |
branch | RCL_3 |
changeset 341 | a648d7ca5e27 |
parent 318 | a231cc388498 |
child 368 | b131f7696342 |
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 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
38 |
class MContainerListener { |
2 | 39 |
public: |
40 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0; |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
41 |
virtual void SizeChanged() = 0; |
2 | 42 |
}; |
43 |
||
44 |
class MPointerListener { |
|
45 |
public: |
|
46 |
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0; |
|
47 |
}; |
|
48 |
||
49 |
class CPodcastListContainer : public CCoeControl |
|
50 |
{ |
|
51 |
public: |
|
52 |
CPodcastListContainer(); |
|
53 |
~CPodcastListContainer(); |
|
54 |
void ConstructL( const TRect& aRect, TInt aListboxFlags ); |
|
55 |
void SizeChanged(); |
|
56 |
TInt CountComponentControls() const; |
|
57 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
58 |
void HandleResourceChange(TInt aType); |
|
59 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
60 |
void SetContainerListener(MContainerListener *aContainerListener); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
61 |
void SetListboxObserver(MEikListBoxObserver *aObserver); |
2 | 62 |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
63 |
CEikColumnListBox* Listbox(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
64 |
void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
65 |
CArrayPtr<CGulIcon>* ListboxIcons(); |
316 | 66 |
void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray); |
67 |
void SetEmptyText(const TDesC &aText); |
|
2 | 68 |
void ScrollToVisible(); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
69 |
void Draw(const TRect& aRect) const; |
315 | 70 |
|
71 |
protected: |
|
2 | 72 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
73 |
||
74 |
private: |
|
316 | 75 |
CAknSingleLargeStyleListBox * iListboxLandscape; |
76 |
CAknDoubleLargeStyleListBox * iListboxPortrait; |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
77 |
MContainerListener* iContainerListener; |
2 | 78 |
CAknsBasicBackgroundControlContext* iBgContext; |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
79 |
CEikColumnListBox * iListbox; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
80 |
TBool iLandscape; |
2 | 81 |
}; |
82 |
||
83 |
||
84 |
class CPodcastListView : public CAknView, public MAknToolbarObserver, |
|
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
85 |
public MProgressDialogCallback, public MContainerListener, MEikListBoxObserver |
2 | 86 |
{ |
87 |
public: |
|
88 |
~CPodcastListView(); |
|
13 | 89 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; |
48 | 90 |
TBool IsVisible(); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
91 |
|
2 | 92 |
protected: |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
93 |
void SwitchListbox(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
94 |
void ConstructL(); |
2 | 95 |
CPodcastListView(); |
96 |
||
97 |
/** |
|
98 |
* Handles a view activation and passes the message of type |
|
99 |
* @c aCustomMessageId. This function is intended for overriding by |
|
100 |
* sub classes. This function is called by @c AknViewActivatedL(). |
|
101 |
* @param aPrevViewId Specifies the view previously active. |
|
102 |
* @param aCustomMessageId Specifies the message type. |
|
103 |
* @param aCustomMessage The activation message. |
|
104 |
*/ |
|
105 |
void DoActivateL(const TVwsViewId& aPrevViewId, |
|
106 |
TUid aCustomMessageId, |
|
107 |
const TDesC8& aCustomMessage); |
|
108 |
||
109 |
/** |
|
110 |
* View deactivation function intended for overriding by sub classes. |
|
111 |
* This function is called by @c AknViewDeactivated(). |
|
112 |
*/ |
|
113 |
void DoDeactivate(); |
|
114 |
||
115 |
void HandleViewRectChange(); |
|
116 |
||
117 |
/** |
|
118 |
* Event handler for status pane size changes. |
|
119 |
* @c CAknView provides an empty implementation for sub classes that do |
|
120 |
* not want to handle this event. |
|
121 |
*/ |
|
122 |
void HandleStatusPaneSizeChange(); |
|
123 |
||
124 |
/** |
|
125 |
* Command handling function intended for overriding by sub classes. |
|
126 |
* Default implementation is empty. |
|
127 |
* @param aCommand ID of the command to respond to. |
|
128 |
*/ |
|
302
cf14797d0023
Fix for broken check for active downloads when exiting
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
129 |
virtual void HandleCommandL(TInt aCommand); |
2 | 130 |
|
131 |
void OfferToolbarEventL(TInt aCommand); |
|
132 |
void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar); |
|
133 |
||
134 |
virtual void UpdateListboxItemsL() = 0; |
|
135 |
||
136 |
void RunAboutDialogL(); |
|
137 |
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
|
138 |
void ShowOkMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
139 |
void ShowErrorMessageL(TDesC &aText); |
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
140 |
TInt ShowQueryMessageL(TDesC &aText); |
2 | 141 |
void CloseToolbarExtension(); |
142 |
void ShowWaitDialogL(TDesC &aWaitText); |
|
143 |
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
|
144 |
|
2 | 145 |
// from MProgressDialogCallback |
146 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
147 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
148 |
// from MContainerListener |
2 | 149 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
150 |
virtual void SizeChanged() {}; |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
151 |
void ResetContainer(); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
152 |
|
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
153 |
virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)=0; |
2 | 154 |
protected: |
155 |
CPodcastListContainer* iListContainer; |
|
156 |
/** Previous activated view */ |
|
157 |
TVwsViewId iPreviousView; |
|
158 |
||
159 |
/** Listbox flags which the listbox is created with*/ |
|
160 |
TInt iListboxFlags; |
|
161 |
||
162 |
CDesCArray* iItemArray; |
|
316 | 163 |
CDesCArray* iItemArrayShort; |
2 | 164 |
RArray<TUint> iItemIdArray; |
316 | 165 |
|
2 | 166 |
TBuf<1024> iListboxFormatbuffer; |
316 | 167 |
TBuf<1024> iListboxFormatbufferShort; |
2 | 168 |
|
169 |
CAknToolbar *iToolbar; |
|
170 |
CAknWaitDialog *iWaitDialog; |
|
341
a648d7ca5e27
Small fixes after merge with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
318
diff
changeset
|
171 |
|
2 | 172 |
}; |
173 |
#endif // PODCASTBASEVIEWH |
|
174 |