Check coding style 05/201705/4
authormk5004.lee <mk5004.lee@samsung.com>
Tue, 19 Mar 2019 04:24:12 +0000 (13:24 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Tue, 19 Mar 2019 06:30:34 +0000 (15:30 +0900)
Change-Id: I69aa2da99230868a3fc3d39c865f963a571cee09
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
30 files changed:
notification-ex/abstract_item.cc
notification-ex/app_control_action.cc
notification-ex/button_item.cc
notification-ex/chat_message_item.cc
notification-ex/checkbox_item.cc
notification-ex/dbus_connection_manager.cc
notification-ex/dbus_event_listener.cc
notification-ex/dbus_event_listener.h
notification-ex/dbus_sender.cc
notification-ex/dbus_sender.h
notification-ex/default_action_factory.cc
notification-ex/default_item_factory.cc
notification-ex/entry_item.cc
notification-ex/event_info.cc
notification-ex/ex_util.cc
notification-ex/ex_util.h
notification-ex/factory_manager.cc
notification-ex/group_item.cc
notification-ex/icon_item.cc
notification-ex/icon_text_item.cc
notification-ex/image_item.cc
notification-ex/input_selector_item.cc
notification-ex/item_info.cc
notification-ex/manager.cc
notification-ex/null_item.cc
notification-ex/progress_item.cc
notification-ex/reporter.cc
notification-ex/text_item.cc
notification-ex/time_item.cc
notification-ex/visibility_action.cc

index 8e0edae87487beb84d24c0443b4c261a98b9c088..e1e48609b41227f440ec2f0a7b9ac7ab56fbe353 100644 (file)
@@ -31,7 +31,6 @@
 #endif
 
 #define LOG_TAG "NOTIFICATION_EX"
-
 #define ABSTRACT_ITEM_TYPE_KEY "__ABSTRACT_ITEM_TYPE_KEY__"
 #define ABSTRACT_ITEM_ID_KEY "__ABSTRACT_ITEM_ID_KEY__"
 #define ABSTRACT_ITEM_SENDER_APPID_KEY "__ABSTRACT_ITEM_SENDER_APPID_KEY__"
@@ -49,21 +48,19 @@ string AbstractItem::Impl::GenerateItemId() {
   return string(uuid) + ":" + id;
 }
 
-AbstractItem::AbstractItem(
-    std::shared_ptr<AbstractAction> action)
-  : impl_(new Impl(this, action)) {
+AbstractItem::AbstractItem(std::shared_ptr<AbstractAction> action)
+    : impl_(new Impl(this, action)) {
 }
 
 AbstractItem::AbstractItem(std::string id,
     std::shared_ptr<AbstractAction> action)
-  : impl_(new Impl(this, id, action)) {
+    : impl_(new Impl(this, id, action)) {
 }
 
 AbstractItem::Impl::Impl(AbstractItem* parent, string id,
     std::shared_ptr<AbstractAction> action)
-  : id_(id), action_(action), parent_(parent),
+    : id_(id), action_(action), parent_(parent),
     info_(std::make_shared<ItemInfo>(this)) {
-
   if (id_.empty())
     id_ = GenerateItemId();
   sender_appid_ = util::GetAppId();
@@ -72,7 +69,7 @@ AbstractItem::Impl::Impl(AbstractItem* parent, string id,
 
 AbstractItem::Impl::Impl(AbstractItem* parent,
     std::shared_ptr<AbstractAction> action)
-  : action_(action), parent_(parent),
+    : action_(action), parent_(parent),
     info_(std::make_shared<ItemInfo>(this)) {
   LOGI("GroupItem created");
 
@@ -102,7 +99,7 @@ void AbstractItem::Deserialize(Bundle b) {
 }
 
 string AbstractItem::GetId() const {
- return impl_->id_;
 return impl_->id_;
 }
 
 shared_ptr<AbstractAction> AbstractItem::GetAction() const {
index 5108c11280a2ca77ea9ed5e9fcc0abb9d289831d..d58c8d7ec0fba334af4fa539ce98222aa4342037 100644 (file)
@@ -143,5 +143,5 @@ app_control_h AppControlAction::GetAppControl() const {
   return impl_->control_;
 }
 
-} //namespace item
+}  //namespace item
 }  //namespace notification
index 3042d35b5fc2e42d8dc7cc885f8cb86d923f749b..0c862abc715d35c8a5fa2ed59ff221c00f01d945 100644 (file)
@@ -46,7 +46,7 @@ ButtonItem::~ButtonItem() = default;
 ButtonItem::Impl::~Impl() = default;
 
 ButtonItem::Impl::Impl(ButtonItem* parent, string title)
-  : title_(title), parent_(parent) {
+    : title_(title), parent_(parent) {
   LOGI("ButtonItem impl created");
 }
 
index ec592498c1e8a34e9a0b31dae2b0c9410d32d314..eb89fb88ac39f2a080815641fa907b2e6617e598 100644 (file)
@@ -36,16 +36,18 @@ namespace notification {
 namespace item {
 
 ChatMessageItem::ChatMessageItem(std::string id, std::shared_ptr<TextItem> name,
-  std::shared_ptr<TextItem> text, std::shared_ptr<TextItem> data,
-  std::shared_ptr<TimeItem> time, Type type, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action),
-  impl_(new Impl(this, name, text, data, time, type)) {
+    std::shared_ptr<TextItem> text, std::shared_ptr<TextItem> data,
+    std::shared_ptr<TimeItem> time, Type type,
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action),
+    impl_(new Impl(this, name, text, data, time, type)) {
 }
 
 ChatMessageItem::Impl::Impl(ChatMessageItem* parent,
-  std::shared_ptr<TextItem> name, std::shared_ptr<TextItem> text,
-  std::shared_ptr<TextItem> data, std::shared_ptr<TimeItem> time, Type type)
-  : parent_(parent), name_(name), text_(text), data_(data), time_(time), type_(type) {
+    std::shared_ptr<TextItem> name, std::shared_ptr<TextItem> text,
+    std::shared_ptr<TextItem> data, std::shared_ptr<TimeItem> time, Type type)
+    : parent_(parent), name_(name), text_(text), data_(data), time_(time),
+    type_(type) {
   LOGI("ChatMessageItem impl created");
 }
 
index 7fb48733deefbe201d3bc6d4f6c1f9c54606e2a2..ce2c5fed80c617191d4e6e62ac5cb656f2d01f88 100644 (file)
@@ -33,12 +33,12 @@ namespace notification {
 namespace item {
 
 CheckBoxItem::CheckBoxItem(std::string id, std::string title, bool checked,
-  std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this, title, checked)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, title, checked)) {
 }
 
 CheckBoxItem::Impl::Impl(CheckBoxItem* parent, std::string title, bool checked)
-  : parent_(parent), title_(title), checked_(checked) {
+    : parent_(parent), title_(title), checked_(checked) {
   LOGI("CheckBoxItem impl created");
 }
 
index 5c2abe847cae3c7880ce103a37a134909caf4a05..736dfe9881be415d29ccaba659708f6936f029f1 100644 (file)
@@ -36,6 +36,7 @@ namespace notification {
 
 DBusConnectionManager::DBusConnectionManager() = default;
 DBusConnectionManager::~DBusConnectionManager() = default;
+
 DBusConnectionManager& DBusConnectionManager::GetInst() {
   static DBusConnectionManager w_inst;
   int ret;
@@ -115,4 +116,4 @@ int DBusConnectionManager::Init() {
   return NOTIFICATION_ERROR_NONE;
 }
 
-}  // nampace notification
\ No newline at end of file
+}  // nampace notification
index 455ce9322b18458da51e0f0c8fea89fe7e1901c3..1aa4b45a8e329da1cc4d02a109183c72b45f643f 100644 (file)
 #endif
 
 #define LOG_TAG "NOTIFICATION_EX"
-
 #define MAX_PACKAGE_STR_SIZE 512
 
 using namespace std;
 namespace notification {
 
 DBusEventListener::DBusEventListener(string path)
-  : impl_(new Impl(this, path)) {
+    : impl_(new Impl(this, path)) {
   LOGW("Created (%s)", path.c_str());
 }
 
@@ -47,7 +46,7 @@ DBusEventListener::~DBusEventListener() {
 DBusEventListener::Impl::~Impl() = default;
 
 DBusEventListener::Impl::Impl(DBusEventListener* parent, string path)
-  : subscribe_id_(0), registration_id_(0), path_(path), parent_(parent) {
+    : subscribe_id_(0), registration_id_(0), path_(path), parent_(parent) {
   LOGI("ButtonItem impl created");
 }
 
@@ -215,4 +214,4 @@ list<Bundle> DBusEventListener::NotifyObserver(const EventInfo& info) {
   return impl_->observer_->OnRequest(info);
 }
 
-}  // nampace notification
\ No newline at end of file
+}  // nampace notification
index bea87d7c94735ca7740b421af49a122e395f82bd..ea1452bb628dfd38b62541fbb430960f29cff5f6 100644 (file)
@@ -17,8 +17,6 @@
 #ifndef NOTIFICATION_EX_DBUS_LISTENER_H_
 #define NOTIFICATION_EX_DBUS_LISTENER_H_
 
-#include <gio/gio.h>
-
 #include "notification-ex/event_listener_interface.h"
 
 namespace notification {
index c3e9991fc3c118b3ca66e3e6cb6cda5934cefdd5..760a5a0fcc6ac9d03bed384176e5d98e506c1b3c 100644 (file)
 #endif
 
 #define LOG_TAG "NOTIFICATION_EX"
-
 #define MAX_PACKAGE_STR_SIZE 512
 
 using namespace std;
 namespace notification {
 
-DBusSender::DBusSender(string path)
-  : impl_(new Impl(this, path)) {
+DBusSender::DBusSender(string path) : impl_(new Impl(this, path)) {
   LOGW("Created (%s)", path.c_str());
 }
 
 DBusSender::Impl::~Impl() = default;
 
 DBusSender::Impl::Impl(DBusSender* parent, string path)
-  : path_(path), parent_(parent) {
+    : path_(path), parent_(parent) {
   LOGI("ButtonItem impl created");
 }
 
@@ -53,8 +51,8 @@ DBusSender::~DBusSender() {
   LOGW("Destroyed");
 }
 
-bool DBusSender::Impl::EmitSignal(string bus_name,
-    string signal_name, GVariant* data) {
+bool DBusSender::Impl::EmitSignal(string bus_name, string signal_name,
+    GVariant* data) {
   GError* err = NULL;
   gboolean result = TRUE;
 
@@ -78,8 +76,8 @@ bool DBusSender::Impl::EmitSignal(string bus_name,
   return result;
 }
 
-void DBusSender::Notify(const EventInfo& info,
-    list<Bundle> serialized, string dest_appid) {
+void DBusSender::Notify(const EventInfo& info, list<Bundle> serialized,
+    string dest_appid) {
   string signal_name = EventInfo::GetString(info.GetEventType());
   string appid = util::GetAppId();
   string bus_name = "";
@@ -104,8 +102,8 @@ void DBusSender::Notify(const EventInfo& info,
   g_variant_builder_unref(builder);
 }
 
-GDBusMessage* DBusSender::Impl::MethodCall(string appid,
-    string method_name, Bundle serialized) {
+GDBusMessage* DBusSender::Impl::MethodCall(string appid, string method_name,
+    Bundle serialized) {
   GError* err = nullptr;
   GDBusMessage* msg = g_dbus_message_new_method_call(
       DBusConnectionManager::GetInst().GetDataProviderMasterName().c_str(),
@@ -153,4 +151,4 @@ std::list<Bundle> DBusSender::Request(const EventInfo& info) {
   return ret_list;
 }
 
-}  // nampace notification
\ No newline at end of file
+}  // nampace notification
index a347bcf488a3f68343e052ac08ccc16465be4e91..b9c9659dcd26efc286b1b13850b18e81d9093836 100644 (file)
@@ -17,8 +17,6 @@
 #ifndef NOTIFICATION_EX_DBUS_SENDER_H_
 #define NOTIFICATION_EX_DBUS_SENDER_H_
 
-#include <gio/gio.h>
-
 #include "notification-ex/ex_bundle.h"
 #include "notification-ex/event_sender_interface.h"
 #include "notification-ex/event_info.h"
index e60012e2a2fd5d3e1a0cffef91d5fe3a9470a7c6..89f7689b7b5bbf9dba9ab0158f5a2e8b4ac1907f 100644 (file)
@@ -35,16 +35,16 @@ namespace item {
 
 unique_ptr<AbstractAction> DefaultActionFactory::CreateAction(int type) {
   switch (type) {
-  case AbstractAction::NullObject :
-    THROW(NOTIFICATION_ERROR_INVALID_PARAMETER);
-  case AbstractAction::AppControl :
-    app_control_h control;
-    app_control_create(&control);
-    return unique_ptr<AbstractAction>(new AppControlAction(control));
-  case AbstractAction::Visibility :
-    return unique_ptr<AbstractAction>(new VisibilityAction());
-  case AbstractAction::Custom :
-    return nullptr;
+    case AbstractAction::NullObject :
+      THROW(NOTIFICATION_ERROR_INVALID_PARAMETER);
+    case AbstractAction::AppControl :
+      app_control_h control;
+      app_control_create(&control);
+      return unique_ptr<AbstractAction>(new AppControlAction(control));
+    case AbstractAction::Visibility :
+      return unique_ptr<AbstractAction>(new VisibilityAction());
+    case AbstractAction::Custom :
+      return nullptr;
   }
 
   return nullptr;
index bf77bb7f5bb978db993cf1c4e09317cf8fce8a3e..13e43d7e54515dd5bd09b97a82d3342ef2a9bf03 100644 (file)
@@ -45,35 +45,35 @@ namespace item {
 
 unique_ptr<AbstractItem> DefaultItemFactory::CreateItem(int type) {
   switch (type) {
-  case AbstractItem::NullObject :
-    THROW(NOTIFICATION_ERROR_INVALID_PARAMETER);
-  case AbstractItem::Text :
-    return unique_ptr<AbstractItem>(new TextItem("",""));
-  case AbstractItem::Icon :
-    return unique_ptr<AbstractItem>(new IconItem(""));
-  case AbstractItem::Image :
-    return unique_ptr<AbstractItem>(new ImageItem(""));
-  case AbstractItem::Button :
-    return unique_ptr<AbstractItem>(new ButtonItem(""));
-  case AbstractItem::ChatMessage :
-    return unique_ptr<AbstractItem>(new ChatMessageItem("",
+    case AbstractItem::NullObject :
+      THROW(NOTIFICATION_ERROR_INVALID_PARAMETER);
+    case AbstractItem::Text :
+      return unique_ptr<AbstractItem>(new TextItem("",""));
+    case AbstractItem::Icon :
+      return unique_ptr<AbstractItem>(new IconItem(""));
+    case AbstractItem::Image :
+      return unique_ptr<AbstractItem>(new ImageItem(""));
+    case AbstractItem::Button :
+      return unique_ptr<AbstractItem>(new ButtonItem(""));
+    case AbstractItem::ChatMessage :
+      return unique_ptr<AbstractItem>(new ChatMessageItem("",
         nullptr, nullptr, nullptr, nullptr, ChatMessageItem::Type::user));
-  case AbstractItem::CheckBox :
-    return unique_ptr<AbstractItem>(new CheckBoxItem("", ""));
-  case AbstractItem::IconText :
-    return unique_ptr<AbstractItem>(new IconTextItem("", nullptr, nullptr));
-  case AbstractItem::InputSelector :
-    return unique_ptr<AbstractItem>(new InputSelectorItem());
-  case AbstractItem::Group :
-    return unique_ptr<AbstractItem>(new GroupItem());
-  case AbstractItem::Entry :
-    return unique_ptr<AbstractItem>(new EntryItem(""));
-  case AbstractItem::Progress :
-    return unique_ptr<AbstractItem>(new ProgressItem(0.0, 0.0, 0.0));
-  case AbstractItem::Time :
-    return unique_ptr<AbstractItem>(new TimeItem());
-  case AbstractItem::Custom :
-    return unique_ptr<AbstractItem>(new ButtonItem(""));
+    case AbstractItem::CheckBox :
+      return unique_ptr<AbstractItem>(new CheckBoxItem("", ""));
+    case AbstractItem::IconText :
+      return unique_ptr<AbstractItem>(new IconTextItem("", nullptr, nullptr));
+    case AbstractItem::InputSelector :
+      return unique_ptr<AbstractItem>(new InputSelectorItem());
+    case AbstractItem::Group :
+      return unique_ptr<AbstractItem>(new GroupItem());
+    case AbstractItem::Entry :
+      return unique_ptr<AbstractItem>(new EntryItem(""));
+    case AbstractItem::Progress :
+      return unique_ptr<AbstractItem>(new ProgressItem(0.0, 0.0, 0.0));
+    case AbstractItem::Time :
+      return unique_ptr<AbstractItem>(new TimeItem());
+    case AbstractItem::Custom :
+      return unique_ptr<AbstractItem>(new ButtonItem(""));
   }
 
   return nullptr;
index dd62de0167b8be195fb0e69d7d53eee681a7dfff..9b0bdc6bea62ddc19189d78e550cc4fc9b64f827 100644 (file)
@@ -34,15 +34,15 @@ namespace notification {
 namespace item {
 
 EntryItem::EntryItem(std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action), impl_(new Impl(this)) {
+    : AbstractItem(action), impl_(new Impl(this)) {
 }
 
 EntryItem::EntryItem(std::string id, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this)) {
+    : AbstractItem(id, action), impl_(new Impl(this)) {
 }
 
 EntryItem::Impl::Impl(EntryItem* parent)
-  : parent_(parent) {
+    : parent_(parent) {
   LOGI("EntryItem created");
 }
 
index a0d9f4b982eaf84a3c518ec8be2afd1c41c187bc..0ffbe10e5ebf161508ca39ddbd0559c41ecd94eb 100644 (file)
@@ -37,14 +37,14 @@ namespace notification {
 
 EventInfo::EventInfo(EventInfo::EventType type, std::string owner,
     std::string channel, std::string item_id, std::string tag)
-  : impl_(new Impl(this, type, owner, channel, item_id, tag)) {
+    : impl_(new Impl(this, type, owner, channel, item_id, tag)) {
 }
 EventInfo::~EventInfo() = default;
 EventInfo::Impl::~Impl() = default;
 
 EventInfo::Impl::Impl(EventInfo* parent, EventInfo::EventType type, std::string owner,
     std::string channel, std::string item_id, std::string tag)
-  : type_(type), owner_(owner), channel_(channel), item_id_(item_id),
+    : type_(type), owner_(owner), channel_(channel), item_id_(item_id),
     tag_(tag), parent_(parent) {
   LOGI("EventInfo impl created");
 }
@@ -60,18 +60,18 @@ EventInfo::EventInfo(Bundle serialized) {
 
 string EventInfo::GetString(EventInfo::EventType type) {
   switch(type) {
-  case Post:
-    return "Post";
-    break;
-  case Update:
-    return "Update";
-    break;
-  case Delete:
-    return "Delete";
-    break;
-  case Get:
-    return "Get";
-    break;
+    case Post:
+      return "Post";
+      break;
+    case Update:
+      return "Update";
+      break;
+    case Delete:
+      return "Delete";
+      break;
+    case Get:
+      return "Get";
+      break;
   }
   return "";
 }
index dca66063ce7e11aefac310c39869795efeaa3dc7..a7ddcaf52ccd521df70a2607ad0b07babfe70912 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <dlog.h>
 #include <aul.h>
-#include <aul.h>
 #include <fcntl.h>
 #include <unistd.h>
 
 using namespace std;
 namespace notification {
 namespace util {
-  GQuark GetQuarkFromString(string str) {
-    return g_quark_from_string(str.c_str());
-  }
+GQuark GetQuarkFromString(string str) {
+  return g_quark_from_string(str.c_str());
+}
 
-  std::string GetQuarkToString(GQuark quark) {
-    return g_quark_to_string(quark);
-  }
+std::string GetQuarkToString(GQuark quark) {
+  return g_quark_to_string(quark);
+}
+
+string GetAppId() {
+  static string appid = "";
+  char appid_buf[MAX_PACKAGE_STR_SIZE] = {0, };
 
-  string GetAppId() {
-    static string appid = "";
-    char appid_buf[MAX_PACKAGE_STR_SIZE] = {0, };
+  if (!appid.empty()) {
+    LOGI("appid(%s)", appid.c_str());
+    return appid;
+  }
 
-    if (!appid.empty()) {
-      LOGI("appid(%s)", appid.c_str());
-      return appid;
+  int pid = getpid();
+  int ret = aul_app_get_appid_bypid(pid, appid_buf, sizeof(appid_buf));
+  if (ret == AUL_R_OK) {
+    appid = string(appid_buf);
+  } else {
+    int fd, i;
+    int last_slash_index = 0;
+    char proc_buf[MAX_PACKAGE_STR_SIZE] = { 0, };
+
+    snprintf(proc_buf, sizeof(proc_buf), "/proc/%d/cmdline", pid);
+
+    fd = open(proc_buf, O_RDONLY);
+    if (fd < 0) {
+      LOGE("Fail to get appid (%d)", errno);
+      return "";
     }
 
-    int pid = getpid();
-    int ret = aul_app_get_appid_bypid(pid, appid_buf, sizeof(appid_buf));
-    if (ret == AUL_R_OK) {
-      appid = string(appid_buf);
-    } else {
-      int fd, i;
-      int last_slash_index = 0;
-      char proc_buf[MAX_PACKAGE_STR_SIZE] = { 0, };
-
-      snprintf(proc_buf, sizeof(proc_buf), "/proc/%d/cmdline", pid);
-
-      fd = open(proc_buf, O_RDONLY);
-      if (fd < 0) {
-        LOGE("Fail to get appid (%d)", errno);
-        return "";
-      }
-
-      ret = read(fd, appid_buf, sizeof(appid_buf) - 1);
-      if (ret <= 0) {
-        LOGE("Fail to get appid (%d)", errno);
-        close(fd);
-        return "";
-      }
+    ret = read(fd, appid_buf, sizeof(appid_buf) - 1);
+    if (ret <= 0) {
+      LOGE("Fail to get appid (%d)", errno);
       close(fd);
+      return "";
+    }
+    close(fd);
 
-      for (i = 0 ; i < ret ; i++) {
-        if (appid_buf[i] == '/')
-          last_slash_index = i;
-      }
-
-      if (last_slash_index == (ret - 1)) {
-        LOGE("Fail to get appid (%s)", appid_buf);
-        return "";
-      }
+    for (i = 0 ; i < ret ; i++) {
+      if (appid_buf[i] == '/')
+        last_slash_index = i;
+    }
 
-      if (last_slash_index == 0)
-        appid = string(appid_buf);
-      else
-        appid = string(&appid_buf[last_slash_index + 1]);
+    if (last_slash_index == (ret - 1)) {
+      LOGE("Fail to get appid (%s)", appid_buf);
+      return "";
     }
 
-    LOGI("appid(%s)", appid.c_str());
-    return appid;
+    if (last_slash_index == 0)
+      appid = string(appid_buf);
+    else
+      appid = string(&appid_buf[last_slash_index + 1]);
   }
+
+  LOGI("appid(%s)", appid.c_str());
+  return appid;
+}
+
 }  // namespace util
 }  // namespace watchface_complication
index c4250d4dac9f254217311fbd2cbab2276774cc34..191cd68a54fae9da1eda7b2dc6e08390e0950b3d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 4945d50f2ee4088d5b2fe57195f67f7ccf54add6..10e3118c37a71c27adcd170d8b52a51e961aea87 100644 (file)
@@ -33,7 +33,6 @@ namespace item {
 
 FactoryManager& FactoryManager::GetInst() {
   static FactoryManager manager;
-
   return manager;
 }
 
index 6e65f0a72a51cb88685242dc4701639325a6f63c..db2a7ec635c30442915e24a81bc458148f01d0cd 100644 (file)
@@ -42,15 +42,15 @@ namespace notification {
 namespace item {
 
 GroupItem::GroupItem(string id, shared_ptr<AbstractAction> action)
-  : AbstractItem(id), impl_(new Impl(this)) {
+    : AbstractItem(id), impl_(new Impl(this)) {
 }
 
 GroupItem::GroupItem(shared_ptr<AbstractAction> action)
-  : AbstractItem(), impl_(new Impl(this)) {
+    : AbstractItem(), impl_(new Impl(this)) {
 }
 
 GroupItem::Impl::Impl(GroupItem* parent)
-  : parent_(parent) {
+    : parent_(parent) {
   LOGI("GroupItem created");
 }
 
index 8e266a1e4774b3d788d0fe0a3a834a05a01e527a..2b3a0d6b6c83ddc920df3dd96095c82d14e0a2a1 100644 (file)
@@ -30,16 +30,16 @@ namespace notification {
 namespace item {
 
 IconItem::IconItem(std::string iconPath, std::shared_ptr<AbstractAction> action)
-  : ImageItem(iconPath, action) , impl_(new Impl(this, iconPath)) {
+    : ImageItem(iconPath, action) , impl_(new Impl(this, iconPath)) {
 }
 
 IconItem::IconItem(std::string id, std::string iconPath,
-  std::shared_ptr<AbstractAction> action)
-  : ImageItem(id, iconPath, action), impl_(new Impl(this, iconPath)) {
+    std::shared_ptr<AbstractAction> action)
+    : ImageItem(id, iconPath, action), impl_(new Impl(this, iconPath)) {
 }
 
 IconItem::Impl::Impl(IconItem* parent, std::string iconPath)
-  : parent_(parent), iconPath_(iconPath) {
+    : parent_(parent), iconPath_(iconPath) {
   LOGI("IconItem impl created");
 }
 
index a237ae94b2857c47f51af1b038bf1699f6e7a7c6..813a23056d5d41d859e4dd3c4cb18164486187b4 100644 (file)
@@ -33,14 +33,13 @@ namespace notification {
 namespace item {
 
 IconTextItem::IconTextItem(std::string id, std::shared_ptr<IconItem> icon,
-  std::shared_ptr<TextItem> text, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action),
-  impl_(new Impl(this, icon, text)) {
+    std::shared_ptr<TextItem> text, std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, icon, text)) {
 }
 
 IconTextItem::Impl::Impl(IconTextItem* parent, std::shared_ptr<IconItem> icon,
-  std::shared_ptr<TextItem> text)
-  : parent_(parent), icon_(icon), text_(text) {
+    std::shared_ptr<TextItem> text)
+    : parent_(parent), icon_(icon), text_(text) {
   LOGI("IconTextItem impl created");
 }
 
index bce699dfdafacb777cde061358091e56124711d7..c829f5e6f960d0d5a8e983ba146a266ae88d61e7 100644 (file)
@@ -32,17 +32,17 @@ namespace notification {
 namespace item {
 
 ImageItem::ImageItem(std::string imagePath,
-  std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action), impl_(new Impl(this, imagePath)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(action), impl_(new Impl(this, imagePath)) {
 }
 
 ImageItem::ImageItem(std::string id, std::string imagePath,
-  std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this, imagePath)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, imagePath)) {
 }
 
 ImageItem::Impl::Impl(ImageItem* parent, std::string imagePath)
-  : parent_(parent), imagePath_(imagePath) {
+    : parent_(parent), imagePath_(imagePath) {
   LOGI("ImageItem impl created");
 }
 
@@ -60,7 +60,6 @@ Bundle ImageItem::Serialize() const {
 
 void ImageItem::Deserialize(Bundle b) {
   AbstractItem::Deserialize(b);
-
   impl_->imagePath_ = b.GetString(IMAGE_PATH_KEY);
 }
 
@@ -78,6 +77,5 @@ std::string ImageItem::GetImagePath() const {
 ImageItem::~ImageItem() = default;
 ImageItem::Impl::~Impl() = default;
 
-
 }  // namespace item
 }  // namespace notification
index 37867e23d8d7f9423d79b51a6c0f060e5a6ac2c6..f8ea9265f5c7ed5da5003be6a4f2929ae4340932 100644 (file)
@@ -36,18 +36,18 @@ namespace notification {
 namespace item {
 
 InputSelectorItem::InputSelectorItem(std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action), impl_(new Impl(this)) {
+    : AbstractItem(action), impl_(new Impl(this)) {
 }
 
 InputSelectorItem::InputSelectorItem(string id, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this)) {
+    : AbstractItem(id, action), impl_(new Impl(this)) {
 }
 
 InputSelectorItem::~InputSelectorItem() = default;
 InputSelectorItem::Impl::~Impl() = default;
 
 InputSelectorItem::Impl::Impl(InputSelectorItem* parent)
-  : parent_(parent) {
+    : parent_(parent) {
   LOGI("InputSelectorItem impl created");
 }
 
index 6bf60ff98cf152ff017d00cdc80b4bfa6541ae56..8556e0c5d3445b608c87e9297be472d3af97333a 100644 (file)
@@ -31,7 +31,8 @@ using namespace std;
 namespace notification {
 namespace item {
 
-AbstractItem::Impl::ItemInfo::ItemInfo(AbstractItem::Impl* impl) : impl_(impl) {}
+AbstractItem::Impl::ItemInfo::ItemInfo(AbstractItem::Impl* impl) : impl_(impl) {
+}
 
 int AbstractItem::Impl::ItemInfo::GetVersion() const {
   return impl_->version_;
@@ -66,6 +67,5 @@ std::list<std::string> AbstractItem::Impl::ItemInfo::GetHideViewerList() const {
   return impl_->hide_viewer_list_;
 }
 
-
 }  // namespace item
 }  // namespace notification
index d46b1e138e8af3486e786cf6986d829c08999a6a..78d83c279c2c6d13c54e79a68fbb298540d67cd5 100644 (file)
@@ -42,16 +42,17 @@ using namespace notification::item;
 namespace notification {
 
 Manager::Manager(IEventSender* sender, IEventListener* listener, string receiver_group)
-  : impl_(new Impl(this, sender, listener, receiver_group)) {
+    : impl_(new Impl(this, sender, listener, receiver_group)) {
 }
 Manager::~Manager() = default;
 
 Manager::Impl::~Impl() {
   listener_->UnRegisterObserver(parent_);
 }
+
 Manager::Impl::Impl(Manager* parent,
     IEventSender* sender, IEventListener* listener, string receiver_group)
-  : sender_(sender), listener_(listener), receiver_group_(receiver_group),
+    : sender_(sender), listener_(listener), receiver_group_(receiver_group),
     parent_(parent) {
   LOGI("impl created");
   listener_->RegisterObserver(parent_);
@@ -81,8 +82,7 @@ void Manager::Hide(shared_ptr<item::AbstractItem> noti) {
 }
 
 shared_ptr<item::AbstractItem> Manager::FindByRootID(string id) {
-  EventInfo info(EventInfo::Get,
-     util::GetAppId(), "", id);
+  EventInfo info(EventInfo::Get, util::GetAppId(), "", id);
   list<Bundle> result = impl_->sender_->Request(info);
   if (result.size() == 0) {
     LOGE("Fail to get noti");
@@ -104,7 +104,8 @@ list<shared_ptr<item::AbstractItem>> Manager::Get() {
   return gen_list;
 }
 
-void Manager::SendEvent(const EventInfo& info, shared_ptr<item::AbstractItem> noti) {
+void Manager::SendEvent(const EventInfo& info,
+    shared_ptr<item::AbstractItem> noti) {
   Bundle serialized = noti->Serialize();
   Bundle serialized_info = info.Serialize();
   list<Bundle> serialized_list {serialized};
@@ -124,46 +125,48 @@ void Manager::OnEvent(const EventInfo& info, list<Bundle> serialized) {
   shared_ptr<AbstractItem> gen_item;
   const EventInfo::EventType type = info.GetEventType();
   switch(type) {
-  case EventInfo::Post:
-  {
-    list<shared_ptr<item::AbstractItem>> added;
-    for (auto& i : serialized) {
-      gen_item = ItemInflator::Create(i);
-      if (gen_item->CanReceive(impl_->receiver_group_))
-        added.emplace_back(gen_item);
+    case EventInfo::Post: {
+      list<shared_ptr<item::AbstractItem>> added;
+      for (auto& i : serialized) {
+        gen_item = ItemInflator::Create(i);
+        if (gen_item->CanReceive(impl_->receiver_group_))
+          added.emplace_back(gen_item);
+      }
+      if (added.size() > 0)
+        OnAdd(info, added);
+      break;
     }
-    if (added.size() > 0)
-      OnAdd(info, added);
-    break;
-  }
-  case EventInfo::Update:
-  {
-    for (auto& i : serialized) {
-      gen_item = ItemInflator::Create(i);
-      if (gen_item->CanReceive(impl_->receiver_group_))
-        OnUpdate(info, gen_item);
+    case EventInfo::Update: {
+      for (auto& i : serialized) {
+        gen_item = ItemInflator::Create(i);
+        if (gen_item->CanReceive(impl_->receiver_group_))
+          OnUpdate(info, gen_item);
+      }
+      break;
     }
-    break;
-  }
-  case EventInfo::Delete:
-    for (auto& i : serialized) {
-      gen_item = ItemInflator::Create(i);
-      if (gen_item->CanReceive(impl_->receiver_group_))
-        OnDelete(info, gen_item);
+    case EventInfo::Delete: {
+      for (auto& i : serialized) {
+        gen_item = ItemInflator::Create(i);
+        if (gen_item->CanReceive(impl_->receiver_group_))
+          OnDelete(info, gen_item);
+      }
+      break;
     }
-    break;
-  case EventInfo::Get:
-    break;
+    case EventInfo::Get:
+      break;
   }
 }
 
-void Manager::OnAdd(const EventInfo& info, list<shared_ptr<item::AbstractItem>> addedItem) {
+void Manager::OnAdd(const EventInfo& info,
+      list<shared_ptr<item::AbstractItem>> addedItem) {
 }
 
-void Manager::OnUpdate(const EventInfo& info, shared_ptr<item::AbstractItem> updatedItem) {
+void Manager::OnUpdate(const EventInfo& info,
+      shared_ptr<item::AbstractItem> updatedItem) {
 }
 
-void Manager::OnDelete(const EventInfo& info, shared_ptr<item::AbstractItem> deletedItem) {
+void Manager::OnDelete(const EventInfo& info,
+      shared_ptr<item::AbstractItem> deletedItem) {
 }
 
 list<shared_ptr<item::AbstractItem>> Manager::OnRequestEvent(const EventInfo& info) {
@@ -174,4 +177,4 @@ string Manager::GetPath() {
   return NOTIFICATION_EX_MANAGER_OBJECT_PATH;
 }
 
-}  // nampace notification
\ No newline at end of file
+}  // nampace notification
index 5d688d23e26f3a1306bc3372ca47d78e555d4e74..3c0f7f8c08f14d33b19e3e93d4c99f2b7aedb5b6 100644 (file)
@@ -31,12 +31,12 @@ namespace notification {
 namespace item {
 
 NullItem::NullItem(shared_ptr<AbstractAction> action)
-  : AbstractItem(action) {
+    : AbstractItem(action) {
 }
 
 NullItem::NullItem(string id,
       shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action) {
+    : AbstractItem(id, action) {
 }
 NullItem::~NullItem() = default;
 
index 36dd5dfec8ded492a507fa329e75f512f7bd3f03..9738ea35f656422755af0a403f8cc542a1d7b172 100644 (file)
@@ -38,21 +38,22 @@ namespace item {
 
 ProgressItem::ProgressItem(float min_val, float current, float max_val,
     std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action),
+    : AbstractItem(action),
     impl_(new Impl(min_val, current, max_val, this)) {
 }
 
-ProgressItem::ProgressItem(string id, float min_val, float current, float max_val,
-    std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action),
-  impl_(new Impl(min_val, current, max_val, this)) {
+ProgressItem::ProgressItem(string id, float min_val, float current,
+    float max_val, std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action),
+    impl_(new Impl(min_val, current, max_val, this)) {
 }
 
 ProgressItem::~ProgressItem() = default;
 ProgressItem::Impl::~Impl() = default;
 
-ProgressItem::Impl::Impl(float min_val, float current, float max_val, ProgressItem* parent)
-  : min_(min_val), current_(current), max_(max_val), parent_(parent) {
+ProgressItem::Impl::Impl(float min_val, float current, float max_val,
+    ProgressItem* parent)
+    : min_(min_val), current_(current), max_(max_val), parent_(parent) {
   if (min_val > current || max_val < current)
     THROW(NOTIFICATION_ERROR_INVALID_PARAMETER);
   LOGI("ProgressItem impl created");
index 893b615013df53a55dd67ac52d8d01a48bd32dfb..bd32670e5ffbb19fc8829ab9918769de3811ae8e 100644 (file)
@@ -32,7 +32,6 @@
 #endif
 
 #define LOG_TAG "NOTIFICATION_EX"
-
 #define MAX_PACKAGE_STR_SIZE 512
 #define NOTIFICATION_EX_REPORTER_OBJECT_PATH "/org/tizen/notification_ex_reporter"
 
@@ -41,16 +40,17 @@ using namespace notification::item;
 namespace notification {
 
 Reporter::Reporter(IEventSender* sender, IEventListener* listener)
-  : impl_(new Impl(this, sender, listener)) {
+    : impl_(new Impl(this, sender, listener)) {
 }
 Reporter::~Reporter() = default;
 
 Reporter::Impl::~Impl() {
   listener_->UnRegisterObserver(parent_);
 }
+
 Reporter::Impl::Impl(Reporter* parent,
     IEventSender* sender, IEventListener* listener)
-  : sender_(sender), listener_(listener), parent_(parent) {
+    : sender_(sender), listener_(listener), parent_(parent) {
   LOGI("impl created");
   listener_->RegisterObserver(parent_);
 }
@@ -88,8 +88,7 @@ void Reporter::Remove(std::shared_ptr<AbstractItem> noti) {
 
 std::shared_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
   Bundle serialized;
-  EventInfo info(EventInfo::Get,
-     util::GetAppId(), "", id);
+  EventInfo info(EventInfo::Get, util::GetAppId(), "", id);
   list<Bundle> result = impl_->sender_->Request(info);
   if (result.size() == 0) {
     LOGE("Fail to get noti");
@@ -100,7 +99,8 @@ std::shared_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
   return gen_item;
 }
 
-void Reporter::SendEvent(const EventInfo& info, shared_ptr<item::AbstractItem> noti) {
+void Reporter::SendEvent(const EventInfo& info,
+    shared_ptr<item::AbstractItem> noti) {
   Bundle serialized = noti->Serialize();
   list<Bundle> serialized_list {serialized};
   impl_->sender_->Notify(info, serialized_list);
@@ -136,4 +136,4 @@ string Reporter::GetPath() {
   return NOTIFICATION_EX_REPORTER_OBJECT_PATH;
 }
 
-}  // nampace notification
\ No newline at end of file
+}  // nampace notification
index f5d5ed28190ee4e5181eb4cf00b73064b3490f1b..075df87f3656f4ecf29294a661a825eb9a1dc9fd 100644 (file)
 namespace notification {
 namespace item {
 TextItem::TextItem(std::string id, std::string text, std::string hyperlink,
-      std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this, text, hyperlink)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, text, hyperlink)) {
 }
 
 TextItem::Impl::Impl(TextItem* parent, std::string text, std::string hyperlink)
-  : parent_(parent), text_(text), hyperlink_(hyperlink) {
+    : parent_(parent), text_(text), hyperlink_(hyperlink) {
   LOGI("TextItem created");
 }
 
@@ -87,4 +87,4 @@ std::string TextItem::GetHyperLink() const {
 }
 
 }  // namespace item
-}  // namespace notification
\ No newline at end of file
+}  // namespace notification
index 0816373bd6228f9754e4ca0774240d2ca09dd154..e97cd911fd8785fee1bd2489f7fb5311db536d5f 100644 (file)
@@ -32,7 +32,7 @@ namespace notification {
 namespace item {
 
 TimeItem::TimeItem(std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action), impl_(new Impl(this, 0)) {
+    : AbstractItem(action), impl_(new Impl(this, 0)) {
   time_t current_time;
   time(&current_time);
 
@@ -40,16 +40,16 @@ TimeItem::TimeItem(std::shared_ptr<AbstractAction> action)
 }
 
 TimeItem::TimeItem(time_t time, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(action), impl_(new Impl(this, time)) {
+    : AbstractItem(action), impl_(new Impl(this, time)) {
 }
 
 TimeItem::TimeItem(std::string id, time_t time,
-  std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, action), impl_(new Impl(this, time)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, time)) {
 }
 
 TimeItem::Impl::Impl(TimeItem* parent, time_t time)
-  : parent_(parent), time_(time) {
+    : parent_(parent), time_(time) {
   LOGI("TimeItem impl created");
 }
 
index 1ec90b578aa61b1883121b8e8d33627cfa42a858..f274eb25dd3d5d1780eb3c6072ecf70dd791a71c 100644 (file)
@@ -124,5 +124,5 @@ void VisibilityAction::SetVisibility(std::string id, bool visible) {
       id, visible));
 }
 
-} //namespace item
+}  //namespace item
 }  //namespace notification