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_ITEM_H_
18 #define NOTIFICATION_EX_ITEM_H_
26 #include "notification-ex/abstract_item.h"
27 #include "notification-ex/ex_bundle.h"
30 #define EXPORT_API __attribute__((visibility("default")))
33 namespace notification {
36 class EXPORT_API TextItem : public AbstractItem {
38 TextItem(std::string text);
41 Bundle Serialize() override;
42 void Deserialize(Bundle b) override;
43 AbstractItem& FindByID(std::string id) override;
44 void SetContents(std::string contents);
45 std::string GetContents() const;
46 std::string GetHyperLink() const;
49 std::string text_ = nullptr;
52 class EXPORT_API IconItem : public AbstractItem {
54 IconItem(std::string iconpath);
57 Bundle Serialize() override;
58 void Deserialize(Bundle b) override;
59 AbstractItem& FindByID(std::string id) override;
62 std::string iconPath_ = nullptr;
65 class EXPORT_API IconTextItem : public AbstractItem {
67 IconTextItem(std::string iconpath, std::string text);
68 virtual ~IconTextItem();
70 Bundle Serialize() override;
71 void Deserialize(Bundle b) override;
72 AbstractItem& FindByID(std::string id) override;
73 IconItem GetIconItem() const;
74 TextItem GetTextItem() const;
77 std::string iconPath_ = nullptr;
78 std::string text_ = nullptr;
79 }; // class IconTextItem
81 class EXPORT_API ImageItem : public AbstractItem {
83 ImageItem(std::string imagePath);
86 Bundle Serialize() override;
87 void Deserialize(Bundle b) override;
88 AbstractItem& FindByID(std::string id) override;
89 std::string GetImagePath() const;
92 std::string imagePath_ = nullptr;
95 class EXPORT_API CheckBoxItem : public AbstractItem {
97 CheckBoxItem(bool checked);
98 virtual ~CheckBoxItem();
100 Bundle Serialize() override;
101 void Deserialize(Bundle b) override;
102 AbstractItem& FindByID(std::string id) override;
103 bool IsChecked() const;
106 bool checked_ = false;
107 }; // class CheckBoxItem
109 class EXPORT_API ChatMessageItem : public AbstractItem {
118 virtual ~ChatMessageItem();
120 Bundle Serialize() override;
121 void Deserialize(Bundle b) override;
122 AbstractItem& FindByID(std::string id) override;
123 TextItem GetTextItem() const;
124 TextItem GetDataItem() const;
125 time_t GetTimeItem() const;
126 Type GetType() const;
127 }; // class ChatMessageItem
129 class EXPORT_API EntryItem : public AbstractItem {
132 virtual ~EntryItem();
134 Bundle Serialize() override;
135 void Deserialize(Bundle b) override;
136 AbstractItem& FindByID(std::string id) override;
137 std::string GetText() const;
138 void SetText(std::string text);
139 void SetTextLimit(int size);
140 int GetTextLimit() const;
143 std::string text_ = nullptr;
145 }; // class EntryItem
147 class EXPORT_API EffectItem : public AbstractItem {
150 virtual ~EffectItem();
152 Bundle Serialize() override;
153 void Deserialize(Bundle b) override;
154 AbstractItem& FindByID(std::string id) override;
155 std::string GetSoundPath() const;
156 std::string GetVibrationPath() const;
159 std::string soundPath_ = nullptr;
160 std::string vibrationPath_ = nullptr;
161 }; // class EffectItem
163 class EXPORT_API CustomItem : public AbstractItem {
166 virtual ~CustomItem();
168 Bundle Serialize() override;
169 void Deserialize(Bundle b) override;
170 AbstractItem& FindByID(std::string id) override;
171 }; // class CustomItem
174 } // nampace notification
175 #endif // NOTIFICATION_EX_ITEM_H_