| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtVersit module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at http://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 2.1 or version 3 as published by the Free |
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and |
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the |
| 22 | ** following information to ensure the GNU Lesser General Public License |
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and |
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
| 25 | ** |
| 26 | ** As a special exception, The Qt Company gives you certain additional |
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception |
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
| 29 | ** |
| 30 | ** $QT_END_LICENSE$ |
| 31 | ** |
| 32 | ****************************************************************************/ |
| 33 | |
| 34 | #include "qversitcontacthandler.h" |
| 35 | |
| 36 | QT_BEGIN_NAMESPACE_VERSIT |
| 37 | |
| 38 | /*! |
| 39 | \internal |
| 40 | */ |
| 41 | QStringList QVersitContactHandlerFactory::keys() const |
| 42 | { |
| 43 | return QStringList() << name(); |
| 44 | } |
| 45 | |
| 46 | /*! |
| 47 | \class QVersitContactHandler |
| 48 | \brief The QVersitContactHandler class is a union of the |
| 49 | QVersitContactImporterPropertyHandlerV2 and QVersitContactExporterDetailHandlerV2 interfaces. |
| 50 | \ingroup versit-extension |
| 51 | \inmodule QtVersit |
| 52 | */ |
| 53 | |
| 54 | /*! |
| 55 | \fn QVersitContactHandler::~QVersitContactHandler() |
| 56 | This frees any memory used by the QVersitContactHandler. |
| 57 | */ |
| 58 | |
| 59 | /*! |
| 60 | \class QVersitContactHandlerFactory |
| 61 | \brief The QVersitContactHandlerFactory class provides the interface for Versit plugins. |
| 62 | \ingroup versit-extension |
| 63 | \inmodule QtVersit |
| 64 | |
| 65 | This class provides a simple interface for the creation of QVersitContactHandler instances. |
| 66 | Implement this interface to write a Versit plugin. For more details, see |
| 67 | \l{Qt Versit Plugins}. |
| 68 | */ |
| 69 | |
| 70 | /*! |
| 71 | \fn static const QString QVersitContactHandlerFactory::ProfileSync() |
| 72 | |
| 73 | The constant string signifying a plugin that is relevant to import and export in a |
| 74 | synchronization context. |
| 75 | \sa profiles(), |
| 76 | QVersitContactImporter::QVersitContactImporter(), |
| 77 | QVersitContactExporter::QVersitContactExporter() |
| 78 | */ |
| 79 | |
| 80 | /*! |
| 81 | \fn static const QString QVersitContactHandlerFactory::ProfileBackup() |
| 82 | |
| 83 | The constant string signifying a plugin that will backup a QContact to vCard, so that exporting, |
| 84 | then importing a contact will not lose any data. |
| 85 | \sa profiles(), |
| 86 | QVersitContactImporter::QVersitContactImporter(), |
| 87 | QVersitContactExporter::QVersitContactExporter() |
| 88 | */ |
| 89 | |
| 90 | /* TODO: make this a qdoc comment in 1.2 |
| 91 | \variable QVersitContactHandlerFactory::ProfilePreserve |
| 92 | |
| 93 | The constant string signifying a plugin that will preserve a vCard within a QContact, so that |
| 94 | importing, then exporting a vCard will not lose any data. |
| 95 | \sa profiles(), |
| 96 | QVersitContactImporter::QVersitContactImporter(), |
| 97 | QVersitContactExporter::QVersitContactExporter() |
| 98 | */ |
| 99 | |
| 100 | /*! |
| 101 | \fn QVersitContactHandlerFactory::~QVersitContactHandlerFactory() |
| 102 | This frees any memory used by the QVersitContactHandlerFactory. |
| 103 | */ |
| 104 | |
| 105 | /*! |
| 106 | \fn QSet<QString> QVersitContactHandlerFactory::profiles() const |
| 107 | This function can be overridden to allow a plugin to report which profiles it is to be active |
| 108 | under. If this (as in the default case) returns the empty set, it indicates that the plugin |
| 109 | should be loaded under all profiles. If it returns a non-empty set, it will only be loaded for |
| 110 | those profiles that are specified by the importer/exporter class. |
| 111 | */ |
| 112 | |
| 113 | /*! |
| 114 | \fn QString QVersitContactHandlerFactory::name() const |
| 115 | This function should return a unique string that identifies the handlers provided by this factory. |
| 116 | Typically, this will be of the form "org.qt-project.Qt.SampleVersitContactHandler" with the |
| 117 | appropriate domain and handler name substituted. |
| 118 | */ |
| 119 | |
| 120 | /*! |
| 121 | \fn int QVersitContactHandlerFactory::index() const |
| 122 | This function should return an index that helps with determining the order in which to run the |
| 123 | plugins. Plugins are run in the following order: |
| 124 | \list |
| 125 | \li Positively-indexed, ascending |
| 126 | \li Zero-indexed |
| 127 | \li Negatively-indexed, ascending |
| 128 | \endlist |
| 129 | For example, plugins with an index of 1 are run first and plugins of index -1 are run last. |
| 130 | If more than one plugin share an index, the order of execution between them is undefined. |
| 131 | |
| 132 | By default, this returns 0, which is recommended for plugins with no special ordering |
| 133 | requirements. |
| 134 | */ |
| 135 | |
| 136 | /*! |
| 137 | \fn QVersitContactHandler* QVersitContactHandlerFactory::createHandler() const |
| 138 | This function is called by the Versit importer or exporter class to create an instance of the |
| 139 | handler provided by this factory. |
| 140 | */ |
| 141 | |
| 142 | #include "moc_qversitcontacthandler.cpp" |
| 143 | QT_END_NAMESPACE_VERSIT |
| 144 | |