Merge "Fix build warning based on GCC-9" into tizen
[platform/core/api/notification.git] / notification-ex / app_control_action.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef NOTIFICATION_EX_APP_CONTROL_ACTION_H_
18 #define NOTIFICATION_EX_APP_CONTROL_ACTION_H_
19
20 #include <app_control.h>
21
22 #include <string>
23
24 #include "notification-ex/abstract_action.h"
25
26 namespace notification {
27 namespace item {
28
29 /**
30  * @brief The class for AppControlAction type action.
31  * @details The action with app control.
32  * @since_tizen 5.5
33  */
34 class EXPORT_API AppControlAction : public AbstractAction {
35  public:
36   /**
37    * @brief Constructor
38    * @since_tizen 5.5
39    * @param[in] app_control The app control handle
40    */
41   AppControlAction(app_control_h app_control);
42
43   /**
44    * @brief Constructor
45    * @since_tizen 5.5
46    * @param[in] app_control The app control handle
47    * @param[in] extra
48    */
49   AppControlAction(app_control_h app_control, std::string extra);
50
51   /**
52    * @brief Destructor
53    * @since_tizen 5.5
54    */
55   virtual ~AppControlAction();
56
57   /**
58    * @brief Gets the type of action
59    * @since_tizen 5.5
60    * @return The type of action
61    */
62   int GetType() const override;
63
64   /**
65    * @brief Serialize the data of AbstractAction.
66    * @since_tizen 5.5
67    * @return Bundle type data
68    */
69   tizen_base::Bundle Serialize() const override;
70
71   /**
72    * @brief Deserialize the serialized data.
73    * @since_tizen 5.5
74    * @param[in] b The serialized Bundle data
75    */
76   void Deserialize(tizen_base::Bundle b) override;
77
78   /**
79    * @brief Gets whether local or not.
80    * @since_tizen 5.5
81    * @return true if local, or false
82    */
83   bool IsLocal() const override;
84
85   /**
86    * @brief Execute the action
87    * @since_tizen 5.5
88    * @param[in] item The AbstractItem
89    */
90   void Execute(std::shared_ptr<AbstractItem> item) override;
91
92   /**
93    * @brief Gets the extra data
94    * @since_tizen 5.5
95    * @return The extra data
96    */
97   std::string GetExtra() const override;
98
99   /**
100    * @brief Gets the extra data
101    * @since_tizen 5.5
102    * @return The extra data
103    */
104   void SetAppControl(app_control_h app_control);
105
106   /**
107    * @brief Gets the app control handle
108    * @since_tizen 5.5
109    * @return the app control handle
110    */
111   app_control_h GetAppControl() const;
112
113  private:
114   class Impl;
115   std::unique_ptr<Impl> impl_;
116 };
117
118 }  // namespace item
119 }  // namespace notification
120
121 #endif  // NOTIFICATION_EX_APP_CONTROL_ACTION_H_