2015-01-12 13:35:11 +03:00
|
|
|
/*
|
2015-02-25 20:32:25 +03:00
|
|
|
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
|
2015-01-12 13:35:11 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2015-01-12 13:35:11 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
#ifndef SHAREDIALOG_H
|
|
|
|
#define SHAREDIALOG_H
|
|
|
|
|
2016-02-22 12:38:10 +03:00
|
|
|
#include "accountstate.h"
|
2016-03-30 12:33:34 +03:00
|
|
|
#include "sharepermissions.h"
|
2018-04-06 18:13:29 +03:00
|
|
|
#include "owncloudgui.h"
|
2016-02-22 12:38:10 +03:00
|
|
|
|
2019-04-06 21:15:24 +03:00
|
|
|
#include <QSharedPointer>
|
2016-02-22 12:38:10 +03:00
|
|
|
#include <QPointer>
|
2015-11-05 11:58:16 +03:00
|
|
|
#include <QString>
|
2014-09-03 18:12:21 +04:00
|
|
|
#include <QDialog>
|
2015-11-05 11:58:16 +03:00
|
|
|
#include <QWidget>
|
2015-10-29 13:09:10 +03:00
|
|
|
|
2016-03-30 12:33:34 +03:00
|
|
|
class QProgressIndicator;
|
|
|
|
|
2014-12-19 18:56:17 +03:00
|
|
|
namespace OCC {
|
2014-09-03 18:12:21 +04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ShareDialog;
|
|
|
|
}
|
|
|
|
|
2015-11-05 11:58:16 +03:00
|
|
|
class ShareLinkWidget;
|
|
|
|
class ShareUserGroupWidget;
|
2019-04-06 21:15:24 +03:00
|
|
|
class ShareManager;
|
|
|
|
class LinkShare;
|
|
|
|
class Share;
|
2014-09-03 18:12:21 +04:00
|
|
|
|
|
|
|
class ShareDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-02-22 12:38:10 +03:00
|
|
|
explicit ShareDialog(QPointer<AccountState> accountState,
|
2015-11-05 11:58:16 +03:00
|
|
|
const QString &sharePath,
|
|
|
|
const QString &localPath,
|
2016-03-30 12:33:34 +03:00
|
|
|
SharePermissions maxSharingPermissions,
|
2017-05-10 10:37:10 +03:00
|
|
|
const QByteArray &numericFileId,
|
2018-04-06 18:13:29 +03:00
|
|
|
ShareDialogStartPage startPage,
|
2018-11-11 12:56:22 +03:00
|
|
|
QWidget *parent = nullptr);
|
2014-09-03 18:12:21 +04:00
|
|
|
~ShareDialog();
|
2015-11-05 11:58:16 +03:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
private slots:
|
2018-11-11 13:08:03 +03:00
|
|
|
void done(int r) override;
|
2017-09-15 15:24:34 +03:00
|
|
|
void slotPropfindReceived(const QVariantMap &result);
|
|
|
|
void slotPropfindError();
|
2015-01-21 15:51:16 +03:00
|
|
|
void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
|
2016-02-22 12:38:10 +03:00
|
|
|
void slotAccountStateChanged(int state);
|
2015-03-26 20:08:06 +03:00
|
|
|
|
2019-04-06 21:15:24 +03:00
|
|
|
void slotSharesFetched(const QList<QSharedPointer<Share>> &shares);
|
|
|
|
void slotAddLinkShareWidget(const QSharedPointer<LinkShare> &linkShare);
|
|
|
|
void slotDeleteShare();
|
|
|
|
void slotCreateLinkShare();
|
2020-01-09 17:10:01 +03:00
|
|
|
void slotLinkShareRequiresPassword();
|
2019-04-06 21:15:24 +03:00
|
|
|
void slotAdjustScrollWidgetSize();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void toggleAnimation(bool);
|
2019-12-09 22:59:10 +03:00
|
|
|
void styleChanged();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void changeEvent(QEvent *) override;
|
2019-04-06 21:15:24 +03:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
private:
|
2016-03-30 12:33:34 +03:00
|
|
|
void showSharingUi();
|
2019-04-06 21:15:24 +03:00
|
|
|
void addLinkShareWidget(const QSharedPointer<LinkShare> &linkShare);
|
|
|
|
void initLinkShareWidget();
|
2016-03-30 12:33:34 +03:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
Ui::ShareDialog *_ui;
|
2018-07-25 12:18:08 +03:00
|
|
|
|
2016-02-22 12:38:10 +03:00
|
|
|
QPointer<AccountState> _accountState;
|
2015-01-16 16:48:56 +03:00
|
|
|
QString _sharePath;
|
|
|
|
QString _localPath;
|
2016-03-30 12:33:34 +03:00
|
|
|
SharePermissions _maxSharingPermissions;
|
2017-05-10 10:37:10 +03:00
|
|
|
QByteArray _numericFileId;
|
2017-09-15 15:24:34 +03:00
|
|
|
QString _privateLinkUrl;
|
2018-04-06 18:13:29 +03:00
|
|
|
ShareDialogStartPage _startPage;
|
2020-05-29 19:12:36 +03:00
|
|
|
ShareManager *_manager = nullptr;
|
2015-11-05 11:58:16 +03:00
|
|
|
|
2020-05-29 19:12:36 +03:00
|
|
|
QList<ShareLinkWidget*> _linkWidgetList = {};
|
|
|
|
ShareLinkWidget* _emptyShareLinkWidget = nullptr;
|
|
|
|
ShareUserGroupWidget *_userGroupWidget = nullptr;
|
|
|
|
QProgressIndicator *_progressIndicator = nullptr;
|
2014-09-03 18:12:21 +04:00
|
|
|
};
|
2020-05-29 19:12:36 +03:00
|
|
|
|
|
|
|
} // namespace OCC
|
2014-09-03 18:12:21 +04:00
|
|
|
|
|
|
|
#endif // SHAREDIALOG_H
|