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_OPERATION_INFO_H 17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_OPERATION_INFO_H 18 19 #include "parcel.h" 20 #include <cstdint> 21 #include <string> 22 23 namespace OHOS { 24 namespace Notification { 25 26 enum OperationType { 27 DISTRIBUTE_OPERATION_JUMP = 0, 28 DISTRIBUTE_OPERATION_REPLY 29 }; 30 31 class NotificationOperationInfo : public Parcelable { 32 public: 33 NotificationOperationInfo() = default; 34 35 ~NotificationOperationInfo() = default; 36 37 /** 38 * @brief Obtains the initialTime. 39 * 40 * @return Returns the initialTime. 41 */ 42 std::string GetActionName() const; 43 44 void SetActionName(const std::string& actionName); 45 46 /** 47 * @brief Obtains the initialTime. 48 * 49 * @return Returns the initialTime. 50 */ 51 std::string GetUserInput() const; 52 53 void SetUserInput(const std::string& userInput); 54 55 std::string GetHashCode() const; 56 57 void SetHashCode(const std::string& hashCode); 58 59 std::string GetEventId() const; 60 61 void SetEventId(const std::string& eventId); 62 63 OperationType GetOperationType() const; 64 65 void SetOperationType(const OperationType& operationType); 66 67 std::string Dump(); 68 69 /** 70 * @brief Marshal a object into a Parcel. 71 * 72 * @param parcel Indicates the object into the parcel. 73 * @return Returns true if succeed; returns false otherwise. 74 */ 75 bool Marshalling(Parcel &parcel) const override; 76 77 /** 78 * @brief Unmarshal object from a Parcel. 79 * 80 * @param parcel Indicates the parcel object. 81 * @return Returns the NotificationOperationInfo. 82 */ 83 static NotificationOperationInfo *Unmarshalling(Parcel &parcel); 84 85 private: 86 87 bool ReadFromParcel(Parcel &parcel); 88 89 std::string actionName_; 90 std::string userInput_; 91 std::string hashCode_; 92 std::string eventId_; 93 OperationType operationType_; 94 }; 95 } // namespace Notification 96 } // namespace OHOS 97 98 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_TIME_H 99