Improve coverage and add notification unittest
[platform/core/api/notification.git] / notification-ex / abstract_item.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_ABSTRACT_ITEM_H_
18 #define NOTIFICATION_EX_ABSTRACT_ITEM_H_
19
20 #include <time.h>
21 #include <bundle_cpp.h>
22
23 #include <memory>
24 #include <string>
25 #include <list>
26 #include <vector>
27 #include <map>
28
29 #include "notification-ex/abstract_action.h"
30 #include "notification-ex/multi_language.h"
31 #include "notification-ex/iitem_info.h"
32
33 #ifndef EXPORT_API
34 #define EXPORT_API __attribute__((visibility("default")))
35 #endif
36
37 namespace notification {
38 namespace item {
39
40 /* LCOV_EXCL_START */
41 /**
42  * @brief The class for ReceiverGroup.
43  * @details The class to define receiver group of notification.
44  * @since_tizen 5.5
45  */
46 class EXPORT_API ReceiverGroup {
47  public:
48   static const std::string Panel;
49   static const std::string Ticker;
50   static const std::string LockScreen;
51   static const std::string Indicator;
52   static const std::string Popup;
53 };
54
55 /**
56  * @brief The class for color data.
57  * @details The color consists A,R,G,B values.
58  * @since_tizen 5.5
59  */
60 class EXPORT_API Color {
61  public:
62   Color() {
63     a_ = 0;
64     r_ = 0;
65     g_ = 0;
66     b_ = 0;
67   }
68   Color(unsigned char a, unsigned char r, unsigned char g, unsigned char b)
69     : a_(a), r_(r), g_(g), b_(b) {
70   }
71   virtual ~Color() = default;
72
73   /**
74    * @brief Copy-constructor.
75    * @since_tizen 5.5
76    * @param[in] c The object to copy
77    */
78   Color(const Color& c) {
79     a_ = c.a_;
80     r_ = c.r_;
81     g_ = c.g_;
82     b_ = c.b_;
83   }
84
85   /**
86    * @brief Assignment.
87    * @since_tizen 5.5
88    * @param[in] c The object to copy
89    */
90   Color& operator = (const Color& c) {
91     if (this != &c) {
92       a_ = c.a_;
93       r_ = c.r_;
94       g_ = c.g_;
95       b_ = c.b_;
96     }
97     return *this;
98   }
99
100   /**
101    * @brief Move-constructor.
102    * @since_tizen 5.5
103    * @param[in] c The object to move
104    */
105   Color(Color&& c) noexcept {
106     a_ = c.a_;
107     c.a_ = 0;
108
109     r_ = c.r_;
110     c.r_ = 0;
111
112     g_ = c.g_;
113     c.g_ = 0;
114
115     b_ = c.b_;
116     c.b_ = 0;
117   }
118
119   /**
120    * @brief Assignment.
121    * @since_tizen 5.5
122    * @param[in] c The object to move
123    */
124   Color& operator = (Color&& c) noexcept {
125     if (this != &c) {
126       a_ = c.a_;
127       c.a_ = 0;
128
129       r_ = c.r_;
130       c.r_ = 0;
131
132       g_ = c.g_;
133       c.g_ = 0;
134
135       b_ = c.b_;
136       c.b_ = 0;
137     }
138     return *this;
139   }
140
141   /**
142    * @brief Gets alpha value of color.
143    * @since_tizen 5.5
144    * @return The alpha value of color
145    */
146   unsigned char GetAVal() const {
147     return a_;
148   }
149
150   /**
151    * @brief Gets red value of color.
152    * @since_tizen 5.5
153    * @return The red value of color
154    */
155   unsigned char GetRVal() const {
156     return r_;
157   }
158
159   /**
160    * @brief Gets green value of color.
161    * @since_tizen 5.5
162    * @return The green value of color
163    */
164   unsigned char GetGVal() const {
165     return g_;
166   }
167
168   /**
169    * @brief Gets blue value of color.
170    * @since_tizen 5.5
171    * @return The blue value of color
172    */
173   unsigned char GetBVal() const {
174     return b_;
175   }
176
177  private:
178   unsigned char a_;
179   unsigned char r_;
180   unsigned char g_;
181   unsigned char b_;
182 };  // class Color
183
184 /**
185  * @brief The class for padding data.
186  * @details There are left, top, right, bottom padding value.
187  * @since_tizen 5.5
188  */
189 class EXPORT_API Padding {
190  public:
191   Padding() {
192     left_ = 0;
193     top_ = 0;
194     right_ = 0;
195     bottom_ = 0;
196   }
197   Padding(int left, int top, int right, int bottom)
198     : left_(left), top_(top), right_(right), bottom_(bottom) {
199   }
200   virtual ~Padding() = default;
201
202   /**
203    * @brief Copy-constructor.
204    * @since_tizen 5.5
205    * @param[in] c The object to copy
206    */
207   Padding(const Padding& c) {
208     left_ = c.left_;
209     top_ = c.top_;
210     right_ = c.right_;
211     bottom_ = c.bottom_;
212   }
213
214   /**
215    * @brief Assignment.
216    * @since_tizen 5.5
217    * @param[in] c The object to copy
218    */
219   Padding& operator = (const Padding& c) {
220     if (this != &c) {
221       left_ = c.left_;
222       top_ = c.top_;
223       right_ = c.right_;
224       bottom_ = c.bottom_;
225     }
226     return *this;
227   }
228
229   /**
230    * @brief Move-constructor.
231    * @since_tizen 5.5
232    * @param[in] c The object to move
233    */
234   Padding(Padding&& c) noexcept {
235     left_ = c.left_;
236     c.left_ = 0;
237
238     top_ = c.top_;
239     c.top_ = 0;
240
241     right_ = c.right_;
242     c.right_ = 0;
243
244     bottom_ = c.bottom_;
245     c.bottom_ = 0;
246   }
247
248   /**
249    * @brief Assignment.
250    * @since_tizen 5.5
251    * @param[in] c The object to move
252    */
253   Padding& operator = (Padding&& c) noexcept {
254     if (this != &c) {
255       left_ = c.left_;
256       c.left_ = 0;
257
258       top_ = c.top_;
259       c.top_ = 0;
260
261       right_ = c.right_;
262       c.right_ = 0;
263
264       bottom_ = c.bottom_;
265       c.bottom_ = 0;
266     }
267     return *this;
268   }
269
270   /**
271    * @brief Gets left value of padding.
272    * @since_tizen 5.5
273    * @return The left value of padding
274    */
275   int GetLeft() const {
276     return left_;
277   }
278
279   /**
280    * @brief Gets top value of padding.
281    * @since_tizen 5.5
282    * @return The top value of padding
283    */
284   int GetTop() const {
285     return top_;
286   }
287
288   /**
289    * @brief Gets right value of padding.
290    * @since_tizen 5.5
291    * @return the right value of padding
292    */
293   int GetRight() const {
294     return right_;
295   }
296
297   /**
298    * @brief Gets bottom value of padding.
299    * @since_tizen 5.5
300    * @return The bottom value of padding.
301    */
302   int GetBottom() const {
303     return bottom_;
304   }
305
306  private:
307   int left_;
308   int top_;
309   int right_;
310   int bottom_;
311 };  // class  Padding
312
313 /**
314  * @brief The class for geometry data.
315  * @details There are x, y, width, height value.
316  * @since_tizen 5.5
317  */
318 class EXPORT_API Geometry {
319  public:
320   Geometry() {
321     x_ = 0;
322     y_ = 0;
323     w_ = 0;
324     h_ = 0;
325   }
326   Geometry(int x, int y, int w, int h) : x_(x), y_(y), w_(w), h_(h) {
327   }
328   virtual ~Geometry() = default;
329
330   /**
331    * @brief Copy-constructor.
332    * @since_tizen 5.5
333    * @param[in] c The object to copy
334    */
335   Geometry(const Geometry& c) {
336     x_ = c.x_;
337     y_ = c.y_;
338     w_ = c.w_;
339     h_ = c.h_;
340   }
341
342   /**
343    * @brief Assignment.
344    * @since_tizen 5.5
345    * @param[in] c The object to copy
346    */
347   Geometry& operator = (const Geometry& c) {
348     if (this != &c) {
349       x_ = c.x_;
350       y_ = c.y_;
351       w_ = c.w_;
352       h_ = c.h_;
353     }
354     return *this;
355   }
356
357   /**
358    * @brief Move-constructor.
359    * @since_tizen 5.5
360    * @param[in] c The object to move
361    */
362   Geometry(Geometry&& c) noexcept {
363     x_ = c.x_;
364     c.x_ = 0;
365
366     y_ = c.y_;
367     c.y_ = 0;
368
369     w_ = c.w_;
370     c.w_ = 0;
371
372     h_ = c.h_;
373     c.h_ = 0;
374   }
375
376   /**
377    * @brief Assignment.
378    * @since_tizen 5.5
379    * @param[in] c The object to move
380    */
381   Geometry& operator = (Geometry&& c) noexcept {
382     if (this != &c) {
383       x_ = c.x_;
384       c.x_ = 0;
385
386       y_ = c.y_;
387       c.y_ = 0;
388
389       w_ = c.w_;
390       c.w_ = 0;
391
392       h_ = c.h_;
393       c.h_ = 0;
394     }
395     return *this;
396   }
397
398   /**
399    * @brief Gets x value of geometry.
400    * @since_tizen 5.5
401    * @return The x value of geometry.
402    */
403   int GetX() const {
404     return x_;
405   }
406
407   /**
408    * @brief Gets y value of geometry.
409    * @since_tizen 5.5
410    * @return The y value of geometry.
411    */
412   int GetY() const {
413     return y_;
414   }
415
416   /**
417    * @brief Gets width value of geometry.
418    * @since_tizen 5.5
419    * @return The width value of geometry.
420    */
421   int GetWidth() const {
422     return w_;
423   }
424
425   /**
426    * @brief Gets height value of geometry.
427    * @since_tizen 5.5
428    * @return The height value of geometry.
429    */
430   int GetHeight() const {
431     return h_;
432   }
433
434  private:
435   int x_;
436   int y_;
437   int w_;
438   int h_;
439 };  // class Geometry
440
441 /**
442  * @brief The class for style data
443  * @details The style data consists color, padding, geometry data.
444  * @since_tizen 5.5
445  */
446 class EXPORT_API Style {
447  public:
448   Style() {
449   }
450
451   Style(std::shared_ptr<Color> color, std::shared_ptr<Padding> padding,
452       std::shared_ptr<Geometry> geometry)
453     : color_(color), padding_(padding), geometry_(geometry) {
454   }
455
456   Style(std::shared_ptr<Color> color, std::shared_ptr<Padding> padding,
457       std::shared_ptr<Geometry> geometry,
458       std::shared_ptr<Color> background_color, std::string background_image)
459     : color_(color), padding_(padding), geometry_(geometry),
460       background_color_(background_color),
461       background_image_path_(background_image) {
462   }
463
464   virtual ~Style() = default;
465
466   /**
467    * @brief Copy-constructor.
468    * @since_tizen 5.5
469    * @param[in] c The object to copy
470    */
471   Style(const Style& c) {
472     color_ = c.color_;
473     padding_ = c.padding_;
474     geometry_ = c.geometry_;
475     background_color_ = c.background_color_;
476     background_image_path_ = c.background_image_path_;
477   }
478
479   /**
480    * @brief Assignment.
481    * @since_tizen 5.5
482    * @param[in] c The object to copy
483    */
484   Style& operator = (const Style& c) {
485     if (this != &c) {
486       color_ = c.color_;
487       padding_ = c.padding_;
488       geometry_ = c.geometry_;
489       background_color_ = c.background_color_;
490       background_image_path_ = c.background_image_path_;
491     }
492     return *this;
493   }
494
495   /**
496    * @brief Move-constructor.
497    * @since_tizen 5.5
498    * @param[in] c The object to move
499    */
500   Style(Style&& c) noexcept {
501     color_ = c.color_;
502     c.color_ = nullptr;
503
504     padding_ = c.padding_;
505     c.padding_ = nullptr;
506
507     geometry_ = c.geometry_;
508     c.geometry_ = nullptr;
509
510     background_color_ = c.background_color_;
511     c.background_color_ = nullptr;
512
513     background_image_path_ = c.background_image_path_;
514     c.background_image_path_ = "";
515   }
516
517   /**
518    * @brief Assignment.
519    * @since_tizen 5.5
520    * @param[in] c The object to move
521    */
522   Style& operator = (Style&& c) noexcept {
523     if (this != &c) {
524       color_ = c.color_;
525       c.color_ = nullptr;
526
527       padding_ = c.padding_;
528       c.padding_ = nullptr;
529
530       geometry_ = c.geometry_;
531       c.geometry_ = nullptr;
532
533       background_color_ = c.background_color_;
534       c.background_color_ = nullptr;
535
536       background_image_path_ = c.background_image_path_;
537       c.background_image_path_ = "";
538     }
539     return *this;
540   }
541
542   /**
543    * @brief Gets padding data
544    * @since_tizen 5.5
545    * @return The padding data
546    */
547   std::shared_ptr<Padding> GetPadding() const {
548     return padding_;
549   }
550
551   /**
552    * @brief Sets padding data
553    * @since_tizen 5.5
554    * @param[in] padding The padding data
555    */
556   void SetPadding(std::shared_ptr<Padding> padding) {
557     padding_ = std::move(padding);
558   }
559
560   /**
561    * @brief Gets color data
562    * @since_tizen 5.5
563    * @return The color data
564    */
565   std::shared_ptr<Color> GetColor() const {
566     return color_;
567   }
568
569   /**
570    * @brief Sets color data
571    * @since_tizen 5.5
572    * @param[in] color The color data
573    */
574   void SetColor(std::shared_ptr<Color> color) {
575     color_ = std::move(color);
576   }
577
578   /**
579    * @brief Gets geometry data
580    * @since_tizen 5.5
581    * @return The geometry data
582    */
583   std::shared_ptr<Geometry> GetGeometry() const {
584     return geometry_;
585   }
586
587   /**
588    * @brief Sets geometry data
589    * @since_tizen 5.5
590    * @param[in] geometry The geometry data
591    */
592   void SetGeometry(std::shared_ptr<Geometry> geometry) {
593     geometry_ = std::move(geometry);
594   }
595
596   /**
597    * @brief Gets background image path
598    * @since_tizen 5.5
599    * @param[in] image_path The background image path
600    */
601   void SetBackgroundImage(std::string image_path) {
602     background_image_path_ = std::move(image_path);
603   }
604
605   /**
606    * @brief Gets background image path
607    * @since_tizen 5.5
608    * @return The background image path
609    */
610   std::string GetBackgroundImage() const {
611     return background_image_path_;
612   }
613
614   /**
615    * @brief Sets background color
616    * @since_tizen 5.5
617    */
618   void SetBackgroundColor(std::shared_ptr<Color> color) {
619     background_color_ = std::move(color);
620   }
621
622   /**
623    * @brief Gets background color
624    * @since_tizen 5.5
625    * @return The background color
626    */
627   std::shared_ptr<Color> GetBackgroundColor() const {
628     return background_color_;
629   }
630
631  private:
632   std::shared_ptr<Color> color_;
633   std::shared_ptr<Padding> padding_;
634   std::shared_ptr<Geometry> geometry_;
635   std::shared_ptr<Color> background_color_;
636   std::string background_image_path_;
637 };  // class Style
638
639 /**
640  * @brief The class for LED data.
641  * @details The LED data consists color data and period time.
642  * @since_tizen 5.5
643  */
644 class EXPORT_API LEDInfo {
645  public:
646   LEDInfo() {
647   }
648   explicit LEDInfo(std::shared_ptr<Color> color)
649     : color_(color) {
650   }
651   virtual ~LEDInfo() = default;
652
653   /**
654    * @brief Sets the time period for turning on the LED
655    * @since_tizen 5.5
656    * @param[in] ms period time
657    */
658   void SetOnPeriod(int ms) {
659     on_period_ = ms;
660   }
661
662   /**
663    * @brief Gets the time period for turning on the LED
664    * @since_tizen 5.5
665    * @return The time for turning on the LED
666    */
667   int GetOnPeriod() const {
668     return on_period_;
669   }
670
671   /**
672    * @brief Sets the time period for turning off the LED
673    * @since_tizen 5.5
674    * @param[in] ms period time
675    */
676   void SetOffPeriod(int ms) {
677     off_period_ = ms;
678   }
679
680   /**
681    * @brief Gets the time period for turning off the LED
682    * @since_tizen 5.5
683    * @return The time for turning off the LED
684    */
685   int GetOffPeriod() const {
686     return off_period_;
687   }
688
689   /**
690    * @brief Gets the color of LED
691    * @since_tizen 5.5
692    * @return color data
693    */
694   std::shared_ptr<Color> GetColor() const {
695     return color_;
696   }
697
698   void SetColor(std::shared_ptr<Color> color) {
699     color_ = std::move(color);
700   }
701
702  private:
703   std::shared_ptr<Color> color_;
704   int on_period_ = 0;
705   int off_period_ = 0;
706 };  // clss LEDInfo
707
708 /**
709  * @brief The base class for the notification item classes.
710  * @details The AbstractItem is abstract class.
711  *          The AbstractItem has basic APIs for notification items.
712  *          The notification item class have to be a derived class of this class.
713  * @since_tizen 5.5
714  */
715 class EXPORT_API AbstractItem {
716  public:
717   enum Type {
718     NullObject,
719     Text,
720     Image,
721     Icon,
722     Button,
723     ChatMessage,
724     CheckBox,
725     IconText,
726     InputSelector,
727     Group,
728     Entry,
729     Progress,
730     Time,
731     Custom = 100
732   };
733
734   enum Policy {
735     None = 0,
736     OnBootClear = 1 << 0,
737     SimMode = 1 << 1,
738   };
739
740   enum MainType {
741     MainNone = 0,
742     MainTitle,
743     MainContents,
744     MainIcon,
745     MainButton
746   };
747
748  public:
749   /**
750    * @brief Constructor
751    * @since_tizen 5.5
752    * @param[in] action The AbstractAction for notification item
753    */
754   AbstractItem(
755       std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
756
757   /**
758    * @brief Constructor
759    * @since_tizen 5.5
760    * @param[in] id The notification id
761    * @param[in] action The AbstractAction for notification item
762    */
763   AbstractItem(std::string id,
764       std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
765
766   /**
767    * @brief Destructor
768    * @since_tizen 5.5
769    */
770   virtual ~AbstractItem() = 0;
771
772   /**
773    * @brief Serialize the data of AbstractItem.
774    * @since_tizen 5.5
775    * @return Bundle type data
776    */
777   virtual tizen_base::Bundle Serialize() const = 0;
778
779   /**
780    * @brief Deserialize the serialized data.
781    * @since_tizen 5.5
782    * @param[in] b The serialized Bundle data
783    */
784   virtual void Deserialize(tizen_base::Bundle b) = 0;
785
786   /**
787    * @brief Finds the AbstractItem using by notification item id.
788    * @since_tizen 5.5
789    * @param[in] id notification item id
790    * @return AbstractItem object
791    */
792   virtual AbstractItem& FindByID(std::string id);
793
794   /**
795    * @brief Finds the AbstractItem using by main type.
796    * @since_tizen 5.5
797    * @param[in] type The main type
798    * @return AbstractItem object
799    */
800   virtual AbstractItem& FindByMainType(MainType type);
801
802   /**
803    * @brief Checks the item type exist in this notification.
804    * @since_tizen 5.5
805    * @param[in] type notification item type
806    * @return true if the item type exists
807    */
808   virtual bool IsItemTypeExist(int type) = 0;
809
810   /**
811    * @brief Gets the type of notification item.
812    * @since_tizen 5.5
813    * @return The type of notification item
814    */
815   virtual int GetType() const = 0;
816
817   /**
818    * @brief Gets the type of notification item from Bundle data.
819    * @since_tizen 5.5
820    * @return The type of notification item
821    */
822   static int GetType(tizen_base::Bundle b);
823
824   /**
825    * @brief Gets the path of shared file location.
826    * @since_tizen 5.5
827    * @return The list of shared path.
828    */
829   virtual std::list<std::string> GetSharedPath() const;
830
831   /**
832    * @brief Sets the shared file path to original file path.
833    */
834   virtual void SetSharedPath();
835
836   /**
837    * @brief
838    * @since_tizen 5.5
839    * @return
840    */
841   virtual std::list<std::map<std::string, std::string>> GetPathMapList() const;
842
843   /**
844    * @brief Gets the notification item id.
845    * @since_tizen 5.5
846    * @return The notification item id.
847    */
848   std::string GetId() const;
849
850   /**
851    * @brief Sets the notification item id.
852    * @since_tizen 5.5
853    * @param[in] id notification item id
854    */
855   void SetId(std::string id);
856
857   std::vector<std::shared_ptr<MultiLanguage>> GetMultiLanguageArr() const;
858   std::shared_ptr<MultiLanguage> GetMultiLanguage() const;
859   void SetMultiLanguage(std::shared_ptr<MultiLanguage> multi);
860   void SetMultiLanguage(std::vector<std::shared_ptr<MultiLanguage>> multi_arr);
861
862   /**
863    * @brief Gets AbstractAction for notification item.
864    * @since_tizen 5.5
865    * @return AbstractAction instance
866    */
867   std::shared_ptr<AbstractAction> GetAction() const;
868
869   /**
870    * @brief Sets AbstractAction for notification item.
871    * @since_tizen 5.5
872    * @param[in] action AbstractAction instance
873    */
874   void SetAction(std::shared_ptr<AbstractAction> action);
875
876   /**
877    * @brief Sets the style data for notification item.
878    * @since_tizen 5.5
879    * @return Style instance
880    */
881   std::shared_ptr<Style> GetStyle() const;
882
883   /**
884    * @brief Sets the style data for notification item.
885    * @since_tizen 5.5
886    * @param[in] style Style instance
887    */
888   void SetStyle(std::shared_ptr<Style> style);
889
890   /**
891    * @brief Sets the visibile state of notification item.
892    * @since_tizen 5.5
893    * @param[in] visibile The visible state
894    */
895   void SetVisible(bool visible);
896
897   /**
898    * @brief Gets the visibile state of notification item.
899    * @since_tizen 5.5
900    * @return true if visible, false if not visible.
901    */
902   bool GetVisible() const;
903
904   /**
905    * @brief Sets the enable state of notification item.
906    * @since_tizen 5.5
907    * @param[in] enable The enable state
908    */
909   void SetEnable(bool enable);
910
911   /**
912    * @brief Gets the enable state of notification item.
913    * @since_tizen 5.5
914    * @return true if enabled, false if not enabled.
915    */
916   bool GetEnable() const;
917
918   /**
919    * @brief Adds the receiver group for notification item.
920    * @since_tizen 5.5
921    * @param[in] receiver_group The receiver group for notification item
922    */
923   void AddReceiver(std::string receiver_group);
924
925   /**
926    * @brief Removes the receiver group from the receiver group list.
927    * @since_tizen 5.5
928    * @param[in] receiver_group The receiver group
929    */
930   void RemoveReceiver(std::string receiver_group);
931
932   /**
933    * @brief Gets the receiver group list.
934    * @since_tizen 5.5
935    * @return The list of receiver group.
936    */
937   std::list<std::string> GetReceiverList();
938
939   /**
940    * @brief Sets the policy for notification item.
941    * @since_tizen 5.5
942    * @param[in] policy The policy option
943    */
944   void SetPolicy(int policy);
945
946   /**
947    * @brief Gets the policy for notification item.
948    * @since_tizen 5.5
949    * @return The policy for notification item.
950    */
951   int GetPolicy() const;
952
953   /**
954    * @brief Gets the channel option for notification item.
955    * @since_tizen 5.5
956    * @return The channel option for notification item.
957    */
958   std::string GetChannel() const;
959
960   /**
961    * @brief Sets the channel option for notification item.
962    * @since_tizen 5.5
963    * @param[in] channel The channel option for notification item.
964    */
965   void SetChannel(std::string channel);
966
967   /**
968    * @brief Sets LED option for notification item.
969    * @since_tizen 5.5
970    * @param[in] led The LEDInfo instance
971    */
972   void SetLEDInfo(std::shared_ptr<LEDInfo> led);
973
974   /**
975    * @brief Gets LED option for notification item.
976    * @since_tizen 5.5
977    * @return The LEDInfo instance
978    */
979   std::shared_ptr<LEDInfo> GetLEDInfo() const;
980
981   /**
982    * @brief Sets the sound path for notification item.
983    * @since_tizen 5.5
984    * @param[in] path The sound path
985    */
986   void SetSoundPath(std::string path);
987
988   /**
989    * @brief Sets the vibration path for notification item.
990    * @since_tizen 5.5
991    * @param[in] path The vibration path
992    */
993   void SetVibrationPath(std::string path);
994
995   /**
996    * @brief Gets the sound path for notification item.
997    * @since_tizen 5.5
998    * @return The sound path
999    */
1000   std::string GetSoundPath() const;
1001
1002   /**
1003    * @brief Gets the vibration path for notification item.
1004    * @since_tizen 5.5
1005    * @return The vibration path
1006    */
1007   std::string GetVibrationPath() const;
1008
1009   /**
1010    * @brief Gets IItemInfo instance to get some information of notification item.
1011    * @since_tizen 5.5
1012    * @return The IItemInfo instance
1013    */
1014   std::shared_ptr<IItemInfo> GetInfo() const;
1015
1016   /**
1017    * @brief Gets the sender app id of notification item.
1018    * @since_tizen 5.5
1019    * @return The sender app id.
1020    */
1021   std::string GetSenderAppId() const;
1022
1023   /**
1024    * @brief Sets the sender app id of notification item.
1025    * @since_tizen 5.5
1026    * @param[in] sender_appid The sender app id
1027    */
1028   void SetSenderAppId(std::string sender_appid);
1029
1030   /**
1031    * @brief Sets the tag of notification item.
1032    * @since_tizen 5.5
1033    * @return The tag of notification item
1034    */
1035   std::string GetTag() const;
1036
1037   /**
1038    * @brief Sets the tag of notification item.
1039    * @since_tizen 5.5
1040    * @param[in] tag The tag of notification item
1041    */
1042   void SetTag(std::string tag);
1043
1044   /**
1045    * @brief Sets the ongoing state of notification item.
1046    * @since_tizen 5.5
1047    * @param[in] ongoing The ongoing state of notification item
1048    */
1049   void SetOnGoingState(bool ongoing);
1050
1051   /**
1052    * @brief Gets the ongoing state of notification item.
1053    * @since_tizen 5.5
1054    * @return The ongoing state of notification item
1055    */
1056   bool GetOnGoingState() const;
1057
1058   /**
1059    * @brief Sets the main type of notification item.
1060    * @since_tizen 5.5
1061    * @param[in] target_id The ID of notification item to set
1062    * @param[in] type The main type
1063    * @return true if target_id is valid to set
1064    */
1065   bool SetMainType(std::string target_id, MainType type);
1066
1067   /**
1068    * @brief Gets the main type of notification item.
1069    * @since_tizen 5.5
1070    * @return The main type
1071    */
1072   MainType GetMainType() const;
1073
1074   /**
1075    * @brief Gets the extension data.
1076    * @since_tizen 5.5
1077    * @param[in] key
1078    * @return Bundle
1079    */
1080   tizen_base::Bundle GetExtensionData(std::string key);
1081
1082   /**
1083    * @brief Sets the extension data.
1084    * @since_tizen 5.5
1085    * @param[in] key key string
1086    * @param[in] value Bundle
1087    */
1088   void SetExtensionData(std::string key, tizen_base::Bundle value);
1089
1090  private:
1091   class Impl;
1092   std::unique_ptr<Impl> impl_;
1093   void UpdateSoundPrivatePath();
1094   void UpdateVibrationPrivatePath();
1095 };  // class AbstractItem
1096 /* LCOV_EXCL_STOP */
1097
1098 }  // namespace item
1099 }  // namespace notification
1100
1101 #endif  // NOTIFICATION_EX_ABSTRACT_ITEM_H_