From 5f49bb01d6610c8d3d73b1f22689ded6b891af36 Mon Sep 17 00:00:00 2001 From: HyungKyu Song Date: Fri, 15 Feb 2013 15:11:45 +0900 Subject: [PATCH] Tizen 2.0 Release --- LICENSE | 206 +++++++++ NOTICE | 4 + description.xml | 11 + project/data/continents.xml | 23 + project/data/map.xml | 23 + project/data/tizen.html | 17 + project/inc/FormFactory.h | 21 + project/inc/HtmlParser.h | 73 +++ project/inc/MainListForm.h | 51 ++ project/inc/XmlParser.h | 83 ++++ project/inc/XmlParserApp.h | 74 +++ project/inc/XmlReader.h | 70 +++ project/inc/XmlWriter.h | 72 +++ project/manifest.xml | 30 ++ project/res/eng-GB.xml | 5 + project/res/screen-size-normal/IDF_FORM1.xml | 24 + project/shared/data/nofile.dummy | 0 .../shared/res/screen-density-xhigh/mainmenu.png | Bin 0 -> 17581 bytes project/shared/trusted/nofile.dummy | 0 project/src/FormFactory.cpp | 63 +++ project/src/HtmlParser.cpp | 203 ++++++++ project/src/MainListForm.cpp | 112 +++++ project/src/XmlParser.cpp | 511 +++++++++++++++++++++ project/src/XmlParserApp.cpp | 103 +++++ project/src/XmlParserAppEntry.cpp | 60 +++ project/src/XmlReader.cpp | 201 ++++++++ project/src/XmlWriter.cpp | 297 ++++++++++++ sample.xml | 34 ++ screenshot.png | Bin 0 -> 8765 bytes 29 files changed, 2371 insertions(+) create mode 100644 LICENSE create mode 100644 NOTICE create mode 100755 description.xml create mode 100755 project/data/continents.xml create mode 100755 project/data/map.xml create mode 100755 project/data/tizen.html create mode 100644 project/inc/FormFactory.h create mode 100755 project/inc/HtmlParser.h create mode 100755 project/inc/MainListForm.h create mode 100755 project/inc/XmlParser.h create mode 100644 project/inc/XmlParserApp.h create mode 100755 project/inc/XmlReader.h create mode 100755 project/inc/XmlWriter.h create mode 100644 project/manifest.xml create mode 100755 project/res/eng-GB.xml create mode 100755 project/res/screen-size-normal/IDF_FORM1.xml create mode 100644 project/shared/data/nofile.dummy create mode 100755 project/shared/res/screen-density-xhigh/mainmenu.png create mode 100644 project/shared/trusted/nofile.dummy create mode 100644 project/src/FormFactory.cpp create mode 100644 project/src/HtmlParser.cpp create mode 100755 project/src/MainListForm.cpp create mode 100644 project/src/XmlParser.cpp create mode 100644 project/src/XmlParserApp.cpp create mode 100644 project/src/XmlParserAppEntry.cpp create mode 100644 project/src/XmlReader.cpp create mode 100644 project/src/XmlWriter.cpp create mode 100755 sample.xml create mode 100755 screenshot.png diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..917b21e --- /dev/null +++ b/LICENSE @@ -0,0 +1,206 @@ +Flora License + +Version 1.0, May, 2012 + +http://www.tizenopensource.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://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. + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..3997999 --- /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 file for Flora License terms and conditions. + diff --git a/description.xml b/description.xml new file mode 100755 index 0000000..cc326b9 --- /dev/null +++ b/description.xml @@ -0,0 +1,11 @@ + + + + + XmlParserApp + 1.0 + screenshot.png + + This sample application demonstrates the features supported by Tizen XML. + + diff --git a/project/data/continents.xml b/project/data/continents.xml new file mode 100755 index 0000000..9be078d --- /dev/null +++ b/project/data/continents.xml @@ -0,0 +1,23 @@ + + + + + + South Korea + Seoul + Won + + + + France + Paris + Euro + + + + Canada + Ottawa + Dollar + + + \ No newline at end of file diff --git a/project/data/map.xml b/project/data/map.xml new file mode 100755 index 0000000..c305faf --- /dev/null +++ b/project/data/map.xml @@ -0,0 +1,23 @@ + + + + + United Arab Emirates + Abu Dhabi + + + + Nigeria + Abuja + + + + Ghana + Accra + + + + Pitcairn Islands + Adamstown + + \ No newline at end of file diff --git a/project/data/tizen.html b/project/data/tizen.html new file mode 100755 index 0000000..1b27e5d --- /dev/null +++ b/project/data/tizen.html @@ -0,0 +1,17 @@ + + + + +

Tizen Store

+


+


