2023-11-21 12:38:01 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2023 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QObject>
|
2024-01-02 11:28:26 +03:00
|
|
|
#include <QHash>
|
2023-11-21 12:38:01 +03:00
|
|
|
|
2024-01-02 11:28:26 +03:00
|
|
|
#include "accountstate.h"
|
2024-01-02 10:47:22 +03:00
|
|
|
|
2024-01-02 11:02:53 +03:00
|
|
|
#pragma once
|
2023-11-21 12:38:01 +03:00
|
|
|
|
2024-01-02 11:02:53 +03:00
|
|
|
namespace OCC::Mac {
|
2023-11-21 12:38:01 +03:00
|
|
|
|
2024-01-23 17:25:27 +03:00
|
|
|
/*
|
|
|
|
* Establishes communication between the app and the file provider extension.
|
|
|
|
* This is done via File Provider's XPC services API.
|
|
|
|
* Note that this is for client->extension communication, not the other way around.
|
|
|
|
* This is because the extension does not have a way to communicate with the client through the File Provider XPC API
|
|
|
|
*/
|
2023-11-21 12:38:01 +03:00
|
|
|
class FileProviderXPC : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FileProviderXPC(QObject *parent = nullptr);
|
2023-11-22 14:45:48 +03:00
|
|
|
|
|
|
|
public slots:
|
2023-12-27 14:10:37 +03:00
|
|
|
void connectToExtensions();
|
|
|
|
void configureExtensions();
|
2024-01-02 10:49:20 +03:00
|
|
|
void authenticateExtension(const QString &extensionAccountId) const;
|
|
|
|
void unauthenticateExtension(const QString &extensionAccountId) const;
|
2023-12-27 14:10:37 +03:00
|
|
|
|
2024-01-02 10:56:59 +03:00
|
|
|
private slots:
|
|
|
|
void slotAccountStateChanged(AccountState::State state) const;
|
|
|
|
|
2023-12-27 14:10:37 +03:00
|
|
|
private:
|
2024-01-02 11:28:26 +03:00
|
|
|
QHash<QString, void*> _clientCommServices;
|
2023-11-21 12:38:01 +03:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:02:53 +03:00
|
|
|
} // namespace OCC::Mac
|