|
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 #include <cpsettingformentryitemdataimpl.h> |
|
18 #include <cpitemdatahelper.h> |
|
19 #include "cptelephonyplugin.h" |
|
20 #include "cptelephonypluginview.h" |
|
21 #include "cppluginlogging.h" |
|
22 |
|
23 |
|
24 /*! |
|
25 CpTelephonyPlugin::CpTelephonyPlugin() |
|
26 */ |
|
27 CpTelephonyPlugin::CpTelephonyPlugin() : |
|
28 QObject(0), |
|
29 m_localisation(0) |
|
30 { |
|
31 // Install plugin specific msg handler |
|
32 INSTALL_TRACE_MSG_HANDLER; |
|
33 DPRINT << ": IN"; |
|
34 |
|
35 // Set scoped pointer |
|
36 m_localisation.reset(new CpPhoneLocalisation(this)); |
|
37 |
|
38 // Install required translations |
|
39 m_localisation->installTranslator( |
|
40 CpPhoneLocalisation:: |
|
41 TranslationFileCommon); |
|
42 m_localisation->installTranslator( |
|
43 CpPhoneLocalisation:: |
|
44 TranslationFileTelephoneCp); |
|
45 |
|
46 DPRINT << ": OUT"; |
|
47 } |
|
48 |
|
49 /*! |
|
50 CpTelephonyPlugin::~CpTelephonyPlugin() |
|
51 */ |
|
52 CpTelephonyPlugin::~CpTelephonyPlugin() |
|
53 { |
|
54 DPRINT; |
|
55 |
|
56 // Uninstall plugin specific msg handler |
|
57 UNINSTALL_TRACE_MSG_HANDLER; |
|
58 } |
|
59 |
|
60 /*! |
|
61 CpTelephonyPlugin::createSettingFormItemData() const |
|
62 */ |
|
63 QList<CpSettingFormItemData*> CpTelephonyPlugin::createSettingFormItemData( |
|
64 CpItemDataHelper &itemDataHelper) const |
|
65 { |
|
66 DPRINT; |
|
67 |
|
68 QList<CpSettingFormItemData*> ret; |
|
69 ret.append(new CpSettingFormEntryItemDataImpl<CpTelephonyPluginView>( |
|
70 itemDataHelper, |
|
71 hbTrId("txt_cp_dblist_telephone"), |
|
72 hbTrId(""), |
|
73 HbIcon(QString("qtg_large_voice_call")))); |
|
74 return ret; |
|
75 } |
|
76 |
|
77 /*! |
|
78 CpTelephonyPlugin::createSettingView() const |
|
79 */ |
|
80 CpBaseSettingView *CpTelephonyPlugin::createSettingView(const QVariant &hint) const |
|
81 { |
|
82 QVariantHash hash = hint.value<QVariantHash>(); |
|
83 |
|
84 if( hash.value("view").toString().compare("divert_view",Qt::CaseInsensitive) == 0){ |
|
85 QVariantList params; |
|
86 params << QVariant("cpdivertplugin"); |
|
87 return new CpTelephonyPluginView(params); |
|
88 } |
|
89 return 0; |
|
90 } |
|
91 |
|
92 |
|
93 Q_EXPORT_PLUGIN2(cptelephonyplugin, CpTelephonyPlugin); |
|
94 |
|
95 |
|
96 // End of File. |