author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 13 Nov 2010 13:54:36 +0000 | |
branch | 3rded |
changeset 343 | 9c56bf585696 |
parent 176 | 1c8b56cb6409 |
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 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
34 |
class MContainerListener { |
2 | 35 |
public: |
36 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0; |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
37 |
virtual void SizeChanged() = 0; |
2 | 38 |
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0; |
39 |
}; |
|
40 |
||
41 |
class CPodcastListContainer : public CCoeControl |
|
42 |
{ |
|
43 |
public: |
|
44 |
CPodcastListContainer(); |
|
45 |
~CPodcastListContainer(); |
|
46 |
void ConstructL( const TRect& aRect, TInt aListboxFlags ); |
|
47 |
void SizeChanged(); |
|
48 |
TInt CountComponentControls() const; |
|
49 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
50 |
void HandleResourceChange(TInt aType); |
|
51 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
52 |
void SetContainerListener(MContainerListener *aContainerListener); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
53 |
void SetListboxObserver(MEikListBoxObserver *aObserver); |
2 | 54 |
CEikFormattedCellListBox* Listbox(); |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
55 |
void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
56 |
CArrayPtr<CGulIcon>* ListboxIcons(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
57 |
void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
58 |
void SetEmptyText(const TDesC &aText); |
2 | 59 |
void ScrollToVisible(); |
60 |
void Draw(const TRect& aRect) const; |
|
61 |
||
62 |
protected: |
|
63 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
64 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
65 |
||
66 |
private: |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
67 |
CEikFormattedCellListBox * iListbox; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
68 |
MContainerListener* iContainerListener; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
69 |
|
2 | 70 |
CAknsBasicBackgroundControlContext* iBgContext; |
26 | 71 |
|
2 | 72 |
}; |
73 |
||
74 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
75 |
class CPodcastListView : public CAknView, public MContainerListener, |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
76 |
public MEikListBoxObserver, |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
77 |
public MProgressDialogCallback |
2 | 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); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
136 |
virtual void SizeChanged() {}; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
137 |
void ResetContainer(); |
2 | 138 |
|
139 |
// from MPointerListener |
|
140 |
void PointerEventL(const TPointerEvent& aPointerEvent); |
|
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 |
CAknWaitDialog *iWaitDialog; |
|
156 |
||
157 |
}; |
|
158 |
#endif // PODCASTBASEVIEWH |
|
159 |