Tizen 2.0 Release tizen_2.0 submit/tizen_2.0/20130215.192252
authorHyungKyu Song <hk76.song@samsung.com>
Fri, 15 Feb 2013 15:56:06 +0000 (00:56 +0900)
committerHyungKyu Song <hk76.song@samsung.com>
Fri, 15 Feb 2013 15:56:06 +0000 (00:56 +0900)
28 files changed:
LICENSE.Flora [new file with mode: 0644]
NOTICE [new file with mode: 0644]
description.xml [new file with mode: 0644]
project/data/nofile.dummy [new file with mode: 0644]
project/inc/DictionaryDataControl.h [new file with mode: 0644]
project/inc/DictionaryDataControlData.h [new file with mode: 0644]
project/inc/DictionaryDataControlFrame.h [new file with mode: 0644]
project/inc/FormFactory.h [new file with mode: 0644]
project/inc/MapDataControlForm.h [new file with mode: 0644]
project/inc/SelectDictionaryDataControlForm.h [new file with mode: 0644]
project/inc/SqlDataControlForm.h [new file with mode: 0644]
project/inc/ViewDescriptForm.h [new file with mode: 0644]
project/manifest.xml [new file with mode: 0644]
project/res/screen-density-xhigh/nofile.dummy [new file with mode: 0644]
project/shared/data/nofile.dummy [new file with mode: 0644]
project/shared/res/screen-density-xhigh/mainmenu.png [new file with mode: 0755]
project/shared/trusted/nofile.dummy [new file with mode: 0644]
project/src/DictionaryDataControl.cpp [new file with mode: 0644]
project/src/DictionaryDataControlData.cpp [new file with mode: 0644]
project/src/DictionaryDataControlEntry.cpp [new file with mode: 0644]
project/src/DictionaryDataControlFrame.cpp [new file with mode: 0644]
project/src/FormFactory.cpp [new file with mode: 0644]
project/src/MapDataControlForm.cpp [new file with mode: 0644]
project/src/SelectDictionaryDataControlForm.cpp [new file with mode: 0644]
project/src/SqlDataControlForm.cpp [new file with mode: 0644]
project/src/ViewDescriptForm.cpp [new file with mode: 0644]
sample.xml [new file with mode: 0644]
screenshot.png [new file with mode: 0644]

