1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 16:45:07 +00:00
serenity/Userland/Services/FileSystemAccessServer/ConnectionFromClient.h
Itamar 3a71748e5d Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-25 22:35:12 +01:00

49 lines
1.6 KiB
C++

/*
* Copyright (c) 2021, timmot <tiwwot@protonmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <FileSystemAccessServer/FileSystemAccessClientEndpoint.h>
#include <FileSystemAccessServer/FileSystemAccessServerEndpoint.h>
#include <LibCore/Forward.h>
#include <LibGUI/Forward.h>
#include <LibIPC/ConnectionFromClient.h>
namespace FileSystemAccessServer {
class ConnectionFromClient final
: public IPC::ConnectionFromClient<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint> {
C_OBJECT(ConnectionFromClient);
public:
~ConnectionFromClient() override;
virtual void die() override;
private:
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
virtual void request_file_read_only_approved(i32, i32, String const&) override;
virtual void request_file(i32, i32, String const&, Core::OpenMode const&) override;
virtual void prompt_open_file(i32, i32, String const&, String const&, Core::OpenMode const&) override;
virtual void prompt_save_file(i32, i32, String const&, String const&, String const&, Core::OpenMode const&) override;
void prompt_helper(Optional<String> const&, Core::OpenMode const&);
RefPtr<GUI::Window> create_dummy_child_window(i32, i32);
enum class ShouldPrompt {
No,
Yes
};
void request_file_handler(i32, i32, String const&, Core::OpenMode const&, ShouldPrompt);
virtual Messages::FileSystemAccessServer::ExposeWindowServerClientIdResponse expose_window_server_client_id() override;
HashMap<String, Core::OpenMode> m_approved_files;
};
}