2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef NOTIFICATION_EX_ABSTRACT_ACTION_H_
18 #define NOTIFICATION_EX_ABSTRACT_ACTION_H_
23 #include <bundle_cpp.h>
26 #define EXPORT_API __attribute__((visibility("default")))
29 namespace notification {
35 * @brief The base class for the notification action classes.
36 * @details The AbstractAction is abstract class.
37 * The AbstractAction has basic APIs for notification actions.
38 * The notification action class have to be a derived class of this class.
41 class EXPORT_API AbstractAction {
56 AbstractAction(bool isLocal);
64 AbstractAction(bool isLocal, std::string extra);
70 virtual ~AbstractAction();
73 * @brief Gets the type of action
75 * @return The type of action
77 virtual int GetType() const = 0;
80 * @brief Gets the type of action from Bundle data
82 * @param[in] b Bundle type data
83 * @return The type of action
85 static int GetType(tizen_base::Bundle b);
88 * @brief Serialize the data of AbstractAction.
90 * @return Bundle type data
92 virtual tizen_base::Bundle Serialize() const = 0;
95 * @brief Deserialize the serialized data.
97 * @param[in] b The serialized Bundle data
99 virtual void Deserialize(tizen_base::Bundle b) = 0;
102 * @brief Gets whether local or not.
104 * @return true if local, or false
106 virtual bool IsLocal() const = 0;
109 * @brief Execute the action
111 * @param[in] item The AbstractItem
113 virtual void Execute(std::shared_ptr<AbstractItem> item) = 0;
116 * @brief Gets the extra data
118 * @return The extra data
120 virtual std::string GetExtra() const = 0;
124 std::unique_ptr<Impl> impl_;
128 } // namespace notification
130 #endif // NOTIFICATION_EX_ABSTRACT_ACTION_H_