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 |
void SetPointerListener(MPointerListener *aPointerListener);
|
|
61 |
|
|
62 |
CEikFormattedCellListBox* Listbox();
|
|
63 |
void ScrollToVisible();
|
|
64 |
void Draw(const TRect& aRect) const;
|
13
|
65 |
|
26
|
66 |
void SetLongTapDetected(TBool aLongTapDetected);
|
|
67 |
|
|
68 |
CEikFormattedCellListBox * iListbox;
|
2
|
69 |
|
|
70 |
protected:
|
|
71 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
|
|
72 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
73 |
|
|
74 |
private:
|
|
75 |
MKeyEventListener* iKeyEventListener;
|
|
76 |
MPointerListener* iPointerListener;
|
|
77 |
CAknsBasicBackgroundControlContext* iBgContext;
|
26
|
78 |
TBool iLongTapDetected;
|
|
79 |
|
2
|
80 |
};
|
|
81 |
|
|
82 |
|
|
83 |
class CPodcastListView : public CAknView, public MAknToolbarObserver,
|
|
84 |
public MPointerListener, public MAknLongTapDetectorCallBack,
|
|
85 |
public MProgressDialogCallback, public MKeyEventListener
|
|
86 |
{
|
|
87 |
public:
|
|
88 |
~CPodcastListView();
|
13
|
89 |
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
|
|
90 |
|
2
|
91 |
protected:
|
|
92 |
void ConstructL();
|
|
93 |
CPodcastListView();
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Handles a view activation and passes the message of type
|
|
97 |
* @c aCustomMessageId. This function is intended for overriding by
|
|
98 |
* sub classes. This function is called by @c AknViewActivatedL().
|
|
99 |
* @param aPrevViewId Specifies the view previously active.
|
|
100 |
* @param aCustomMessageId Specifies the message type.
|
|
101 |
* @param aCustomMessage The activation message.
|
|
102 |
*/
|
|
103 |
void DoActivateL(const TVwsViewId& aPrevViewId,
|
|
104 |
TUid aCustomMessageId,
|
|
105 |
const TDesC8& aCustomMessage);
|
|
106 |
|
|
107 |
/**
|
|
108 |
* View deactivation function intended for overriding by sub classes.
|
|
109 |
* This function is called by @c AknViewDeactivated().
|
|
110 |
*/
|
|
111 |
void DoDeactivate();
|
|
112 |
|
|
113 |
void HandleViewRectChange();
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Event handler for status pane size changes.
|
|
117 |
* @c CAknView provides an empty implementation for sub classes that do
|
|
118 |
* not want to handle this event.
|
|
119 |
*/
|
|
120 |
void HandleStatusPaneSizeChange();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Command handling function intended for overriding by sub classes.
|
|
124 |
* Default implementation is empty.
|
|
125 |
* @param aCommand ID of the command to respond to.
|
|
126 |
*/
|
|
127 |
void HandleCommandL(TInt aCommand);
|
|
128 |
|
|
129 |
void OfferToolbarEventL(TInt aCommand);
|
|
130 |
void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar);
|
|
131 |
|
|
132 |
virtual void UpdateListboxItemsL() = 0;
|
|
133 |
|
|
134 |
void RunAboutDialogL();
|
|
135 |
void SetEmptyTextL(TInt aResourceId);
|
|
136 |
void ShowOkMessage(TDesC &aText);
|
|
137 |
void ShowErrorMessage(TDesC &aText);
|
|
138 |
TInt ShowQueryMessage(TDesC &aText);
|
|
139 |
void CloseToolbarExtension();
|
|
140 |
void ShowWaitDialogL(TDesC &aWaitText);
|
|
141 |
void CloseWaitDialog();
|
|
142 |
|
|
143 |
// From MAknLongTapDetectorCallBack
|
|
144 |
virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
|
|
145 |
|
|
146 |
// from MProgressDialogCallback
|
|
147 |
void DialogDismissedL(TInt /*aButtonId*/) {}
|
|
148 |
|
|
149 |
// from MKeyEventListener
|
|
150 |
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
|
151 |
|
|
152 |
// from MPointerListener
|
|
153 |
void PointerEventL(const TPointerEvent& aPointerEvent);
|
|
154 |
|
|
155 |
protected:
|
|
156 |
CPodcastListContainer* iListContainer;
|
|
157 |
/** Previous activated view */
|
|
158 |
TVwsViewId iPreviousView;
|
|
159 |
|
|
160 |
/** Listbox flags which the listbox is created with*/
|
|
161 |
TInt iListboxFlags;
|
|
162 |
|
|
163 |
CDesCArray* iItemArray;
|
|
164 |
RArray<TUint> iItemIdArray;
|
|
165 |
|
|
166 |
TBuf<1024> iListboxFormatbuffer;
|
|
167 |
|
|
168 |
CAknToolbar *iToolbar;
|
|
169 |
CAknStylusPopUpMenu* iStylusPopupMenu;
|
|
170 |
CAknLongTapDetector* iLongTapDetector;
|
|
171 |
CAknWaitDialog *iWaitDialog;
|
|
172 |
|
|
173 |
};
|
|
174 |
#endif // PODCASTBASEVIEWH
|
|
175 |
|