1/*
2 * Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
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, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15#ifndef SHAREDIALOG_H
16#define SHAREDIALOG_H
17
18#include "accountstate.h"
19#include "sharepermissions.h"
20#include "owncloudgui.h"
21
22#include <QPointer>
23#include <QString>
24#include <QDialog>
25#include <QWidget>
26
27class QProgressIndicator;
28
29namespace OCC {
30
31namespace Ui {
32 class ShareDialog;
33}
34
35class ShareLinkWidget;
36class ShareUserGroupWidget;
37
38class ShareDialog : public QDialog
39{
40 Q_OBJECT
41
42public:
43 explicit ShareDialog(QPointer<AccountState> accountState,
44 const QString &sharePath,
45 const QString &localPath,
46 SharePermissions maxSharingPermissions,
47 const QByteArray &numericFileId,
48 ShareDialogStartPage startPage,
49 QWidget *parent = 0);
50 ~ShareDialog();
51
52private slots:
53 void done(int r);
54 void slotPropfindReceived(const QVariantMap &result);
55 void slotPropfindError();
56 void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
57 void slotAccountStateChanged(int state);
58
59private:
60 void showSharingUi();
61
62 Ui::ShareDialog *_ui;
63 QPointer<AccountState> _accountState;
64 QString _sharePath;
65 QString _localPath;
66 SharePermissions _maxSharingPermissions;
67 QByteArray _numericFileId;
68 QString _privateLinkUrl;
69 ShareDialogStartPage _startPage;
70
71 ShareLinkWidget *_linkWidget;
72 ShareUserGroupWidget *_userGroupWidget;
73 QProgressIndicator *_progressIndicator;
74};
75}
76
77#endif // SHAREDIALOG_H
78