|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #include "qversitcontacthandler.h" |
|
43 |
|
44 QTM_USE_NAMESPACE |
|
45 |
|
46 Q_DEFINE_LATIN1_CONSTANT(QVersitContactHandlerFactory::ProfileSync, "Sync"); |
|
47 Q_DEFINE_LATIN1_CONSTANT(QVersitContactHandlerFactory::ProfileBackup, "Backup"); |
|
48 |
|
49 /*! |
|
50 \class QVersitContactHandler |
|
51 \brief The QVersitContactHandler class is a union of the |
|
52 QVersitContactImporterPropertyHandlerV2 and QVersitContactExporterDetailHandlerV2 interfaces. |
|
53 \ingroup versit-extension |
|
54 */ |
|
55 |
|
56 /*! |
|
57 \class QVersitContactHandlerFactory |
|
58 \brief The QVersitContactHandlerFactory class provides the interface for Versit plugins. |
|
59 \ingroup versit-extension |
|
60 |
|
61 This class provides a simple interface for the creation of QVersitContactHandler instances. |
|
62 Implement this interface to write a Versit plugin. For more details, see \l{Versit Plugins}. |
|
63 */ |
|
64 |
|
65 /*! |
|
66 \variable QVersitContactHandlerFactory::ProfileSync |
|
67 |
|
68 The constant string signifying a plugin that is relevant to import and export in a |
|
69 synchronization context. |
|
70 \sa QVersitContactHandlerFactory::profiles(), QVersitContactImporter(), QVersitContactExporter() |
|
71 */ |
|
72 |
|
73 /*! |
|
74 \variable QVersitContactHandlerFactory::ProfileBackup |
|
75 |
|
76 The constant string signifying a plugin that is relevant to import and export in a backup/restore |
|
77 context. |
|
78 \sa profiles(), |
|
79 QVersitContactImporter::QVersitContactImporter(), |
|
80 QVersitContactExporter::QVersitContactExporter() |
|
81 */ |
|
82 |
|
83 /*! |
|
84 \fn QVersitContactHandlerFactory::~QVersitContactHandlerFactory() |
|
85 This frees any memory used by the QVersitContactHandlerFactory. |
|
86 */ |
|
87 |
|
88 /*! |
|
89 \fn QSet<QString> QVersitContactHandlerFactory::profiles() const |
|
90 This function can be overridden to allow a plugin to report which profiles it is to be active |
|
91 under. If this (as in the default case) returns the empty set, it indicates that the plugin |
|
92 should be loaded under all profiles. If it returns a non-empty set, it will only be loaded for |
|
93 those profiles that are specified by the importer/exporter class. |
|
94 */ |
|
95 |
|
96 /*! |
|
97 \fn QString QVersitContactHandlerFactory::name() const |
|
98 This function should return a unique string that identifies the handlers provided by this factory. |
|
99 Typically, this will be of the form "com.nokia.qt.mobility.versit.samplehandler" with the |
|
100 appropriate domain and handler name substituted. |
|
101 */ |
|
102 |
|
103 /*! |
|
104 \fn int index() const |
|
105 This function should return an index that helps with determining the order in which to run the |
|
106 plugins. Plugins are run in the following order: |
|
107 \list |
|
108 \o Positively-indexed, ascending |
|
109 \o Zero-indexed |
|
110 \o Negatively-indexed, ascending |
|
111 \endlist |
|
112 For example, plugins with an index of 1 are run first and plugins of index -1 are run last. |
|
113 If more than one plugin share an index, the order of execution between them is undefined. |
|
114 |
|
115 By default, this returns 0, which is recommended for plugins with no special ordering |
|
116 requirements. |
|
117 */ |
|
118 |
|
119 /*! |
|
120 \fn QVersitContactHandler* QVersitContactHandlerFactory::createHandler() const |
|
121 This function is called by the Versit importer or exporter class to create an instance of the |
|
122 handler provided by this factory. |
|
123 */ |