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