author | Sebastian Brannstrom <sebastianb@symbian.org> |
Tue, 16 Nov 2010 13:05:42 +0000 | |
branch | RCL_3 |
changeset 369 | c683165bec63 |
parent 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); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
62 |
CEikColumnListBox* Listbox(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
63 |
void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
64 |
CArrayPtr<CGulIcon>* ListboxIcons(); |
316 | 65 |
void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray); |
66 |
void SetEmptyText(const TDesC &aText); |
|
2 | 67 |
void ScrollToVisible(); |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
68 |
void Draw(const TRect& aRect) const; |
315 | 69 |
|
368
b131f7696342
Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
341
diff
changeset
|
70 |
protected: |
2 | 71 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
72 |
||
73 |
private: |
|
316 | 74 |
CAknSingleLargeStyleListBox * iListboxLandscape; |
75 |
CAknDoubleLargeStyleListBox * iListboxPortrait; |
|
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
76 |
MContainerListener* iContainerListener; |
2 | 77 |
CAknsBasicBackgroundControlContext* iBgContext; |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
78 |
CEikColumnListBox * iListbox; |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
79 |
TBool iLandscape; |
2 | 80 |
}; |
81 |
||
82 |
||
83 |
class CPodcastListView : public CAknView, public MAknToolbarObserver, |
|
368
b131f7696342
Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
341
diff
changeset
|
84 |
public MProgressDialogCallback, public MContainerListener, public MEikListBoxObserver |
2 | 85 |
{ |
86 |
public: |
|
87 |
~CPodcastListView(); |
|
13 | 88 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; |
48 | 89 |
TBool IsVisible(); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
90 |
|
2 | 91 |
protected: |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
92 |
void SwitchListbox(); |
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
93 |
void ConstructL(); |
2 | 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 |
*/ |
|
302
cf14797d0023
Fix for broken check for active downloads when exiting
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
128 |
virtual void HandleCommandL(TInt aCommand); |
2 | 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(); |
|
243
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
50
diff
changeset
|
143 |
|
2 | 144 |
// from MProgressDialogCallback |
145 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
146 |
||
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
147 |
// from MContainerListener |
2 | 148 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
149 |
virtual void SizeChanged() {}; |
313
0f30a75610de
First implementation of two listboxes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
302
diff
changeset
|
150 |
void ResetContainer(); |
318
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
151 |
|
a231cc388498
Improved event handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
316
diff
changeset
|
152 |
virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)=0; |
2 | 153 |
protected: |
154 |
CPodcastListContainer* iListContainer; |
|
155 |
/** Previous activated view */ |
|
156 |
TVwsViewId iPreviousView; |
|
157 |
||
158 |
/** Listbox flags which the listbox is created with*/ |
|
159 |
TInt iListboxFlags; |
|
160 |
||
161 |
CDesCArray* iItemArray; |
|
316 | 162 |
CDesCArray* iItemArrayShort; |
2 | 163 |
RArray<TUint> iItemIdArray; |
316 | 164 |
|
2 | 165 |
TBuf<1024> iListboxFormatbuffer; |
316 | 166 |
TBuf<1024> iListboxFormatbufferShort; |
2 | 167 |
|
168 |
CAknToolbar *iToolbar; |
|
169 |
CAknWaitDialog *iWaitDialog; |
|
341
a648d7ca5e27
Small fixes after merge with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
318
diff
changeset
|
170 |
|
2 | 171 |
}; |
172 |
#endif // PODCASTBASEVIEWH |
|
173 |