|
1 /* |
|
2 * Copyright (c) 2010 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 CBSUIVIEWMANAGER_H |
|
19 #define CBSUIVIEWMANAGER_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <CbsCommonTypes.h> |
|
23 #include <hbdocumentloader.h> |
|
24 |
|
25 class HbMainWindow; |
|
26 class MCbs; |
|
27 class CCbsUiTopicListMonitor; |
|
28 class CbsUiTopicListView; |
|
29 class CbsUiTopicView; |
|
30 class HbAction; |
|
31 |
|
32 |
|
33 // Here we create custom document loader to be able to use own classes in XML. |
|
34 class CbsUiDocumentLoader : public HbDocumentLoader |
|
35 { |
|
36 public: |
|
37 virtual QObject *createObject(const QString &type, const QString &name); |
|
38 }; |
|
39 |
|
40 class CbsUiViewManager : public QObject |
|
41 { |
|
42 Q_OBJECT |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Constructor |
|
47 * |
|
48 * @param window The mainwindow of qt mode. |
|
49 * @param server The handler of connecting to Cbs server. |
|
50 */ |
|
51 CbsUiViewManager(HbMainWindow *window, MCbs &server); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CbsUiViewManager(); |
|
57 |
|
58 /** |
|
59 * Get handler of CbsUiDocumentLoader |
|
60 * |
|
61 * @return The handler of CbsUiDocumentLoader. |
|
62 */ |
|
63 CbsUiDocumentLoader* xmlLoader() { return mLoader; }; |
|
64 |
|
65 public slots: |
|
66 |
|
67 /** |
|
68 * Activate the currenct view as Topic view |
|
69 * |
|
70 * @param topicNumber The currenct topic number. |
|
71 */ |
|
72 void activateTopicView(TCbsTopicNumber topicNumber); |
|
73 |
|
74 /** |
|
75 * Activate the currenct view as Topic list view |
|
76 */ |
|
77 void activateMainView(); |
|
78 |
|
79 private: |
|
80 |
|
81 /** |
|
82 * Not Own, from CbsUiMainWindow |
|
83 */ |
|
84 HbMainWindow *mMainWindow; |
|
85 |
|
86 /** |
|
87 * Own |
|
88 */ |
|
89 CCbsUiTopicListMonitor *mTopicMonitor; |
|
90 |
|
91 /** |
|
92 * Not own, reference of MCbs |
|
93 */ |
|
94 MCbs &mServer; |
|
95 |
|
96 /** |
|
97 * Own but don't delete. Deleted via mObjects |
|
98 */ |
|
99 CbsUiTopicListView *mTopicListView; |
|
100 |
|
101 /** |
|
102 * Own but don't delete. Deleted via mObjects |
|
103 */ |
|
104 CbsUiTopicView *mTopicView; |
|
105 |
|
106 /** |
|
107 * Own |
|
108 */ |
|
109 CbsUiDocumentLoader *mLoader; |
|
110 |
|
111 /** |
|
112 * objects load from XML. Needs to be deleted once application exits |
|
113 */ |
|
114 QList<QObject *> mObjects; |
|
115 |
|
116 /** |
|
117 * Own but don't delete. Deleted via mObjects |
|
118 */ |
|
119 HbAction *mSoftKeyBackAction; |
|
120 |
|
121 /** |
|
122 * Own but don't delete. Deleted via mObjects |
|
123 */ |
|
124 HbAction *mSoftKeyExitAction; |
|
125 |
|
126 }; |
|
127 |
|
128 #endif // CBSUIVIEWMANAGER_H |
|
129 |
|
130 // End of file |
|
131 |