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 #ifndef CNTSERVICEHANDLER_H |
|
19 #define CNTSERVICEHANDLER_H |
|
20 |
|
21 #include <cntservicescontact.h> |
|
22 #include <xqserviceprovider.h> |
|
23 #include <cntviewparams.h> |
|
24 #include <qtcontacts.h> |
|
25 |
|
26 QTM_USE_NAMESPACE |
|
27 |
|
28 class CntServiceHandler : public XQServiceProvider |
|
29 { |
|
30 Q_OBJECT |
|
31 public: |
|
32 CntServiceHandler(QObject *parent = 0); |
|
33 ~CntServiceHandler(); |
|
34 |
|
35 enum CntServiceViewParams |
|
36 { |
|
37 ETitle = ECustomParam, |
|
38 EFilter, |
|
39 EAction |
|
40 }; |
|
41 |
|
42 public: |
|
43 void completeFetch(const CntServicesContactList &contactList); |
|
44 void completeEdit(int result); |
|
45 |
|
46 public slots: |
|
47 // Services offered to clients |
|
48 void fetch(const QString &title, |
|
49 const QString &action, |
|
50 const QString &filter); |
|
51 |
|
52 void Dofetch(const QString &title, |
|
53 const QString &action, |
|
54 const QString &filter, |
|
55 const QString &mode = KCntNoSelectionMode); |
|
56 |
|
57 void editCreateNew(const QString &definitionName, const QString &value); |
|
58 void editCreateNew(const QString &vCardFile); |
|
59 void editUpdateExisting(const QString &definitionName, const QString &value); |
|
60 void open(int contactId); |
|
61 void open(const QString &definitionName, const QString &value); |
|
62 |
|
63 signals: |
|
64 void launchFetch(const QString &title, |
|
65 const QString &action, |
|
66 const QString &filter); |
|
67 |
|
68 void launchFetchVerified(const QString &title, |
|
69 const QString &action, |
|
70 const QString &filter, |
|
71 const QString &mode); |
|
72 |
|
73 void launchEditor(QContact contact); |
|
74 void launchContactSelection(QContactDetail detail); |
|
75 void launchContactCard(QContact contact); |
|
76 void launchAssignContactCard(QContact contact, QContactDetail detail); |
|
77 |
|
78 private: |
|
79 void removeNotSupportedFields(QContact& contact); |
|
80 void removeNotSupportedDetails(QContact& contact); |
|
81 |
|
82 private: |
|
83 int mCurrentRequestIndex; |
|
84 QStringList m_definitionNames; |
|
85 }; |
|
86 |
|
87 #endif /* CNTSERVICEHANDLER_H */ |
|