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_ANS_STANDARD_KITS_NATIVE_INCLUDE_NOTIFICATION_NORMAL_CONTENT_H 17 #define BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_INCLUDE_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 /** 27 * Default constructor used to create a NotificationNormalContent instance. 28 */ 29 NotificationNormalContent() = default; 30 31 /** 32 * Default deconstructor used to deconstruct. 33 */ 34 ~NotificationNormalContent() = default; 35 36 /** 37 * Returns a string representation of the object. 38 * @return a string representation of the object. 39 */ 40 std::string Dump() override; 41 42 /** 43 * Converts a NotificationNormalContent object into a Json. 44 * @param jsonObject Indicates the Json object. 45 */ 46 bool ToJson(nlohmann::json &jsonObject) const override; 47 48 /** 49 * Creates a NotificationNormalContent object from a Json. 50 * @param jsonObject Indicates the Json object. 51 * @return the NotificationNormalContent. 52 */ 53 static NotificationNormalContent *FromJson(const nlohmann::json &jsonObject); 54 55 /** 56 * Marshal a object into a Parcel. 57 * @param parcel the object into the parcel 58 */ 59 virtual bool Marshalling(Parcel &parcel) const override; 60 61 /** 62 * Unmarshal object from a Parcel. 63 * @return the NotificationNormalContent 64 */ 65 static NotificationNormalContent *Unmarshalling(Parcel &parcel); 66 }; 67 } // namespace Notification 68 } // namespace OHOS 69 70 #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_INCLUDE_NOTIFICATION_NORMAL_CONTENT_H