~unity-api-team/storage-provider-webdav/trunk

« back to all changes in this revision

Viewing changes to src/DeleteHandler.h

  • Committer: Bileto Bot
  • Author(s): James Henstridge, Tarmac
  • Date: 2016-11-28 07:45:30 UTC
  • mfrom: (10.2.12 devel)
  • Revision ID: ci-train-bot@canonical.com-20161128074530-mvjmc01hwb2s8q45
Merge lp:storage-provider-webdav/devel r22 to trunk.

Approved by: Michi Henning

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical Ltd.
 
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 version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: James Henstridge <james.henstridge@canonical.com>
 
17
 */
 
18
 
 
19
#pragma once
 
20
 
 
21
#include <QBuffer>
 
22
#include <QObject>
 
23
#include <QNetworkReply>
 
24
#include <unity/storage/provider/ProviderBase.h>
 
25
 
 
26
#include <memory>
 
27
 
 
28
class DavProvider;
 
29
 
 
30
class DeleteHandler : public QObject {
 
31
    Q_OBJECT
 
32
public:
 
33
    DeleteHandler(std::shared_ptr<DavProvider> const& provider, std::string const& item_id,
 
34
                  unity::storage::provider::Context const& ctx);
 
35
    ~DeleteHandler();
 
36
 
 
37
    boost::future<void> get_future();
 
38
 
 
39
private Q_SLOTS:
 
40
    void onFinished();
 
41
 
 
42
private:
 
43
    boost::promise<void> promise_;
 
44
 
 
45
    std::shared_ptr<DavProvider> const provider_;
 
46
    std::string const item_id_;
 
47
 
 
48
    std::unique_ptr<QNetworkReply> reply_;
 
49
};