1 /*
2  * Copyright (c) 2022-2023 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 /**
17  * @addtogroup TokenCallback
18  * @{
19  *
20  * @brief Provides napi RequestPermissionsFromUser callback interface
21  *
22  * @since 8.0
23  * @version 8.0
24  */
25 
26 /**
27  * @file token_callback_stub.h
28  *
29  * @brief Declares TokenCallbackStub class.
30  *
31  * @since 8.0
32  * @version 8.0
33  */
34 
35 #ifndef I_TOKEN_CALLBACK_STUB_H
36 #define I_TOKEN_CALLBACK_STUB_H
37 
38 #include "i_token_callback.h"
39 
40 #include "iremote_stub.h"
41 #include "nocopyable.h"
42 
43 namespace OHOS {
44 namespace Security {
45 namespace AccessToken {
46 /**
47  * @brief Declares TokenCallbackStub class
48  */
49 class TokenCallbackStub : public IRemoteStub<ITokenCallback> {
50 public:
51     /**
52      * @brief Default constructor without any param.
53      */
54     TokenCallbackStub() = default;
55     /**
56      * @brief Default destructor without any param.
57      */
58     virtual ~TokenCallbackStub() = default;
59 
60     /**
61      * @brief Ipc trans fuction.
62      * @param code interface code, see i_token_callback.h InterfaceCode
63      * @param data ipc requst data
64      * @param reply ipc response data
65      * @param option some ipc comm parameter
66      * @return ipc comm exec result
67      */
68     int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override;
69 };
70 } // namespace AccessToken
71 } // namespace Security
72 } // namespace OHOS
73 #endif // I_TOKEN_CALLBACK_STUB_H