|
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 |
|
19 #include <hbdocumentloader.h> |
|
20 |
|
21 //#include <hbeffect.h> |
|
22 |
|
23 #include "cxuidocumentloader.h" |
|
24 #include "cxuistillprecaptureview.h" |
|
25 #include "cxuipostcaptureview.h" |
|
26 #include "cxuistillprecaptureview2.h" |
|
27 #include "cxuivideoprecaptureview.h" |
|
28 #include "cxuivideoprecaptureview2.h" |
|
29 #include "cxutils.h" //CX_DEBUG_ASSERT |
|
30 #include "cxuisettingdialog.h" |
|
31 #include "cxuisettingbutton.h" |
|
32 #include "cxuisettingslider.h" |
|
33 #include "cxuisettingradiobuttonlist.h" |
|
34 #include "cxuiscenelabel.h" |
|
35 #include "cxuisettingbuttoncontainer.h" |
|
36 #include "cxeengine.h" |
|
37 #include "cxuienums.h" |
|
38 |
|
39 #include "OstTraceDefinitions.h" |
|
40 #ifdef OST_TRACE_COMPILER_IN_USE |
|
41 #include "cxuidocumentloaderTraces.h" |
|
42 #endif |
|
43 |
|
44 |
|
45 CxuiDocumentLoader::CxuiDocumentLoader(CxeEngine *engine) : HbDocumentLoader(), mEngine(engine) |
|
46 { |
|
47 } |
|
48 |
|
49 QObject *CxuiDocumentLoader::createObject(const QString& type, const QString &name) |
|
50 { |
|
51 OstTrace0( camerax_performance, CXUIDOCUMENTLOADER_CREATEOBJECT, "msg: e_CX_DOCLOADER_CREATEOBJECT 1" ); |
|
52 QObject *object = NULL; |
|
53 |
|
54 if (type == "HbView") { |
|
55 if (name == CxUiLayout::STILL_PRE_CAPTURE_VIEW) { |
|
56 object = new CxuiStillPrecaptureView(); |
|
57 } else if (name == CxUiLayout::VIDEO_PRE_CAPTURE_VIEW) { |
|
58 object = new CxuiVideoPrecaptureView(); |
|
59 } else if (name == CxUiLayout::POSTCAPTURE_VIEW) { |
|
60 object = new CxuiPostcaptureView(); |
|
61 } |
|
62 } else if (type == "CxuiStillPrecaptureView2") { |
|
63 object = new CxuiStillPrecaptureView2(); |
|
64 |
|
65 } else if (type == "CxuiVideoPrecaptureView2") { |
|
66 object = new CxuiVideoPrecaptureView2; |
|
67 |
|
68 } else if (type == "HbDialog") { |
|
69 if (name == CxUiLayout::SETTINGS_DIALOG_WIDGET |
|
70 || name == CxUiLayout::SETTINGS_SLIDER_DIALOG_WIDGET) { |
|
71 object = new CxuiSettingDialog(); |
|
72 } |
|
73 } else if (type == "CxuiSettingButton") { |
|
74 object = new CxuiSettingButton(NULL, mEngine); |
|
75 |
|
76 } else if (type == "CxuiSettingSlider") { |
|
77 object = new CxuiSettingSlider(NULL, mEngine); |
|
78 |
|
79 } else if (type == "CxuiSettingRadioButtonList") { |
|
80 object = new CxuiSettingRadioButtonList(NULL, mEngine); |
|
81 |
|
82 } else if (type == "CxuiSceneLabel") { |
|
83 object = new CxuiSceneLabel(NULL, mEngine); |
|
84 |
|
85 } else if (type == "CxuiSettingButtonContainer") { |
|
86 object = new CxuiSettingButtonContainer(NULL); |
|
87 |
|
88 } |
|
89 |
|
90 if (object) { |
|
91 object->setObjectName(name); |
|
92 } else { |
|
93 object = HbDocumentLoader::createObject(type, name); |
|
94 } |
|
95 |
|
96 OstTrace0( camerax_performance, DUP1_CXUIDOCUMENTLOADER_CREATEOBJECT, "msg: e_CX_DOCLOADER_CREATEOBJECT 0" ); |
|
97 return object; |
|
98 } |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |