• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef EXECUTOR_CALLBACK_INTERFACE_H
17 #define EXECUTOR_CALLBACK_INTERFACE_H
18 
19 #include <cstdint>
20 
21 #include "iremote_broker.h"
22 
23 #include "executor_messenger_interface.h"
24 namespace OHOS {
25 namespace UserIam {
26 namespace UserAuth {
27 class ExecutorCallbackInterface : public IRemoteBroker {
28 public:
29     /* Message ID */
30     enum : uint32_t {
31         ON_MESSENGER_READY = 1,
32         ON_BEGIN_EXECUTE,
33         ON_END_EXECUTE,
34         ON_SET_PROPERTY,
35         ON_GET_PROPERTY,
36     };
37     virtual void OnMessengerReady(sptr<ExecutorMessengerInterface> &messenger, const std::vector<uint8_t> &publicKey,
38         const std::vector<uint64_t> &templateIdList) = 0;
39     virtual int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
40         const Attributes &command) = 0;
41     virtual int32_t OnEndExecute(uint64_t scheduleId, const Attributes &command) = 0;
42     virtual int32_t OnSetProperty(const Attributes &properties) = 0;
43     virtual int32_t OnGetProperty(const Attributes &condition, Attributes &values) = 0;
44     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.UserIam.AuthResPool.ExecutorCallback");
45 };
46 } // namespace UserAuth
47 } // namespace UserIam
48 } // namespace OHOS
49 #endif // EXECUTOR_CALLBACK_INTERFACE_H