resource fixed
authorYoungil Shin <yi.shin@samsung.com>
Mon, 15 Apr 2013 01:14:26 +0000 (10:14 +0900)
committerYoungil Shin <yi.shin@samsung.com>
Mon, 15 Apr 2013 01:14:26 +0000 (10:14 +0900)
Change-Id: I3b49886184eebfcc83835b554d76e2b73e1980d0
Signed-off-by: Youngil Shin <yi.shin@samsung.com>
project/inc/AppResourceId.h [new file with mode: 0644]
project/src/AppResourceId.cpp [new file with mode: 0644]
project/src/SpeechAppMainForm.cpp
project/src/SpeechAppSttForm.cpp
project/src/SpeechAppTtsForm.cpp

diff --git a/project/inc/AppResourceId.h b/project/inc/AppResourceId.h
new file mode 100644 (file)
index 0000000..73b0762
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2012 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://www.tizenopensource.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_MAIN;
+extern const wchar_t* IDC_BUTTON_STT;
+extern const wchar_t* IDC_BUTTON_TTS;
+
+extern const wchar_t* IDF_FORM_STT;
+extern const wchar_t* IDC_BUTTON_START;
+extern const wchar_t* IDC_BUTTON_STOP;
+extern const wchar_t* IDC_BUTTON_CANCEL;
+extern const wchar_t* IDC_LISTVIEW_LANGS;
+extern const wchar_t* IDC_LABEL_INFO;
+
+extern const wchar_t* IDF_FORM_TTS;
+extern const wchar_t* IDC_BUTTON_SPEAK;
+extern const wchar_t* IDC_BUTTON_PAUSE;
+extern const wchar_t* IDC_BUTTON_RESUME;
+extern const wchar_t* IDC_BUTTON_STOP;
+extern const wchar_t* IDC_EDITFIELD_TEXT;
+extern const wchar_t* IDC_CHECKBUTTON_MODE;
+
+#endif // _APP_RESOURCE_ID_H_
diff --git a/project/src/AppResourceId.cpp b/project/src/AppResourceId.cpp
new file mode 100644 (file)
index 0000000..046b8f1
--- /dev/null
@@ -0,0 +1,35 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License) = L"";
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.tizenopensource.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_MAIN = L"IDF_FORM_MAIN";
+const wchar_t* IDF_FORM_STT = L"IDF_FORM_STT";
+const wchar_t* IDF_FORM_TTS = L"IDF_FORM_TTS";
+
+const wchar_t* IDC_BUTTON_STT = L"IDC_BUTTON_STT";
+const wchar_t* IDC_BUTTON_TTS = L"IDC_BUTTON_TTS";
+const wchar_t* IDC_BUTTON_START = L"IDC_BUTTON_START";
+const wchar_t* IDC_BUTTON_STOP = L"IDC_BUTTON_STOP";
+const wchar_t* IDC_BUTTON_CANCEL = L"IDC_BUTTON_CANCEL";
+const wchar_t* IDC_LISTVIEW_LANGS = L"IDC_LISTVIEW_LANGS";
+const wchar_t* IDC_LABEL_INFO = L"IDC_LABEL_INFO";
+const wchar_t* IDC_BUTTON_SPEAK = L"IDC_BUTTON_SPEAK";
+const wchar_t* IDC_BUTTON_PAUSE = L"IDC_BUTTON_PAUSE";
+const wchar_t* IDC_BUTTON_RESUME = L"IDC_BUTTON_RESUME";
+const wchar_t* IDC_EDITFIELD_TEXT = L"IDC_EDITFIELD_TEXT";
+const wchar_t* IDC_CHECKBUTTON_MODE = L"IDC_CHECKBUTTON_MODE";
index 3798b51..e428033 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <FApp.h>
 #include "SpeechAppMainForm.h"
+#include "AppResourceId.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::App;
@@ -36,7 +37,7 @@ SpeechAppMainForm::~SpeechAppMainForm(void)
 bool
 SpeechAppMainForm::Initialize(void)
 {
-       Construct(L"IDF_FORM_MAIN");
+       Construct(IDF_FORM_MAIN);
 
        return true;
 }
