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: Screensaver custom document loader. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "snsrdocumentloader.h" |
|
19 |
|
20 #include "snsranalogclockwidget.h" |
|
21 #include "snsroledclockwidget.h" |
|
22 #include "snsrlabel.h" |
|
23 |
|
24 /*! |
|
25 \class SnsrDocumentLoader |
|
26 \ingroup group_snsrbigclockscreensaverprovider |
|
27 \brief Custom screensaver docml layout loader. |
|
28 |
|
29 Used mainly to create the analog clock widget from docml. |
|
30 */ |
|
31 |
|
32 /*! |
|
33 Creates the analog clock. |
|
34 \param type Static type name. |
|
35 \param name Object name. |
|
36 \retval Created object. |
|
37 */ |
|
38 QObject *SnsrDocumentLoader::createObject(const QString &type, const QString &name) |
|
39 { |
|
40 if (type == SnsrAnalogClockWidget::staticMetaObject.className()) { |
|
41 QObject *object = new SnsrAnalogClockWidget(); |
|
42 object->setObjectName(name); |
|
43 return object; |
|
44 } |
|
45 |
|
46 if (type == SnsrOledClockWidget::staticMetaObject.className()) { |
|
47 QObject *object = new SnsrOledClockWidget(); |
|
48 object->setObjectName(name); |
|
49 return object; |
|
50 } |
|
51 |
|
52 if (type == SnsrLabel::staticMetaObject.className()) { |
|
53 QObject *object = new SnsrLabel(); |
|
54 object->setObjectName(name); |
|
55 return object; |
|
56 } |
|
57 |
|
58 return HbDocumentLoader::createObject(type, name); |
|
59 } |
|