From: SukHyung, Kang Date: Tue, 26 Mar 2019 06:20:07 +0000 (+0900) Subject: Add description for notification ex api X-Git-Tag: submit/tizen/20190410.085238~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42ec005738c79be881bdcc8cf74ce7fdc1dcf726;p=platform%2Fcore%2Fapi%2Fnotification.git Add description for notification ex api Change-Id: I6f8ef0f0789bf0375eea75220ea719ed3e39b881 Signed-off-by: SukHyung, Kang --- diff --git a/notification-ex/abstract_action.h b/notification-ex/abstract_action.h index 0e001b85..71d9f1a6 100644 --- a/notification-ex/abstract_action.h +++ b/notification-ex/abstract_action.h @@ -30,6 +30,14 @@ namespace notification { namespace item { class AbstractItem; + +/** + * @brief The base class for the notification action classes. + * @details The AbstractAction is abstract class. + * The AbstractAction has basic APIs for notification actions. + * The notification action class have to be a derived class of this class. + * @since_tizen 5.5 + */ class EXPORT_API AbstractAction { public: enum Type { @@ -40,16 +48,75 @@ class EXPORT_API AbstractAction { }; public: + /** + * @brief Constructor + * @since_tizen 5.5 + * @param[in] isLoacal + */ AbstractAction(bool isLocal); + + /** + * @brief Constructor + * @since_tizen 5.5 + * @param[in] isLocal + * @param[in] extra + */ AbstractAction(bool isLocal, std::string extra); + + /** + * @brief Destructor + * @since_tizen 5.5 + */ virtual ~AbstractAction(); + /** + * @brief Gets the type of action + * @since_tizen 5.5 + * @return The type of action + */ virtual int GetType() const = 0; + + /** + * @brief Gets the type of action from Bundle data + * @since_tizen 5.5 + * @param[in] b Bundle type data + * @return The type of action + */ static int GetType(Bundle b); + + /** + * @brief Serialize the data of AbstractAction. + * @since_tizen 5.5 + * @return Bundle type data + */ virtual Bundle Serialize() const = 0; + + /** + * @brief Deserialize the serialized data. + * @since_tizen 5.5 + * @param[in] b The serialized Bundle data + */ virtual void Deserialize(Bundle b) = 0; + + /** + * @brief Gets whether local or not. + * @since_tizen 5.5 + * @return true if local, or false + */ virtual bool IsLocal() const = 0; + + /** + * @brief Execute the action + * @since_tizen 5.5 + * @param[in] item The AbstractItem + */ virtual void Execute(std::shared_ptr item) = 0; + + /** + * @brief Gets the extra data + * @since_tizen 5.5 + * @return The extra data + */ virtual std::string GetExtra() const = 0; private: diff --git a/notification-ex/abstract_item.h b/notification-ex/abstract_item.h index 81451cac..e9961a75 100644 --- a/notification-ex/abstract_item.h +++ b/notification-ex/abstract_item.h @@ -34,6 +34,11 @@ namespace notification { namespace item { +/** + * @brief The class for ReceiverGroup. + * @details The class to define receiver group of notification. + * @since_tizen 5.5 + */ class EXPORT_API ReceiverGroup { public: static const std::string Panel; @@ -43,6 +48,11 @@ class EXPORT_API ReceiverGroup { static const std::string Popup; }; +/** + * @brief The class for color data. + * @details The color consists A,R,G,B values. + * @since_tizen 5.5 + */ class EXPORT_API Color { public: Color() { @@ -56,15 +66,38 @@ class EXPORT_API Color { } virtual ~Color() = default; + /** + * @brief Gets alpha value of color. + * @since_tizen 5.5 + * @return The alpha value of color + */ unsigned char GetAVal() const { return a_; } + + /** + * @brief Gets red value of color. + * @since_tizen 5.5 + * @return The red value of color + */ unsigned char GetRVal() const { return r_; } + + /** + * @brief Gets green value of color. + * @since_tizen 5.5 + * @return The green value of color + */ unsigned char GetGVal() const { return g_; } + + /** + * @brief Gets blue value of color. + * @since_tizen 5.5 + * @return The blue value of color + */ unsigned char GetBVal() const { return b_; } @@ -76,6 +109,11 @@ class EXPORT_API Color { unsigned char b_; }; // class Color +/** + * @brief The class for padding data. + * @details There are left, top, right, bottom padding value. + * @since_tizen 5.5 + */ class EXPORT_API Padding { public: Padding() { @@ -89,15 +127,38 @@ class EXPORT_API Padding { } virtual ~Padding() = default; + /** + * @brief Gets left value of padding. + * @since_tizen 5.5 + * @return The left value of padding + */ int GetLeft() const { return left_; } + + /** + * @brief Gets top value of padding. + * @since_tizen 5.5 + * @return The top value of padding + */ int GetTop() const { return top_; } + + /** + * @brief Gets right value of padding. + * @since_tizen 5.5 + * @return the right value of padding + */ int GetRight() const { return right_; } + + /** + * @brief Gets bottom value of padding. + * @since_tizen 5.5 + * @return The bottom value of padding. + */ int GetBottom() const { return bottom_; } @@ -109,6 +170,11 @@ class EXPORT_API Padding { int bottom_; }; // class Padding +/** + * @brief The class for geometry data. + * @details There are x, y, width, height value. + * @since_tizen 5.5 + */ class EXPORT_API Geometry { public: Geometry() { @@ -121,15 +187,38 @@ class EXPORT_API Geometry { } virtual ~Geometry() = default; + /** + * @brief Gets x value of geometry. + * @since_tizen 5.5 + * @return The x value of geometry. + */ int GetX() const { return x_; } + + /** + * @brief Gets y value of geometry. + * @since_tizen 5.5 + * @return The y value of geometry. + */ int GetY() const { return y_; } + + /** + * @brief Gets width value of geometry. + * @since_tizen 5.5 + * @return The width value of geometry. + */ int GetWidth() const { return w_; } + + /** + * @brief Gets height value of geometry. + * @since_tizen 5.5 + * @return The height value of geometry. + */ int GetHeight() const { return h_; } @@ -141,6 +230,11 @@ class EXPORT_API Geometry { int h_; }; // class Geometry +/** + * @brief The class for style data + * @details The style data consists color, padding, geometry data. + * @since_tizen 5.5 + */ class EXPORT_API Style { public: Style() { @@ -150,12 +244,29 @@ class EXPORT_API Style { } virtual ~Style() = default; + /** + * @brief Gets padding data + * @since_tizen 5.5 + * @return The padding data + */ Padding GetPadding() const { return padding_; } + + /** + * @brief Gets color data + * @since_tizen 5.5 + * @return The color data + */ Color GetColor() const { return color_; } + + /** + * @brief Gets geometry data + * @since_tizen 5.5 + * @return The geometry data + */ Geometry GetGeometry() const { return geometry_; } @@ -166,6 +277,11 @@ class EXPORT_API Style { Geometry geometry_; }; // class Style +/** + * @brief The class for LED data. + * @details The LED data consists color data and period time. + * @since_tizen 5.5 + */ class EXPORT_API LEDInfo { public: LEDInfo() { @@ -176,19 +292,47 @@ class EXPORT_API LEDInfo { } virtual ~LEDInfo() = default; + /** + * @brief Sets the time period for turning on the LED + * @since_tizen 5.5 + * @param[in] ms period time + */ void SetOnPeriod(int ms) { on_period_ = ms; } + + /** + * @brief Gets the time period for turning on the LED + * @since_tizen 5.5 + * @return The time for turning on the LED + */ int GetOnPeriod() const { return on_period_; } + + /** + * @brief Sets the time period for turning off the LED + * @since_tizen 5.5 + * @param[in] ms period time + */ void SetOffPeriod(int ms) { off_period_ = ms; } + + /** + * @brief Gets the time period for turning off the LED + * @since_tizen 5.5 + * @return The time for turning off the LED + */ int GetOffPeriod() const { return off_period_; } + /** + * @brief Gets the color of LED + * @since_tizen 5.5 + * @return color data + */ Color GetColor() const { return color_; } @@ -199,6 +343,13 @@ class EXPORT_API LEDInfo { int off_period_ = 0; }; // clss LEDInfo +/** + * @brief The base class for the notification item classes. + * @details The AbstractItem is abstract class. + * The AbstractItem has basic APIs for notification items. + * The notification item class have to be a derived class of this class. + * @since_tizen 5.5 + */ class EXPORT_API AbstractItem { public: enum Type { @@ -225,44 +376,266 @@ class EXPORT_API AbstractItem { }; public: + /** + * @brief Constructor + * @since_tizen 5.5 + * @param[in] action The AbstractAction for notification item + */ AbstractItem( std::shared_ptr action = std::shared_ptr({})); + + /** + * @brief Constructor + * @since_tizen 5.5 + * @param[in] id The notification id + * @param[in] action The AbstractAction for notification item + */ AbstractItem(std::string id, std::shared_ptr action = std::shared_ptr({})); + + /** + * @brief Destructor + * @since_tizen 5.5 + */ virtual ~AbstractItem() = 0; + + /** + * @brief Serialize the data of AbstractItem. + * @since_tizen 5.5 + * @return Bundle type data + */ virtual Bundle Serialize() const = 0; + + /** + * @brief Deserialize the serialized data. + * @since_tizen 5.5 + * @param[in] b The serialized Bundle data + */ virtual void Deserialize(Bundle b) = 0; + + /** + * @brief Finds the AbstractItem using by notification item id. + * @since_tizen 5.5 + * @param[in] id notification item id + * @return AbstractItem object + */ virtual AbstractItem& FindByID(std::string id) = 0; + + /** + * @brief Gets the type of notification item. + * @since_tizen 5.5 + * @return The type of notification item + */ virtual int GetType() const = 0; + + /** + * @brief Gets the type of notification item from Bundle data. + * @since_tizen 5.5 + * @return The type of notification item + */ static int GetType(Bundle b); + + /** + * @brief Gets the path of shared file location. + * @since_tizen 5.5 + * @return The list of shared path. + */ virtual std::list GetSharedPath() const; + + /** + * @brief Gets the notification item id. + * @since_tizen 5.5 + * @return The notification item id. + */ std::string GetId() const; + + /** + * @brief Sets the notification item id. + * @since_tizen 5.5 + * @param[in] id notification item id + */ void SetId(std::string id); + + /** + * @brief Gets AbstractAction for notification item. + * @since_tizen 5.5 + * @return AbstractAction instance + */ std::shared_ptr GetAction() const; + + /** + * @brief Sets AbstractAction for notification item. + * @since_tizen 5.5 + * @param[in] action AbstractAction instance + */ void SetAction(std::shared_ptr action); + + /** + * @brief Sets the style data for notification item. + * @since_tizen 5.5 + * @return Style instance + */ std::shared_ptr