1 /* 2 * Copyright (c) 2021 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_INTERFACES_INNER_API_NOTIFICATION_NORMAL_CONTENT_H 17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_NORMAL_CONTENT_H 18 19 #include "notification_basic_content.h" 20 #include "parcel.h" 21 22 namespace OHOS { 23 namespace Notification { 24 class NotificationNormalContent : public NotificationBasicContent { 25 public: 26 NotificationNormalContent() = default; 27 28 ~NotificationNormalContent() = default; 29 30 /** 31 * @brief Returns a string representation of the object. 32 * 33 * @return Returns a string representation of the object. 34 */ 35 std::string Dump() override; 36 37 /** 38 * @brief Converts a NotificationNormalContent object into a Json. 39 * 40 * @param jsonObject Indicates the Json object. 41 * @return Returns true if succeed; returns false otherwise. 42 */ 43 bool ToJson(nlohmann::json &jsonObject) const override; 44 45 /** 46 * @brief Creates a NotificationNormalContent object from a Json. 47 * 48 * @param jsonObject Indicates the Json object. 49 * @return Returns the NotificationNormalContent object. 50 */ 51 static NotificationNormalContent *FromJson(const nlohmann::json &jsonObject); 52 53 /** 54 * @brief Marshal a object into a Parcel. 55 * 56 * @param parcel the object into the parcel. 57 * @return Returns true if succeed; returns false otherwise. 58 */ 59 virtual bool Marshalling(Parcel &parcel) const override; 60 61 /** 62 * @brief Unmarshal object from a Parcel. 63 * 64 * @param parcel Indicates the parcel object. 65 * @return Returns the NotificationNormalContent object. 66 */ 67 static NotificationNormalContent *Unmarshalling(Parcel &parcel); 68 }; 69 } // namespace Notification 70 } // namespace OHOS 71 72 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_NORMAL_CONTENT_H