#include "watchface-complication/include/watchface-complication-internal.h"
#include "watchface-complication/include/watchface-complication.h"
-#include "complication_parser_plugin_internal.h"
+#include "parser/complication_parser_plugin_internal.h"
#define DEFAULT_SHORT_TEXT "default-short-text"
#define DEFAULT_LONG_TEXT "default-long-text"
#include <dlog.h>
#include <tzplatform_config.h>
-#include "complication_parser_plugin_internal.h"
+#include "parser/complication_parser_plugin_internal.h"
#define BUSY_WAITING_USEC 50000 /* 0.05 sec */
#define BUSY_WAITING_MAX 20 /* wait for max 1 sec */
#include <fcntl.h>
#include <glib.h>
#include <gio/gio.h>
-#include <string>
#include <cynara-client.h>
#include <cynara-creds-gdbus.h>
#include <cynara-session.h>
-#include "watchface-util.h"
-#include "watchface-common.h"
+#include <string>
+
+#include "watchface-common/watchface-util.h"
+#include "watchface-common/include/watchface-common.h"
#ifdef LOG_TAG
#undef LOG_TAG
#include <string>
#include <exception>
-#include "watchface-common.h"
+
+#include "watchface-common/include/watchface-common.h"
#define THROW(error_code) throw Exception(error_code, __FILE__, __LINE__)
class Exception : public std::exception {
public:
- Exception(int error_code, std::string file = __FILE__, int line = __LINE__ ) {
+ explicit Exception(int error_code, std::string file = __FILE__,
+ int line = __LINE__ ) {
_error_code = error_code;
_whatMessage = file.substr(file.find_last_of("/") + 1) + ":"
+ std::to_string(line) + GetErrorString(error_code);
Impl(ComplicationProvider* parent, const std::string& provider_id);
class SenderInfo {
public:
- SenderInfo(const std::string& sender_name, const char* sender_app_id,
+ SenderInfo(const std::string& sender_name, const char* sender_app_id,
int watcher_id);
- int CheckPrivilege(std::list<std::string>& required_privileges, GDBusConnection* connection);
- bool CheckAppid(const std::string& Appid);
- int GetWatcherID();
- cynara_result GetPrivilegeResult();
- void SetPrivilegeResult(cynara_result result);
+ int CheckPrivilege(std::list<std::string>& required_privileges,
+ GDBusConnection* connection);
+ bool CheckAppid(const std::string& Appid);
+ int GetWatcherID();
+ cynara_result GetPrivilegeResult();
+ void SetPrivilegeResult(cynara_result result);
private:
- std::string sender_name_;
- std::string sender_app_id_;
- int watcher_id_;
- std::list<std::string> sender_privileges_;
- cynara_result privilege_result_;
+ std::string sender_name_;
+ std::string sender_app_id_;
+ int watcher_id_;
+ std::list<std::string> sender_privileges_;
+ cynara_result privilege_result_;
};
private:
#include <glib.h>
#include <unistd.h>
+#include <list>
+
#include "watchface-common/watchface-util.h"
-#include "complication-provider.h"
-#include "complication-provider-implementation.h"
+#include "watchface-complication-provider/complication-provider.h"
+#include "watchface-complication-provider/complication-provider-implementation.h"
#ifdef LOG_TAG
#undef LOG_TAG
LOGI("subscribe signal %d", subscribe_id_);
}
-ComplicationProvider::Impl::SenderInfo::SenderInfo(const std::string& sender_name,
- const char* sender_app_id,
- int watcher_id)
+ComplicationProvider::Impl::SenderInfo::SenderInfo(
+ const std::string& sender_name, const char* sender_app_id, int watcher_id)
: sender_name_(sender_name), sender_app_id_(sender_app_id),
- watcher_id_(watcher_id), privilege_result_(COMPLICATION_CYNARA_UNKNOWN) {
+ watcher_id_(watcher_id), privilege_result_(COMPLICATION_CYNARA_UNKNOWN) {
}
int ComplicationProvider::Impl::SenderInfo::CheckPrivilege(
class EXPORT_API ComplicationProvider : public IComplicationEvent {
public:
- ComplicationProvider(const std::string& provider_id);
+ explicit ComplicationProvider(const std::string& provider_id);
virtual ~ComplicationProvider();
public:
#include <list>
#include "watchface-common/watchface-util.h"
-#include "complication-provider.h"
-#include "include/watchface-complication-provider.h"
+#include "watchface-complication-provider/complication-provider.h"
+#include "watchface-complication-provider/include/watchface-complication-provider.h"
#include "watchface-complication/db-manager.h"
#include "watchface-complication/include/watchface-complication-internal.h"
class WatchComplicationProviderStub : public ComplicationProvider {
public:
- WatchComplicationProviderStub(const std::string& provider_id)
+ explicit WatchComplicationProviderStub(const std::string& provider_id)
: ComplicationProvider(provider_id) {
}
#define WATCHFACE_COMPLICATION_COMPLICATION_BUNDLE_H_
#include <bundle.h>
-#include <string>
#include <watchface-common.h>
+#include <string>
+
namespace watchface_complication {
class EXPORT_API Bundle {
#define WATCHFACE_COMPLICATION_COMPLICATION_IMPLEMENTATION_H_
#include <gio/gio.h>
+#include <dlog.h>
#include <memory>
#include <string>
#include <map>
#include <list>
-#include <dlog.h>
#include "watchface-complication/complication.h"
#include "watchface-complication/complication-connector.h"
#include <appsvc.h>
#include <stdexcept>
+#include "watchface-common/watchface-util.h"
#include "watchface-complication/complication.h"
#include "watchface-complication/complication-implementation.h"
-#include "watchface-common/watchface-util.h"
-#include "watchface-complication-internal.h"
+#include "watchface-complication/include/watchface-complication-internal.h"
#ifdef LOG_TAG
#undef LOG_TAG
LOGI("invalid sender_appid");
return;
}
- std::string provider_appid = DBManager::GetProviderAppId(cur_provider_id_.c_str());
+ std::string provider_appid =
+ DBManager::GetProviderAppId(cur_provider_id_.c_str());
if (provider_appid.empty()) {
LOGI("invalid provider_appid");
return;
else
cur_type_ = default_type_;
- LOGI("get setting from bundle %s, %s", prev_provider_id, prev_provider_type);
+ LOGI("prev provider info %s, %s", prev_provider_id, prev_provider_type);
}
cur_data_idx_ = FindCandidateDataIdx(cur_provider_id_, cur_type_);
}
try {
- impl_->last_context_data_.reset(new Bundle((impl_->context_data_.get())->GetRaw()));
+ impl_->last_context_data_.reset(
+ new Bundle((impl_->context_data_.get())->GetRaw()));
} catch (const std::bad_alloc &ba) {
LOGE("Bundle::Exception bad_alloc");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
#define WATCHFACE_COMPLICATION_DB_MANAGER_H_
#include <gio/gio.h>
+#include <sqlite3.h>
+#include <watchface-common.h>
+
#include <string>
#include <memory>
#include <list>
-#include <sqlite3.h>
-#include <watchface-common.h>
#include "watchface-complication/complication-bundle.h"
namespace watchface_complication {
int support_type);
static std::string GetProviderAppId(const char* provider_id);
static std::list<std::string> GetProviderList(int support_type);
- static std::list<std::string> GetRequiredPrivlegeList(std::string& provider_id);
+ static std::list<std::string> GetRequiredPrivlegeList(
+ std::string& provider_id);
static std::list<std::unique_ptr<ProviderInfo>> GetProviderListWithTypes(
- int support_types);
+ int support_types);
static int GetSupportTypes(std::string& provider_id, int* types);
static int GetProviderPeriod(std::string& provider_id, int* period);
static std::string GetLabel(const char* provider_id);
#include <unistd.h>
#include <bundle.h>
#include <bundle_internal.h>
+
#include <utility>
#include "watchface-complication/editables-container.h"
#include "watchface-complication/editables-container-implementation.h"
-#include "watchface-complication-internal.h"
+#include "watchface-complication/include/watchface-complication-internal.h"
#include "watchface-common/watchface-util.h"
#ifdef LOG_TAG
}
bundle_add(ed, "SETUP_APPID", i.get()->GetSetupAppId().c_str());
- bundle_add(ed, "EDITABLE_ID", std::to_string(i.get()->GetEditableId()).c_str());
+ bundle_add(ed, "EDITABLE_ID",
+ std::to_string(i.get()->GetEditableId()).c_str());
int cur_data_idx = i.get()->GetCurDataIdx();
bundle_add(ed, "CUR_DATA_IDX", std::to_string(cur_data_idx).c_str());
- std::unique_ptr<const char*[]> arr(new const char*[i->GetCandidates().size()]);
+ std::unique_ptr<const char*[]> arr(
+ new const char*[i->GetCandidates().size()]);
int idx = 0;
for (auto& data : i.get()->GetCandidates()) {
arr.get()[idx++] = data->ToString();
#define WATCHFACE_COMPLICATION_EDITABLES_MANAGER_IMPLEMENTATION_H_
#include <gio/gio.h>
+#include <app_common.h>
#include <memory>
#include <string>
#include <list>
-#include <app_common.h>
#include "watchface-complication/complication.h"
#include "watchface-complication/complication-connector.h"
#define WATCHFACE_COMPLICATION_EDITABLES_MANAGER_H_
#include <gio/gio.h>
+#include <watchface-common.h>
+
#include <string>
#include <memory>
-#include <watchface-common.h>
#include "watchface-complication/complication-bundle.h"
namespace watchface_complication {
class EXPORT_API ReceivedEditable : public IEditable {
public:
- ReceivedEditable(std::string raw);
+ explicit ReceivedEditable(std::string raw);
virtual ~ReceivedEditable();
ReceivedEditable(ReceivedEditable const& other) = default;
ReceivedEditable(ReceivedEditable && other) = default;
return;
}
- bundle* data = bundle_decode(raw, strlen((char*)raw));
+ bundle* data = bundle_decode(raw, strlen(reinterpret_cast<char*>(raw)));
const char** str_arr = NULL;
int len = 0;
#include <stdio.h>
#include <errno.h>
#include <glib.h>
-#include <string>
-
#include <dlog.h>
#include <app_control.h>
+#include <string>
+
#include "watchface-editor/include/watchface-editor.h"
#include "watchface-complication/complication.h"
#include "watchface-editor/editables-editor.h"