author | Sebastian Brannstrom <sebastianb@symbian.org> |
Mon, 15 Nov 2010 23:37:25 +0000 | |
branch | newlist |
changeset 355 | 075b3a49cb55 |
parent 336 | 3d6c1417e8bd |
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 |
||
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
38 |
class MContainerListener { |
2 | 39 |
public: |
40 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0; |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
41 |
virtual void SizeChanged() = 0; |
2 | 42 |
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0; |
43 |
}; |
|
44 |
||
45 |
class CPodcastListContainer : public CCoeControl |
|
46 |
{ |
|
47 |
public: |
|
48 |
CPodcastListContainer(); |
|
49 |
~CPodcastListContainer(); |
|
50 |
void ConstructL( const TRect& aRect, TInt aListboxFlags ); |
|
51 |
void SizeChanged(); |
|
52 |
TInt CountComponentControls() const; |
|
53 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
54 |
void HandleResourceChange(TInt aType); |
|
55 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
56 |
void SetContainerListener(MContainerListener *aContainerListener); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
57 |
void SetListboxObserver(MEikListBoxObserver *aObserver); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
58 |
CEikColumnListBox* Listbox(); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
59 |
void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
60 |
CArrayPtr<CGulIcon>* ListboxIcons(); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
61 |
void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
62 |
void SetEmptyText(const TDesC &aText); |
2 | 63 |
void ScrollToVisible(); |
64 |
void Draw(const TRect& aRect) const; |
|
13 | 65 |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
66 |
void SetLongTapDetectedL(TBool aLongTapDetected); |
26 | 67 |
|
2 | 68 |
protected: |
69 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
70 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
71 |
||
72 |
private: |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
73 |
CAknSingleLargeStyleListBox * iListboxLandscape; |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
74 |
CAknDoubleLargeStyleListBox * iListboxPortrait; |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
75 |
MContainerListener* iContainerListener; |
2 | 76 |
CAknsBasicBackgroundControlContext* iBgContext; |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
77 |
TBool iLongTapDetected; |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
78 |
CEikColumnListBox * iListbox; |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
79 |
TBool iLandscape; |
2 | 80 |
}; |
81 |
||
82 |
||
83 |
class CPodcastListView : public CAknView, public MAknToolbarObserver, |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
84 |
public MAknLongTapDetectorCallBack, public MEikListBoxObserver, |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
85 |
public MProgressDialogCallback, public MContainerListener |
2 | 86 |
{ |
87 |
public: |
|
88 |
~CPodcastListView(); |
|
13 | 89 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; |
48 | 90 |
TBool IsVisible(); |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
91 |
|
2 | 92 |
protected: |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
93 |
void SwitchListbox(); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
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 |
*/ |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
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(); |
|
144 |
||
145 |
// From MAknLongTapDetectorCallBack |
|
146 |
virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
|
147 |
||
148 |
// from MProgressDialogCallback |
|
149 |
void DialogDismissedL(TInt /*aButtonId*/) {} |
|
150 |
||
151 |
// from MKeyEventListener |
|
152 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
153 |
virtual void SizeChanged() {}; |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
154 |
void ResetContainer(); |
2 | 155 |
|
156 |
// from MPointerListener |
|
157 |
void PointerEventL(const TPointerEvent& aPointerEvent); |
|
158 |
||
159 |
protected: |
|
160 |
CPodcastListContainer* iListContainer; |
|
161 |
/** Previous activated view */ |
|
162 |
TVwsViewId iPreviousView; |
|
163 |
||
164 |
/** Listbox flags which the listbox is created with*/ |
|
165 |
TInt iListboxFlags; |
|
166 |
||
167 |
CDesCArray* iItemArray; |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
168 |
CDesCArray* iItemArrayShort; |
2 | 169 |
RArray<TUint> iItemIdArray; |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
170 |
|
2 | 171 |
TBuf<1024> iListboxFormatbuffer; |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
172 |
TBuf<1024> iListboxFormatbufferShort; |
2 | 173 |
|
174 |
CAknToolbar *iToolbar; |
|
175 |
CAknStylusPopUpMenu* iStylusPopupMenu; |
|
176 |
CAknLongTapDetector* iLongTapDetector; |
|
177 |
CAknWaitDialog *iWaitDialog; |
|
178 |
||
179 |
}; |
|
180 |
#endif // PODCASTBASEVIEWH |
|
181 |