|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef IRABSTRACTLISTVIEWBASE_H |
|
18 #define IRABSTRACTLISTVIEWBASE_H |
|
19 |
|
20 |
|
21 #include <hbeffect.h> |
|
22 #include "irbaseview.h" |
|
23 #include "irqenums.h" |
|
24 |
|
25 class HbListView; |
|
26 class IrNowPlayingBannerLabel; |
|
27 class IrViewBannerLabel; |
|
28 class HbAction; |
|
29 class HbLabel; |
|
30 class IRQMetaData; |
|
31 class HbAbstractViewItem; |
|
32 |
|
33 class IrAbstractListViewBase : public IRBaseView |
|
34 { |
|
35 Q_OBJECT |
|
36 public: |
|
37 void setHeadingText(const QString &aText); |
|
38 QString getHeadingText() const; |
|
39 virtual void resetCurrentItem(); |
|
40 |
|
41 ~IrAbstractListViewBase(); |
|
42 |
|
43 protected: |
|
44 IrAbstractListViewBase(IRApplication *aApplication, TIRViewId aViewId); |
|
45 virtual void storeCurrentItem(); |
|
46 virtual void handleItemSelected(); |
|
47 |
|
48 |
|
49 //we call the functin when we handle the handleitemselect. |
|
50 //The return value shows wether we need to connect to the |
|
51 //network, true means we connect and false means do not |
|
52 //eg. click song name, Music Shop will be open. IR needn't connect netork |
|
53 virtual void itemAboutToBeSelected(bool &aNeedNetwork); |
|
54 |
|
55 virtual void setCheckedAction(); |
|
56 |
|
57 virtual void updateView(); |
|
58 |
|
59 //from base |
|
60 TIRHandleResult handleCommand(TIRViewCommand aCommand, TIRViewCommandReason aReason); |
|
61 |
|
62 private slots: |
|
63 void clickItem(const QModelIndex &aIndex); |
|
64 |
|
65 void collectionsActionClicked(); |
|
66 |
|
67 void favoritesActionClicked(); |
|
68 |
|
69 void searchActionClicked(); |
|
70 |
|
71 virtual void prepareMenu(); |
|
72 |
|
73 void metaDataAvailable(IRQMetaData*); |
|
74 |
|
75 void removeBanner(); |
|
76 |
|
77 void notReady(); |
|
78 |
|
79 void gotoNowPlaying(); |
|
80 |
|
81 void launchSettingsView(); |
|
82 |
|
83 void openWebAddress(); |
|
84 |
|
85 virtual void listViewLongPressed(HbAbstractViewItem *aItem, const QPointF &aCoords); |
|
86 |
|
87 void selectEffectComplete1(HbEffect::EffectStatus aStatus); |
|
88 |
|
89 void selectEffectComplete2(HbEffect::EffectStatus aStatus); |
|
90 private: |
|
91 void initMenu(); |
|
92 void initToolBar(); |
|
93 void initContentWidget(); |
|
94 void initEffects(); |
|
95 void initScrollBar(); |
|
96 void addBanner(const QString &aText); |
|
97 void clickAfterEffects(); |
|
98 |
|
99 |
|
100 |
|
101 protected: |
|
102 HbListView *iListView; |
|
103 IrNowPlayingBannerLabel *iBannerLabel; |
|
104 IrViewBannerLabel *iHeadingLabel; |
|
105 HbAction *iOpenWebAddressAction; |
|
106 HbAction *iCollectionsAction; |
|
107 HbAction *iFavoritesAction; |
|
108 HbAction *iGenresAction; |
|
109 HbAction *iSearchAction; |
|
110 QTimer *iConvertTimer; |
|
111 bool iEffectOnGoing; |
|
112 QModelIndex iChosenIndex; |
|
113 }; |
|
114 |
|
115 #endif // IRABSTRACTLISTVIEWBASE_H |