• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_ETS_ANI_INCLUDE_STS_ACTION_BUTTON_H
17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_ETS_ANI_INCLUDE_STS_ACTION_BUTTON_H
18 #include "ani.h"
19 #include "pixel_map.h"
20 #include "want_params.h"
21 #include "want_agent.h"
22 #include "notification_constant.h"
23 #include "notification_user_input.h"
24 #include "notification_action_button.h"
25 
26 namespace OHOS {
27 namespace NotificationSts {
28 using namespace OHOS::AppExecFwk;
29 using namespace OHOS::AAFwk;
30 using SemanticActionButton = OHOS::Notification::NotificationConstant::SemanticActionButton;
31 using WantAgent = OHOS::AbilityRuntime::WantAgent::WantAgent;
32 using NotificationUserInput = OHOS::Notification::NotificationUserInput;
33 using NotificationActionButton = OHOS::Notification::NotificationActionButton;
34 
35 struct StsActionButton {
36     std::shared_ptr<Media::PixelMap> icon;
37     std::string title;
38     std::shared_ptr<WantAgent> wantAgent;
39     std::shared_ptr<WantParams> extras = {};
40     SemanticActionButton semanticActionButton = SemanticActionButton::NONE_ACTION_BUTTON;
41     bool autoCreatedReplies = true;
42     std::vector<std::shared_ptr<NotificationUserInput>> mimeTypeOnlyInputs = {};
43     std::shared_ptr<NotificationUserInput> userInput = {};
44     bool isContextual = false;
45 };
46 
47 ani_status UnwrapNotificationActionButton(ani_env *env, ani_object param,
48     StsActionButton &actionButton);
49 ani_object WrapNotificationActionButton(ani_env* env,
50     const std::shared_ptr<NotificationActionButton> &actionButton);
51 
52 ani_status GetNotificationActionButtonArray(ani_env *env, ani_object param,
53     const char *name, std::vector<std::shared_ptr<NotificationActionButton>> &res);
54 ani_object GetAniArrayNotificationActionButton(ani_env* env,
55     const std::vector<std::shared_ptr<NotificationActionButton>> &actionButtons);
56 }
57 }
58 #endif