+ +
+Entertainment!
+Games!
+Social!
+Widgets!
+Education!
+Navigation!
+
+ diff --git a/project/inc/FormFactory.h b/project/inc/FormFactory.h new file mode 100644 index 0000000..0be8e11 --- /dev/null +++ b/project/inc/FormFactory.h @@ -0,0 +1,21 @@ +/* + * FormFactory.h + * + * Created on: Sep 25, 2012 + * Author: lsw2000.lee + */ + +#ifndef _FORM_FACTORY_H_ +#define _FORM_FACTORY_H_ + +#include + +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 /* _FORM_FACTORY_H_ */ diff --git a/project/inc/HtmlParser.h b/project/inc/HtmlParser.h new file mode 100755 index 0000000..8a46f2a --- /dev/null +++ b/project/inc/HtmlParser.h @@ -0,0 +1,73 @@ +// +// 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 _HTML_PARSER_H_ +#define _HTML_PARSER_H_ + +#include +#include + +#include +#include +#include + +class HtmlParser + : public Tizen::Ui::Controls::Form + , public Tizen::Ui::Controls::IListViewItemEventListener + , public Tizen::Ui::Controls::IListViewItemProvider + , public Tizen::Ui::IActionEventListener + , public Tizen::Ui::Controls::IFormBackEventListener +{ +public: + HtmlParser(void); + virtual ~HtmlParser(void); + + bool Initialize(void); + + void RunHtmlParser(void); + void ExtractHyperLinks(htmlNodePtr pRoot); + virtual result OnInitializing(void); + virtual result OnTerminating(void); + + //IActionEventListener + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + + // IListViewItemEventListener + virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state); + virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status); + 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); + + //IFormBackEventListener + virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + +protected: + Tizen::Ui::Controls::ListView* _pList; + Tizen::Base::Collection::ArrayList* _pItemList; + +private: + static const int LIST_WIDTH = 720; + static const int LIST_HEIGHT = 640; + + static const int ITEM_HEIGHT = 112; +}; + +#endif //_HTML_PARSER_H_ diff --git a/project/inc/MainListForm.h b/project/inc/MainListForm.h new file mode 100755 index 0000000..bfb1fef --- /dev/null +++ b/project/inc/MainListForm.h @@ -0,0 +1,51 @@ +// +// 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 _MAINLISTFORM_H_ +#define _MAINLISTFORM_H_ + +#include +#include + +class MainListForm + : public Tizen::Ui::Controls::Form + , public Tizen::Ui::IActionEventListener +{ +public: + MainListForm(void); + virtual ~MainListForm(void); + bool Initialize(void); + + virtual result OnInitializing(void); + virtual result OnTerminating(void); + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + +protected: + static const int ID_BUTTON_XMLReader = 102; + static const int ID_BUTTON_HTMLParser = 103; + static const int ID_BUTTON_XMLParser = 104; + static const int ID_BUTTON_XMLWriter = 105; + +private: + static const int BUTTON_LEFT_RIGHT_MARGIN = 128; + static const int BUTTON_TOP_MARGIN = 112; + static const int BUTTON_BOTTOM_MARGIN = 38; + static const int BUTTON_WIDTH = 480; + static const int BUTTON_HEIGHT = 74; +}; + +#endif //_MAINLISTFORM_H_ diff --git a/project/inc/XmlParser.h b/project/inc/XmlParser.h new file mode 100755 index 0000000..2c137f9 --- /dev/null +++ b/project/inc/XmlParser.h @@ -0,0 +1,83 @@ +// +// 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 _XML_PARSER_H_ +#define _XML_PARSER_H_ + +#include +#include + +class XmlParser + : public Tizen::Ui::Controls::Form + , public Tizen::Ui::Controls::IListViewItemEventListener + , public Tizen::Ui::Controls::IListViewItemProvider + , public Tizen::Ui::IActionEventListener + , public Tizen::Ui::Controls::IFormBackEventListener +{ +public: + XmlParser(void); + virtual ~XmlParser(void); + bool Initialize(void); + + virtual result OnInitializing(void); + virtual result OnTerminating(void); + + result SAXParse(void); + result SAXParseMemory(void); + + //IActionEventListener + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + + // IListViewItemEventListener + virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state); + virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status); + 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); + + //IFormBackEventListener + virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + + bool IsFound(void){ return __found;} + bool IsCheckContent(void){ return __checkContent;} + bool IsPrintCapital(void){ return __printCapital;} + void SetFound(bool found){ __found = found;} + void SetCheckContent(bool checkContent){ __checkContent = checkContent;} + void SetPrintCapital(bool printCapital){ __printCapital = printCapital;} + +private: + static const int LABEL_WIDTH = 330; + static const int LABEL_HEIGHT = 96; + static const int LABEL_BOTTOM_MARGIN = 64; + + static const int LIST_HEIGHT = 640; + + static const int ITEM_HEIGHT = 112; + + bool __found; + bool __checkContent; + bool __printCapital; + Tizen::Ui::Controls::ListView* __pList; + Tizen::Base::Collection::ArrayList* __pItemList; + Tizen::Ui::Controls::Label* __pLabel; + Tizen::Base::String __filePath; + Tizen::Base::ByteBuffer* __pPath; +}; + +#endif //_XML_PARSER_H_ diff --git a/project/inc/XmlParserApp.h b/project/inc/XmlParserApp.h new file mode 100644 index 0000000..f9de4c7 --- /dev/null +++ b/project/inc/XmlParserApp.h @@ -0,0 +1,74 @@ +// +// 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 _XML_PARSER_APP_H_ +#define _XML_PARSER_APP_H_ + +#include +#include +#include +#include + +/** + * [XmlParserApp] application must inherit from Application class + * which provides basic features necessary to define an application. + */ +class XmlParserApp + : public Tizen::App::Application + , public Tizen::System::IScreenEventListener +{ +public: + /** + * [XmlParserApp] application must have a factory method that creates an instance of itself. + */ + static Tizen::App::Application* CreateInstance(void); + + +public: + XmlParserApp(void); + ~XmlParserApp(void); + + +public: + // Called when the application is initializing. + virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry); + + // Called when the application is terminating. + virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false); + + + // Called when the application's frame moves to the top of the screen. + virtual void OnForeground(void); + + + // Called when this application's frame is moved from top of the screen to the background. + virtual void OnBackground(void); + + // Called when the system memory is not sufficient to run the application any further. + virtual void OnLowMemory(void); + + // Called when the battery level changes. + virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel); + + // Called when the screen turns on. + virtual void OnScreenOn(void); + + // Called when the screen turns off. + virtual void OnScreenOff(void); +}; + +#endif //_XML_PARSER_APP_H_ diff --git a/project/inc/XmlReader.h b/project/inc/XmlReader.h new file mode 100755 index 0000000..39537af --- /dev/null +++ b/project/inc/XmlReader.h @@ -0,0 +1,70 @@ +// +// 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 _XML_READER_H_ +#define _XML_READER_H_ + +#include +#include +#include + +class XmlReader + : public Tizen::Ui::Controls::Form + , public Tizen::Ui::Controls::IListViewItemEventListener + , public Tizen::Ui::Controls::IListViewItemProvider + , public Tizen::Ui::IActionEventListener + , public Tizen::Ui::Controls::IFormBackEventListener +{ + +public: + XmlReader(void); + virtual ~XmlReader(void); + bool Initialize(void); + + void XmlReaderRun(void); + + virtual result OnInitializing(void); + virtual result OnTerminating(void); + + //IActionEventListener + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + + // IListViewItemEventListener + virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state); + virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status); + 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); + + //IFormBackEventListener + virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + +protected: + Tizen::Ui::Controls::ListView* _pList; + Tizen::Base::Collection::ArrayList* _pItemList; + +private: + static const int LIST_WIDTH = 720; + static const int LIST_HEIGHT = 640; + + static const int ITEM_HEIGHT = 112; +}; + +#endif //_XML_READER_H_ diff --git a/project/inc/XmlWriter.h b/project/inc/XmlWriter.h new file mode 100755 index 0000000..97fc9fd --- /dev/null +++ b/project/inc/XmlWriter.h @@ -0,0 +1,72 @@ +// +// 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 _XML_WRITER_H_ +#define _XML_WRITER_H_ + +#include +#include + +class XmlWriter + : public Tizen::Ui::Controls::Form + , public Tizen::Ui::Controls::IListViewItemEventListener + , public Tizen::Ui::Controls::IListViewItemProvider + , public Tizen::Ui::IActionEventListener + , public Tizen::Ui::Controls::IFormBackEventListener +{ + +public: + XmlWriter(void); + virtual ~XmlWriter(void); + bool Initialize(void); + + result RunXMLWrite(void); + void RunXMLParseandDisplay(void); + virtual result OnInitializing(void); + virtual result OnTerminating(void); + + //IActionEventListener + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + + // IListViewItemEventListener + virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state); + virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status); + virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction); + + //IFormBackEventListener + virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + + //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); + +protected: + Tizen::Ui::Controls::ListView* _pList; + Tizen::Base::Collection::ArrayList* _pItemList; + static const int ID_BUTTON_WRITE = 905; + +private: + static const int LIST_WIDTH = 720; + static const int LIST_HEIGHT = 640; + + static const int ITEM_HEIGHT = 112; + + bool __display; +}; + +#endif //_XML_WRITER_H_ diff --git a/project/manifest.xml b/project/manifest.xml new file mode 100644 index 0000000..c7cffb1 --- /dev/null +++ b/project/manifest.xml @@ -0,0 +1,30 @@ + + + $(manifestAppId) + 2.0.0 + C++App + + + + + + x86 + vfpv3 + + + 2.1 + + + + + + $(projectName) + + + mainmenu.png + + + + + + diff --git a/project/res/eng-GB.xml b/project/res/eng-GB.xml new file mode 100755 index 0000000..08a9a95 --- /dev/null +++ b/project/res/eng-GB.xml @@ -0,0 +1,5 @@ + + + diff --git a/project/res/screen-size-normal/IDF_FORM1.xml b/project/res/screen-size-normal/IDF_FORM1.xml new file mode 100755 index 0000000..7f4862a --- /dev/null +++ b/project/res/screen-size-normal/IDF_FORM1.xml @@ -0,0 +1,24 @@ + + + + + +
+ + + + +
+ +
+
+ +
+ +
diff --git a/project/shared/data/nofile.dummy b/project/shared/data/nofile.dummy new file mode 100644 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 index 0000000000000000000000000000000000000000..983c883493a0ae561b9592d54ea8204042b4b6fb GIT binary patch literal 17581 zcmWh!1yCGI6g=ErgFA=2yL<2e!JP!R;O-JMxI=K4;O-JEK!D(SxV!%SRdZ|=vb!_$ zrr+!CN0iz}IW%MGn)_u zLRS4EC8efjQ%n4@*V{mUuKj5+*J#Fcwdp88sSt31OGAFfODhGJ5=Z z%cscpZ|D8~saqJr4fBf}U#us$G@QEF;WP-q4S zSN2Lr_>!px6T%3rR7Qhv8;yWWkUk=dGlGr|D;ao7fq)5@*A&_`Q=GNmE8_!a5I4r= z^=}X;KM@a@?e(kY6nf3n6mMKJx-rX95Bxionc2?U-gKptI0&@m=0E$!%+^R0CHoEnDM)BrUf$c?T~ZvB)Hfa1@q4rGH}2JW zwR`jze!0Kh?B1pc;xr7BgMHZS|9zueOfsE>6l%7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wmo(+Y8Nkanr{ol=5+0Ena1#UM2gKQrvp$ zt&|XAKK$^**7oh&Ujy*wDW{w=EgTNtpeV{sygkB~rFz*=B9T6dr$Hn}xg~13B$(H9 zUH@5ITiYKw4zkN-9DNjS`baLMkHb+P#nmGY>?4mn!bGByOeUlC_4QY(s(Otq%jfdt zo;$jOq<`*3u9S0pps=ajSQv1*8ruuK=s1vziF#(2g z-_oT^DIvrngjkO}@`y1wIQS%hUp6&0)x_iR%Vb&pv@FYi<%Qt9VEM6ZEic5!d;FbA zu*tHl*9(Qh3%hph+Tw)BEdchdx86!cSpRVi*#A+E`ncQj<;%yCkN_nbjRqPT8ctVL zb&(`V3nWRJNeDUlPj%FCgzcl0?y_xrvuT>^Mn*>7>FVklbO>WP+(ZA|-1EPNqdx9- z^UXK23KtuIxqSI@ZRgINZ=tv>w*)}0tgH;CQmHA5qD+!yc_JYsMF>d(2m** +#include "FormFactory.h" +#include "MainListForm.h" +#include "XmlReader.h" +#include "HtmlParser.h" +#include "XmlParser.h" +#include "XmlWriter.h" + +using namespace Tizen::Ui::Controls; + +FormFactory::FormFactory() { + // TODO Auto-generated constructor stub + +} + +FormFactory::~FormFactory() { + // TODO Auto-generated destructor stub +} + +Form* +FormFactory::CreateFormN(const Tizen::Base::String &formId, const Tizen::Ui::Scenes::SceneId &sceneId) +{ + Form* pNewForm = null; + + if (formId == L"MainListForm") + { + MainListForm* pForm = new (std::nothrow) MainListForm(); + pForm->Initialize(); + pNewForm = pForm; + } + else if (formId == L"XmlReaderForm") + { + XmlReader* pForm = new (std::nothrow) XmlReader(); + pForm->Initialize(); + pNewForm = pForm; + } + else if (formId == L"HtmlParserForm") + { + HtmlParser* pForm = new (std::nothrow) HtmlParser(); + pForm->Initialize(); + pNewForm = pForm; + } + else if (formId == L"XmlParserForm") + { + XmlParser* pForm = new (std::nothrow) XmlParser(); + pForm->Initialize(); + pNewForm = pForm; + } + else if (formId == L"XmlWriterForm") + { + XmlWriter* pForm = new (std::nothrow) XmlWriter(); + pForm->Initialize(); + pNewForm = pForm; + } + + return pNewForm; +} diff --git a/project/src/HtmlParser.cpp b/project/src/HtmlParser.cpp new file mode 100644 index 0000000..c3000e3 --- /dev/null +++ b/project/src/HtmlParser.cpp @@ -0,0 +1,203 @@ +// +// 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. +// + +#include +#include +#include +#include +#include "HtmlParser.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; +using namespace Tizen::Io; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Scenes; + +HtmlParser::HtmlParser(void) + : _pList(null) + , _pItemList(null) +{ +} + +HtmlParser::~HtmlParser(void) +{ +} + +bool +HtmlParser::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER | FORM_STYLE_INDICATOR); + return true; +} + +result +HtmlParser::OnInitializing(void) +{ + result r = E_SUCCESS; + Rectangle clientRect = GetClientAreaBounds(); + Header* pHeader = GetHeader(); + pHeader->SetTitleText("HTML Parser"); + + Footer* pFooter = GetFooter(); + pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON); + pFooter->SetBackButton(); + SetFormBackEventListener(this); + + _pList = new (std::nothrow) ListView(); + _pList->Construct(Rectangle(0, 0, LIST_WIDTH, LIST_HEIGHT), true); + _pList->SetItemProvider(*this); + _pList->AddListViewItemEventListener(*this); + _pList->SetTextOfEmptyList(L""); + AddControl(*_pList); + + _pItemList = new (std::nothrow) ArrayList(); + _pItemList->Construct(); + + RunHtmlParser(); + + return r; +} + +int +HtmlParser::GetItemCount(void) +{ + TryReturn(_pItemList, 0, "_pItemList is null."); + return _pItemList->GetCount(); +} + +Tizen::Ui::Controls::ListItemBase* +HtmlParser::CreateItem(int index, int itemWidth) +{ + ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL; + SimpleItem* pItem = new (std::nothrow) SimpleItem(); + + pItem->Construct(Tizen::Graphics::Dimension(itemWidth, ITEM_HEIGHT), style); + Tizen::Base::String* pKey = static_cast< String* >(_pItemList->GetAt(index)); + TryReturn(pKey, null, "key is empty for index %d",index); + + pItem->SetElement(*pKey, null); + return pItem; +} + +bool +HtmlParser::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) +{ + delete pItem; + pItem = null; + return true; +} + + +void +HtmlParser::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) +{ +} + +void +HtmlParser::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) +{ +} + +void +HtmlParser::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) +{ +} + + +void +HtmlParser::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) +{ +} + +void +HtmlParser::RunHtmlParser(void) +{ + //Parse html file and build a tree + String filepath = App::GetInstance()->GetAppRootPath() + L"data/tizen.html"; + ByteBuffer* pBuf = Tizen::Base::Utility::StringUtil::StringToUtf8N(filepath); + TryReturnVoid(pBuf, "StringToUtf8N failed."); + + htmlNodePtr pRoot =null; + htmlDocPtr pDoc = htmlParseFile((const char*) pBuf->GetPointer(), (const char*) "utf-8"); + TryCatch(pDoc, , "htmlParseFile failed."); + + //Get the root element of the document + pRoot = xmlDocGetRootElement(pDoc); + TryCatch(pRoot, xmlFreeDoc(pDoc), "xmlDocGetRootElement failed."); + + ExtractHyperLinks(pRoot); + _pList->UpdateList(); + xmlFreeDoc(pDoc); + +CATCH: + delete pBuf; +} + +/* this functions extracts links present in HTML file and displays*/ +void +HtmlParser::ExtractHyperLinks(htmlNodePtr pRoot) +{ + xmlNodePtr pCurrentElement = null; + xmlAttrPtr attr = null; + + for (pCurrentElement = pRoot; pCurrentElement; pCurrentElement = pCurrentElement->next) + { + if (pCurrentElement->type != XML_ELEMENT_NODE) + { + continue; + } + if (xmlStrcasecmp(pCurrentElement->name, (const xmlChar*) "A") == 0) + { + for (attr = pCurrentElement->properties; attr != null; attr = attr->next) + { + if (xmlStrcasecmp(attr->name, (const xmlChar*) "HREF") == 0) + { + String* nodeName = new (std::nothrow) String; + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) pCurrentElement->children->content, *nodeName); + _pItemList->Add(*nodeName); + } + } + } + if (pCurrentElement->children != null) + { + ExtractHyperLinks(pCurrentElement->children); + } + } +} + +result +HtmlParser::OnTerminating(void) +{ + if (_pItemList) + { + _pItemList->RemoveAll(true); + delete _pItemList; + _pItemList = null; + } + + return E_SUCCESS; +} + +void +HtmlParser::OnFormBackRequested(Tizen::Ui::Controls::Form& source) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition()); +} diff --git a/project/src/MainListForm.cpp b/project/src/MainListForm.cpp new file mode 100755 index 0000000..e1ec1d0 --- /dev/null +++ b/project/src/MainListForm.cpp @@ -0,0 +1,112 @@ +// +// 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. +// + +#include +#include "MainListForm.h" +#include "XmlReader.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Graphics; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Scenes; + +MainListForm::MainListForm(void) +{ +} + +MainListForm::~MainListForm(void) +{ +} + +bool +MainListForm::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_INDICATOR); + return true; +} + +result +MainListForm::OnInitializing(void) +{ + result r = E_SUCCESS; + + Header* pHeader = GetHeader(); + pHeader->SetTitleText("XML PARSER APP"); + + //For xmlreader + Button* pXmlReader = new (std::nothrow) Button(); + pXmlReader->Construct(Rectangle(BUTTON_LEFT_RIGHT_MARGIN, BUTTON_TOP_MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT), L"XML Reader"); + pXmlReader->AddActionEventListener(*this); + pXmlReader->SetActionId(ID_BUTTON_XMLReader); + AddControl(*pXmlReader); + + //For htmlparser + Button* pHtmlParser = new (std::nothrow) Button(); + pHtmlParser->Construct(Rectangle(BUTTON_LEFT_RIGHT_MARGIN, BUTTON_TOP_MARGIN + ( BUTTON_HEIGHT + BUTTON_BOTTOM_MARGIN ), BUTTON_WIDTH, BUTTON_HEIGHT), L"HTML Parser"); + pHtmlParser->AddActionEventListener(*this); + pHtmlParser->SetActionId(ID_BUTTON_HTMLParser); + AddControl(*pHtmlParser); + + //For xmlparser + Button* pXmlParser = new (std::nothrow) Button(); + pXmlParser->Construct(Rectangle(BUTTON_LEFT_RIGHT_MARGIN, BUTTON_TOP_MARGIN + 2 * ( BUTTON_HEIGHT + BUTTON_BOTTOM_MARGIN ), BUTTON_WIDTH, BUTTON_HEIGHT), L"XML Parser"); + pXmlParser->AddActionEventListener(*this); + pXmlParser->SetActionId(ID_BUTTON_XMLParser); + AddControl(*pXmlParser); + + //For xmlwriter + Button* pXmlWriter = new (std::nothrow) Button(); + pXmlWriter->Construct(Rectangle(BUTTON_LEFT_RIGHT_MARGIN, BUTTON_TOP_MARGIN + 3 * ( BUTTON_HEIGHT + BUTTON_BOTTOM_MARGIN ), BUTTON_WIDTH, BUTTON_HEIGHT), L"XML Writer"); + pXmlWriter->AddActionEventListener(*this); + pXmlWriter->SetActionId(ID_BUTTON_XMLWriter); + AddControl(*pXmlWriter); + return r; +} + +result +MainListForm::OnTerminating(void) +{ + result r = E_SUCCESS; + return r; +} + +void +MainListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + AppAssert(pSceneManager); + + switch (actionId) + { + case ID_BUTTON_XMLReader: + pSceneManager->GoForward(ForwardSceneTransition(L"XmlReaderScene")); + break; + case ID_BUTTON_HTMLParser: + pSceneManager->GoForward(ForwardSceneTransition(L"HtmlParserScene")); + break; + case ID_BUTTON_XMLParser: + pSceneManager->GoForward(ForwardSceneTransition(L"XmlParserScene")); + break; + case ID_BUTTON_XMLWriter: + pSceneManager->GoForward(ForwardSceneTransition(L"XmlWriterScene")); + break; + default: + break; + } +} diff --git a/project/src/XmlParser.cpp b/project/src/XmlParser.cpp new file mode 100644 index 0000000..8ebb748 --- /dev/null +++ b/project/src/XmlParser.cpp @@ -0,0 +1,511 @@ +// +// 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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include "XmlParser.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; +using namespace Tizen::Io; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Scenes; + +xmlParserInputPtr ResolveEntitySAXFunc(void* ctx, const xmlChar* publicId, const xmlChar* systemId); +void InternalSubsetSAXFunc(void* ctx, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID); +void ExternalSubsetSAXFunc(void* ctx, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID); +xmlEntityPtr GetEntitySAXFunc(void* ctx, const xmlChar* name); +xmlEntityPtr GetParameterEntitySAXFunc(void* ctx, const xmlChar* name); +void EntityDeclSAXFunc(void* ctx, const xmlChar* name, int type, const xmlChar* publicId, const xmlChar* systemId, xmlChar* content); +void NotationDeclSAXFunc(void* ctx, const xmlChar* name, const xmlChar* publicId, const xmlChar* systemId); +void AttributeDeclSAXFunc(void* ctx, const xmlChar* elem, const xmlChar* fullname, int type, int def, const xmlChar* defaultValue, xmlEnumerationPtr tree); +void ElementDeclSAXFunc(void* ctx, const xmlChar* name, int type, xmlElementContentPtr content); +void UnparsedEntityDeclSAXFunc(void* ctx, const xmlChar* name, const xmlChar* publicId, const xmlChar* systemId, const xmlChar* notationName); +void SetDocumentLocatorSAXFunc(void* ctx, xmlSAXLocatorPtr loc); +void StartDocumentSAXFunc(void* ctx); +void EndDocumentSAXFunc(void* ctx); +void StartElementSAXFunc(void* ctx, const xmlChar* name, const xmlChar** atts); +void EndElementSAXFunc(void* ctx, const xmlChar* name); +void AttributeSAXFunc(void* ctx, const xmlChar* name, const xmlChar* value); +void ReferenceSAXFunc(void* ctx, const xmlChar* name); +void CharactersSAXFunc(void* ctx, const xmlChar* ch, int len); +void IgnorableWhitespaceSAXFunc(void* ctx, const xmlChar* ch, int len); +void ProcessingInstructionSAXFunc(void* ctx, const xmlChar* target, const xmlChar* data); +void CommentSAXFunc(void* ctx, const xmlChar* value); +void CdataBlockSAXFunc(void* ctx, const xmlChar* value, int len); +void WarningSAXFunc(void* ctx, const char* msg, ...); +void ErrorSAXFunc(void* ctx, const char* msg, ...); +void FatalErrorSAXFunc(void* ctx, const char* msg, ...); +int IsStandaloneSAXFunc(void* ctx); +int HasInternalSubsetSAXFunc(void* ctx); +int HasExternalSubsetSAXFunc(void* ctx); + + +xmlSAXHandler mySaxHandler = +{ +InternalSubsetSAXFunc, +IsStandaloneSAXFunc, +HasInternalSubsetSAXFunc, +HasExternalSubsetSAXFunc, +ResolveEntitySAXFunc, +GetEntitySAXFunc, +EntityDeclSAXFunc, +NotationDeclSAXFunc, +AttributeDeclSAXFunc, +ElementDeclSAXFunc, +UnparsedEntityDeclSAXFunc, +SetDocumentLocatorSAXFunc, +StartDocumentSAXFunc, +EndDocumentSAXFunc, +StartElementSAXFunc, +EndElementSAXFunc, +ReferenceSAXFunc, +CharactersSAXFunc, +IgnorableWhitespaceSAXFunc, +ProcessingInstructionSAXFunc, +CommentSAXFunc, +WarningSAXFunc, +ErrorSAXFunc, +FatalErrorSAXFunc, +GetParameterEntitySAXFunc, +CdataBlockSAXFunc, +ExternalSubsetSAXFunc, +0, +null, +null, +null, +null +}; + +XmlParser::XmlParser(void) + : __found(false) + , __checkContent(false) + , __printCapital(false) + , __pList(null) + , __pItemList(null) + , __pLabel(null) + , __pPath(null) +{ +} + +XmlParser::~XmlParser(void) +{ + delete __pPath; +} + +bool +XmlParser::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER | FORM_STYLE_INDICATOR); + return true; +} + +result +XmlParser::OnInitializing(void) +{ + Rectangle clientRect = GetClientAreaBounds(); + Header* pHeader = GetHeader(); + pHeader->SetTitleText("XML Parser"); + result r = E_FAILURE; + + Footer* pFooter = GetFooter(); + pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON); + pFooter->SetBackButton(); + SetFormBackEventListener(this); + + __pLabel = new Label(); + __pLabel->Construct(Rectangle((clientRect.width - LABEL_WIDTH) / 2, clientRect.height - LABEL_BOTTOM_MARGIN - LABEL_HEIGHT, LABEL_WIDTH, LABEL_HEIGHT), L""); + AddControl(*__pLabel); + + // Create xml document + __filePath = App::GetInstance()->GetAppRootPath() + L"data/map.xml"; + __pPath = Tizen::Base::Utility::StringUtil::StringToUtf8N(__filePath); + TryReturn(__pPath, GetLastResult(), "Path conversion failed."); + + xmlDocPtr pDocument = xmlParseFile((const char*) __pPath->GetPointer()); + TryReturn(pDocument, E_FAILURE, "xmlDocPtr conversion failed."); + + xmlNodePtr pRoot = xmlDocGetRootElement(pDocument); + TryCatch(pRoot, , "xmlNodePtr conversion failed."); + + __pList = new ListView(); + __pList->Construct(Rectangle(0, 0, clientRect.width, LIST_HEIGHT), true); + __pList->SetItemProvider(*this); + __pList->AddListViewItemEventListener(*this); + __pList->SetTextOfEmptyList(L""); + AddControl(*__pList); + + __pItemList = new ArrayList(); + __pItemList->Construct(); + + for (xmlNodePtr pCurrentElement = pRoot->children; pCurrentElement; pCurrentElement = pCurrentElement->next) + { + xmlNodePtr pChildElement = null; + + if (pCurrentElement->type == XML_ELEMENT_NODE) + { + // Get element from element + pChildElement = pCurrentElement->children->next; + + if (pChildElement) + { + String* countryName = new String; + // Get content from XML_TEXT_NODE + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) pChildElement->children->content, *countryName); + __pItemList->Add(*countryName); + AppLog("country : %ls\n", (*countryName).GetPointer()); + } + } + } + __pList->UpdateList(); + r = E_SUCCESS; + +CATCH: + xmlFreeDoc(pDocument); + return r; +} + +void +XmlParser::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) +{ + String key(L"/map/item[]/capital"); + ByteBuffer* pExpr = null; + String capital; + + xmlDocPtr pDocument = null; + xmlXPathContextPtr pXpathCtx = null; + xmlXPathObjectPtr pXpathObj = null; + xmlChar* pContent = null; + + // Create xml document + pDocument = xmlParseFile((const char*) __pPath->GetPointer()); + + // Create xpath context + pXpathCtx = xmlXPathNewContext(pDocument); + + key.Insert(index + 1, 10); + // Get an element + pExpr = Tizen::Base::Utility::StringUtil::StringToUtf8N(key); + pXpathObj = xmlXPathEvalExpression((xmlChar*) pExpr->GetPointer(), pXpathCtx); + delete pExpr; + + pContent = pXpathObj->nodesetval->nodeTab[0]->children->content; + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) pContent, capital); + + // Clean up + xmlXPathFreeObject(pXpathObj); + xmlXPathFreeContext(pXpathCtx); + xmlFreeDoc(pDocument); + + __pLabel->SetText(capital); + + __pLabel->Draw(); +} + +void +XmlParser::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) +{ + +} + +void +XmlParser::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) +{ + +} + +int +XmlParser::GetItemCount(void) +{ + TryReturn(__pItemList, 0, "__pItemList is null"); + return __pItemList->GetCount(); +} + +Tizen::Ui::Controls::ListItemBase* +XmlParser::CreateItem(int index, int itemWidth) +{ + ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL; + SimpleItem* pItem = new SimpleItem(); + + pItem->Construct(Tizen::Graphics::Dimension(itemWidth, ITEM_HEIGHT), style); + Tizen::Base::String* pKey = static_cast< String* >(__pItemList->GetAt(index)); + + TryReturn(pKey, null, "Key value is empty for %d", index); + pItem->SetElement(*pKey, null); + return pItem; +} + +bool +XmlParser::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) +{ + delete pItem; + pItem = null; + return true; +} + +result +XmlParser::OnTerminating(void) +{ + result r = E_SUCCESS; + if (__pItemList) + { + __pItemList->RemoveAll(true); + delete __pItemList; + __pItemList = null; + } + + // TODO: Add your termination code here + + return r; +} + +result +XmlParser::SAXParse(void) +{ + xmlSAXHandlerPtr pMySaxhandler = &mySaxHandler; + __found = false; + __checkContent = false; + __printCapital = false; + + xmlSAXUserParseFile(pMySaxhandler, null, (const char*) __pPath->GetPointer()); + + return E_SUCCESS; +} + + +result +XmlParser::SAXParseMemory(void) +{ + xmlDocPtr pDoc = null; + result r = E_SUCCESS; + File file; + FileAttributes fileAttribute; + ByteBuffer buffer; + + r = File::GetAttributes(__filePath, fileAttribute); + TryCatch(r == E_SUCCESS, , "Fail to get file attribute"); + + r = buffer.Construct((int) fileAttribute.GetFileSize()); + TryCatch(r == E_SUCCESS, , "Fail to construct buffer"); + + r = file.Construct(__filePath, L"r"); + r = file.Read(buffer); + TryCatch(r == E_SUCCESS, , "Fail to read file"); + + pDoc = xmlSAXParseMemory(null, (const char*) (buffer.GetPointer()), (int) fileAttribute.GetFileSize(), 0); + TryCatch(pDoc != null, , "document is null"); + + return E_SUCCESS; + +CATCH: + return E_FAILURE; +} + +xmlParserInputPtr +ResolveEntitySAXFunc(void* ctx, const xmlChar* publicId, const xmlChar* systemId) +{ + return null; +} + +void +InternalSubsetSAXFunc(void* ctx, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID) +{ +} + +void +ExternalSubsetSAXFunc(void* ctx, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID) +{ +} + +xmlEntityPtr +GetEntitySAXFunc(void* ctx, const xmlChar* name) +{ + return null; +} + +xmlEntityPtr +GetParameterEntitySAXFunc(void* ctx, const xmlChar* name) +{ + return null; +} + +void +EntityDeclSAXFunc(void* ctx, const xmlChar* name, int type, const xmlChar* publicId, const xmlChar* systemId, xmlChar* content) +{ +} + +void +NotationDeclSAXFunc(void* ctx, const xmlChar* name, const xmlChar* publicId, const xmlChar* systemId) +{ +} + +void +AttributeDeclSAXFunc(void* ctx, const xmlChar* elem, const xmlChar* fullname, int type, int def, const xmlChar* defaultValue, xmlEnumerationPtr tree) +{ +} + +void +ElementDeclSAXFunc(void* ctx, const xmlChar* name, int type, xmlElementContentPtr content) +{ +} + +void +UnparsedEntityDeclSAXFunc(void* ctx, const xmlChar* name, const xmlChar* publicId, const xmlChar* systemId, const xmlChar* notationName) +{ +} + +void +SetDocumentLocatorSAXFunc(void* ctx, xmlSAXLocatorPtr loc) +{ +} + +void +StartDocumentSAXFunc(void* ctx) +{ + +} + +void +EndDocumentSAXFunc(void* ctx) +{ +} + +void +StartElementSAXFunc(void* ctx, const xmlChar* name, const xmlChar** atts) +{ + XmlParser* pXmlParser = static_cast< XmlParser* >(ctx); + if (xmlStrcmp(name, (xmlChar*) "country") == 0) + { + pXmlParser->SetCheckContent(true); + } + else if (xmlStrcmp(name, (xmlChar*) "capital") == 0) + { + pXmlParser->SetPrintCapital(true); + } + else + { + pXmlParser->SetCheckContent(false); + pXmlParser->SetPrintCapital(false); + } +} + +void +EndElementSAXFunc(void* ctx, const xmlChar* name) +{ +} + +void +AttributeSAXFunc(void* ctx, const xmlChar* name, const xmlChar* value) +{ +} + +void +ReferenceSAXFunc(void* ctx, const xmlChar* name) +{ +} + +void +CharactersSAXFunc(void* ctx, const xmlChar* ch, int len) +{ + XmlParser* pXmlParser = static_cast< XmlParser* >(ctx); + if (pXmlParser->IsCheckContent()) + { + if (xmlStrncmp(ch, (xmlChar*) "Ghana", len) == 0) + { + pXmlParser->SetFound(true); + } + } + if (pXmlParser->IsFound() && pXmlParser->IsPrintCapital()) + { + AppLog("The capital of Chana is %ls\n", ch); + } +} + +void +IgnorableWhitespaceSAXFunc(void* ctx, const xmlChar* ch, int len) +{ +} + +void +ProcessingInstructionSAXFunc(void* ctx, const xmlChar* target, const xmlChar* data) +{ +} + +void +CommentSAXFunc(void* ctx, const xmlChar* value) +{ +} + +void +CdataBlockSAXFunc(void* ctx, const xmlChar* value, int len) +{ +} + +void +WarningSAXFunc(void* ctx, const char* msg, ...) +{ +} + +void +ErrorSAXFunc(void* ctx, const char* msg, ...) +{ +} + +void +FatalErrorSAXFunc(void* ctx, const char* msg, ...) +{ +} + +int +IsStandaloneSAXFunc(void* ctx) +{ + return 1; +} + +int +HasInternalSubsetSAXFunc(void* ctx) +{ + return 0; +} + + +int +HasExternalSubsetSAXFunc(void* ctx) +{ + return 0; +} + +void +XmlParser::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) +{ +} + +void +XmlParser::OnFormBackRequested(Tizen::Ui::Controls::Form& source) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition()); +} diff --git a/project/src/XmlParserApp.cpp b/project/src/XmlParserApp.cpp new file mode 100644 index 0000000..cc3408b --- /dev/null +++ b/project/src/XmlParserApp.cpp @@ -0,0 +1,103 @@ +// +// 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. +// + +#include "XmlParserApp.h" +#include "MainListForm.h" +#include "XmlReader.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; + +XmlParserApp::XmlParserApp(void) +{ +} + +XmlParserApp::~XmlParserApp(void) +{ +} + +Application* +XmlParserApp::CreateInstance(void) +{ + return new XmlParserApp(); +} + +bool +XmlParserApp::OnAppInitializing(AppRegistry& appRegistry) +{ + Frame* pAppFrame = new Frame(); + pAppFrame->Construct(); + AddFrame(*pAppFrame); + + SceneManager* pSceneManager = SceneManager::GetInstance(); + AppAssert(pSceneManager); + static FormFactory formFactory; + pSceneManager->RegisterFormFactory(formFactory); + pSceneManager->RegisterScene(L"MainListScene", L"MainListForm", L""); + pSceneManager->RegisterScene(L"XmlReaderScene", L"XmlReaderForm", L""); + pSceneManager->RegisterScene(L"HtmlParserScene", L"HtmlParserForm", L""); + pSceneManager->RegisterScene(L"XmlParserScene", L"XmlParserForm", L""); + pSceneManager->RegisterScene(L"XmlWriterScene", L"XmlWriterForm", L""); + + if (pSceneManager->GoForward(ForwardSceneTransition(L"MainListScene")) != E_SUCCESS) + { + return false; + } + + return true; +} + +bool +XmlParserApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination) +{ + return true; +} + +void +XmlParserApp::OnForeground(void) +{ +} + +void +XmlParserApp::OnBackground(void) +{ +} + +void +XmlParserApp::OnLowMemory(void) +{ +} + +void +XmlParserApp::OnBatteryLevelChanged(BatteryLevel batteryLevel) +{ +} + +void +XmlParserApp::OnScreenOn(void) +{ +} + +void +XmlParserApp::OnScreenOff(void) +{ +} diff --git a/project/src/XmlParserAppEntry.cpp b/project/src/XmlParserAppEntry.cpp new file mode 100644 index 0000000..3170902 --- /dev/null +++ b/project/src/XmlParserAppEntry.cpp @@ -0,0 +1,60 @@ +// +// 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. +// + +/** + * This file contains the Tizen C++ application entry point. + */ +#include "XmlParserApp.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 C++ 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::Application::Execute(XmlParserApp::CreateInstance, &args); + TryLog(r == E_SUCCESS, "Application execution failed-[%s].", GetErrorMessage(r)); + + args.RemoveAll(true); + AppLog("Application finished."); + + return static_cast< int >(r); +} +#ifdef __cplusplus +} +#endif // __cplusplus diff --git a/project/src/XmlReader.cpp b/project/src/XmlReader.cpp new file mode 100644 index 0000000..b8d993f --- /dev/null +++ b/project/src/XmlReader.cpp @@ -0,0 +1,201 @@ +// +// 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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include "XmlReader.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; +using namespace Tizen::Io; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Scenes; + +XmlReader::XmlReader(void) + : _pList(null) + , _pItemList(null) +{ +} + +XmlReader::~XmlReader(void) +{ +} + +bool +XmlReader::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER | FORM_STYLE_INDICATOR); + return true; +} + +void +XmlReader::XmlReaderRun(void) +{ + int xmlreadType = 0; + int ret = 0; + + //Create xml text reader + String filepath = App::GetInstance()->GetAppRootPath() + L"data/continents.xml"; + ByteBuffer* pBuf = Tizen::Base::Utility::StringUtil::StringToUtf8N(filepath); + TryReturnVoid(pBuf, "ByteBuffer is null"); + + xmlTextReaderPtr reader = xmlReaderForFile((const char*) pBuf->GetPointer(), NULL, XML_PARSE_HUGE); + TryCatch(reader, , "xmlTextReaderPtr is null"); + TryCatch(_pList, xmlFreeTextReader(reader), "_pList is null"); + + ret = xmlTextReaderRead(reader); + while (ret == 1) + { + const xmlChar* value = null; + const xmlChar* name = xmlTextReaderConstName(reader); //read node name + if (xmlTextReaderHasValue(reader)) + { + value = xmlTextReaderConstValue(reader); //read value + } + xmlreadType = xmlTextReaderNodeType(reader); //read Node type + + /* Ignore #Text node */ + if (xmlStrcasecmp(name, (const xmlChar*) "#Text") != 0 && xmlreadType != XML_READER_TYPE_END_ELEMENT) + { + String* nodeName = new (std::nothrow) String; //Carries node name + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) name, *nodeName); + _pItemList->Add(*nodeName); + } + /* Add value if node is not of type XML_READER_TYPE_SIGNIFICANT_WHITESPACE */ + if ((xmlreadType != XML_READER_TYPE_SIGNIFICANT_WHITESPACE) && (value != null)) + { + String* nodeValue = new (std::nothrow) String; //Carries node value + if (value != null) + { + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) value, *nodeValue); + } + _pItemList->Add(*nodeValue); + } + ret = xmlTextReaderRead(reader); + } + + _pList->UpdateList(); + xmlFreeTextReader(reader); + +CATCH: + delete pBuf; +} + +result +XmlReader::OnInitializing(void) +{ + result r = E_SUCCESS; + Header* pHeader = GetHeader(); + pHeader->SetTitleText("XML Reader"); + + Footer* pFooter = GetFooter(); + pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON); + pFooter->SetBackButton(); + SetFormBackEventListener(this); + + _pList = new (std::nothrow) ListView(); + _pList->Construct(Rectangle(0, 0, LIST_WIDTH, LIST_HEIGHT), true); + _pList->SetItemProvider(*this); + _pList->AddListViewItemEventListener(*this); + _pList->SetTextOfEmptyList(L""); + AddControl(*_pList); + + _pItemList = new (std::nothrow) ArrayList(); + _pItemList->Construct(); + + XmlReaderRun(); + + return r; +} + +int +XmlReader::GetItemCount(void) +{ + TryReturn(_pItemList, 0, "_pItemList is null"); + return _pItemList->GetCount(); +} + +Tizen::Ui::Controls::ListItemBase* +XmlReader::CreateItem(int index, int itemWidth) +{ + ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL; + SimpleItem* pItem = new (std::nothrow) SimpleItem(); + + pItem->Construct(Tizen::Graphics::Dimension(itemWidth, ITEM_HEIGHT), style); + Tizen::Base::String* key = static_cast< String* >(_pItemList->GetAt(index)); + TryReturn(key, null, "Key value is empty for %d", index); + + pItem->SetElement(*key, null); + return pItem; +} + +bool +XmlReader::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) +{ + delete pItem; + pItem = null; + return true; +} + +void +XmlReader::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) +{ +} + +void +XmlReader::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) +{ +} + +void +XmlReader::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) +{ +} + +void +XmlReader::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) +{ +} + +result +XmlReader::OnTerminating(void) +{ + result r = E_SUCCESS; + if (_pItemList) + { + _pItemList->RemoveAll(true); + delete _pItemList; + _pItemList = null; + } + return r; +} + +void +XmlReader::OnFormBackRequested(Tizen::Ui::Controls::Form& source) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition()); +} diff --git a/project/src/XmlWriter.cpp b/project/src/XmlWriter.cpp new file mode 100644 index 0000000..7e55235 --- /dev/null +++ b/project/src/XmlWriter.cpp @@ -0,0 +1,297 @@ +// +// 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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include "XmlWriter.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; +using namespace Tizen::Io; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Scenes; + +XmlWriter::XmlWriter(void) + : _pList(null) + , _pItemList(null) + , __display(false) +{ +} + +XmlWriter::~XmlWriter(void) +{ +} + +bool +XmlWriter::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_FOOTER | FORM_STYLE_HEADER | FORM_STYLE_INDICATOR); + return true; +} + +result +XmlWriter::OnInitializing(void) +{ + result r = E_SUCCESS; + Header* pHeader = GetHeader(); + pHeader->SetTitleText("XML Writer"); + + Footer* pFooter = GetFooter(); + pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT); + + FooterItem writeButton; + writeButton.Construct(ID_BUTTON_WRITE); + writeButton.SetText("Write"); + pFooter->AddItem(writeButton); + + pFooter->SetBackButton(); + pFooter->AddActionEventListener(*this); + SetFormBackEventListener(this); + + _pList = new (std::nothrow) ListView(); + _pList->Construct(Rectangle(0, 0, LIST_WIDTH, LIST_HEIGHT), true); + _pList->SetItemProvider(*this); + _pList->AddListViewItemEventListener(*this); + _pList->SetTextOfEmptyList(L""); + AddControl(*_pList); + + _pItemList = new (std::nothrow) ArrayList(); + _pItemList->Construct(); + + return r; +} + +int +XmlWriter::GetItemCount(void) +{ + TryReturn(_pItemList, 0, "_pItemList is null"); + return _pItemList->GetCount(); +} + +Tizen::Ui::Controls::ListItemBase* +XmlWriter::CreateItem(int index, int itemWidth) +{ + ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL; + SimpleItem* pItem = new (std::nothrow) SimpleItem(); + + pItem->Construct(Tizen::Graphics::Dimension(itemWidth, ITEM_HEIGHT), style); + Tizen::Base::String* key = static_cast< String* >(_pItemList->GetAt(index)); + TryReturn(key, null, "key value is null for index %d", index); + + pItem->SetElement(*key, null); + return pItem; +} + +bool +XmlWriter::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) +{ + delete pItem; + pItem = null; + return true; +} + + +void +XmlWriter::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) +{ + +} + +void +XmlWriter::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) +{ + +} + +void +XmlWriter::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state) +{ + +} + +void +XmlWriter::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) +{ + result err; + switch (actionId) + { + case ID_BUTTON_WRITE: + { + err = RunXMLWrite(); + TryReturnVoid(E_SUCCESS == err , "RunXMLWrite failed.%S", GetErrorMessage(err)); + + if(__display && _pItemList) + { + _pItemList->RemoveAll(true); + } + __display = false; + RunXMLParseandDisplay(); + Draw(); + } + break; + } +} + + +result +XmlWriter::RunXMLWrite(void) +{ + int rc; + result r = E_FAILURE; + + // Create xml document + const String filepath = App::GetInstance()->GetAppRootPath() + L"data/writemap.xml"; + + ByteBuffer* pBuf = Tizen::Base::Utility::StringUtil::StringToUtf8N(filepath); + TryReturn(pBuf, r, "String to ByteBuffer conversion failed."); + + xmlTextWriterPtr writer = xmlNewTextWriterFilename((const char*) pBuf->GetPointer(), 0); + TryCatch(writer, , "xmlNewTextWriterFilename Failed!"); + + rc = xmlTextWriterStartDocument(writer, null, "ISO-8859-1", null); + TryCatch(rc >= 0, , "xmlTextWriterStartDocument Failed!"); + + rc = xmlTextWriterStartElement(writer, (xmlChar*) "map"); + TryCatch(rc >= 0, , "xmlTextWriterStartElement Failed!"); + + rc = xmlTextWriterStartElement(writer, (xmlChar*) "item"); + TryCatch(rc >= 0, , "xmlTextWriterStartElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Country", (xmlChar*) "America"); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Capital", (xmlChar*) "Washington D.C."); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterEndElement(writer); + TryCatch(rc >= 0, , "xmlTextWriterEndElement Failed!"); + + rc = xmlTextWriterStartElement(writer, (xmlChar*) "item"); + TryCatch(rc >= 0, , "xmlTextWriterStartElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Country", (xmlChar*) "England"); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Capital", (xmlChar*) "London"); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterEndElement(writer); + TryCatch(rc >= 0, , "xmlTextWriterEndElement Failed!"); + + rc = xmlTextWriterStartElement(writer, (xmlChar*) "item"); + TryCatch(rc >= 0, , "xmlTextWriterStartElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Country", (xmlChar*) "India"); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterWriteElement(writer, (xmlChar*) "Capital", (xmlChar*) "Delhi"); + TryCatch(rc >= 0, , "xmlTextWriterWriteElement Failed!"); + + rc = xmlTextWriterEndElement(writer); + TryCatch(rc >= 0, , "xmlTextWriterEndElement Failed!"); + + rc = xmlTextWriterEndElement(writer); + TryCatch(rc >= 0, , "xmlTextWriterEndElement Failed!"); + + rc = xmlTextWriterEndDocument(writer); + TryCatch(rc >= 0, , "xmlTextWriterEndDocument Failed!"); + + r = E_SUCCESS; + +CATCH: + delete pBuf; + pBuf = null; + if (writer) + { + xmlFreeTextWriter(writer); + } + return r; +} + +void +XmlWriter::RunXMLParseandDisplay(void) +{ + + const String filepath = App::GetInstance()->GetAppRootPath() + L"data/writemap.xml"; + xmlNodePtr pRoot = null; + + ByteBuffer* pBuf = Tizen::Base::Utility::StringUtil::StringToUtf8N(filepath); + TryReturnVoid(pBuf, "StringToUtf8N failed."); + + xmlDocPtr pDocument = xmlParseFile((const char*) pBuf->GetPointer()); + TryCatch(pBuf, , "xmlParseFile failed."); + + pRoot = xmlDocGetRootElement(pDocument); + TryCatch(pRoot, xmlFreeDoc(pDocument), "xmlDocGetRootElement failed."); + + TryCatch(_pList, xmlFreeDoc(pDocument), "_pList is null."); + + for (xmlNodePtr pCurrentElement = pRoot->children; pCurrentElement; pCurrentElement = pCurrentElement->next) + { + xmlNodePtr pChildElement = null; + + if (pCurrentElement->type == XML_ELEMENT_NODE) + { + // Get element from element + pChildElement = pCurrentElement->children; + + for (; pChildElement; pChildElement = pChildElement->next) + { + String* textName = new String; + Tizen::Base::Utility::StringUtil::Utf8ToString((char*) pChildElement->children->content, *textName); + _pItemList->Add(*textName); + } + } + } + + _pList->UpdateList(); + __display = true; + xmlFreeDoc(pDocument); +CATCH: + delete pBuf; + pBuf = null; + +} + +result +XmlWriter::OnTerminating(void) +{ + result r = E_SUCCESS; + if (_pItemList) + { + _pItemList->RemoveAll(true); + delete _pItemList; + _pItemList = null; + } + return r; +} + +void +XmlWriter::OnFormBackRequested(Tizen::Ui::Controls::Form& source) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition()); +} diff --git a/sample.xml b/sample.xml new file mode 100755 index 0000000..b724960 --- /dev/null +++ b/sample.xml @@ -0,0 +1,34 @@ + + diff --git a/screenshot.png b/screenshot.png new file mode 100755 index 0000000000000000000000000000000000000000..98fb24563b31859ded6942f452463c1968887522 GIT binary patch literal 8765 zcmeHNRZ|>*u3p>=6e;e-t(4-jNO5;}cV}^TSfogyxclPni?kGXcXxNWz5n1mo`>_0 zNxnSfn@KX0nIut43X&M8M5q7&07F_zT;-om003YB$cXbkjaDQ00&ytU>vGCi&OI^Mm%yW8u~Of4)- z&dbYt^d1}xdn?TSmIIk?^b(iU^cR!d`^v#F0Wl0{uv<(5C`X$*zghC)};TXi=lM}oCp`q=jWe3%DLZ{wdN-25y?;8g65ghnZa40q7eMaeA_I&s(I*~0cJZ=XU z@UXBimpyRyPOI+j2?+^--)!eL{?O%6q3xD1PkXMjh@`QOGxf-2@!?IEjQ1yfmfhIi zE(n?#8_)j*u4hNY;_r4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