From 5f0a128358b2b2bfd88da298663083669e1138b7 Mon Sep 17 00:00:00 2001 From: Gwangbok Kim Date: Fri, 12 Apr 2013 11:23:16 +0900 Subject: [PATCH] fix contact sample app code for resource id concept Change-Id: I3fabea38d9e173251c6b0cd95c3cd06b39058c0b Signed-off-by: Gwangbok Kim --- project/inc/AppResourceId.h | 23 +++++++++++++++++++++++ project/src/AppResourceId.cpp | 20 ++++++++++++++++++++ project/src/CategoryAddMemberForm.cpp | 3 ++- project/src/CategoryListForm.cpp | 3 ++- project/src/CategoryMemberForm.cpp | 3 ++- project/src/CategoryRemoveMemberForm.cpp | 3 ++- project/src/CreateContactForm.cpp | 3 ++- project/src/DetailViewForm.cpp | 3 ++- project/src/EditContactForm.cpp | 3 ++- project/src/FavoriteListForm.cpp | 3 ++- project/src/MainForm.cpp | 3 ++- 11 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 project/inc/AppResourceId.h create mode 100644 project/src/AppResourceId.cpp diff --git a/project/inc/AppResourceId.h b/project/inc/AppResourceId.h new file mode 100644 index 0000000..8347869 --- /dev/null +++ b/project/inc/AppResourceId.h @@ -0,0 +1,23 @@ +// +// Open Service Platform +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef _APP_RESOURCE_ID_H_ +#define _APP_RESOURCE_ID_H_ + +extern const wchar_t* IDF_FORM_CONTACTS; + +#endif // _APP_RESOURCE_ID_H_ diff --git a/project/src/AppResourceId.cpp b/project/src/AppResourceId.cpp new file mode 100644 index 0000000..783d56f --- /dev/null +++ b/project/src/AppResourceId.cpp @@ -0,0 +1,20 @@ +// +// Open Service Platform +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "AppResourceId.h" + +const wchar_t* IDF_FORM_CONTACTS = L"IDF_FORM_CONTACTS"; diff --git a/project/src/CategoryAddMemberForm.cpp b/project/src/CategoryAddMemberForm.cpp index 5059c8b..1e62817 100755 --- a/project/src/CategoryAddMemberForm.cpp +++ b/project/src/CategoryAddMemberForm.cpp @@ -19,6 +19,7 @@ #include "CategoryAddMemberForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -52,7 +53,7 @@ CategoryAddMemberForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/CategoryListForm.cpp b/project/src/CategoryListForm.cpp index 3d25de1..95cfffb 100644 --- a/project/src/CategoryListForm.cpp +++ b/project/src/CategoryListForm.cpp @@ -20,6 +20,7 @@ #include "CategoryListForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -52,7 +53,7 @@ CategoryListForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/CategoryMemberForm.cpp b/project/src/CategoryMemberForm.cpp index 947e17c..a13736d 100755 --- a/project/src/CategoryMemberForm.cpp +++ b/project/src/CategoryMemberForm.cpp @@ -19,6 +19,7 @@ #include "CategoryMemberForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -50,7 +51,7 @@ CategoryMemberForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/CategoryRemoveMemberForm.cpp b/project/src/CategoryRemoveMemberForm.cpp index 601d65e..2daf325 100644 --- a/project/src/CategoryRemoveMemberForm.cpp +++ b/project/src/CategoryRemoveMemberForm.cpp @@ -19,6 +19,7 @@ #include "CategoryRemoveMemberForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -52,7 +53,7 @@ CategoryRemoveMemberForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/CreateContactForm.cpp b/project/src/CreateContactForm.cpp index c94f12b..1ed8369 100644 --- a/project/src/CreateContactForm.cpp +++ b/project/src/CreateContactForm.cpp @@ -19,6 +19,7 @@ #include "CreateContactForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -60,7 +61,7 @@ CreateContactForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/DetailViewForm.cpp b/project/src/DetailViewForm.cpp index 3353499..7c9b1de 100644 --- a/project/src/DetailViewForm.cpp +++ b/project/src/DetailViewForm.cpp @@ -19,6 +19,7 @@ #include "DetailViewForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -55,7 +56,7 @@ DetailViewForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/EditContactForm.cpp b/project/src/EditContactForm.cpp index 6b4c9c5..07a4182 100644 --- a/project/src/EditContactForm.cpp +++ b/project/src/EditContactForm.cpp @@ -19,6 +19,7 @@ #include "EditContactForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -62,7 +63,7 @@ EditContactForm::Initialize(void) r = GetLastResult(); TryReturn(!IsFailed(r), false, "Failed to get instance of addressbook manager (%s)", GetErrorMessage(r)); - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/FavoriteListForm.cpp b/project/src/FavoriteListForm.cpp index d88a02a..1b5090b 100644 --- a/project/src/FavoriteListForm.cpp +++ b/project/src/FavoriteListForm.cpp @@ -20,6 +20,7 @@ #include "FavoriteListForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -45,7 +46,7 @@ FavoriteListForm::Initialize(void) { result r = E_SUCCESS; - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; diff --git a/project/src/MainForm.cpp b/project/src/MainForm.cpp index 1fd6954..6606d13 100644 --- a/project/src/MainForm.cpp +++ b/project/src/MainForm.cpp @@ -21,6 +21,7 @@ #include "MainForm.h" #include "SceneRegister.h" +#include "AppResourceId.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -47,7 +48,7 @@ MainForm::Initialize(void) { result r = E_SUCCESS; - r = Construct(L"IDF_FORM_CONTACTS"); + r = Construct(IDF_FORM_CONTACTS); TryReturn(!IsFailed(r), false, "Failed to construct the form (%s).", GetErrorMessage(r)); return true; -- 2.7.4