~ubuntu-branches/ubuntu/quantal/qtmobility/quantal

« back to all changes in this revision

Viewing changes to src/versitorganizer/qversitorganizerexporter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-16 16:18:07 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20101116161807-k2dzt2nyse975r3l
Tags: 1.1.0-0ubuntu1
* New upstream release
* Syncronise with Debian, no remaining changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
**
9
9
** $QT_BEGIN_LICENSE:LGPL$
10
10
** Commercial Usage
11
 
** Licensees holding valid Qt Commercial licenses may use this file in
12
 
** accordance with the Qt Solutions Commercial License Agreement provided
13
 
** with the Software or, alternatively, in accordance with the terms
 
11
** Licensees holding valid Qt Commercial licenses may use this file in 
 
12
** accordance with the Qt Commercial License Agreement provided with
 
13
** the Software or, alternatively, in accordance with the terms
14
14
** contained in a written agreement between you and Nokia.
15
15
**
16
16
** GNU Lesser General Public License Usage
33
33
** ensure the GNU General Public License version 3.0 requirements will be
34
34
** met: http://www.gnu.org/copyleft/gpl.html.
35
35
**
36
 
** Please note Third Party Software included with Qt Solutions may impose
37
 
** additional restrictions and it is the user's responsibility to ensure
38
 
** that they have met the licensing requirements of the GPL, LGPL, or Qt
39
 
** Solutions Commercial license and the relevant license of the Third
40
 
** Party Software they are using.
41
 
**
42
36
** If you are unsure which license is appropriate for your use, please
43
37
** contact the sales department at qt-sales@nokia.com.
44
38
** $QT_END_LICENSE$
63
57
  \inmodule QtVersit
64
58
 
65
59
  This class is used to convert a list of \l {QOrganizerItem}{QOrganizerItems} (which may be stored
66
 
  in a QOrganizerItemManager) into a QVersitDocument (which may be written to an I/O device using
 
60
  in a QOrganizerManager) into a QVersitDocument (which may be written to an I/O device using
67
61
  QVersitReader.  While multiple items are provided as input, a single QVersitDocument is produced
68
62
  as output.  Unless there is an error, there is a one-to-one mapping between organizer items
69
63
  and sub-documents of the result.
76
70
  \ingroup versit-extension
77
71
  \inmodule QtVersit
78
72
 
79
 
  This interface supercedes QVersitOrganizerImporterPropertyHandler.
80
 
 
81
73
  \sa QVersitOrganizerExporter
82
74
 */
83
75
 
122
114
  QVersitOrganizerExporter.
123
115
*/
124
116
 
125
 
/*! Constructs a new importer */
 
117
/*!
 
118
  \enum QVersitOrganizerExporter::Error
 
119
  This enum specifies an error that occurred during the most recent call to exportItems()
 
120
  \value NoError The most recent operation was successful
 
121
  \value EmptyOrganizerError One of the organizer items was empty
 
122
  \value UnknownComponentTypeError One of the components in the iCalendar file is not supported
 
123
  \value UnderspecifiedOccurrenceError An event or todo exception was found which did not specify both its parent and a specifier for which instance to override
 
124
  */
 
125
 
 
126
/*! Constructs a new exporter */
126
127
QVersitOrganizerExporter::QVersitOrganizerExporter()
127
128
    : d(new QVersitOrganizerExporterPrivate)
128
129
{
129
130
}
130
131
 
131
 
/*! Frees the memory used by the importer */
 
132
/*!
 
133
 * Constructs a new exporter for the given \a profile.  The profile strings should be one of those
 
134
 * defined by QVersitOrganizerHandlerFactory, or a value otherwise agreed to by a \l{Versit
 
135
 * Plugins}{Versit plugin}.
 
136
 *
 
137
 * The profile determines which plugins will be loaded to supplement the exporter.
 
138
 */
 
139
QVersitOrganizerExporter::QVersitOrganizerExporter(const QString& profile)
 
140
    : d(new QVersitOrganizerExporterPrivate(profile))
 
141
{
 
142
}
 
143
 
 
144
/*! Frees the memory used by the exporter */
132
145
QVersitOrganizerExporter::~QVersitOrganizerExporter()
133
146
{
134
147
    delete d;
137
150
/*!
138
151
 * Converts \a items into a QVersitDocument, using the format given by \a versitType.
139
152
 * Returns true on success.  If any of the items could not be exported, false is returned and
140
 
 * errors() will return a list describing the errors that occurred.  The successfully exported
 
153
 * errorMap() will return a list describing the errors that occurred.  The successfully exported
141
154
 * components will still be available via document().
 
155
 *
 
156
 * \sa document(), errorMap()
142
157
 */
143
158
bool QVersitOrganizerExporter::exportItems(
144
159
    const QList<QOrganizerItem>& items,
185
200
 *
186
201
 * \sa exportItems()
187
202
 */
188
 
QMap<int, QVersitOrganizerExporter::Error> QVersitOrganizerExporter::errors() const
 
203
QMap<int, QVersitOrganizerExporter::Error> QVersitOrganizerExporter::errorMap() const
189
204
{
190
205
    return d->mErrors;
191
206
}
192
207
 
193
208
/*!
194
 
 * \preliminary
195
209
 * Sets \a handler to be the handler for processing QOrganizerItemDetails, or 0 to have no handler.
196
210
 *
197
211
 * Does not take ownership of the handler.  The client should ensure the handler remains valid for
198
212
 * the lifetime of the exporter.
199
213
 *
200
 
 * Only one detail handler can be set.  If another detail handler (of any version) was
201
 
 * previously set, it will no longer be associated with the exporter.
202
 
 *
203
 
 * NOTE: Detail handlers for organizer items have not been implemented yet.
 
214
 * Only one detail handler can be set.  If another detail handler was previously set, it will no
 
215
 * longer be associated with the exporter.
204
216
 */
205
217
void QVersitOrganizerExporter::setDetailHandler(QVersitOrganizerExporterDetailHandler* handler)
206
218
{