1 /*
2  * Copyright (c) 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 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_CHECK_INFO_H
16 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_CHECK_INFO_H
17 
18 #include "nlohmann/json.hpp"
19 #include "want.h"
20 
21 namespace OHOS {
22 namespace Notification {
23 
24 class NotificationCheckInfo {
25 private:
26     std::string pkgName_;
27     int32_t notifyId_;
28     int32_t contentType_;
29     int32_t creatorUserId_;
30     int32_t slotType_;
31     std::string label_;
32     std::shared_ptr<AAFwk::WantParams> extraInfo_ {};
33     void ConvertJsonExtraInfoToValue(nlohmann::json &jsonobj);
34 public:
35     NotificationCheckInfo() = default;
36     NotificationCheckInfo(std::string pkgName, int32_t notifyId, int32_t contentType,
37     int32_t creatorUserId, int32_t slotType, std::shared_ptr<AAFwk::WantParams> extraInfo);
38     ~NotificationCheckInfo();
39     std::string GetPkgName() const;
40     void SetPkgName(std::string pkgName);
41     int32_t GetNotifyId() const;
42     void SetNotifyId(int32_t notifyId);
43     int32_t GetContentType() const;
44     void SetContentType(int32_t contentType);
45     int32_t GetCreatorUserId() const;
46     void SetCreatorUserId(int32_t creatorUserId);
47     int32_t GetSlotType() const;
48     void SetSlotType(int32_t slotType);
49     std::string GetLabel() const;
50     void SetLabel(std::string label);
51     std::shared_ptr<AAFwk::WantParams> GetExtraInfo() const;
52     void SetExtraInfo(std::shared_ptr<AAFwk::WantParams> extraInfo);
53     void ConvertJsonStringToValue(const std::string &notificationData);
54 };
55 }  // namespace Notification
56 }  // namespace OHOS
57 
58 #endif  //BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_CHECK_INFO_H
59