|
1 /* |
|
2 * Copyright (c) 2008-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: Definition file for class CalenDocLoader. |
|
15 * |
|
16 */ |
|
17 |
|
18 // System includes |
|
19 #include <HbGroupBox> |
|
20 |
|
21 // User includes |
|
22 #include "calendocloader.h" |
|
23 #include "calenagendaview.h" |
|
24 #include "calenagendaviewwidget.h" |
|
25 #include "calenmonthview.h" |
|
26 #include "calenmonthgrid.h" |
|
27 #include "calenpreviewpane.h" |
|
28 #include "calencontroller.h" |
|
29 #include "calenthicklinesdrawer.h" |
|
30 #include "calencommon.h" |
|
31 #include "calenpluginlabel.h" |
|
32 #include "calendayview.h" |
|
33 #include "calendayhourscrollarea.h" |
|
34 #include "calendaycontentscrollarea.h" |
|
35 #include "OstTraceDefinitions.h" |
|
36 #ifdef OST_TRACE_COMPILER_IN_USE |
|
37 #include "calendocloaderTraces.h" |
|
38 #endif |
|
39 |
|
40 // ---------------------------------------------------------------------------- |
|
41 // CalenDocLoader::CalenDocLoader |
|
42 // C++ default Constructor. |
|
43 // (other items were commented in a header). |
|
44 // ---------------------------------------------------------------------------- |
|
45 // |
|
46 CalenDocLoader::CalenDocLoader(CCalenController &controller) : |
|
47 mController(controller) |
|
48 { |
|
49 OstTraceFunctionEntry0( CALENDOCLOADER_CALENDOCLOADER_ENTRY ); |
|
50 |
|
51 |
|
52 OstTraceFunctionExit0( CALENDOCLOADER_CALENDOCLOADER_EXIT ); |
|
53 } |
|
54 |
|
55 // ---------------------------------------------------------------------------- |
|
56 // CalenDocLoader::CalenDocLoader |
|
57 // C++ default Destructor. |
|
58 // ---------------------------------------------------------------------------- |
|
59 // |
|
60 CalenDocLoader::~CalenDocLoader() |
|
61 { |
|
62 OstTraceFunctionEntry0( DUP1_CALENDOCLOADER_CALENDOCLOADER_ENTRY ); |
|
63 |
|
64 |
|
65 OstTraceFunctionExit0( DUP1_CALENDOCLOADER_CALENDOCLOADER_EXIT ); |
|
66 } |
|
67 // ---------------------------------------------------------------------------- |
|
68 // CalenDocLoader::createObject |
|
69 // @brief From HbDocumentLoader |
|
70 // Called whenever the docml file is parsed to create objects. |
|
71 // Over-riding it since we need to create custom views and widgets. |
|
72 // @param type The object type which is being created. For ex: HbWidget. |
|
73 // @param name The name of the created object. |
|
74 // @return QObject* Pointer to the created object. |
|
75 // ---------------------------------------------------------------------------- |
|
76 // |
|
77 QObject *CalenDocLoader::createObject(const QString &type, |
|
78 const QString &name) |
|
79 { |
|
80 OstTraceFunctionEntry0( CALENDOCLOADER_CREATEOBJECT_ENTRY ); |
|
81 |
|
82 MCalenServices &services = mController.Services(); |
|
83 if (name == QString(CALEN_AGENDAVIEW)) { |
|
84 QObject *calenAgendaView = new CalenAgendaView(services); |
|
85 calenAgendaView->setObjectName(name); |
|
86 OstTraceFunctionExit0( CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
87 return calenAgendaView; |
|
88 } else if (name == QString(CALEN_AGENDAVIEW_WIDGET)) { |
|
89 QObject *calenAgendaViewWidget = new CalenAgendaViewWidget(services, this); |
|
90 calenAgendaViewWidget->setObjectName(name); |
|
91 OstTraceFunctionExit0( DUP1_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
92 return calenAgendaViewWidget; |
|
93 } else if (name == QString(CALEN_MONTHVIEW)) { // For Month View |
|
94 QObject *calenMonthView = new CalenMonthView(services); |
|
95 calenMonthView->setObjectName(name); |
|
96 OstTraceFunctionExit0( DUP2_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
97 return calenMonthView; |
|
98 } else if (name == QString(CALEN_MONTHGRID)) { |
|
99 QObject *calenMonthGrid = new CalenMonthGrid(); |
|
100 calenMonthGrid->setObjectName(name); |
|
101 OstTraceFunctionExit0( DUP3_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
102 return calenMonthGrid; |
|
103 } else if(name == QString(CALEN_PREVPREVIEWPANE)) { |
|
104 QObject *prevPreviewPane = |
|
105 new CalenPreviewPane(services); |
|
106 prevPreviewPane->setObjectName(name); |
|
107 OstTraceFunctionExit0( DUP4_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
108 return prevPreviewPane; |
|
109 } else if(name == QString(CALEN_CURRPREVIEWPANE)) { |
|
110 QObject *currPreviewPane = |
|
111 new CalenPreviewPane(services); |
|
112 currPreviewPane->setObjectName(name); |
|
113 OstTraceFunctionExit0( DUP5_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
114 return currPreviewPane; |
|
115 } else if(name == QString(CALEN_NEXTPREVIEWPANE)) { |
|
116 QObject *nextPreviewPane = |
|
117 new CalenPreviewPane(services); |
|
118 nextPreviewPane->setObjectName(name); |
|
119 OstTraceFunctionExit0( DUP6_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
120 return nextPreviewPane; |
|
121 } else if (name == QString(CALEN_DAYNAMES_WIDGET)) { |
|
122 QObject *calenDayNamesWidget = |
|
123 new CalenThickLinesDrawer(CalendarNamespace::CalenDayNameWidget); |
|
124 calenDayNamesWidget->setObjectName(name); |
|
125 OstTraceFunctionExit0( DUP7_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
126 return calenDayNamesWidget; |
|
127 } else if (name == QString(CALEN_WEEKNUMBERS_WIDGET)) { |
|
128 QObject *calenSWeekNumWidget = |
|
129 new CalenThickLinesDrawer(CalendarNamespace::CalenWeekNumWidget); |
|
130 calenSWeekNumWidget->setObjectName(name); |
|
131 OstTraceFunctionExit0( DUP8_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
132 return calenSWeekNumWidget; |
|
133 } else if (name == QString(CALEN_PREVREGIONALINFO)) { |
|
134 QObject *calenPrevRegionalLabel = new CalenPluginLabel(services); |
|
135 calenPrevRegionalLabel->setObjectName(name); |
|
136 OstTraceFunctionExit0( DUP9_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
137 return calenPrevRegionalLabel; |
|
138 } else if (name == QString(CALEN_CURRREGIONALINFO)) { |
|
139 QObject *calencurrRegionalLabel = new CalenPluginLabel(services); |
|
140 calencurrRegionalLabel->setObjectName(name); |
|
141 OstTraceFunctionExit0( DUP10_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
142 return calencurrRegionalLabel; |
|
143 } else if (name == QString(CALEN_NEXTREGIONALINFO)) { |
|
144 QObject *calenNextRegionalLabel = new CalenPluginLabel(services); |
|
145 calenNextRegionalLabel->setObjectName(name); |
|
146 OstTraceFunctionExit0( DUP11_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
147 return calenNextRegionalLabel; |
|
148 } else if (name == QString(CALEN_DAYVIEW)) { |
|
149 QObject *calenDayView = new CalenDayView(services); |
|
150 calenDayView->setObjectName(name); |
|
151 return calenDayView; |
|
152 } else if (name == QString(CALEN_DAYVIEW_DAYINFO)) { |
|
153 QObject *calenDayInfo = new HbGroupBox(); |
|
154 calenDayInfo->setObjectName(name); |
|
155 return calenDayInfo; |
|
156 } else if (name == QString(CALEN_DAYVIEW_CONTENTWIDGET)) { |
|
157 QObject *calenContentWidget = new HbWidget(); |
|
158 calenContentWidget->setObjectName(name); |
|
159 return calenContentWidget; |
|
160 } else if (name == QString(CALEN_DAYVIEW_HOURSCROLLAREA)) { |
|
161 QObject *hourScrollArea = new CalenDayHourScrollArea(); |
|
162 hourScrollArea->setObjectName(name); |
|
163 return hourScrollArea; |
|
164 } else if (name == QString(CALEN_DAYVIEW_CONTENTSCROLLAREA)) { |
|
165 QObject *contentScrollArea = new CalenDayContentScrollArea(); |
|
166 contentScrollArea->setObjectName(name); |
|
167 return contentScrollArea; |
|
168 } else { |
|
169 OstTraceFunctionExit0( DUP12_CALENDOCLOADER_CREATEOBJECT_EXIT ); |
|
170 return HbDocumentLoader::createObject(type, name); |
|
171 } |
|
172 } |
|
173 |
|
174 // End of file --Don't remove this. |