50
|
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: This class offers contact editing UI services.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CNTSERVICEPROVIDEREDIT_H
|
|
19 |
#define CNTSERVICEPROVIDEREDIT_H
|
|
20 |
|
|
21 |
#include <cntservicescontact.h>
|
|
22 |
#include <xqserviceprovider.h>
|
|
23 |
#include <cntviewparams.h>
|
|
24 |
#include <qtcontacts.h>
|
|
25 |
|
|
26 |
#include "cntabstractserviceprovider.h"
|
|
27 |
|
|
28 |
class CntServices;
|
|
29 |
|
|
30 |
QTM_USE_NAMESPACE
|
|
31 |
|
|
32 |
/*!
|
|
33 |
This class offers contact editing UI services.
|
|
34 |
*/
|
|
35 |
class CntServiceProviderEdit : public XQServiceProvider, public CntAbstractServiceProvider
|
|
36 |
{
|
|
37 |
Q_OBJECT
|
|
38 |
public:
|
|
39 |
CntServiceProviderEdit(CntServices& aServices, QObject *parent = 0);
|
|
40 |
~CntServiceProviderEdit();
|
|
41 |
|
|
42 |
public slots: // operations offered to clients
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Launch editor for creating a new contact with a given detail.
|
|
46 |
* @param definitionName The field type
|
|
47 |
* @param value The value for the field.
|
|
48 |
*/
|
|
49 |
void editCreateNew(const QString& definitionName, const QString& value);
|
|
50 |
|
|
51 |
/**
|
53
|
52 |
* Launch editor for creating a new contact with a given detail and subtype.
|
|
53 |
* If the given subtype string is empty, then QContactPhoneNumber::SubTypeMobile is used.
|
|
54 |
* @param definitionName The field type
|
|
55 |
* @param value The value for the field.
|
|
56 |
* @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
|
|
57 |
*/
|
|
58 |
void editCreateNew(const QString &definitionName, const QString &value, const QString &subType);
|
|
59 |
|
|
60 |
/**
|
50
|
61 |
* Launch editor for creating a new contact based on vCard file indicated in arg.
|
|
62 |
* @param vCardFile The vCard file name and path.
|
|
63 |
*/
|
|
64 |
void editCreateNewFromVCard(const QString &vCardFile);
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Open the editor for an existing contact.'
|
|
68 |
* @param contactId
|
|
69 |
*/
|
|
70 |
void editExisting(int contactId);
|
|
71 |
|
|
72 |
/**
|
|
73 |
* User can first choose a contact, and then an editor is opened.
|
|
74 |
* A new detail is provided by caller and it will be prefilled in the editor.
|
|
75 |
* @param definitionName The field type
|
|
76 |
* @param value The value for the field.
|
|
77 |
*/
|
|
78 |
void editUpdateExisting(const QString &definitionName, const QString &value);
|
|
79 |
|
53
|
80 |
/**
|
|
81 |
* User can first choose a contact, and then an editor is opened.
|
|
82 |
* A new detail is provided by caller and it will be prefilled in the editor.
|
|
83 |
* The detail sub type can also be given.
|
|
84 |
* @param definitionName The field type
|
|
85 |
* @param value The value for the field.
|
|
86 |
* @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
|
|
87 |
*/
|
|
88 |
void editUpdateExisting(const QString &definitionName, const QString &value, const QString &subType);
|
|
89 |
|
50
|
90 |
private: // from CntAbstractServiceProvider
|
|
91 |
void CompleteServiceAndCloseApp(const QVariant& retValue);
|
|
92 |
|
|
93 |
private:
|
|
94 |
CntServices& mServices;
|
|
95 |
int mCurrentRequestIndex;
|
|
96 |
};
|
|
97 |
|
|
98 |
#endif /* CNTSERVICEPROVIDEREDIT_H */
|