• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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_REQUEST_BOX_H
17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_REQUEST_BOX_H
18 
19 #include <vector>
20 #include <string>
21 #include <map>
22 #include "pixel_map.h"
23 #include "tlv_box.h"
24 #include "box_base.h"
25 
26 namespace OHOS {
27 namespace Notification {
28 class NotificationRequestBox : public BoxBase {
29 public:
30     NotificationRequestBox();
31     NotificationRequestBox(std::shared_ptr<TlvBox> box);
32 #ifdef DISTRIBUTED_FEATURE_MASTER
33     bool SetNotificationHashCode(const std::string& hasdCode);
34     bool SetSlotType(int32_t type);
35     bool SetContentType(int32_t type);
36     bool SetReminderFlag(int32_t flag);
37     bool SetCreatorBundleName(const std::string& bundleName);
38     bool SetNotificationTitle(const std::string& title);
39     bool SetNotificationText(const std::string& text);
40     bool SetNotificationAdditionalText(const std::string& text);
41     bool SetNotificationBriefText(const std::string& text);
42     bool SetNotificationExpandedTitle(const std::string& text);
43     bool SetNotificationLongText(const std::string& text);
44     bool SetAllLineLength(const int32_t& length);
45     bool SetNotificationAllLines(const std::vector<std::string>& allLines);
46     bool SetNotificationBigPicture(const std::shared_ptr<Media::PixelMap>& bigPicture);
47     bool SetNotificationActionName(const std::string& actionName);
48     bool SetNotificationUserInput(const std::string& userInput);
49     bool SetSmallIcon(const std::shared_ptr<Media::PixelMap>& smallIcon);
50     bool SetBigIcon(const std::shared_ptr<Media::PixelMap>& bigIcon, int32_t deviceType);
51     bool SetOverlayIcon(const std::shared_ptr<Media::PixelMap>& overlayIcon, int32_t deviceType);
52     bool SetCommonLiveView(const std::vector<uint8_t>& byteSequence);
53     bool SetFinishTime(int64_t time);
54     bool SetAutoDeleteTime(int64_t time);
55     bool SetAppMessageId(const std::string& appMessageId);
56     bool SetReceiverUserId(const int32_t& userId);
57     bool SetBoxExtendInfo(const std::string& extendInfo);
58     bool SetDeviceUserId(const int32_t& userId);
59     bool SetDeviceId(const std::string& deviceId);
60     bool SetActionButtonsLength(const int32_t length);
61     bool SetActionButtonsTitle(const std::vector<std::string>& buttonsTitle);
62     bool SetNotificationBasicInfo(const std::string& basicInfo);
63 #else
64     bool GetNotificationHashCode(std::string& hasdCode) const;
65     bool GetSlotType(int32_t& type) const;
66     bool GetContentType(int32_t& type) const;
67     bool GetReminderFlag(int32_t& flag) const;
68     bool GetCreatorBundleName(std::string& bundleName) const;
69     bool GetNotificationTitle(std::string& title) const;
70     bool GetNotificationText(std::string& text) const;
71     bool GetNotificationAdditionalText(std::string& text) const;
72     bool GetNotificationBriefText(std::string& text) const;
73     bool GetNotificationExpandedTitle(std::string& text) const;
74     bool GetNotificationLongText(std::string& text) const;
75     bool GetAllLineLength(int32_t& length) const;
76     bool GetNotificationAllLines(std::vector<std::string>& allLines) const;
77     bool GetNotificationBigPicture(std::shared_ptr<Media::PixelMap>& bigPicture) const;
78     bool GetNotificationActionName(std::string& actionName) const;
79     bool GetNotificationUserInput(std::string& userInput) const;
80     bool GetSmallIcon(std::shared_ptr<Media::PixelMap>& smallIcon) const;
81     bool GetBigIcon(std::shared_ptr<Media::PixelMap>& bigIcon, const int32_t deviceType) const;
82     bool GetOverlayIcon(std::shared_ptr<Media::PixelMap>& overlayIcon, const int32_t deviceType) const;
83     bool GetCommonLiveView(std::vector<uint8_t>& byteSequence) const;
84     bool GetFinishTime(int64_t& time) const;
85     bool GetAutoDeleteTime(int64_t& time) const;
86     bool GetAppMessageId(std::string& appMessageId) const;
87     bool GetReceiverUserId(int32_t& userId) const;
88     bool GetBoxExtendInfo(std::string& extendInfo) const;
89     bool GetDeviceUserId(int32_t& userId) const;
90     bool GetDeviceId(std::string& deviceId) const;
91     bool GetActionButtonsLength(int32_t& length) const;
92     bool GetActionButtonsTitle(std::vector<std::string>& buttonsTitle) const;
93     bool GetNotificationBasicInfo(std::string& basicInfo) const;
94 #endif
95 };
96 }  // namespace Notification
97 }  // namespace OHOS
98 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_TLV_BOX_H
99