2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
18 * @file ApiInterfaceImpl.h
19 * @author Piotr Sawicki <p.sawicki2@partner.samsung.com>
21 * @brief The declaration of ApiInterfaceImpl.
28 #include <ApiInterface.h>
29 #include <PopupCallbackClosure.h>
30 #include <StatusCallbackClosure.h>
32 #include <askuser-notification/ask-user-client-channel.h>
34 #include <askuser-notification-client.h>
40 class ApiInterfaceImpl : public ApiInterface {
42 ApiInterfaceImpl(const StatusCallbackClosure &closure);
43 ApiInterfaceImpl(const ApiInterfaceImpl& orig) = delete;
44 virtual ~ApiInterfaceImpl();
46 ApiInterface &operator=(const ApiInterfaceImpl& orig) = delete;
48 virtual int process(int fd, int events);
49 virtual askuser_check_result checkPrivilege(const std::string &privilege);
50 virtual RequestId popupRequest(const PopupCallbackClosure &closure,
51 const std::string &privilege);
53 void updateConnection(Protocol::ConnectionFd fd, int mask);
54 void popupResponse(Protocol::RequestId id, int response);
57 StatusCallbackClosure m_statusClosure;
58 std::unique_ptr<Protocol::ClientChannel> m_channel;
59 std::map<RequestId, PopupCallbackClosure> m_callbacks;
64 } // namespace AskUser