@@ -48,14 +49,14 @@ SpeechAppMainForm::OnInitializing(void)
 
        SetFormBackEventListener(this);
 
-       Tizen::Ui::Controls::Button* pButtonStt = static_cast< Button* >(GetControl(L"IDC_BUTTON_STT"));
+       Tizen::Ui::Controls::Button* pButtonStt = static_cast< Button* >(GetControl(IDC_BUTTON_STT));
        if (pButtonStt != null)
        {
                pButtonStt->SetActionId(ID_BUTTON_STT);
                pButtonStt->AddActionEventListener(*this);
        }
 
-       Tizen::Ui::Controls::Button* pButtonTts = static_cast< Button* >(GetControl(L"IDC_BUTTON_TTS"));
+       Tizen::Ui::Controls::Button* pButtonTts = static_cast< Button* >(GetControl(IDC_BUTTON_TTS));
        if (pButtonTts != null)
        {
                pButtonTts->SetActionId(ID_BUTTON_TTS);
index 6f21e0c..0fe56fb 100644 (file)
@@ -19,6 +19,7 @@
 #include <FGraphics.h>
 #include <FLocales.h>
 #include "SpeechAppSttForm.h"
+#include "AppResourceId.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -47,7 +48,7 @@ SpeechAppSttForm::~SpeechAppSttForm(void)
 bool
 SpeechAppSttForm::Initialize(void)
 {
-       Construct(L"IDF_FORM_STT");
+       Construct(IDF_FORM_STT);
 
        return true;
 }
@@ -59,7 +60,7 @@ SpeechAppSttForm::OnInitializing(void)
 
        SetFormBackEventListener(this);
 
-       __pButtonStart = static_cast< Button* >(GetControl(L"IDC_BUTTON_START"));
+       __pButtonStart = static_cast< Button* >(GetControl(IDC_BUTTON_START));
        if (__pButtonStart != null)
        {
                __pButtonStart->SetActionId(ID_BUTTON_START);
@@ -67,7 +68,7 @@ SpeechAppSttForm::OnInitializing(void)
                __pButtonStart->SetEnabled(true);
        }
 
-       __pButtonStop = static_cast< Button* >(GetControl(L"IDC_BUTTON_STOP"));
+       __pButtonStop = static_cast< Button* >(GetControl(IDC_BUTTON_STOP));
        if (__pButtonStop != null)
        {
                __pButtonStop->SetActionId(ID_BUTTON_STOP);
@@ -75,7 +76,7 @@ SpeechAppSttForm::OnInitializing(void)
                __pButtonStop->SetEnabled(false);
        }
 
-       __pButtonCancel = static_cast< Button* >(GetControl(L"IDC_BUTTON_CANCEL"));
+       __pButtonCancel = static_cast< Button* >(GetControl(IDC_BUTTON_CANCEL));
        if (__pButtonCancel != null)
        {
                __pButtonCancel->SetActionId(ID_BUTTON_CANCEL);
@@ -83,7 +84,7 @@ SpeechAppSttForm::OnInitializing(void)
                __pButtonCancel->SetEnabled(false);
        }
 
-       __pLabel = static_cast< Label* >(GetControl(L"IDC_LABEL_INFO"));
+       __pLabel = static_cast< Label* >(GetControl(IDC_LABEL_INFO));
        if (__pLabel != null)
        {
                __pLabel->SetText("Information box");
@@ -203,7 +204,7 @@ SpeechAppSttForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 void
 SpeechAppSttForm::OnSpeechToTextInitialized(void)
 {
-       Tizen::Ui::Controls::ListView* pList = static_cast< ListView* >(GetControl(L"IDC_LISTVIEW_LANGS"));
+       Tizen::Ui::Controls::ListView* pList = static_cast< ListView* >(GetControl(IDC_LISTVIEW_LANGS));
        if (pList != null)
        {
                pList->SetItemProvider(*this);
index 397cc47..ec1ce76 100644 (file)
@@ -17,6 +17,7 @@
 #include <FUiScenes.h>
 #include <FLocales.h>
 #include "SpeechAppTtsForm.h"
+#include "AppResourceId.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Ui;
@@ -44,7 +45,7 @@ SpeechAppTtsForm::~SpeechAppTtsForm(void)
 bool
 SpeechAppTtsForm::Initialize()
 {
-       Construct(L"IDF_FORM_TTS");
+       Construct(IDF_FORM_TTS);
 
        return true;
 }
@@ -56,7 +57,7 @@ SpeechAppTtsForm::OnInitializing(void)
 
        SetFormBackEventListener(this);
 
-       __pButtonSpeak = static_cast< Button* >(GetControl(L"IDC_BUTTON_SPEAK"));
+       __pButtonSpeak = static_cast< Button* >(GetControl(IDC_BUTTON_SPEAK));
        if (__pButtonSpeak != null)
        {
                __pButtonSpeak->SetActionId(ID_BUTTON_SPEAK);
@@ -64,7 +65,7 @@ SpeechAppTtsForm::OnInitializing(void)
                __pButtonSpeak->SetEnabled(true);
        }
 
-       __pButtonPause = static_cast< Button* >(GetControl(L"IDC_BUTTON_PAUSE"));
+       __pButtonPause = static_cast< Button* >(GetControl(IDC_BUTTON_PAUSE));
        if (__pButtonPause != null)
        {
                __pButtonPause->SetActionId(ID_BUTTON_PAUSE);
@@ -72,7 +73,7 @@ SpeechAppTtsForm::OnInitializing(void)
                __pButtonPause->SetEnabled(false);
        }
 
-       __pButtonResume = static_cast< Button* >(GetControl(L"IDC_BUTTON_RESUME"));
+       __pButtonResume = static_cast< Button* >(GetControl(IDC_BUTTON_RESUME));
        if (__pButtonResume != null)
        {
                __pButtonResume->SetActionId(ID_BUTTON_RESUME);
@@ -80,7 +81,7 @@ SpeechAppTtsForm::OnInitializing(void)
                __pButtonResume->SetEnabled(false);
        }
 
-       __pButtonStop = static_cast< Button* >(GetControl(L"IDC_BUTTON_STOP"));
+       __pButtonStop = static_cast< Button* >(GetControl(IDC_BUTTON_STOP));
        if (__pButtonStop != null)
        {
                __pButtonStop->SetActionId(ID_BUTTON_STOP);
@@ -88,7 +89,7 @@ SpeechAppTtsForm::OnInitializing(void)
                __pButtonStop->SetEnabled(false);
        }
 
-       CheckButton* pAppendCheckbutton = static_cast< CheckButton* >(GetControl("IDC_CHECKBUTTON_MODE"));
+       CheckButton* pAppendCheckbutton = static_cast< CheckButton* >(GetControl(IDC_CHECKBUTTON_MODE));
        if (pAppendCheckbutton != null)
        {
                pAppendCheckbutton->SetSelected(true);
@@ -132,7 +133,7 @@ SpeechAppTtsForm::OnActionPerformed(const Tizen::Ui::Control& source, int action
 {
        result r = E_SUCCESS;
 
-       Tizen::Ui::Controls::EditField* pEditField = static_cast< EditField* >(GetControl(L"IDC_EDITFIELD_TEXT"));
+       Tizen::Ui::Controls::EditField* pEditField = static_cast< EditField* >(GetControl(IDC_EDITFIELD_TEXT));
 
        switch (actionId)
        {
@@ -330,7 +331,7 @@ SpeechAppTtsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
                Locale* pLocale = static_cast< Locale* >(pArgs->GetAt(1));
                AppLog("[%ls] Received locale of STT", pLocale->GetLocaleCodeString().GetPointer());
 
-               Tizen::Ui::Controls::EditField* pEditField = static_cast< EditField* >(GetControl(L"IDC_EDITFIELD_TEXT"));
+               Tizen::Ui::Controls::EditField* pEditField = static_cast< EditField* >(GetControl(IDC_EDITFIELD_TEXT));
                pEditField->SetText(*pStr);
 
                __sttLocale = *pLocale;