2022-03-29 16:00:59 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Claudio Cambra <claudio.cambra@nextcloud.com>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2022-12-13 18:53:36 +03:00
|
|
|
#pragma once
|
2022-03-29 16:00:59 +03:00
|
|
|
|
2022-05-12 23:49:32 +03:00
|
|
|
#include <QObject>
|
|
|
|
|
2023-03-15 12:26:10 +03:00
|
|
|
#include "fileproviderdomainmanager.h"
|
2022-12-27 02:18:00 +03:00
|
|
|
#include "fileprovidersocketserver.h"
|
|
|
|
|
2022-03-29 16:00:59 +03:00
|
|
|
namespace OCC {
|
2022-11-30 18:24:43 +03:00
|
|
|
|
2023-03-15 17:54:10 +03:00
|
|
|
class Application;
|
|
|
|
|
2022-03-29 16:00:59 +03:00
|
|
|
namespace Mac {
|
|
|
|
|
2022-05-13 14:50:17 +03:00
|
|
|
// NOTE: For the file provider extension to work, the app bundle will
|
|
|
|
// need to be correctly codesigned!
|
|
|
|
|
2022-05-12 23:49:32 +03:00
|
|
|
class FileProvider : public QObject
|
|
|
|
{
|
2023-03-15 11:58:47 +03:00
|
|
|
Q_OBJECT
|
|
|
|
|
2022-05-12 23:49:32 +03:00
|
|
|
public:
|
|
|
|
static FileProvider *instance();
|
2023-03-15 17:54:10 +03:00
|
|
|
~FileProvider() override;
|
2022-03-29 16:00:59 +03:00
|
|
|
|
2023-03-15 11:58:47 +03:00
|
|
|
static bool fileProviderAvailable();
|
|
|
|
|
2022-05-12 23:49:32 +03:00
|
|
|
private:
|
2023-03-15 12:26:10 +03:00
|
|
|
std::unique_ptr<FileProviderDomainManager> _domainManager;
|
|
|
|
std::unique_ptr<FileProviderSocketServer> _socketServer;
|
2023-03-15 17:54:10 +03:00
|
|
|
|
|
|
|
static FileProvider *_instance;
|
|
|
|
explicit FileProvider(QObject * const parent = nullptr);
|
|
|
|
|
|
|
|
friend class OCC::Application;
|
2022-05-12 23:49:32 +03:00
|
|
|
};
|
2022-03-29 16:00:59 +03:00
|
|
|
|
|
|
|
} // namespace Mac
|
|
|
|
} // namespace OCC
|