Libkdav2

davcollectionmodifyjob.h
1/*
2 Copyright (c) 2010 Grégory Oestreicher <greg@kamago.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KDAV2_DAVCOLLECTIONMODIFYJOB_H
20#define KDAV2_DAVCOLLECTIONMODIFYJOB_H
21
22#include "kpimkdav2_export.h"
23
24#include "davjobbase.h"
25#include "davurl.h"
26
27#include <QtCore/QList>
28#include <QtXml/QDomDocument>
29
30#include <KCoreAddons/KJob>
31
32namespace KDAV2
33{
34
35/**
36 * @short A job that modifies a DAV collection.
37 *
38 * This job is used to modify a property of a DAV collection
39 * on the DAV server.
40 */
41class KPIMKDAV2_EXPORT DavCollectionModifyJob : public DavJobBase
42{
43 Q_OBJECT
44
45public:
46 /**
47 * Creates a new dav collection modify job.
48 *
49 * @param url The DAV url that identifies the collection.
50 * @param parent The parent object.
51 */
52 explicit DavCollectionModifyJob(const DavUrl &url, QObject *parent = nullptr);
53
54 /**
55 * Sets the property that shall be modified by the job.
56 *
57 * @param property The name of the property.
58 * @param value The value of the property.
59 * @param ns The XML namespace that shall be used for the property name.
60 */
61 void setProperty(const QString &property, const QString &value, const QString &ns = QString());
62
63 /**
64 * Sets the property that shall be removed by the job.
65 *
66 * @param property The name of the property.
67 * @param ns The XML namespace that shall be used for the property name.
68 */
69 void removeProperty(const QString &property, const QString &ns);
70
71 /**
72 * Starts the job.
73 */
74 void start() Q_DECL_OVERRIDE;
75
76private Q_SLOTS:
77 void davJobFinished(KJob *job);
78
79private:
80 DavUrl mUrl;
81 QDomDocument mQuery;
82
83 QVector<QDomElement> mSetProperties;
84 QVector<QDomElement> mRemoveProperties;
85};
86
87}
88
89#endif
A job that modifies a DAV collection.
base class for the jobs used by the resource.
Definition davjobbase.h:38
A helper class to combine url and protocol of a DAV url.
Definition davurl.h:36
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.