author | hgs |
Tue, 05 Oct 2010 09:31:22 +0300 | |
changeset 54 | a8ba0c289b44 |
parent 34 | bc10a61bd7d3 |
child 57 | 21be958eb3ce |
permissions | -rw-r--r-- |
24 | 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 |
||
18 |
#ifndef _RADIOVIEWBASE_H_ |
|
19 |
#define _RADIOVIEWBASE_H_ |
|
20 |
||
21 |
// System includes |
|
22 |
#include <HbView> |
|
23 |
#include <QScopedPointer> |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
24 |
#include <QSharedPointer> |
24 | 25 |
|
26 |
// User includes |
|
27 |
||
28 |
// Forward declarations |
|
29 |
class RadioWindow; |
|
30 |
class RadioStationModel; |
|
31 |
class RadioUiLoader; |
|
32 |
class HbAction; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
33 |
class RadioUiEngine; |
54 | 34 |
class HbSelectionDialog; |
24 | 35 |
|
36 |
// Constants |
|
37 |
namespace MenuItem |
|
38 |
{ |
|
39 |
enum CommonMenuItem |
|
40 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
41 |
UseLoudspeaker, |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
42 |
Exit |
24 | 43 |
}; |
44 |
} |
|
45 |
||
46 |
// Class declaration |
|
47 |
class RadioViewBase : public HbView |
|
48 |
{ |
|
49 |
Q_OBJECT |
|
50 |
Q_DISABLE_COPY( RadioViewBase ) |
|
51 |
||
52 |
public: |
|
53 |
explicit RadioViewBase( bool transient = true ); |
|
54 |
||
55 |
virtual ~RadioViewBase(); |
|
56 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
57 |
void setMembers( RadioWindow* mainWindow, RadioUiLoader* uiLoader ); |
24 | 58 |
|
34 | 59 |
virtual void preLazyLoadInit(); |
60 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
61 |
void initialize( QSharedPointer<RadioUiEngine> uiEngine ); |
24 | 62 |
|
63 |
bool isInitialized() const; |
|
64 |
||
65 |
bool isTransient() const; |
|
66 |
||
67 |
void updateOrientation( Qt::Orientation orientation, bool forceUpdate = false ); |
|
68 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
69 |
void bringToForeground(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
70 |
|
24 | 71 |
protected slots: |
72 |
||
73 |
void updateAudioRouting( bool loudspeaker ); |
|
74 |
void activatePreviousView(); |
|
75 |
void quit(); |
|
76 |
||
77 |
private slots: |
|
78 |
||
79 |
void handleUserAnswer( HbAction* answer ); // Needed by HbMessageBox inconvenience API |
|
80 |
||
81 |
protected: |
|
82 |
||
83 |
// New functinos |
|
84 |
||
85 |
void initBackAction(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
86 |
|
24 | 87 |
void connectCommonMenuItem( int menuItem ); |
88 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
89 |
void connectXmlElement( const QString& name, const char* signal, QObject* receiver, const char* slot ); |
24 | 90 |
|
91 |
void connectViewChangeMenuItem( QString name, const char* slot ); |
|
92 |
||
93 |
void loadSection( const QString& docml, const QString& section ); |
|
94 |
||
95 |
void askQuestion( const QString& question ); |
|
54 | 96 |
|
97 |
void showSelectionDialog( QAbstractItemModel* model, |
|
98 |
const QString& titleTxt, |
|
99 |
const QString& confirmBtnTxt ); |
|
24 | 100 |
|
101 |
private: |
|
102 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
103 |
virtual void init() = 0; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
104 |
|
24 | 105 |
virtual void setOrientation(); |
106 |
virtual void userAccepted(); |
|
107 |
||
108 |
protected: // data |
|
109 |
||
110 |
/** |
|
111 |
* Pointer to the main window. |
|
112 |
* Not own. |
|
113 |
*/ |
|
114 |
RadioWindow* mMainWindow; |
|
115 |
||
116 |
/** |
|
117 |
* Pointer to the XML UI (DocML) loader |
|
118 |
* Own. |
|
119 |
*/ |
|
120 |
QScopedPointer<RadioUiLoader> mUiLoader; |
|
121 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
122 |
/** |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
123 |
* Pointer to the ui engine |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
124 |
* Shared among all views and the radio window |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
125 |
*/ |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
126 |
QSharedPointer<RadioUiEngine> mUiEngine; |
24 | 127 |
|
128 |
/** |
|
129 |
* Flag indicating whether or not the view is transient |
|
130 |
* Transient views are deleted when they are hidden. |
|
131 |
*/ |
|
132 |
bool mTransientView; |
|
133 |
||
134 |
/** |
|
135 |
* Route audio to Loudspeaker/Headset menu item |
|
136 |
*/ |
|
137 |
HbAction* mUseLoudspeakerAction; |
|
138 |
||
139 |
/** |
|
140 |
* View orientation. |
|
141 |
*/ |
|
142 |
Qt::Orientation mOrientation; |
|
143 |
||
144 |
}; |
|
145 |
||
146 |
||
147 |
#endif // _RADIOVIEWBASE_H_ |