divide popup_string.h into popup_string.cc/h
authorYongseop Kim <yons.kim@samsung.com>
Fri, 15 May 2015 09:09:24 +0000 (18:09 +0900)
committerYongseop Kim <yons.kim@samsung.com>
Fri, 15 May 2015 09:09:24 +0000 (18:09 +0900)
Change-Id: Ib3cd4a141b49539b79f95bda42b659b13cf59bbf

src/runtime/CMakeLists.txt
src/runtime/popup_string.cc [new file with mode: 0644]
src/runtime/popup_string.h
tests/popup/CMakeLists.txt
tests/popup/popup_string.cc [new file with mode: 0644]
tests/popup/popup_string.h

index 84b3d91..ef1b902 100755 (executable)
@@ -49,6 +49,7 @@ SET(TARGET_RUNTIME_SRCS
   ${BASE_SRCDIR}/runtime/vibration_manager.cc
   ${BASE_SRCDIR}/runtime/notification_manager.cc
   ${BASE_SRCDIR}/runtime/popup.cc
+  ${BASE_SRCDIR}/runtime/popup_string.cc
 )
 
 # Compiler Flags
diff --git a/src/runtime/popup_string.cc b/src/runtime/popup_string.cc
new file mode 100644 (file)
index 0000000..fb54008
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "runtime/popup_string.h"
+
+#include <libintl.h>
+
+namespace wrt {
+
+namespace popup_string {
+
+const char kTextDomainWrt[] = "wrt";
+
+const char kPopupTitleAuthRequest[] = "Auth Request";
+const char kPopupTitleCert[] = "IDS_BR_HEADER_CERTIFICATE_INFO";
+const char kPopupTitleGeoLocation[] = "IDS_WRT_OPT_ACCESS_USER_LOCATION";
+const char kPopupTitleUserMedia[] = "IDS_WRT_OPT_USE_USER_MEDIA";
+const char kPopupTitleWebNotification[] =
+  "IDS_BR_HEADER_WEB_NOTIFICATION";
+const char kPopupTitleWebStorage[] = "IDS_WRT_OPT_USE_STORE_WEB_DATA";
+
+const char kPopupBodyAuthRequest[] =
+  "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED";
+const char kPopupBodyCert[] =
+  "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG";
+const char kPopupBodyGeoLocation[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION";
+const char kPopupBodyUserMedia[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE";
+const char kPopupBodyWebNotification[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS";
+const char kPopupBodyWebStorage[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE";
+
+const char kPopupCheckRememberPreference[] =
+  "IDS_BR_BODY_REMEMBER_PREFERENCE";
+
+const char kPopupLabelAuthusername[] = "IDS_BR_BODY_AUTHUSERNAME";
+const char kPopupLabelPassword[] =  "IDS_BR_BODY_AUTHPASSWORD";
+
+const char kPopupButtonOk[] = "IDS_BR_SK_OK";
+const char kPopupButtonLogin[] = "IDS_BR_BODY_LOGIN";
+const char kPopupButtonCancel[] = "IDS_BR_SK_CANCEL";
+const char kPopupButtonAllow[] = "IDS_BR_OPT_ALLOW";
+const char kPopupButtonDeny[] = "IDS_COM_BODY_DENY";
+
+std::string GetText(const std::string& msg_id) {
+  return dgettext(kTextDomainWrt, msg_id.c_str());
+}
+
+}  // namespace popup_string
+
+}  // namespace wrt
index f414a55..012b795 100644 (file)
@@ -11,44 +11,34 @@ namespace wrt {
 
 namespace popup_string {
 
-static const char* kTextDomainWrt = "wrt";
-
-static const char* kPopupTitleAuthRequest = "Auth Request";
-static const char* kPopupTitleCert = "IDS_BR_HEADER_CERTIFICATE_INFO";
-static const char* kPopupTitleGeoLocation = "IDS_WRT_OPT_ACCESS_USER_LOCATION";
-static const char* kPopupTitleUserMedia = "IDS_WRT_OPT_USE_USER_MEDIA";
-static const char* kPopupTitleWebNotification =
-  "IDS_BR_HEADER_WEB_NOTIFICATION";
-static const char* kPopupTitleWebStorage = "IDS_WRT_OPT_USE_STORE_WEB_DATA";
-
-static const char* kPopupBodyAuthRequest =
-  "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED";
-static const char* kPopupBodyCert =
-  "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG";
-static const char* kPopupBodyGeoLocation =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION";
-static const char* kPopupBodyUserMedia =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE";
-static const char* kPopupBodyWebNotification =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS";
-static const char* kPopupBodyWebStorage =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE";
-
-static const char* kPopupCheckRememberPreference =
-  "IDS_BR_BODY_REMEMBER_PREFERENCE";
-
-static const char* kPopupLabelAuthusername = "IDS_BR_BODY_AUTHUSERNAME";
-static const char* kPopupLabelPassword =  "IDS_BR_BODY_AUTHPASSWORD";
-
-static const char* kPopupButtonOk = "IDS_BR_SK_OK";
-static const char* kPopupButtonLogin = "IDS_BR_BODY_LOGIN";
-static const char* kPopupButtonCancel = "IDS_BR_SK_CANCEL";
-static const char* kPopupButtonAllow = "IDS_BR_OPT_ALLOW";
-static const char* kPopupButtonDeny = "IDS_COM_BODY_DENY";
-
-static std::string GetText(const std::string& msg_id) {
-  return dgettext(kTextDomainWrt, msg_id.c_str());
-}
+extern const char kTextDomainWrt[];
+
+extern const char kPopupTitleAuthRequest[];
+extern const char kPopupTitleCert[];
+extern const char kPopupTitleGeoLocation[];
+extern const char kPopupTitleUserMedia[];
+extern const char kPopupTitleWebNotification[];
+extern const char kPopupTitleWebStorage[];
+
+extern const char kPopupBodyAuthRequest[];
+extern const char kPopupBodyCert[];
+extern const char kPopupBodyGeoLocation[];
+extern const char kPopupBodyUserMedia[];
+extern const char kPopupBodyWebNotification[];
+extern const char kPopupBodyWebStorage[];
+
+extern const char kPopupCheckRememberPreference[];
+
+extern const char kPopupLabelAuthusername[];
+extern const char kPopupLabelPassword[];
+
+extern const char kPopupButtonOk[];
+extern const char kPopupButtonLogin[];
+extern const char kPopupButtonCancel[];
+extern const char kPopupButtonAllow[];
+extern const char kPopupButtonDeny[];
+
+std::string GetText(const std::string& msg_id);
 
 }  // namespace popup_string
 
index 12f5f41..120eadb 100644 (file)
@@ -37,6 +37,7 @@ SET(TARGET_TEST_POPUP_LIBS
 # Source Files
 SET(TARGET_TEST_POPUP_SRCS
   ${TEST_SRCDIR}/popup/popup.cc
+  ${TEST_SRCDIR}/popup/popup_string.cc
   ${TEST_SRCDIR}/popup/test_popup.cc
 )
 
diff --git a/tests/popup/popup_string.cc b/tests/popup/popup_string.cc
new file mode 100644 (file)
index 0000000..fb74f6d
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "popup/popup_string.h"
+
+#include <libintl.h>
+
+namespace wrt {
+
+namespace popup_string {
+
+const char kTextDomainWrt[] = "wrt";
+
+const char kPopupTitleAuthRequest[] = "Auth Request";
+const char kPopupTitleCert[] = "IDS_BR_HEADER_CERTIFICATE_INFO";
+const char kPopupTitleGeoLocation[] = "IDS_WRT_OPT_ACCESS_USER_LOCATION";
+const char kPopupTitleUserMedia[] = "IDS_WRT_OPT_USE_USER_MEDIA";
+const char kPopupTitleWebNotification[] =
+  "IDS_BR_HEADER_WEB_NOTIFICATION";
+const char kPopupTitleWebStorage[] = "IDS_WRT_OPT_USE_STORE_WEB_DATA";
+
+const char kPopupBodyAuthRequest[] =
+  "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED";
+const char kPopupBodyCert[] =
+  "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG";
+const char kPopupBodyGeoLocation[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION";
+const char kPopupBodyUserMedia[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE";
+const char kPopupBodyWebNotification[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS";
+const char kPopupBodyWebStorage[] =
+  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE";
+
+const char kPopupCheckRememberPreference[] =
+  "IDS_BR_BODY_REMEMBER_PREFERENCE";
+
+const char kPopupLabelAuthusername[] = "IDS_BR_BODY_AUTHUSERNAME";
+const char kPopupLabelPassword[] =  "IDS_BR_BODY_AUTHPASSWORD";
+
+const char kPopupButtonOk[] = "IDS_BR_SK_OK";
+const char kPopupButtonLogin[] = "IDS_BR_BODY_LOGIN";
+const char kPopupButtonCancel[] = "IDS_BR_SK_CANCEL";
+const char kPopupButtonAllow[] = "IDS_BR_OPT_ALLOW";
+const char kPopupButtonDeny[] = "IDS_COM_BODY_DENY";
+
+std::string GetText(const std::string& msg_id) {
+  return dgettext(kTextDomainWrt, msg_id.c_str());
+}
+
+}  // namespace popup_string
+
+}  // namespace wrt
index f414a55..91e0f42 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef WRT_RUNTIME_POPUP_STRING_H_
-#define WRT_RUNTIME_POPUP_STRING_H_
+#ifndef WRT_TESTS_POPUP_STRING_H_
+#define WRT_TESTS_POPUP_STRING_H_
 
 #include <string>
 
@@ -11,47 +11,37 @@ namespace wrt {
 
 namespace popup_string {
 
-static const char* kTextDomainWrt = "wrt";
-
-static const char* kPopupTitleAuthRequest = "Auth Request";
-static const char* kPopupTitleCert = "IDS_BR_HEADER_CERTIFICATE_INFO";
-static const char* kPopupTitleGeoLocation = "IDS_WRT_OPT_ACCESS_USER_LOCATION";
-static const char* kPopupTitleUserMedia = "IDS_WRT_OPT_USE_USER_MEDIA";
-static const char* kPopupTitleWebNotification =
-  "IDS_BR_HEADER_WEB_NOTIFICATION";
-static const char* kPopupTitleWebStorage = "IDS_WRT_OPT_USE_STORE_WEB_DATA";
-
-static const char* kPopupBodyAuthRequest =
-  "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED";
-static const char* kPopupBodyCert =
-  "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG";
-static const char* kPopupBodyGeoLocation =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION";
-static const char* kPopupBodyUserMedia =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE";
-static const char* kPopupBodyWebNotification =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS";
-static const char* kPopupBodyWebStorage =
-  "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE";
-
-static const char* kPopupCheckRememberPreference =
-  "IDS_BR_BODY_REMEMBER_PREFERENCE";
-
-static const char* kPopupLabelAuthusername = "IDS_BR_BODY_AUTHUSERNAME";
-static const char* kPopupLabelPassword =  "IDS_BR_BODY_AUTHPASSWORD";
-
-static const char* kPopupButtonOk = "IDS_BR_SK_OK";
-static const char* kPopupButtonLogin = "IDS_BR_BODY_LOGIN";
-static const char* kPopupButtonCancel = "IDS_BR_SK_CANCEL";
-static const char* kPopupButtonAllow = "IDS_BR_OPT_ALLOW";
-static const char* kPopupButtonDeny = "IDS_COM_BODY_DENY";
-
-static std::string GetText(const std::string& msg_id) {
-  return dgettext(kTextDomainWrt, msg_id.c_str());
-}
+extern const char kTextDomainWrt[];
+
+extern const char kPopupTitleAuthRequest[];
+extern const char kPopupTitleCert[];
+extern const char kPopupTitleGeoLocation[];
+extern const char kPopupTitleUserMedia[];
+extern const char kPopupTitleWebNotification[];
+extern const char kPopupTitleWebStorage[];
+
+extern const char kPopupBodyAuthRequest[];
+extern const char kPopupBodyCert[];
+extern const char kPopupBodyGeoLocation[];
+extern const char kPopupBodyUserMedia[];
+extern const char kPopupBodyWebNotification[];
+extern const char kPopupBodyWebStorage[];
+
+extern const char kPopupCheckRememberPreference[];
+
+extern const char kPopupLabelAuthusername[];
+extern const char kPopupLabelPassword[];
+
+extern const char kPopupButtonOk[];
+extern const char kPopupButtonLogin[];
+extern const char kPopupButtonCancel[];
+extern const char kPopupButtonAllow[];
+extern const char kPopupButtonDeny[];
+
+std::string GetText(const std::string& msg_id);
 
 }  // namespace popup_string
 
 }  // namespace wrt
 
-#endif  // WRT_RUNTIME_POPUP_STRING_H_
+#endif  // WRT_TESTS_POPUP_STRING_H_