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>
|
|
|
|
|
2023-12-27 14:10:37 +03:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2024-01-02 10:47:22 +03:00
|
|
|
#import "ClientCommunicationProtocol.h"
|
|
|
|
|
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
|
|
|
|
|
|
|
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:
|
|
|
|
void setupConnections();
|
|
|
|
void processConnections(NSArray *const services);
|
2023-12-28 06:04:59 +03:00
|
|
|
|
2024-01-02 10:47:22 +03:00
|
|
|
NSDictionary<NSString *, NSObject<ClientCommunicationProtocol> *_clientCommServices;
|
2023-11-21 12:38:01 +03:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:02:53 +03:00
|
|
|
} // namespace OCC::Mac
|