diff --git a/LICENSE.Flora b/LICENSE.Flora
new file mode 100644 (file)
index 0000000..9c95663
--- /dev/null
@@ -0,0 +1,206 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Compatibility Definition Document
+and passes the Compatibility Test Suite as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.  You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+  2. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+  3. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+  4. If the Work includes a "NOTICE" text file as part of its distribution,
+     then any Derivative Works that You distribute must include a readable
+     copy of the attribution notices contained within such NOTICE file,
+     excluding those notices that do not pertain to any part of
+     the Derivative Works, in at least one of the following places:
+     within a NOTICE text file distributed as part of the Derivative Works;
+     within the Source form or documentation, if provided along with the
+     Derivative Works; or, within a display generated by the Derivative Works,
+     if and wherever such third-party notices normally appear.
+     The contents of the NOTICE file are for informational purposes only
+     and do not modify the License.
+
+You may add Your own attribution notices within Derivative Works
+that You distribute, alongside or as an addendum to the NOTICE text
+from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License. You may add Your own
+copyright statement to Your modifications and may provide additional or
+different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works
+as a whole, provided Your use, reproduction, and distribution of
+the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks.  This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..f37f329
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,4 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Flora License, Version 1.
+Please, see the LICENSE.Flora file for Flora License terms and conditions.
+
diff --git a/description.xml b/description.xml
new file mode 100644 (file)
index 0000000..511c825
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type="text/xsl" href="../../../../description.xsl"?>
+
+<Overview version="0.17.1">
+  <SampleName> DictionaryDataControl </SampleName>
+  <SampleVersion>1.0</SampleVersion>
+  <Preview>screenshot.png</Preview>
+  <Description>
+    This sample application demonstrates how to use SqlDataControl and MapDataControl class in Tizen::App namespace. This application has dependency on DictionaryDataControlProvider sample.
+  </Description>
+</Overview>
diff --git a/project/data/nofile.dummy b/project/data/nofile.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/project/inc/DictionaryDataControl.h b/project/inc/DictionaryDataControl.h
new file mode 100644 (file)
index 0000000..337f693
--- /dev/null
@@ -0,0 +1,75 @@
+//
+// 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://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 _DICTIONARY_DATA_CONTROL_H_
+#define _DICTIONARY_DATA_CONTROL_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+/**
+ * [DictionaryDataControl] UiApp must inherit from UiApp class
+ * which provides basic features necessary to define an UiApp.
+ */
+class DictionaryDataControl
+       : public Tizen::App::UiApp
+       , public Tizen::System::IScreenEventListener
+{
+public:
+       /**
+        * [Test] UiApp must have a factory method that creates an instance of itself.
+        */
+       static Tizen::App::UiApp* CreateInstance(void);
+
+       DictionaryDataControl(void);
+
+       virtual ~DictionaryDataControl(void);
+
+       // Called when the UiApp is initializing.
+       bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
+
+       // Called when the UiApp initializing is finished.
+       bool OnAppInitialized(void);
+
+       // Called when the UiApp is requested to terminate.
+       bool OnAppWillTerminate(void);
+
+       // Called when the UiApp is terminating.
+       bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
+
+       // Called when the UiApp's frame moves to the top of the screen.
+       void OnForeground(void);
+
+       // Called when this UiApp's frame is moved from top of the screen to the background.
+       void OnBackground(void);
+
+       // Called when the system memory is not sufficient to run the UiApp any further.
+       void OnLowMemory(void);
+
+       // Called when the battery level changes.
+       void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
+
+       // Called when the screen turns on.
+       void OnScreenOn(void);
+
+       // Called when the screen turns off.
+       void OnScreenOff(void);
+};
+
+#endif //_DICTIONARY_DATA_CONTROL_H_
diff --git a/project/inc/DictionaryDataControlData.h b/project/inc/DictionaryDataControlData.h
new file mode 100644 (file)
index 0000000..0a9804d
--- /dev/null
@@ -0,0 +1,32 @@
+//
+// 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://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 DICTIONARY_DATA_CONTROL_DATA_H_
+#define DICTIONARY_DATA_CONTROL_DATA_H_
+
+#include <FBase.h>
+#include <FBaseCol.h>
+
+class DictionaryDataControlData
+{
+public:
+       DictionaryDataControlData(void);
+       virtual ~DictionaryDataControlData(void);
+       Tizen::Base::Collection::Queue* GetDataN(void);
+};
+
+#endif /* DICTIONARY_DATA_CONTROL_DATA_H_ */
diff --git a/project/inc/DictionaryDataControlFrame.h b/project/inc/DictionaryDataControlFrame.h
new file mode 100644 (file)
index 0000000..5b9208e
--- /dev/null
@@ -0,0 +1,34 @@
+//
+// 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://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 _DICTIONARY_DATA_CONTROL_FRAME_H_
+#define _DICTIONARY_DATA_CONTROL_FRAME_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+class DictionaryDataControlFrame
+       : public Tizen::Ui::Controls::Frame
+{
+public:
+       DictionaryDataControlFrame(void);
+       virtual ~DictionaryDataControlFrame(void);
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+};
+
+#endif  //_DICTIONARY_DATA_CONTROL_FRAME_H_
diff --git a/project/inc/FormFactory.h b/project/inc/FormFactory.h
new file mode 100644 (file)
index 0000000..5495540
--- /dev/null
@@ -0,0 +1,32 @@
+//
+// 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://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 FORMFACTORY_H_
+#define FORMFACTORY_H_
+
+#include <FUiScenesIFormFactory.h>
+
+class FormFactory: public Tizen::Ui::Scenes::IFormFactory {
+public:
+       FormFactory();
+       virtual ~FormFactory();
+
+       virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String &formId, const Tizen::Ui::Scenes::SceneId &sceneId);
+};
+
+#endif /* FORMFACTORY_H_ */
+
diff --git a/project/inc/MapDataControlForm.h b/project/inc/MapDataControlForm.h
new file mode 100644 (file)
index 0000000..7bff715
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// 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://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 _MAP_DATA_CONTROL_FORM_H_
+#define _MAP_DATA_CONTROL_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include <FAppMapDataControl.h>
+
+class MapDataControlForm
+       : public Tizen::Ui::Controls::Form
+       , public Tizen::Ui::Controls::IFormBackEventListener
+       , public Tizen::Ui::Controls::IListViewItemEventListener
+       , public Tizen::Ui::Controls::IListViewItemProvider
+       , public Tizen::App::IMapDataControlResponseListener
+{
+public:
+       MapDataControlForm(void);
+       virtual ~MapDataControlForm(void);
+
+       bool Initialize(void);
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+       // manage popup display
+       void ShowPopup(void);
+       void HidePopup(void);
+
+       // IListViewItemEventListener
+       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
+       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) {}
+       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) {}
+
+       //IListViewItemProvider
+       virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
+       virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
+       virtual int GetItemCount(void);
+
+       // IMapDataControlResponseListener
+       virtual void OnMapDataControlGetValueResponseReceived(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& dataId, Tizen::Base::Collection::IList& resultValueList, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnMapDataControlAddValueResponseReceived(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnMapDataControlSetValueResponseReceived(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnMapDataControlRemoveValueResponseReceived(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+private:
+       bool LoadDictionary(void);
+
+       Tizen::App::MapDataControl* __pMapDataControl;
+
+       Tizen::Ui::Controls::Popup* __pPopup;
+
+       Tizen::Ui::Controls::Label* __pLabel;
+
+       Tizen::Base::Collection::MultiHashMap __map;
+
+       int __currentSelectItemIndex;
+};
+
+#endif // _MAP_DATA_CONTROL_FORM_H_
diff --git a/project/inc/SelectDictionaryDataControlForm.h b/project/inc/SelectDictionaryDataControlForm.h
new file mode 100644 (file)
index 0000000..aa21f44
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// 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://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 _SELECT_DICTIONARY_DATA_CONTROL_FORM_H_
+#define _SELECT_DICTIONARY_DATA_CONTROL_FORM_H_
+
+#include <FApp.h>
+#include <FUi.h>
+
+
+class SelectDictionaryDataControlForm
+       : public Tizen::Ui::Controls::Form
+       , public Tizen::Ui::IActionEventListener
+       , public Tizen::Ui::Controls::IFormBackEventListener
+{
+public:
+       SelectDictionaryDataControlForm(void);
+
+       virtual ~SelectDictionaryDataControlForm(void);
+
+       bool Initialize(void);
+
+       result OnInitializing(void);
+
+       // Overridables
+       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+       void CreateUserSelectionPanel(void);
+
+public:
+       enum
+       {
+               SELECT_NONE = 0
+               , SELECT_SQL_DATACONTROL
+               , SELECT_MAP_DATACONTROL
+       };
+
+private:
+       Tizen::Ui::Controls::Panel* __pPanel;
+};
+
+#endif // _SELECT_DICTIONARY_DATA_CONTROL_FORM_H_
diff --git a/project/inc/SqlDataControlForm.h b/project/inc/SqlDataControlForm.h
new file mode 100644 (file)
index 0000000..58f7d4e
--- /dev/null
@@ -0,0 +1,89 @@
+//
+// 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://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 _SQL_DATA_CONTROL_FORM_H_
+#define _SQL_DATA_CONTROL_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include <FAppSqlDataControl.h>
+
+namespace Tizen { namespace Io
+{
+class IDbEnumerator;
+} }
+
+class SqlDataControlForm
+       : public Tizen::Ui::Controls::Form
+       , public Tizen::Ui::Controls::IFormBackEventListener
+       , public Tizen::Ui::Controls::IListViewItemEventListener
+       , public Tizen::Ui::Controls::IListViewItemProvider
+       , public Tizen::App::ISqlDataControlResponseListener
+{
+public:
+       SqlDataControlForm(void);
+       virtual ~SqlDataControlForm(void);
+
+       bool Initialize(void);
+       virtual result OnInitializing(void);
+       virtual result OnTerminating(void);
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+       // manage popup display
+       void ShowPopup(void);
+       void HidePopup(void);
+
+       // IListViewItemEventListener
+       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
+       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) {}
+       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) {}
+
+       //IListViewItemProvider
+       virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
+       virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
+       virtual int GetItemCount(void);
+
+       // ISqlDataControlResponseListener
+       virtual void OnSqlDataControlSelectResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
+                       const Tizen::Base::String& dataId, Tizen::Io::IDbEnumerator& resultSetEnumerator, bool providerResult,
+                       const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnSqlDataControlInsertResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
+                       const Tizen::Base::String& dataId, long long insertRowId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnSqlDataControlUpdateResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
+                       const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+       virtual void OnSqlDataControlDeleteResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
+                       const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg);
+
+private:
+       bool LoadDictionary(void);
+
+       Tizen::App::SqlDataControl* __pSqlDataControl;
+
+       Tizen::Ui::Controls::Popup* __pPopup;
+
+       Tizen::Ui::Controls::Label* __pLabel;
+
+       Tizen::Base::Collection::HashMap __wordMap;
+
+       Tizen::Base::Collection::HashMap __wordDescMap;
+
+       long long __lastInsertRowId;
+};
+
+#endif // _SQL_DATA_CONTROL_FORM_H_
diff --git a/project/inc/ViewDescriptForm.h b/project/inc/ViewDescriptForm.h
new file mode 100644 (file)
index 0000000..b758d1d
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// 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://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 _VIEW_DESCRIPT_FORM_H_
+#define _VIEW_DESCRIPT_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+class ViewDescriptForm
+       : public Tizen::Ui::Controls::Form
+       , public Tizen::Ui::Controls::IFormBackEventListener
+       , public Tizen::Ui::Controls::IListViewItemEventListener
+       , public Tizen::Ui::Scenes::ISceneEventListener
+{
+public:
+       ViewDescriptForm(void);
+       virtual ~ViewDescriptForm(void);
+       result Construct(Tizen::Base::String* pstr);
+
+       bool Initialize(void);
+
+       virtual result OnInitializing(void);
+
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) {}
+       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) {}
+       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) {}
+
+       // ISceneEventListener
+       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                                  const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                                       const Tizen::Ui::Scenes::SceneId& nextSceneId);
+
+
+
+private:
+       Tizen::Base::String __strDescription;
+};
+
+#endif // _VIEW_DESCRIPT_FORM_H_
diff --git a/project/manifest.xml b/project/manifest.xml
new file mode 100644 (file)
index 0000000..230e7aa
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Manifest xmlns="http://schemas.tizen.org/2012/12/manifest">
+       <Id>$(manifestAppId)</Id>
+       <Version>1.0.0</Version>
+       <Type>C++App</Type>
+       <Author/>
+       <Descriptions>
+               <Description Locale="eng-GB">SqlDataControl and MapDataControl test sample</Description>
+       </Descriptions>
+       <Requirements>
+               <Feature Name="http://tizen.org/feature/platform.core.cpu.arch">x86</Feature>
+               <Feature Name="http://tizen.org/feature/platform.core.fpu.arch">vfpv3</Feature>
+       </Requirements>
+       <Apps>
+               <ApiVersion>2.0</ApiVersion>
+               <Privileges/>
+               <UiApp Main="True" MenuIconVisible="True" Name="$(projectName)">
+                       <UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720" />
+                       <UiTheme SystemTheme="White"/>
+                       <DisplayNames>
+                               <DisplayName Locale="eng-GB">$(projectName)</DisplayName>
+                       </DisplayNames>
+                       <Icons>
+                               <Icon Section="MainMenu" Type="Xhigh">mainmenu.png</Icon>
+                       </Icons>
+                       <LaunchConditions/>
+                       <Notifications/>
+               </UiApp>
+       </Apps>
+</Manifest>
diff --git a/project/res/screen-density-xhigh/nofile.dummy b/project/res/screen-density-xhigh/nofile.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/project/shared/data/nofile.dummy b/project/shared/data/nofile.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/project/shared/res/screen-density-xhigh/mainmenu.png b/project/shared/res/screen-density-xhigh/mainmenu.png
new file mode 100755 (executable)
index 0000000..983c883
Binary files /dev/null and b/project/shared/res/screen-density-xhigh/mainmenu.png differ
diff --git a/project/shared/trusted/nofile.dummy b/project/shared/trusted/nofile.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/project/src/DictionaryDataControl.cpp b/project/src/DictionaryDataControl.cpp
new file mode 100644 (file)
index 0000000..de71273
--- /dev/null
@@ -0,0 +1,127 @@
+//
+// 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://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.
+//
+
+/**
+ * Name        : DictionaryDataControl
+ * Version     : 1.0
+ * Vendor      :
+ * Description : This sample application demonstrates how to use SqlDataControl and MapDataControl class in Tizen::App namespace. @n
+                 This application has dependency on DictionaryDataControlProvider sample.
+ */
+
+
+#include <FUi.h>
+
+#include "DictionaryDataControl.h"
+#include "DictionaryDataControlFrame.h"
+#include "FormFactory.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+DictionaryDataControl::DictionaryDataControl(void)
+{
+}
+
+DictionaryDataControl::~DictionaryDataControl(void)
+{
+}
+
+UiApp*
+DictionaryDataControl::CreateInstance(void)
+{
+       // Create the instance through the constructor.
+       return new DictionaryDataControl();
+}
+
+bool
+DictionaryDataControl::OnAppInitializing(AppRegistry& appRegistry)
+{
+       // Create a Frame
+       DictionaryDataControlFrame* pDictionaryDataControlFrame = new (std::nothrow) DictionaryDataControlFrame;
+       TryReturn(pDictionaryDataControlFrame != null, false, "new DictionaryDataControlFrame() is null");
+       pDictionaryDataControlFrame->Construct();
+       pDictionaryDataControlFrame->SetName(L"DictionaryDataControl");
+       AddFrame(*pDictionaryDataControlFrame);
+
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       AppAssert(pSceneManager);
+
+       static FormFactory formFactory;
+       pSceneManager->RegisterFormFactory(formFactory);
+       pSceneManager->RegisterScene(L"SelectDictionaryDataControlScene", L"SelectDictionaryDataControlForm", L"");
+       pSceneManager->RegisterScene(L"SqlDataControlScene", L"SqlDataControlForm", L"");
+       pSceneManager->RegisterScene(L"MapDataControlScene", L"MapDataControlForm", L"");
+       pSceneManager->RegisterScene(L"ViewDescriptScene", L"ViewDescriptForm", L"");
+
+       if (pSceneManager->GoForward(ForwardSceneTransition(L"SelectDictionaryDataControlScene")) != E_SUCCESS)
+               return false;
+
+       return true;
+}
+
+bool
+DictionaryDataControl::OnAppInitialized(void)
+{
+       return true;
+}
+
+bool
+DictionaryDataControl::OnAppWillTerminate(void)
+{
+       return true;
+}
+
+bool
+DictionaryDataControl::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+       return true;
+}
+
+void
+DictionaryDataControl::OnForeground(void)
+{
+}
+
+void
+DictionaryDataControl::OnBackground(void)
+{
+}
+
+void
+DictionaryDataControl::OnLowMemory(void)
+{
+}
+
+void
+DictionaryDataControl::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+}
+
+void
+DictionaryDataControl::OnScreenOn(void)
+{
+}
+
+void
+DictionaryDataControl::OnScreenOff(void)
+{
+}
diff --git a/project/src/DictionaryDataControlData.cpp b/project/src/DictionaryDataControlData.cpp
new file mode 100644 (file)
index 0000000..d7064cb
--- /dev/null
@@ -0,0 +1,86 @@
+//
+// 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://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 "DictionaryDataControlData.h"
+#include <FBase.h>
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+
+DictionaryDataControlData::DictionaryDataControlData(void)
+{
+}
+
+DictionaryDataControlData::~DictionaryDataControlData(void)
+{
+}
+
+Queue*
+DictionaryDataControlData::GetDataN(void)
+{
+       AppLog("enter");
+
+       Queue* pData = null;
+       int dataSize = 50;
+
+       pData = new Queue();
+       pData->Construct(dataSize);
+
+       pData->Enqueue(*(new (std::nothrow) String(L"a")));
+       pData->Enqueue(*(new (std::nothrow) String(L"a: A or an is the indefinite article. It is used at the beginning of noun groups which refer to only one person or thing. The form an is used in front of words that begin with vowel sounds.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"able")));
+       pData->Enqueue(*(new (std::nothrow) String(L"able: Having the power, skill, means, or opportunity to do something.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"banana")));
+       pData->Enqueue(*(new (std::nothrow) String(L"banana: A banana is a long curved fruit which grows in clusters and has soft pulpy flesh and yellow skin when ripe.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"boss")));
+       pData->Enqueue(*(new (std::nothrow) String(L"boss: Your boss is the person in charge of the organization or department where you work.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"cake")));
+       pData->Enqueue(*(new (std::nothrow) String(L"cake: An item of soft sweet food made from a mixture of flour, fat, eggs, sugar, and other ingredients, baked and sometimes iced or decorated.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"door")));
+       pData->Enqueue(*(new (std::nothrow) String(L"door: A door is a piece of wood, glass, or metal, which is moved to open and close the entrance to a building, room, cupboard, or vehicle.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"echo")));
+       pData->Enqueue(*(new (std::nothrow) String(L"echo: An echo is a sound which is caused by a noise being reflected off a surface such as a wall.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"fox")));
+       pData->Enqueue(*(new (std::nothrow) String(L"fox: A fox is a wild animal which looks like a dog and has reddish-brown fur, a pointed face and ears, and a thick tail. Foxes eat smaller animals.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"gas")));
+       pData->Enqueue(*(new (std::nothrow) String(L"gas: Any substance like air that is neither a solid nor a liquid, for example hydrogen and oxygen are both gases.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"house")));
+       pData->Enqueue(*(new (std::nothrow) String(L"house: Building for people to live in, usually for one family.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"ice")));
+       pData->Enqueue(*(new (std::nothrow) String(L"ice: Frozen water, a brittle transparent crystalline solid.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"jacket")));
+       pData->Enqueue(*(new (std::nothrow) String(L"jacket: An outer garment extending either to the waist or the hips, typically having sleeves and a fastening down the front.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"kiss")));
+       pData->Enqueue(*(new (std::nothrow) String(L"kiss: If you kiss someone, you touch them with your lips to show affection or sexual desire, or to greet them or say goodbye.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"love")));
+       pData->Enqueue(*(new (std::nothrow) String(L"love: If you love someone, you feel romantically or sexually attracted to them, and they are very important to you.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"muse")));
+       pData->Enqueue(*(new (std::nothrow) String(L"muse: If you muse on something, you think about it, usually saying or writing what you are thinking at the same time.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"news")));
+       pData->Enqueue(*(new (std::nothrow) String(L"news: News is information about a recently changed situation or a recent event.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"notice")));
+       pData->Enqueue(*(new (std::nothrow) String(L"notice: If you notice something or someone, you become aware of them.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"oasis")));
+       pData->Enqueue(*(new (std::nothrow) String(L"oasis: An oasis is a small area in a desert where water and plants are found.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"ocean")));
+       pData->Enqueue(*(new (std::nothrow) String(L"ocean: A very large expanse of sea, in particular each of the main areas into which the sea is divided geographically.")));
+       pData->Enqueue(*(new (std::nothrow) String(L"pink")));
+       pData->Enqueue(*(new (std::nothrow) String(L"pink: Pink is the colour between red and white.")));
+
+       AppLog("exit");
+       return pData;
+}
diff --git a/project/src/DictionaryDataControlEntry.cpp b/project/src/DictionaryDataControlEntry.cpp
new file mode 100644 (file)
index 0000000..548444b
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// 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://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.
+//
+
+/**
+ * This file contains the Tizen application entry point.
+ */
+#include "DictionaryDataControl.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif // __cplusplus
+
+_EXPORT_ int OspMain(int argc, char* pArgv[]);
+
+/**
+ * The entry function of Tizen application called by the operating system.
+ */
+int
+OspMain(int argc, char* pArgv[])
+{
+       result r = E_SUCCESS;
+
+       AppLog("Application started.");
+       ArrayList args;
+       args.Construct();
+       for (int i = 0; i < argc; i++)
+       {
+               args.Add(*(new (std::nothrow) String(pArgv[i])));
+       }
+
+       r = Tizen::App::UiApp::Execute(DictionaryDataControl::CreateInstance, &args);
+       if (IsFailed(r))
+       {
+               AppLogException("Application execution failed-[%s].", GetErrorMessage(r));
+               r &= 0x0000FFFF;
+       }
+
+       args.RemoveAll(true);
+       AppLog("Application finished.");
+
+       return static_cast< int >(r);
+}
+#ifdef __cplusplus
+}
+#endif // __cplusplus
diff --git a/project/src/DictionaryDataControlFrame.cpp b/project/src/DictionaryDataControlFrame.cpp
new file mode 100644 (file)
index 0000000..a384acc
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// 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://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.
+//
+
+/**
+ * Name        : DictionaryDataControlFrame
+ * Version     :
+ * Vendor      :
+ * Description :
+ */
+
+
+#include "DictionaryDataControlFrame.h"
+
+DictionaryDataControlFrame::DictionaryDataControlFrame(void)
+{
+}
+
+DictionaryDataControlFrame::~DictionaryDataControlFrame(void)
+{
+}
+
+result
+DictionaryDataControlFrame::OnInitializing(void)
+{
+       return E_SUCCESS;
+}
+
+result
+DictionaryDataControlFrame::OnTerminating(void)
+{
+       return E_SUCCESS;
+}
diff --git a/project/src/FormFactory.cpp b/project/src/FormFactory.cpp
new file mode 100644 (file)
index 0000000..5ac760f
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// 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://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 <FUi.h>
+
+#include "FormFactory.h"
+#include "SelectDictionaryDataControlForm.h"
+#include "MapDataControlForm.h"
+#include "SqlDataControlForm.h"
+#include "ViewDescriptForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+FormFactory::FormFactory() {
+       // TODO Auto-generated constructor stub
+
+}
+
+FormFactory::~FormFactory() {
+       // TODO Auto-generated destructor stub
+}
+
+Form*
+FormFactory::CreateFormN(const String &formId, const SceneId &sceneId)
+{
+       Form* pNewForm = null;
+
+       if (formId == L"SelectDictionaryDataControlForm")
+       {
+               SelectDictionaryDataControlForm* pForm = new (std::nothrow) SelectDictionaryDataControlForm();
+               pForm->Initialize();
+               pNewForm = pForm;
+       }
+       else if (formId == L"ViewDescriptForm")
+       {
+               ViewDescriptForm* pForm = new (std::nothrow) ViewDescriptForm();
+               pForm->Initialize();
+
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               pSceneManager->AddSceneEventListener(sceneId, *pForm);
+
+               return pForm;
+       }
+       else if (formId == L"SqlDataControlForm")
+       {
+               SqlDataControlForm* pForm = new (std::nothrow) SqlDataControlForm();
+               pForm->Initialize();
+               pNewForm = pForm;
+               AppLog("SqlDataControlForm create is success");
+       }
+       else if (formId == L"MapDataControlForm")
+       {
+               MapDataControlForm* pForm = new (std::nothrow) MapDataControlForm();
+               pForm->Initialize();
+               pNewForm = pForm;
+       }
+
+       return pNewForm;
+}
+
diff --git a/project/src/MapDataControlForm.cpp b/project/src/MapDataControlForm.cpp
new file mode 100644 (file)
index 0000000..2f7e4c4
--- /dev/null
@@ -0,0 +1,404 @@
+//
+// 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://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 <FApp.h>
+#include <FIo.h>
+#include <FUiWindow.h>
+#include "MapDataControlForm.h"
+#include "ViewDescriptForm.h"
+#include "DictionaryDataControlData.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Io;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Graphics;
+
+
+MapDataControlForm::MapDataControlForm(void)
+       : __pMapDataControl(null)
+       , __pPopup(null)
+       , __pLabel(null)
+       , __currentSelectItemIndex(-1)
+{
+}
+
+MapDataControlForm::~MapDataControlForm(void)
+{
+       __map.RemoveAll(true);
+}
+
+bool
+MapDataControlForm::Initialize(void)
+{
+       Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+       TryReturn(LoadDictionary() == true, false, "LoadDictionary() failed.");
+
+       return true;
+}
+
+result
+MapDataControlForm::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+
+       SetFormBackEventListener(this);
+
+       Header* pHeader = GetHeader();
+       pHeader->SetTitleText(L"LIST OF WORDS");
+
+       ListView* pListView = new ListView();
+       pListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
+
+       pListView->SetItemProvider(*this);
+       pListView->AddListViewItemEventListener(*this);
+
+       AddControl(*pListView);
+
+       Footer* pFooter = GetFooter();
+       pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
+       pFooter->SetBackButton();
+
+       __pPopup = new Popup();
+       __pPopup->Construct(true, Dimension(600, 250));
+       __pPopup->SetTitleText(L"Please wait.");
+
+       Rectangle rect;
+       rect = __pPopup->GetClientAreaBounds();
+       __pLabel = new Label();
+       __pLabel->Construct(Rectangle(0, 0, rect.width, 80), L"Processing your request.");
+       __pLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
+
+       __pPopup->AddControl(*__pLabel);
+
+       return r;
+}
+
+result
+MapDataControlForm::OnTerminating(void)
+{
+       delete __pPopup;
+       return E_SUCCESS;
+}
+
+void
+MapDataControlForm::OnFormBackRequested(Form& source)
+{
+       AppLog("OnFormBackRequested.");
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       pSceneManager->GoBackward(BackwardSceneTransition());
+}
+
+void
+MapDataControlForm::ShowPopup(void)
+{
+       __pPopup->SetShowState(true);
+       __pPopup->Show();
+}
+
+void
+MapDataControlForm::HidePopup(void)
+{
+       if (__pPopup->GetWindowState() == WINDOW_STATE_ACTIVATED)
+       {
+               __pPopup->SetShowState(false);
+               Invalidate(true);
+       }
+}
+
+void
+MapDataControlForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
+{
+       AppLog("OnListViewItemStateChanged process MapDataControlForm.....%d:%d", index, __map.GetCount());
+       String* pWord = null;
+       String* pWordDescription = null;
+       String dataId(L"Dictionary");
+       RequestId reqId;
+       String key;
+
+       // get value
+       IEnumerator* pValueEnum = __map.GetValuesN(Integer(index));
+       TryReturnVoid(pValueEnum != null, "Not found MultiHashMap data!");
+
+       // show wait popup
+       ShowPopup();
+
+       result r = pValueEnum->MoveNext(); // word data
+       pWord = dynamic_cast< String* >(pValueEnum->GetCurrent());
+       r = pValueEnum->MoveNext(); // word description data
+       pWordDescription = dynamic_cast< String* >(pValueEnum->GetCurrent());
+
+       delete pValueEnum;
+
+       if (__pMapDataControl == null)
+       {
+               __pMapDataControl = AppManager::GetMapDataControlN(L"http://tizen.org/datacontrol/provider/DictionaryDataControlProvider");
+               if (__pMapDataControl == null)
+               {
+                       // hide the popup and show result message.
+                       HidePopup();
+                       MessageBox myMSGBox;
+                       myMSGBox.Construct(L"GetMapDataControlN", L"DictionaryDataControlProvider is not installed. Pls Install!!", MSGBOX_STYLE_OK, 0);
+                       // Call ShowAndWait
+                       int modalResult = 0;
+                       myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+                       return;
+               }
+       }
+
+       __pMapDataControl->SetMapDataControlResponseListener(this);
+
+       key.Append(pWord->GetPointer());
+
+       r = __pMapDataControl->AddValue(dataId, key, String(pWordDescription->GetPointer()), reqId); // Expect result data in response CB
+       if (IsFailed(r))
+       {
+               // hide the popup and show result message.
+               HidePopup();
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"MapDataControl::AddValue", L"Request Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               return;
+       }
+
+       __currentSelectItemIndex = index;
+}
+
+bool
+MapDataControlForm::LoadDictionary(void)
+{
+       String* pWord = null;
+       String* pDescription = null;
+       int index = 0;
+       bool ret = true;
+
+       DictionaryDataControlData* pDictionaryDataControlData = new (std::nothrow) DictionaryDataControlData();
+       TryReturn(pDictionaryDataControlData != null, false, "out of memory");
+
+       Queue* pData = pDictionaryDataControlData->GetDataN();
+       TryCatch(pData != null, ret = false, "out of memory");
+
+       __map.Construct();
+
+       while (pData->GetCount())
+       {
+               pWord = dynamic_cast< String* >(pData->Dequeue());
+               TryCatch(pWord != null, ret = false, "word not found");
+
+               pDescription = dynamic_cast< String* >(pData->Dequeue());
+               TryCatch(pDescription != null, ret = false, "word Description not found");
+
+               Integer* pKey = new (std::nothrow) Integer(index);
+               TryCatch(pKey != null, ret = false, "new Integer(int) is null");
+               __map.Add(*pKey, *(pWord));
+               __map.Add(*pKey, *(pDescription));
+
+               index++;
+       }
+
+// fall through
+CATCH:
+       delete pData;
+       delete pDictionaryDataControlData;
+       return ret;
+}
+
+int
+MapDataControlForm::GetItemCount(void)
+{
+       int itemCount = 0;
+       IList* pList = __map.GetKeysN();
+       AppAssert(pList);
+       itemCount = pList->GetCount();
+       delete pList;
+       return itemCount;
+}
+
+Tizen::Ui::Controls::ListItemBase*
+MapDataControlForm::CreateItem(int index, int itemWidth)
+{
+       ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+       result r;
+       CustomItem* pItem = null;
+
+       // get value
+       IEnumerator* pValueEnum = __map.GetValuesN(Integer(index));
+       TryReturn(pValueEnum != null, null, "Not found MultiHashMap data!");
+
+       String* pStrWord = null;
+
+       // get values
+       if (pValueEnum->MoveNext() == E_SUCCESS)
+       {
+               pStrWord = dynamic_cast< String* >(pValueEnum->GetCurrent());
+
+               pItem = new (std::nothrow) CustomItem();
+               TryCatch(pItem != null, , "new CustomItem() is null");
+               r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112), style);
+               TryCatch(!IsFailed(r), , "CustomItem::Construct() failed with %s", GetErrorMessage(r));
+
+               r = pItem->AddElement(Rectangle(26, 32, 200, 80), 0, *pStrWord, false);
+               TryCatch(!IsFailed(r), , "CustomItem::AddElement() failed with %s", GetErrorMessage(r));
+       }
+       else
+       {
+               AppLog("!!!!!!!!!!!!!!_pValueEnum->MoveNext() Failed!!!!!!!!");
+       }
+
+       delete pValueEnum;
+       return pItem;
+
+CATCH:
+       delete pValueEnum;
+       delete pItem;
+       return null;
+}
+
+bool
+MapDataControlForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
+{
+       delete pItem;
+       pItem = null;
+       return true;
+}
+
+void
+MapDataControlForm::OnMapDataControlGetValueResponseReceived(RequestId reqId, const String& providerId,
+                                                                                                                        const String& dataId, Tizen::Base::Collection::IList& resultValueList, bool providerResult, const String* pErrorMsg)
+{
+       String* pResultVal = null;
+
+       // hide the popup.
+       HidePopup();
+
+       // show result message (word description on success or error message).
+       if (providerResult == false)
+       {
+               AppLog("ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"MapDataControl::GetValue", L"Response Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               return;
+       }
+
+       if (resultValueList.GetCount() > 0)
+       {
+               pResultVal = dynamic_cast< String* >(resultValueList.GetAt(0));
+               TryReturnVoid(pResultVal != null, "pResultVal is null.");
+
+               LinkedList* pList = new LinkedList();
+               pList->Add(*(new String(*pResultVal)));
+
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               pSceneManager->GoForward(ForwardSceneTransition(L"ViewDescriptScene"), pList);
+
+               // Remove the key
+
+               RequestId removeValReqId;
+               result r = E_SUCCESS;
+
+               IEnumerator* pValueEnum = __map.GetValuesN(Integer(__currentSelectItemIndex));
+               TryReturnVoid(pValueEnum != null, "Not found MultiHashMap data!.");
+
+               r = pValueEnum->MoveNext(); // word data
+               String* pWord = dynamic_cast< String* >(pValueEnum->GetCurrent());
+
+               r = pValueEnum->MoveNext(); // word description data
+               String* pWordDesc = dynamic_cast< String* >(pValueEnum->GetCurrent());
+
+               delete pValueEnum;
+
+               r = __pMapDataControl->RemoveValue(L"Dictionary", String(pWord->GetPointer()), String(pWordDesc->GetPointer()), removeValReqId);
+               TryLog(!IsFailed(r), "RemoveValue failed with %s", GetErrorMessage(r));
+       }
+       else
+       {
+               AppLog("resultValueList is empty \n");
+       }
+
+}
+
+void
+MapDataControlForm::OnMapDataControlAddValueResponseReceived(RequestId reqId, const String& providerId,
+                                                                                                                        const String& dataId, bool providerResult, const String* pErrorMsg)
+{
+       RequestId getValReqId;
+       String* pWord = null;
+       String getValDataId(L"Dictionary");
+       String key;
+
+       if (providerResult == false)
+       {
+               AppLog("ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+
+               // hide the popup and show result message.
+               HidePopup();
+
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"MapDataControl::AddValue", L"Response Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               return;
+       }
+       // get value
+       IEnumerator* pValueEnum = __map.GetValuesN(Integer(__currentSelectItemIndex));
+       TryReturnVoid(pValueEnum != null, "Not found MultiHashMap data!");
+
+       result r = pValueEnum->MoveNext(); // word data
+       pWord = dynamic_cast< String* >(pValueEnum->GetCurrent());
+
+       delete pValueEnum;
+
+       // send GetValue request to read the word Description from DictionaryDataControlProvider and show it on WordDescriptionForm.
+       key.Append(pWord->GetPointer());
+
+       r = __pMapDataControl->GetValue(getValDataId, key, getValReqId, 1, 1); // Expect result data in response CB
+       if (IsFailed(r))
+       {
+               AppLog("ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+               // hide the popup and show result message.
+               HidePopup();
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"MapDataControl::GetValue", L"Request Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+       }
+}
+
+void
+MapDataControlForm::OnMapDataControlSetValueResponseReceived(RequestId reqId, const String& providerId,
+                                                                                                                        const String& dataId, bool providerResult, const String* pErrorMsg)
+{
+       TryLog(providerResult == true, "ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+}
+
+void
+MapDataControlForm::OnMapDataControlRemoveValueResponseReceived(RequestId reqId, const String& providerId,
+                                                                                                                               const String& dataId, bool providerResult, const String* pErrorMsg)
+{
+       TryLog(providerResult == true, "ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+}
diff --git a/project/src/SelectDictionaryDataControlForm.cpp b/project/src/SelectDictionaryDataControlForm.cpp
new file mode 100644 (file)
index 0000000..6c343fd
--- /dev/null
@@ -0,0 +1,124 @@
+//
+// 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://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 "SelectDictionaryDataControlForm.h"
+#include "SqlDataControlForm.h"
+#include "MapDataControlForm.h"
+
+#include <FApp.h>
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui::Scenes;
+
+
+SelectDictionaryDataControlForm::SelectDictionaryDataControlForm(void)
+       : __pPanel(null)
+{
+}
+
+SelectDictionaryDataControlForm::~SelectDictionaryDataControlForm(void)
+{
+}
+
+bool
+SelectDictionaryDataControlForm::Initialize(void)
+{
+       result r = Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+       TryReturn(!IsFailed(r), false, "form::Construct failed with %s", GetErrorMessage(r));
+       return true;
+}
+
+result
+SelectDictionaryDataControlForm::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+
+       Header* pHeader = GetHeader();
+       pHeader->SetTitleText(L"DICTIONARY DataControl");
+
+       Footer* pFooter = GetFooter();
+       if (pFooter != null)
+       {
+               pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
+               pFooter->SetBackButton();
+               SetFormBackEventListener(this);
+       }
+
+       CreateUserSelectionPanel();
+
+       __pPanel->SetShowState(true);
+
+       return r;
+}
+
+void
+SelectDictionaryDataControlForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       AppAssert(pSceneManager);
+
+       switch (actionId)
+       {
+       case SELECT_SQL_DATACONTROL:
+               pSceneManager->GoForward(ForwardSceneTransition(L"SqlDataControlScene"));
+               break;
+       case SELECT_MAP_DATACONTROL:
+               pSceneManager->GoForward(ForwardSceneTransition(L"MapDataControlScene"));
+               break;
+       default:
+               AppLog("action id error");
+               break;
+       }
+}
+
+void
+SelectDictionaryDataControlForm::CreateUserSelectionPanel(void)
+{
+       Rectangle clientRect = GetClientAreaBounds();
+       Rectangle rect(0, 0, clientRect.width, clientRect.height);
+
+       __pPanel = new (std::nothrow) Panel();
+       TryReturnVoid(__pPanel != null, "new (std::nothrow) __pPanel() is null");
+       __pPanel->Construct(rect);
+       AddControl(*__pPanel);
+
+       Button* pButton = null;
+       pButton = new (std::nothrow) Button;
+       TryReturnVoid(pButton != null, "new (std::nothrow) Button() is null");
+       pButton->Construct(Rectangle(70, 100, clientRect.width - 140, 74), L"Using SQL-DataControl");
+       pButton->SetActionId(SELECT_SQL_DATACONTROL);
+       pButton->AddActionEventListener(*this);
+       __pPanel->AddControl(*pButton);
+
+       pButton = new (std::nothrow) Button;
+       TryReturnVoid(pButton != null, "new (std::nothrow) Button() is null");
+       pButton->Construct(Rectangle(70, 212, clientRect.width - 140, 74), L"Using MAP-DataControl");
+       pButton->SetActionId(SELECT_MAP_DATACONTROL);
+       pButton->AddActionEventListener(*this);
+       __pPanel->AddControl(*pButton);
+}
+
+void
+SelectDictionaryDataControlForm::OnFormBackRequested(Form& source)
+{
+       UiApp* pApp = UiApp::GetInstance();
+       AppAssert(pApp);
+       pApp->Terminate();
+}
diff --git a/project/src/SqlDataControlForm.cpp b/project/src/SqlDataControlForm.cpp
new file mode 100644 (file)
index 0000000..84fa13c
--- /dev/null
@@ -0,0 +1,403 @@
+//
+// 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://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 <FApp.h>
+#include <FIo.h>
+#include <FUiWindow.h>
+#include "SqlDataControlForm.h"
+#include "ViewDescriptForm.h"
+#include "DictionaryDataControlData.h"
+
+using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Io;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Graphics;
+
+static const int _MAX_DB_COLUMNS = 2;
+
+SqlDataControlForm::SqlDataControlForm(void)
+       : __pSqlDataControl(null)
+       , __pPopup(null)
+       , __pLabel(null)
+       , __lastInsertRowId(-1)
+{
+}
+
+SqlDataControlForm::~SqlDataControlForm(void)
+{
+       __wordMap.RemoveAll(true);
+       __wordDescMap.RemoveAll(true);
+       delete __pSqlDataControl;
+}
+
+bool
+SqlDataControlForm::Initialize(void)
+{
+       Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+       TryReturn(LoadDictionary() == true, false, "LoadDictionary() failed.");
+
+       return true;
+}
+
+result
+SqlDataControlForm::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+
+       SetFormBackEventListener(this);
+
+       Header* pHeader = GetHeader();
+       pHeader->SetTitleText(L"LIST OF WORDS");
+
+       ListView* pListView = new ListView();
+       pListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
+
+       pListView->SetItemProvider(*this);
+       pListView->AddListViewItemEventListener(*this);
+
+       AddControl(*pListView);
+
+       Footer* pFooter = GetFooter();
+       pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
+       pFooter->SetBackButton();
+
+       __pPopup = new Popup();
+       __pPopup->Construct(true, Dimension(600, 250));
+       __pPopup->SetTitleText(L"Please wait.");
+
+       Rectangle rect;
+       rect = __pPopup->GetClientAreaBounds();
+       __pLabel = new Label();
+       __pLabel->Construct(Rectangle(0, 0, rect.width, 80), L"Processing your request.");
+       __pLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
+
+       __pPopup->AddControl(*__pLabel);
+
+       return r;
+}
+
+result
+SqlDataControlForm::OnTerminating(void)
+{
+       delete __pPopup;
+       return E_SUCCESS;
+}
+
+void
+SqlDataControlForm::OnFormBackRequested(Form& source)
+{
+       AppLog("OnFormBackRequested.");
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       pSceneManager->GoBackward(BackwardSceneTransition());
+}
+
+void
+SqlDataControlForm::ShowPopup(void)
+{
+       __pPopup->SetShowState(true);
+       __pPopup->Show();
+}
+
+void
+SqlDataControlForm::HidePopup(void)
+{
+       if (__pPopup->GetWindowState() == WINDOW_STATE_ACTIVATED)
+       {
+               __pPopup->SetShowState(false);
+               Invalidate(true);
+       }
+}
+
+void
+SqlDataControlForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
+{
+       RequestId insertReqId;
+       HashMap* pInsertMap = null;
+       String columnNames[_MAX_DB_COLUMNS] =
+       {
+               L"WORD",
+               L"WORD_DESC"
+       };
+
+       String wordDescription;
+       String word;
+
+       result r = E_SUCCESS;
+
+       // show wait popup
+       ShowPopup();
+
+       if (__pSqlDataControl == null)
+       {
+               // send insert command
+               __pSqlDataControl = AppManager::GetSqlDataControlN(L"http://tizen.org/datacontrol/provider/DictionaryDataControlProvider");
+               if (__pSqlDataControl == null)
+               {
+                       // hide the popup and show result message.
+                       HidePopup();
+                       AppLog("GetSqlDataControlN() Failed");
+                       MessageBox myMSGBox;
+                       myMSGBox.Construct(L"GetSqlDataControlN", L"DictionaryDataControlProvider is not installed. Pls Install!!", MSGBOX_STYLE_OK, 0);
+                       // Call ShowAndWait
+                       int modalResult = 0;
+                       myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+                       return;
+               }
+       }
+       __pSqlDataControl->SetSqlDataControlResponseListener(this);
+
+       pInsertMap = new (std::nothrow) HashMap();
+       TryReturnVoid(pInsertMap != null, "new HashMap() is null");
+
+       r = pInsertMap->Construct(); // construct with default capacity
+       TryCatch(!IsFailed(r), , "HashMap::Construct() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+
+       word.Format(10, L"'%ls'", (dynamic_cast< String* >(__wordMap.GetValue(Integer(index))))->GetPointer());
+       r = pInsertMap->Add(*new (std::nothrow) String(columnNames[0]), *new (std::nothrow) String(word));
+       TryCatch(!IsFailed(r), , "HashMap::Add() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+
+       wordDescription.Format(1024, L"'%ls'", (dynamic_cast< String* >(__wordDescMap.GetValue(Integer(index))))->GetPointer());
+       r = pInsertMap->Add(*new (std::nothrow) String(columnNames[1]), *new (std::nothrow) String(wordDescription));
+       TryCatch(!IsFailed(r), , "HashMap::Add() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+
+       r = __pSqlDataControl->Insert(L"Dictionary", *pInsertMap, insertReqId); // Expect result data in response CB
+       if (IsFailed(r))
+       {
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"SqlDataControl::Insert", L"Request Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               goto CATCH;
+       }
+
+       AppLog("insertReqId:%d", insertReqId);
+
+       pInsertMap->RemoveAll(true);
+       delete pInsertMap;
+
+       return;
+
+CATCH:
+       // hide the popup and show result message.
+       HidePopup();
+       if (pInsertMap != null)
+       {
+               pInsertMap->RemoveAll(true);
+               delete pInsertMap;
+       }
+}
+
+int
+SqlDataControlForm::GetItemCount(void)
+{
+       int itemCount = 0;
+       IList* pList = __wordMap.GetKeysN();
+       AppAssert(pList);
+       itemCount = pList->GetCount();
+       delete pList;
+       return itemCount;
+}
+
+ListItemBase*
+SqlDataControlForm::CreateItem(int index, int itemWidth)
+{
+       ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+       result r;
+       String* pWord = null;
+
+       CustomItem* pItem = new (std::nothrow) CustomItem();
+       TryReturn(pItem != null, null, "new CustomItem() is null");
+       pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112), style);
+       pWord = dynamic_cast< String* >(__wordMap.GetValue(Integer(index)));
+       r = pItem->AddElement(Rectangle(26, 32, 200, 80), 0, *pWord, false);
+       TryLog(!IsFailed(r), "CustomItem::AddElement() is failed by %s", GetErrorMessage(r));
+
+       return pItem;
+}
+
+bool
+SqlDataControlForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
+{
+       delete pItem;
+       pItem = null;
+       return true;
+}
+
+bool
+SqlDataControlForm::LoadDictionary(void)
+{
+       int index = 0;
+       bool ret = true;
+
+       DictionaryDataControlData* pDictionaryDataControlData = new (std::nothrow) DictionaryDataControlData();
+       TryReturn(pDictionaryDataControlData != null, false, "out of memory");
+
+       Queue* pData = pDictionaryDataControlData->GetDataN();
+       TryCatch(pData != null, ret = false, "out of memory");
+
+       __wordMap.Construct();
+
+       __wordDescMap.Construct();
+
+       while (pData->GetCount())
+       {
+               __wordMap.Add(*(new (std::nothrow) Integer(index)), *(dynamic_cast< String* >(pData->Dequeue())));
+               __wordDescMap.Add(*(new (std::nothrow) Integer(index)), *(dynamic_cast< String* >(pData->Dequeue())));
+               index++;
+       }
+
+       // fall through
+CATCH:
+       delete pData;
+       delete pDictionaryDataControlData;
+       return ret;
+}
+
+void
+SqlDataControlForm::OnSqlDataControlInsertResponseReceived(RequestId reqId, const String& providerId, const String& dataId,
+               long long insertRowId, bool providerResult, const String* pErrorMsg)
+{
+       AppLog("Tizen::Io >> reqId: %d, providerId: %ls, dataId: %ls, providerResult: %d",
+                  reqId, providerId.GetPointer(), dataId.GetPointer(), providerResult);
+
+       if (providerResult == false)
+       {
+               AppLog("SqlDataControl::Insert() failed. ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+
+               // hide the popup and show result message.
+               HidePopup();
+
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"SqlDataControl::Insert", L"Response Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               return;
+       }
+       else // on success
+       {
+               // send Select request to read the word Description from DictionaryDataControlProvider and show it on WordDescriptionForm.
+               String where;
+               RequestId selectReqId;
+               ArrayList* pColumnList = null;
+               String columnNames[_MAX_DB_COLUMNS] =
+               {
+                       L"WORD",
+                       L"WORD_DESC"
+               };
+
+               __lastInsertRowId = insertRowId;
+
+               AppLog("insertRowId: %lld", insertRowId);
+
+               pColumnList = new (std::nothrow) ArrayList();
+               TryReturnVoid(pColumnList != null, "new ArrayList() is null.");
+
+               result r = pColumnList->Add(*new String(columnNames[1]));
+               TryCatch(!IsFailed(r), , "ArrayList::Add() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+
+               where.Format(10, L"rowid=%lld", __lastInsertRowId);
+
+               r = __pSqlDataControl->Select(L"Dictionary", pColumnList, &where, null, selectReqId, 1, 1);
+               if (IsFailed(r))
+               {
+                       AppLog("SqlDataControl::Select() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+                       // hide the popup and show result message.
+                       HidePopup();
+                       MessageBox myMSGBox;
+                       myMSGBox.Construct(L"SqlDataControl::Select", L"Request Failed!!", MSGBOX_STYLE_OK, 0);
+                       // Call ShowAndWait
+                       int modalResult = 0;
+                       myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               }
+
+               // fall thru
+CATCH:
+               AppLog("selectReqId:%d", selectReqId);
+               pColumnList->RemoveAll(true);
+               delete pColumnList;
+       }
+}
+
+void
+SqlDataControlForm::OnSqlDataControlSelectResponseReceived(RequestId reqId, const String& providerId, const String& dataId, IDbEnumerator& resultSetEnum,
+                                                                                                                  bool providerResult, const String* pErrorMsg)
+{
+       result ret = E_SUCCESS;
+       result r = E_SUCCESS;
+
+       AppLog("Tizen::Io >> reqId: %d, providerId: %ls, dataId: %ls, providerResult: %d",
+                  reqId, providerId.GetPointer(), dataId.GetPointer(), providerResult);
+
+       // hide the popup.
+       HidePopup();
+
+       // show result message (word description on success or error message).
+       if (providerResult == false)
+       {
+               AppLog("SqlDataControl::Select() failed. ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+               MessageBox myMSGBox;
+               myMSGBox.Construct(L"SqlDataControl::Select", L"Response Failed!!", MSGBOX_STYLE_OK, 0);
+               // Call ShowAndWait
+               int modalResult = 0;
+               myMSGBox.ShowAndWait(modalResult);  //ShowAndWait() draw, show itself and process events
+               return;
+       }
+
+       r = resultSetEnum.MoveNext();
+       if (r == E_SUCCESS)
+       {
+               String wordDescription;
+
+               ret = resultSetEnum.GetStringAt(0, wordDescription);
+               TryReturnVoid(!IsFailed(ret), "GetStringAt() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(ret));
+
+               LinkedList* pList = new LinkedList();
+               pList->Add(*(new String(wordDescription)));
+
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               pSceneManager->GoForward(ForwardSceneTransition(L"ViewDescriptScene"), pList);
+
+               // send delete request
+               RequestId delReqId;
+               String where;
+
+               where.Format(10, L"rowid=%lld", __lastInsertRowId);
+               r = __pSqlDataControl->Delete(L"Dictionary", &where, delReqId);
+               TryReturnVoid(!IsFailed(r), "Delete() failed to return E_SUCCESS, instead %s occured \n", GetErrorMessage(r));
+       }
+
+       return;
+}
+
+void
+SqlDataControlForm::OnSqlDataControlUpdateResponseReceived(RequestId reqId, const String& providerId, const String& dataId, bool providerResult, const String* pErrorMsg)
+{
+       TryLog(providerResult == true, "ErrorMsg (%ls). \n", pErrorMsg->GetPointer());
+}
+
+void
+SqlDataControlForm::OnSqlDataControlDeleteResponseReceived(RequestId reqId, const String& providerId, const String& dataId, bool providerResult, const String* pErrorMsg)
+{
+       TryLog(providerResult == true, "reqId(%d) ErrorMsg (%ls). \n", reqId, pErrorMsg->GetPointer());
+}
diff --git a/project/src/ViewDescriptForm.cpp b/project/src/ViewDescriptForm.cpp
new file mode 100644 (file)
index 0000000..0791f40
--- /dev/null
@@ -0,0 +1,123 @@
+//
+// 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://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 "ViewDescriptForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui::Scenes;
+
+
+ViewDescriptForm::ViewDescriptForm(void)
+{
+}
+
+ViewDescriptForm::~ViewDescriptForm(void)
+{
+}
+
+result
+ViewDescriptForm::Construct(String* pStr)
+{
+       __strDescription = *pStr;
+
+       Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+       EditArea* pEaEditor = new (std::nothrow) EditArea;
+       TryReturn(pEaEditor != null, E_OUT_OF_MEMORY, "new EditArea() is null");
+
+       Rectangle rect = Rectangle(10, 10, GetClientAreaBounds().width - 20, GetClientAreaBounds().height - 15);
+       result r = pEaEditor->Construct(rect);
+       TryReturn(r == E_SUCCESS, r, "FileViewForm - EditArea::Construct() is failed by %s", GetErrorMessage(r));
+
+       pEaEditor->SetKeypadEnabled(false);
+       pEaEditor->SetEnabled(false);
+
+       r = AddControl(*pEaEditor);
+       TryReturn(r == E_SUCCESS, r, "FileViewForm - AddControl() is failed by %s", GetErrorMessage(r));
+
+       pEaEditor->SetText(__strDescription);
+
+       return E_SUCCESS;
+}
+
+bool
+ViewDescriptForm::Initialize(void)
+{
+       Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+       return true;
+}
+
+result
+ViewDescriptForm::OnInitializing(void)
+{
+       result r = E_SUCCESS;
+
+       SetFormBackEventListener(this);
+
+       EditArea* pEaEditor = new (std::nothrow) EditArea;
+
+       Rectangle rect = Rectangle(10, 10, GetClientAreaBounds().width - 20, GetClientAreaBounds().height - 15);
+       pEaEditor->Construct(rect);
+
+       pEaEditor->SetKeypadEnabled(false);
+
+       AddControl(*pEaEditor);
+
+       pEaEditor->SetText(__strDescription);
+
+       Header* pHeader = GetHeader();
+       pHeader->SetTitleText(L"DESCRIPTION");
+
+       Footer* pFooter = GetFooter();
+       pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
+       pFooter->SetBackButton();
+
+       return r;
+}
+
+void
+ViewDescriptForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       pSceneManager->GoBackward(BackwardSceneTransition());
+}
+
+void
+ViewDescriptForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                          const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+       if (pArgs != null)
+       {
+               __strDescription = *((String*)pArgs->GetAt(0));
+
+               EditArea* pEaEditor = static_cast<EditArea*>(GetControl(0));
+               pEaEditor->SetText(__strDescription);
+
+               pArgs->RemoveAll(true);
+               delete pArgs;
+       }
+}
+
+void
+ViewDescriptForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                               const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+
+}
diff --git a/sample.xml b/sample.xml
new file mode 100644 (file)
index 0000000..5b02d4e
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template>
+
+       <slp-property>
+               <property-group>
+                       <sample-name>DictionaryDataControl</sample-name>
+                       <category>Sample</category>
+                       <sdk-version>1.00</sdk-version>
+                       <project-type>org.tizen.nativecpp.buildArtefactType.app</project-type>
+                       <sample-description>description.xml</sample-description>
+               </property-group>
+       </slp-property>
+
+       <process type="org.tizen.nativeappcommon.TizenCopyFolder">
+               <simple name="projectName" value="$(projectName)"/>
+               <simple name="folderPath" value="project"/>
+               <complex-array name="replaceableFiles">
+                 <element>
+                               <simple name="sourcePath" value="manifest.xml"/>
+                               <simple name="targetPath" value="manifest.xml"/>
+                               <simple name="replaceable" value = "true"/>
+                       </element>
+               </complex-array>
+       </process>
+       <process type="org.tizen.nativecpp.SetDefaultFrameworks">
+               <simple name="projectName" value="$(projectName)"/>
+               <complex-array name="frameworkList">
+                       <element>
+                               <simple name="framework" value="osp"/>
+                       </element>
+               </complex-array>
+       </process>
+
+</template>
diff --git a/screenshot.png b/screenshot.png
new file mode 100644 (file)
index 0000000..ad075ba
Binary files /dev/null and b/screenshot.png differ