sync with master
authorJinkun Jang <jinkun.jang@samsung.com>
Mon, 18 Mar 2013 06:26:29 +0000 (15:26 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Mon, 18 Mar 2013 06:26:29 +0000 (15:26 +0900)
38 files changed:
LICENSE [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/FeatureManagerForm.h [new file with mode: 0644]
project/inc/FeatureSetGenerator.h [new file with mode: 0644]
project/inc/FileManagerForm.h [new file with mode: 0644]
project/inc/GeneratePanel.h [new file with mode: 0644]
project/inc/IFeatureSetGeneratorListener.h [new file with mode: 0644]
project/inc/ImageFeatureApp.h [new file with mode: 0644]
project/inc/ImageFeatureFormFactory.h [new file with mode: 0644]
project/inc/ImageFeaturePanelFactory.h [new file with mode: 0644]
project/inc/MainForm.h [new file with mode: 0644]
project/inc/UpdatePanel.h [new file with mode: 0644]
project/manifest.xml [new file with mode: 0644]
project/res/screen-density-high/home_type3.png [new file with mode: 0644]
project/res/screen-density-high/message_type3.png [new file with mode: 0644]
project/res/screen-density-xhigh/home_type3.png [new file with mode: 0644]
project/res/screen-density-xhigh/message_type3.png [new file with mode: 0644]
project/res/screen-size-normal/IDC_GENERATION_MODE_PANEL.xml [new file with mode: 0644]
project/res/screen-size-normal/IDC_MESSAGE_POPUP.xml [new file with mode: 0644]
project/res/screen-size-normal/IDC_UPDATE_MODE_PANEL.xml [new file with mode: 0644]
project/res/screen-size-normal/IDF_FORM.xml [new file with mode: 0644]
project/shared/data/nofile.dummy [new file with mode: 0755]
project/shared/res/screen-density-xhigh/mainmenu.png [new file with mode: 0644]
project/shared/trusted/nofile.dummy [new file with mode: 0755]
project/src/FeatureManagerForm.cpp [new file with mode: 0644]
project/src/FeatureSetGenerator.cpp [new file with mode: 0644]
project/src/FileManagerForm.cpp [new file with mode: 0644]
project/src/GeneratePanel.cpp [new file with mode: 0644]
project/src/ImageFeatureApp.cpp [new file with mode: 0644]
project/src/ImageFeatureAppEntry.cpp [new file with mode: 0644]
project/src/ImageFeatureFormFactory.cpp [new file with mode: 0644]
project/src/ImageFeaturePanelFactory.cpp [new file with mode: 0644]
project/src/MainForm.cpp [new file with mode: 0644]
project/src/UpdatePanel.cpp [new file with mode: 0644]
sample.xml [new file with mode: 0644]
screenshot.png [new file with mode: 0755]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
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 (file)
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 100644 (file)
index 0000000..0b88bef
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?> 
+<?xml-stylesheet type="text/xsl" href="../../../../description.xsl"?>
+
+<Overview version="0.17.1">
+  <SampleName> ImageFeatureManager </SampleName>
+  <SampleVersion>1.0</SampleVersion>
+  <Preview>screenshot.png</Preview>
+  <Description>The ImageFeatureManager sample application demonstrates how you can enable your device to generate and update image feature for image recognition.
+  </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/FeatureManagerForm.h b/project/inc/FeatureManagerForm.h
new file mode 100644 (file)
index 0000000..ecdc941
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _FEATURE_MANAGER_FORM_H_
+#define _FEATURE_MANAGER_FORM_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FUi.h>
+#include <FIo.h>
+
+#include <FUixVisionImageFeatureManager.h>
+#include <FUixVisionImageFeatureInfo.h>
+
+class FeatureManagerForm
+    : public Tizen::Ui::Controls::Form
+    , public Tizen::Ui::Controls::IListViewItemProvider
+    , public Tizen::Ui::Controls::IListViewItemEventListener
+    , public Tizen::Ui::IActionEventListener
+    , public Tizen::Ui::Controls::IFormBackEventListener
+    , public Tizen::Ui::Scenes::ISceneEventListener
+{
+public:
+    FeatureManagerForm(void);
+    virtual ~FeatureManagerForm(void);
+
+    bool Initialize(void);
+    bool CreateMainList(void);
+
+    virtual result OnInitializing(void);
+    virtual result OnTerminating(void);
+
+    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);
+    virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
+    virtual void OnItemReordered(Tizen::Ui::Controls::ListView &view, int oldIndex, int newIndex);
+
+    virtual int GetItemCount(void);
+    virtual Tizen::Ui::Controls::ListItemBase*  CreateItem (int index, int itemWidth);
+    virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth);
+
+    void OnActionPerformed (const Tizen::Ui::Control &source, int actionId);
+
+    void SetDatabasePath(Tizen::Base::String path);
+    void SetDatabase(Tizen::Uix::Vision::ImageFeatureManager* pDatabase);
+
+private:
+
+    void GetDirs(Tizen::Base::String dirPath);
+    bool CheckExt(Tizen::Base::String fileName);
+    void GoDownDir(void);
+    void GoUpDir(Tizen::Base::String dir);
+    bool IsFile(Tizen::Base::String filePath);
+
+    void OnFormBackRequested(Tizen::Ui::Controls::Form &source);
+
+    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:
+    static const int ID_FORMAT_STRING = 500;
+    static const int ID_FORMAT_BITMAP = 501;
+    static const int ID_BUTTON_CLOSE_POPUP   = 502;
+
+    static const int ID_ITEM_DELETE   = 505;
+    static const int ID_ITEM_DETAILS  = 506;
+
+    static const int ID_BUTTON_SAVE = 511;
+
+    Tizen::Ui::Controls::ListView*           __pList;
+    Tizen::Ui::Controls::Label*              __pLabel;
+    Tizen::Ui::Controls::ListContextItem*    __pItemContext;
+    Tizen::Ui::Controls::Popup*              __pPopup;
+
+private:
+    class StrComparer
+        : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
+    {
+        virtual result Compare(const Tizen::Base::String& str1, const Tizen::Base::String& str2, int& cmp) const
+        {
+            cmp = Tizen::Base::String::Compare(str1, str2);
+            return E_SUCCESS;
+        }
+    };
+};
+
+#endif
diff --git a/project/inc/FeatureSetGenerator.h b/project/inc/FeatureSetGenerator.h
new file mode 100644 (file)
index 0000000..f051bef
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _DB_GENERATOR_H_
+#define _DB_GENERATOR_H_
+
+#include <FBase.h>
+#include <FUixVisionImageFeatureManager.h>
+#include "IFeatureSetGeneratorListener.h"
+
+struct ResultInfo
+{
+    ResultInfo(void)
+        : appendTime(-1)
+        , writeTime(-1)
+        , appendedObjectsNumber(-1)
+       , rejectedObjectsNumber(-1)
+        , totalObjectsNumber(-1)
+    {}
+
+    int appendTime;
+    int writeTime;
+    int appendedObjectsNumber;
+    int rejectedObjectsNumber;
+    int totalObjectsNumber;
+};
+
+class FeatureSetGenThread: public Tizen::Base::Runtime::Thread
+{
+public:
+
+    FeatureSetGenThread(void);
+    ~FeatureSetGenThread(void);
+    result Construct(void);
+
+    void SetListener(IFeatureSetGeneratorListener*);
+    void SetImagePath(const Tizen::Base::String& imPath);
+    void SetFeatureManager(Tizen::Uix::Vision::ImageFeatureManager* pImageFeatureManager);
+    void GetResults(ResultInfo&);
+
+private:
+    Tizen::Base::Object* Run(void);
+    bool Generate(Tizen::Base::String imPath, ResultInfo&);
+    bool CheckExt(Tizen::Base::String fileName);
+
+private:
+    IFeatureSetGeneratorListener*                                    __pListener;
+    Tizen::Base::String                                        __imagePath;
+    Tizen::Base::String                                        __databasePath;
+    ResultInfo                                                 __resultInfo;
+    Tizen::Base::Collection::ArrayListT<Tizen::Base::String>   __files;
+    Tizen::Uix::Vision::ImageFeatureManager*                   __pImageFeatureManager;
+
+private:
+    class StrComparer
+        : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
+    {
+        virtual result Compare(const Tizen::Base::String& str1, const Tizen::Base::String& str2, int& cmp) const
+        {
+            cmp = Tizen::Base::String::Compare(str1, str2);
+            return E_SUCCESS;
+        }
+    };
+
+};
+
+#endif // DBGENERATOR_H_
diff --git a/project/inc/FileManagerForm.h b/project/inc/FileManagerForm.h
new file mode 100644 (file)
index 0000000..b8928c8
--- /dev/null
@@ -0,0 +1,94 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _FILE_MANAGER_H_
+#define _FILE_MANAGER_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FUi.h>
+#include <FIo.h>
+
+class FileManagerForm
+    : public Tizen::Ui::Controls::Form
+    , public Tizen::Ui::Controls::IListViewItemProvider
+    , public Tizen::Ui::Controls::IListViewItemEventListener
+    , public Tizen::Ui::IActionEventListener
+    , public Tizen::Ui::Controls::IFormBackEventListener
+    , public Tizen::Ui::Scenes::ISceneEventListener
+{
+public:
+    FileManagerForm(void);
+    virtual ~FileManagerForm(void);
+
+    bool Initialize(const Tizen::Base::Collection::ArrayListT<Tizen::Base::String>& , bool);
+    bool CreateMainList(void);
+
+    virtual result OnInitializing(void);
+    virtual result OnTerminating(void);
+
+    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);
+    virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
+    virtual void OnItemReordered(Tizen::Ui::Controls::ListView &view, int oldIndex, int newIndex);
+
+    virtual int GetItemCount(void);
+    virtual Tizen::Ui::Controls::ListItemBase*  CreateItem(int index, int itemWidth);
+    virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth);
+
+    void OnActionPerformed(const Tizen::Ui::Control &source, int actionId);
+
+private:
+    void GetDirs(Tizen::Base::String dirPath);
+    bool CheckExt(Tizen::Base::String fileName);
+    void GoDownDir(void);
+    void GoUpDir(Tizen::Base::String dir);
+    bool IsFile(Tizen::Base::String filePath);
+
+    void OnFormBackRequested(Tizen::Ui::Controls::Form &source);
+
+    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:
+    static const int ID_FORMAT_STRING = 500;
+    static const int ID_FORMAT_BITMAP = 501;
+    static const int ID_BUTTON_EXIT = 502;
+
+    Tizen::Ui::Controls::ListView*                             __pList;
+    Tizen::Base::Collection::ArrayListT<Tizen::Base::String>   __files;
+    Tizen::Base::String                                        __currentPath;
+    Tizen::Ui::Controls::EditField*                            __pEditField;
+    Tizen::Graphics::Bitmap*                                   __pFileIcon;
+    Tizen::Graphics::Bitmap*                                   __pFolderIcon;
+    Tizen::Base::Collection::ArrayListT<Tizen::Base::String>   __fileExts;
+    bool                                                       __canChooseNew;
+    bool                                                       __canChooseOne;
+
+
+private:
+    class StrComparer
+        : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
+    {
+        virtual result Compare(const Tizen::Base::String& str1, const Tizen::Base::String& str2, int& cmp) const
+        {
+            cmp = Tizen::Base::String::Compare(str1, str2);
+            return E_SUCCESS;
+        }
+    };
+
+};
+
+#endif // _FILE_MANAGER_H_
diff --git a/project/inc/GeneratePanel.h b/project/inc/GeneratePanel.h
new file mode 100644 (file)
index 0000000..c3369c0
--- /dev/null
@@ -0,0 +1,46 @@
+
+#ifndef _GENERATEPANEL_H_
+#define _GENERATEPANEL_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include "FeatureSetGenerator.h"
+
+
+class GeneratePanel
+    : public Tizen::Ui::Controls::Panel
+    , public Tizen::Ui::IActionEventListener
+    , public Tizen::Ui::Scenes::ISceneEventListener
+    , public IFeatureSetGeneratorListener
+{
+public:
+    GeneratePanel(void);
+    virtual ~GeneratePanel(void);
+    bool Initialize();
+    result OnInitializing(void);
+    result OnTerminating(void);
+
+    virtual void OnFinish(void);
+    virtual void OnImageProcessed(int im_no, int total);
+
+    virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+    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);
+
+// Implementation
+protected:
+    static const int ID_BUTTON_CHOOSE_FEATURE_SET_PATH = 401;
+    static const int ID_BUTTON_GENERATE_FEATURE_SET = 402;
+    static const int ID_BUTTON_CHOOSE_IMAGE_FOLDER_PATH = 501;
+
+// Generated call-back functions
+public:
+
+private:
+    Tizen::Base::String              __currentFeaturePath;
+    Tizen::Base::String              __currentImagePath;
+};
+
+#endif
diff --git a/project/inc/IFeatureSetGeneratorListener.h b/project/inc/IFeatureSetGeneratorListener.h
new file mode 100644 (file)
index 0000000..8d31daa
--- /dev/null
@@ -0,0 +1,27 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _IBASE_GENERATOR_LISTENER_H_
+#define _IBASE_GENERATOR_LISTENER_H_
+
+class IFeatureSetGeneratorListener
+{
+public:
+    virtual ~IFeatureSetGeneratorListener()
+    {
+    }
+    virtual void OnImageProcessed(int im_no, int total) = 0;
+    virtual void OnFinish(void) = 0;
+};
+
+#endif /* _IBASE_GENERATOR_LISTENER_H_ */
diff --git a/project/inc/ImageFeatureApp.h b/project/inc/ImageFeatureApp.h
new file mode 100644 (file)
index 0000000..c2a7f46
--- /dev/null
@@ -0,0 +1,65 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _IMAGE_FEATURE_APP_H_
+#define _IMAGE_FEATURE_APP_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+class ImageFeatureApp
+    : public Tizen::App::UiApp
+    , public Tizen::System::IScreenEventListener
+{
+public:
+    static Tizen::App::UiApp* CreateInstance(void);
+
+public:
+    ImageFeatureApp(void);
+    virtual~ImageFeatureApp(void);
+
+public:
+    // 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 // _IMAGE_FEATURE_APP_H_
diff --git a/project/inc/ImageFeatureFormFactory.h b/project/inc/ImageFeatureFormFactory.h
new file mode 100644 (file)
index 0000000..261d159
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _IMAGEFEATURE_FORM_FACTORY_H_
+#define _IMAGEFEATURE_FORM_FACTORY_H_
+
+#include <FUi.h>
+
+
+class ImageFeatureFormFactory
+    : public Tizen::Ui::Scenes::IFormFactory
+{
+public:
+    ImageFeatureFormFactory(void);
+    virtual ~ImageFeatureFormFactory(void);
+
+    virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _IMAGEFEATURE_FORM_FACTORY_H_
diff --git a/project/inc/ImageFeaturePanelFactory.h b/project/inc/ImageFeaturePanelFactory.h
new file mode 100644 (file)
index 0000000..ca2efab
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _IMAGE_FEATURE_PANEL_FACTORY_H_
+#define _IMAGE_FEATURE_PANEL_FACTORY_H_
+
+#include <FUi.h>
+
+
+class ImageFeaturePanelFactory
+    : public Tizen::Ui::Scenes::IPanelFactory
+{
+public:
+    ImageFeaturePanelFactory(void);
+    virtual ~ImageFeaturePanelFactory(void);
+
+    virtual Tizen::Ui::Controls::Panel* CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _IMAGE_FEATURE_PANEL_FACTORY_H_
diff --git a/project/inc/MainForm.h b/project/inc/MainForm.h
new file mode 100644 (file)
index 0000000..f6d1319
--- /dev/null
@@ -0,0 +1,76 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#ifndef _MAIN_FORM_H_
+#define _MAIN_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include "FeatureSetGenerator.h"
+
+
+class MainForm
+    : public Tizen::Ui::Controls::Form
+    , public Tizen::Ui::IActionEventListener
+    , public Tizen::Ui::Controls::IFormBackEventListener
+    , public Tizen::Ui::Scenes::ISceneEventListener
+    , public IFeatureSetGeneratorListener
+{
+public:
+    MainForm(void);
+    virtual ~MainForm(void);
+    bool Initialize(void);
+
+public:
+    // DBgenerator Listener:
+    virtual void OnImageProcessed(int im_no, int total);
+    virtual void OnFinish(void);
+
+    virtual result OnInitializing(void);
+    virtual result OnTerminating(void);
+    virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+    virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+    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);
+
+    virtual result OnDraw(void);
+
+    virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+
+    void AppendImageFolder(const Tizen::Base::String& imPath, IFeatureSetGeneratorListener* listener = null);
+
+public:
+    static const int ID_BUTTON_GENERATE_MODE = 201;
+    static const int ID_BUTTON_UPDATE_MODE   = 202;
+
+    static const int ID_BUTTON_RESULTS = 333;
+    static const int ID_BUTTON_CLOSE_RESULTS = 334;
+
+    static const RequestId REQUEST_RESULT = 505;
+
+    Tizen::Uix::Vision::ImageFeatureManager* GetFeatureManager(void);
+
+private:
+    FeatureSetGenThread                       __dbGen;
+    ResultInfo                                __resInfo;
+    Tizen::Base::String                       __headerTitle;
+    Tizen::Ui::Controls::RadioGroup*          __pRadioGroupMode;
+    Tizen::Uix::Vision::ImageFeatureManager*  __pFeatureManager;
+
+    Tizen::Ui::Controls::Popup*               __pMessagePopup;
+    Tizen::Ui::Controls::Label*               __pMessageLabel;
+};
+
+#endif //_MAIN_FORM_H_
diff --git a/project/inc/UpdatePanel.h b/project/inc/UpdatePanel.h
new file mode 100644 (file)
index 0000000..7f6cd60
--- /dev/null
@@ -0,0 +1,45 @@
+
+#ifndef _UPDATEPANEL_H_
+#define _UPDATEPANEL_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include <FUixVisionImageFeatureManager.h>
+#include <FApp.h>
+#include "FeatureSetGenerator.h"
+
+
+class UpdatePanel
+    : public Tizen::Ui::Controls::Panel
+    , public Tizen::Ui::IActionEventListener
+    , public Tizen::Ui::Scenes::ISceneEventListener
+    , public IFeatureSetGeneratorListener
+{
+public:
+    UpdatePanel(void);
+    virtual ~UpdatePanel(void);
+    bool Initialize();
+    result OnInitializing(void);
+    result OnTerminating(void);
+    virtual void OnFinish(void);
+    virtual void OnImageProcessed(int im_no, int total);
+
+    virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+    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);
+
+    // Implementation
+protected:
+    static const int ID_BUTTON_DELETE_FEATURES = 301;
+    static const int ID_BUTTON_UPDATE_FEATURE_SET = 302;
+    static const int ID_BUTTON_LOAD_FEATURE_SET = 303;
+    static const int ID_BUTTON_CHOOSE_IMAGE_FOLDER = 304;
+
+private:
+    Tizen::Base::String                         __currentFeaturePath;
+    Tizen::Base::String                         __currentImagePath;
+};
+
+#endif
diff --git a/project/manifest.xml b/project/manifest.xml
new file mode 100644 (file)
index 0000000..3498a38
--- /dev/null
@@ -0,0 +1,31 @@
+<?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/>
+    <Url/>
+    <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.1</ApiVersion>
+        <Privileges>
+            <Privilege>http://tizen.org/privilege/power</Privilege>
+        </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-high/home_type3.png b/project/res/screen-density-high/home_type3.png
new file mode 100644 (file)
index 0000000..71a1985
Binary files /dev/null and b/project/res/screen-density-high/home_type3.png differ
diff --git a/project/res/screen-density-high/message_type3.png b/project/res/screen-density-high/message_type3.png
new file mode 100644 (file)
index 0000000..63b5816
Binary files /dev/null and b/project/res/screen-density-high/message_type3.png differ
diff --git a/project/res/screen-density-xhigh/home_type3.png b/project/res/screen-density-xhigh/home_type3.png
new file mode 100644 (file)
index 0000000..0d41338
Binary files /dev/null and b/project/res/screen-density-xhigh/home_type3.png differ
diff --git a/project/res/screen-density-xhigh/message_type3.png b/project/res/screen-density-xhigh/message_type3.png
new file mode 100644 (file)
index 0000000..49532ed
Binary files /dev/null and b/project/res/screen-density-xhigh/message_type3.png differ
diff --git a/project/res/screen-size-normal/IDC_GENERATION_MODE_PANEL.xml b/project/res/screen-size-normal/IDC_GENERATION_MODE_PANEL.xml
new file mode 100644 (file)
index 0000000..88de83e
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE ScenePanel SYSTEM "UIForm.dtd">
+<ScenePanel Bversion="3.0.0.201302011734" Dversion="20120315">
+    <Panel id="IDC_GENERATION_MODE_PANEL">
+        <property backgroundColor="" backgroundColorOpacity="0" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
+        <layout height="811" mode="Portrait" type="NONE" width="720" x="0" y="143"/>
+        <layout height="300" mode="Landscape" type="NONE" width="93" x="0" y="0"/>
+    </Panel>
+    <Button id="IDC_BUTTON_CHOOSE_FEATURE_SET_PATH" parent="IDC_GENERATION_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="93" mode="Portrait" width="650" x="38" y="97"/>
+        <layout height="76" mode="Landscape" width="362" x="0" y="0"/>
+    </Button>
+    <Button id="IDC_BUTTON_CHOOSE_IMAGE_FOLDER" parent="IDC_GENERATION_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="93" mode="Portrait" width="650" x="39" y="330"/>
+        <layout height="76" mode="Landscape" width="362" x="0" y="0"/>
+    </Button>
+    <Label id="IDC_LABEL1" parent="IDC_GENERATION_MODE_PANEL">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Choose Added Image Folder" textColor="" textSize="33" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_BOTTOM"/>
+        <layout height="93" mode="Portrait" width="650" x="38" y="218"/>
+        <layout height="76" mode="Landscape" width="362" x="0" y="0"/>
+    </Label>
+    <Label id="IDC_LABEL2" parent="IDC_GENERATION_MODE_PANEL">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Create Feature Set File" textColor="" textSize="33" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_BOTTOM"/>
+        <layout height="86" mode="Portrait" width="651" x="38" y="0"/>
+        <layout height="71" mode="Landscape" width="736" x="0" y="0"/>
+    </Label>
+    <Button id="IDC_BUTTON_GENERATE_FEATURE_SET" parent="IDC_GENERATION_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Generate Feature Set File" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="98" mode="Portrait" width="650" x="38" y="530"/>
+        <layout height="76" mode="Landscape" width="362" x="0" y="0"/>
+    </Button>
+</ScenePanel>
diff --git a/project/res/screen-size-normal/IDC_MESSAGE_POPUP.xml b/project/res/screen-size-normal/IDC_MESSAGE_POPUP.xml
new file mode 100644 (file)
index 0000000..e4f7131
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE ScenePopup SYSTEM "UIForm.dtd">
+<ScenePopup Bversion="2.0.0.201302151552" Dversion="20120315">
+    <Popup id="IDC_MESSAGE_POPUP">
+        <property color="" titleText="Result" titleTextColor=""/>
+        <layout height="700" mode="Portrait" style="" type="NONE" width="600"/>
+        <layout height="680" mode="Landscape" style="" type="NONE" width="430"/>
+    </Popup>
+    <Label id="IDC_LABEL_MASSEGE_TEXT" parent="IDC_MESSAGE_POPUP">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" text="Label1" textColor="" textSize="44" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_TOP"/>
+        <layout height="410" mode="Portrait" width="500" x="32" y="50"/>
+        <layout height="74" mode="Landscape" width="375" x="15" y="85"/>
+    </Label>
+    <Button id="IDC_BUTTON_MESSAGE_CLOSE" parent="IDC_MESSAGE_POPUP">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Close" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="88" mode="Portrait" width="283" x="140" y="507"/>
+        <layout height="70" mode="Landscape" width="353" x="37" y="409"/>
+    </Button>
+</ScenePopup>
diff --git a/project/res/screen-size-normal/IDC_UPDATE_MODE_PANEL.xml b/project/res/screen-size-normal/IDC_UPDATE_MODE_PANEL.xml
new file mode 100644 (file)
index 0000000..116b778
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE ScenePanel SYSTEM "UIForm.dtd">
+<ScenePanel Bversion="3.0.0.201302011734" Dversion="20120315">
+    <Panel id="IDC_UPDATE_MODE_PANEL">
+        <property backgroundColor="" backgroundColorOpacity="0" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
+        <layout height="844" mode="Portrait" type="NONE" width="720" x="0" y="143"/>
+        <layout height="300" mode="Landscape" type="NONE" width="93" x="0" y="0"/>
+    </Panel>
+    <Label id="IDC_LABEL1" parent="IDC_UPDATE_MODE_PANEL">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Load Feature Set File" textColor="" textSize="33" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_BOTTOM"/>
+        <layout height="90" mode="Portrait" width="644" x="40" y="0"/>
+        <layout height="71" mode="Landscape" width="736" x="85" y="0"/>
+    </Label>
+    <Label id="IDC_LABEL2" parent="IDC_UPDATE_MODE_PANEL">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_CENTER" text="Choose Added Image Folder" textColor="" textSize="33" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_BOTTOM"/>
+        <layout height="90" mode="Portrait" width="644" x="40" y="218"/>
+        <layout height="76" mode="Landscape" width="362" x="128" y="0"/>
+    </Label>
+    <Button id="IDC_BUTTON_UPDATE_FEATURE_SET" parent="IDC_UPDATE_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Update Feature Set File" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="120" mode="Portrait" width="644" x="40" y="619"/>
+        <layout height="76" mode="Landscape" width="362" x="321" y="0"/>
+    </Button>
+    <Button id="IDC_BUTTON_DELETE_FEATURES" parent="IDC_UPDATE_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Delete Features" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="120" mode="Portrait" width="644" x="40" y="473"/>
+        <layout height="76" mode="Landscape" width="362" x="314" y="0"/>
+    </Button>
+    <Button id="IDC_BUTTON_LOAD_FEATURE_SET" parent="IDC_UPDATE_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="90" mode="Portrait" width="644" x="40" y="97"/>
+        <layout height="76" mode="Landscape" width="362" x="238" y="0"/>
+    </Button>
+    <Button id="IDC_BUTTON_UPDATE_IMAGE_FOLDER" parent="IDC_UPDATE_MODE_PANEL">
+        <property DisabledBitmapX="0" DisabledBitmapY="0" NormalBitmapX="0" NormalBitmapY="0" PressedBitmapX="0" PressedBitmapY="0" disableTextColor="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="" textSize="33" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="90" mode="Portrait" width="644" x="40" y="307"/>
+        <layout height="76" mode="Landscape" width="362" x="386" y="0"/>
+    </Button>
+</ScenePanel>
diff --git a/project/res/screen-size-normal/IDF_FORM.xml b/project/res/screen-size-normal/IDF_FORM.xml
new file mode 100644 (file)
index 0000000..e652021
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE Scene SYSTEM "UIForm.dtd">
+<Scene Bversion="3.0.0.201302011734" Dversion="20120315">
+    <LogicalCoordinate>720</LogicalCoordinate>
+    <Form id="IDF_FORM">
+        <property backgroundColor="" backgroundColorOpacity="100" orientation="Portrait" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+        <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="NONE"/>
+        <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="NONE"/>
+    </Form>
+    <Footer>
+        <property backgroundBitmapPath="" color="" colorOpacity="0" disabledButtonColor="" disabledButtonColorOpacity="0" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="0" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="0" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="0" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="0" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="0" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="0" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="0" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="0" selectedItemTextColor="" showBackButton="true"/>
+        <itemSet/>
+    </Footer>
+    <Header>
+        <property backgroundBitmapPath="" color="" colorOpacity="0" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="0" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="0" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="0" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="0" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="0" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="0" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="0" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="0" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="0" selectedItemTextColor="" titleIconPath="" titleText="ImageFeatureManager" titleTextColor=""/>
+        <itemSet/>
+    </Header>
+    <Panel id="IDC_CHOOSE_MODE_PANEL" parent="IDF_FORM">
+        <property backgroundColor="" backgroundColorOpacity="0" compositeEnabled="true" groupStyle="GROUP_STYLE_TOP"/>
+        <layout height="143" horizontalDirection="HORIZONTAL_DIRECTION_RIGHTWARD" mode="Portrait" type="LAYOUT_HORIZONTAL_BOX" width="720" x="0" y="0"/>
+        <layout height="80" horizontalDirection="HORIZONTAL_DIRECTION_RIGHTWARD" mode="Landscape" type="LAYOUT_HORIZONTAL_BOX" width="1278" x="0" y="20"/>
+    </Panel>
+    <CheckButton id="IDC_GENERATION_MODE_BUTTON" parent="IDC_CHOOSE_MODE_PANEL">
+        <property backgroundStyle="BACKGROUND_STYLE_NONE" colorOfText="" colorOfTitleText="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" disabledTitleTextColor="" groupId="0" groupStyle="GROUP_STYLE_NONE" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" highlightedTitleTextColor="" horizontalAlign="ALIGN_LEFT" normalColor="" normalColorOpacity="100" pressedColor="" pressedColorOpacity="100" pressedTextColor="" pressedTitleTextColor="" showTitleText="true" text="Mode" titleText="Generation" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="143" horizontalFitPolicy="FIT_POLICY_FIXED" mode="Portrait" spacing="0" style="CHECK_BUTTON_STYLE_RADIO" verticalAlignment="LAYOUT_VERTICAL_ALIGN_TOP" verticalBottomMargin="0" verticalFitPolicy="FIT_POLICY_FIXED" verticalTopMargin="0" weight="0.0" width="360"/>
+        <layout height="713" horizontalFitPolicy="FIT_POLICY_FIXED" mode="Landscape" spacing="0" style="CHECK_BUTTON_STYLE_RADIO" verticalAlignment="LAYOUT_VERTICAL_ALIGN_TOP" verticalBottomMargin="0" verticalFitPolicy="FIT_POLICY_FIXED" verticalTopMargin="0" weight="0.0" width="207"/>
+    </CheckButton>
+    <CheckButton id="IDC_UPDATE_MODE_BUTTON" parent="IDC_CHOOSE_MODE_PANEL">
+        <property backgroundStyle="BACKGROUND_STYLE_NONE" colorOfText="" colorOfTitleText="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" disabledTitleTextColor="" groupId="0" groupStyle="GROUP_STYLE_NONE" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" highlightedTitleTextColor="" horizontalAlign="ALIGN_LEFT" normalColor="" normalColorOpacity="100" pressedColor="" pressedColorOpacity="100" pressedTextColor="" pressedTitleTextColor="" showTitleText="true" text="Mode" titleText="Update" verticalAlign="ALIGN_MIDDLE"/>
+        <layout height="143" horizontalFitPolicy="FIT_POLICY_FIXED" mode="Portrait" spacing="0" style="CHECK_BUTTON_STYLE_RADIO" verticalAlignment="LAYOUT_VERTICAL_ALIGN_TOP" verticalBottomMargin="0" verticalFitPolicy="FIT_POLICY_FIXED" verticalTopMargin="0" weight="0.0" width="360"/>
+        <layout height="703" horizontalFitPolicy="FIT_POLICY_FIXED" mode="Landscape" spacing="0" style="CHECK_BUTTON_STYLE_RADIO" verticalAlignment="LAYOUT_VERTICAL_ALIGN_TOP" verticalBottomMargin="0" verticalFitPolicy="FIT_POLICY_FIXED" verticalTopMargin="0" weight="0.0" width="207"/>
+    </CheckButton>
+</Scene>
diff --git a/project/shared/data/nofile.dummy b/project/shared/data/nofile.dummy
new file mode 100755 (executable)
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 100644 (file)
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 100755 (executable)
index 0000000..e69de29
diff --git a/project/src/FeatureManagerForm.cpp b/project/src/FeatureManagerForm.cpp
new file mode 100644 (file)
index 0000000..6260907
--- /dev/null
@@ -0,0 +1,340 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "FeatureManagerForm.h"
+#include "MainForm.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+
+FeatureManagerForm::FeatureManagerForm(void)
+    : __pList(null)
+    , __pPopup(0)
+{
+}
+
+FeatureManagerForm::~FeatureManagerForm(void)
+{
+}
+
+bool
+FeatureManagerForm::Initialize(void)
+{
+    Construct(FORM_STYLE_NORMAL| FORM_STYLE_HEADER| FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+    __pItemContext = new (std::nothrow) ListContextItem();
+    __pItemContext->Construct();
+    __pItemContext->AddElement(ID_ITEM_DELETE, L"Delete");
+    __pItemContext->AddElement(ID_ITEM_DETAILS, L"Details");
+
+    return true;
+}
+
+result
+FeatureManagerForm::OnInitializing(void)
+{
+    Header* pHeader = GetHeader();
+    pHeader->SetTitleText(L"Manage database");
+    if (!CreateMainList())
+    {
+        return false;
+    }
+
+    Footer* pFooter = GetFooter();
+
+    pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+    Form::SetFormBackEventListener(this);
+
+    pFooter->SetBackButton();
+
+    pFooter->AddActionEventListener(*this);
+
+    return E_SUCCESS;
+}
+
+result
+FeatureManagerForm::OnTerminating(void)
+{
+    result r = E_SUCCESS;
+    return r;
+}
+
+bool
+FeatureManagerForm::CreateMainList(void)
+{
+    __pList = new ListView();
+    __pList->Construct(Rectangle(0, 80, GetClientAreaBounds().width, GetClientAreaBounds().height - 120), true, false);
+    __pList->SetItemProvider(*this);
+    __pList->AddListViewItemEventListener(*this);
+    AddControl(*__pList);
+
+    return true;
+}
+
+
+void
+FeatureManagerForm::OnActionPerformed (const Tizen::Ui::Control &source, int actionId)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    switch(actionId)
+    {
+    case ID_BUTTON_SAVE:
+    {
+        if(pForm->GetFeatureManager() != null)
+        {
+            pForm->GetFeatureManager()->Flush(null);
+        }
+    }
+    break;
+    case ID_BUTTON_CLOSE_POPUP:
+    {
+        __pPopup->SetShowState(false);
+        __pPopup->SetEnabled(false);
+        delete __pPopup;
+    }
+    break;
+    default:
+        break;
+    }
+}
+
+void
+FeatureManagerForm::OnFormBackRequested(Tizen::Ui::Controls::Form&  source)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+    pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_OUT));
+}
+
+
+int
+FeatureManagerForm::GetItemCount(void)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    if(pForm == null)
+    {
+        return 0;
+    }
+
+    if (pForm->GetFeatureManager())
+    {
+        return pForm->GetFeatureManager()->GetTotalNumberOfFeatures();
+    }
+    return 0;
+}
+
+bool
+FeatureManagerForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
+{
+    delete pItem;
+    pItem = null;
+    return true;
+}
+
+Tizen::Ui::Controls::ListItemBase*
+FeatureManagerForm::CreateItem(int index, int itemWidth)
+{
+    ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+    CustomItem* pItem = new (std::nothrow) CustomItem();
+    Rectangle thumbnailElementRect(10, 20, 200, 200);
+    Rectangle descElementRect(220, 20, 650, 50);
+    Rectangle idElementRect(220, 40, 650, 30);
+    Dimension itemDimension(itemWidth, 200);
+
+    pItem->Construct(itemDimension, style);
+
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+    if (pForm->GetFeatureManager())
+    {
+        const Tizen::Uix::Vision::ImageFeatureInfo*  pFeature = pForm->GetFeatureManager()->GetImageFeatureInfo(index);
+        if(pFeature == null)
+        {
+            return pItem;
+        }
+
+        ByteBuffer* pByteBuffer = null;
+        pByteBuffer = pFeature->GetThumbnailN();
+        if (pByteBuffer == null)
+        {
+            return null;
+        }
+        int __thumbnailWidth = pFeature->GetThumbnailWidth();
+        int __thumbnailHeight = pFeature->GetThumbnailHeight();
+        unsigned char*     ptr  = const_cast<unsigned char*>(pByteBuffer->GetPointer());
+        unsigned char*     end  = ptr + __thumbnailWidth * __thumbnailHeight;
+
+        ByteBuffer imageBuffer;
+        imageBuffer.Construct(__thumbnailWidth * __thumbnailHeight * 4);
+        unsigned char*     iptr  = const_cast<unsigned char*>(imageBuffer.GetPointer());
+
+        for (;ptr < end; ++ptr)
+        {
+            *(iptr++) = *ptr;
+            *(iptr++) = *ptr;
+            *(iptr++) = *ptr;
+            *(iptr++) = 255;
+        }
+
+        Bitmap* pBitmap = new Bitmap();
+        pBitmap->Construct(imageBuffer, Dimension(__thumbnailWidth, __thumbnailHeight), BITMAP_PIXEL_FORMAT_R8G8B8A8);
+        pItem->AddElement(thumbnailElementRect, ID_FORMAT_BITMAP, *pBitmap, null, null);
+
+        //before this we should get name of the item
+        Tizen::Base::String name;
+        name.Format(80, L"%i: %ls", index, pFeature->GetDescription().GetPointer());
+
+        pItem->AddElement(descElementRect, ID_FORMAT_STRING, name, true);
+
+        if(pByteBuffer)
+        {
+            delete pByteBuffer;
+        }
+
+    }
+
+    pItem->SetContextItem(__pItemContext);
+
+    return pItem;
+}
+
+void
+FeatureManagerForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &view, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
+{
+    if(status == LIST_ITEM_STATUS_SELECTED)
+    {
+        __pList->UpdateList();
+        __pList->Draw(true);
+        __pList->Show();
+    }
+}
+
+void
+FeatureManagerForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction)
+{
+}
+
+void
+FeatureManagerForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    switch(elementId)
+    {
+    case ID_ITEM_DELETE:
+    {
+        pForm->GetFeatureManager()->DeleteFeature(index);
+        __pList->UpdateList();
+        __pList->Draw(true);
+        __pList->Show();
+        break;
+    }
+    case ID_ITEM_DETAILS:
+    {
+        const Tizen::Uix::Vision::ImageFeatureInfo*  pFeature = pForm->GetFeatureManager()->GetImageFeatureInfo(index);
+
+        __pPopup = new Popup();
+        __pPopup->Construct(true, Dimension(700, 1000));
+        __pPopup->SetTitleText(L"Item details");
+
+        ByteBuffer* pByteBuffer;
+        pByteBuffer = pFeature->GetThumbnailN();
+        if(pByteBuffer == null)
+        {
+            return;
+        }
+
+        int __thumbnailWidth = pFeature->GetThumbnailWidth();
+        int __thumbnailHeight = pFeature->GetThumbnailHeight();
+        unsigned char*     ptr  = const_cast<unsigned char*>(pByteBuffer->GetPointer());
+        unsigned char*     end  = ptr + __thumbnailWidth * __thumbnailHeight;
+
+        ByteBuffer imageBuffer;
+        imageBuffer.Construct(__thumbnailWidth * __thumbnailHeight * 4);
+        unsigned char*     iptr  = const_cast<unsigned char*>(imageBuffer.GetPointer());
+
+        for (;ptr < end; ++ptr)
+        {
+            *(iptr++) = *ptr;
+            *(iptr++) = *ptr;
+            *(iptr++) = *ptr;
+            *(iptr++) = 255;
+        }
+
+        Bitmap* pBitmap = new Bitmap();
+        pBitmap->Construct(imageBuffer, Dimension(__thumbnailWidth, __thumbnailHeight), BITMAP_PIXEL_FORMAT_R8G8B8A8);
+
+        Rectangle rect;
+        rect = __pPopup->GetClientAreaBounds();
+
+        Button* pButton = new Button;
+        pButton->Construct(Rectangle(0, 0, rect.width, rect.width), "");
+        pButton->SetNormalBackgroundBitmap(*pBitmap);
+        pButton->SetActionId(ID_BUTTON_CLOSE_POPUP);
+        pButton->AddActionEventListener(*this);
+        __pPopup->AddControl(*pButton);
+
+        String description = pFeature->GetDescription();
+        String itemId;
+        itemId.Format(256, L"Item id: %i", index);
+
+        Label* pDescLabel = new Label();
+        pDescLabel->Construct(Rectangle(10, rect.width + 50, rect.width, rect.height - rect.width), description);
+        pDescLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
+        __pPopup->AddControl(*pDescLabel);
+
+        Label* pIdLabel = new Label();
+        pIdLabel->Construct(Rectangle(10, rect.width, rect.width, rect.height - rect.width), itemId);
+        pIdLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
+        __pPopup->AddControl(*pIdLabel);
+
+        __pPopup->SetShowState(true);
+        __pPopup->Show();
+        break;
+    }
+    };
+}
+
+void
+FeatureManagerForm::OnItemReordered(Tizen::Ui::Controls::ListView &listView, int oldIndex, int newIndex)
+{
+}
+
+void
+FeatureManagerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+        const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+    __pList->ScrollToItem(0);
+    __pList->UpdateList();
+
+    if(pArgs != null)
+    {
+        pArgs->RemoveAll();
+        delete pArgs;
+    }
+}
+
+void
+FeatureManagerForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
diff --git a/project/src/FeatureSetGenerator.cpp b/project/src/FeatureSetGenerator.cpp
new file mode 100644 (file)
index 0000000..8cd1ccf
--- /dev/null
@@ -0,0 +1,212 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "FeatureSetGenerator.h"
+
+#include <FIo.h>
+#include <FSysSystemTime.h>
+
+FeatureSetGenThread::FeatureSetGenThread(void)
+    : __pListener(0)
+       , __pImageFeatureManager(0)
+{
+}
+
+FeatureSetGenThread::~FeatureSetGenThread(void)
+{
+}
+
+result
+FeatureSetGenThread::Construct(void)
+{
+    return Thread::Construct();
+}
+
+Tizen::Base::Object*
+FeatureSetGenThread::Run(void)
+{
+    __resultInfo.appendTime = 0;
+    __resultInfo.totalObjectsNumber = 0;
+    __resultInfo.appendedObjectsNumber = 0;
+    __resultInfo.rejectedObjectsNumber = 0;
+
+    Generate(__imagePath, __resultInfo);
+
+    if (__pListener)
+    {
+        __pListener->OnFinish();
+    }
+
+    return null;
+}
+
+void
+FeatureSetGenThread::SetListener(IFeatureSetGeneratorListener* pListener)
+{
+    if (__pListener == pListener)
+    {
+        return;
+    }
+    __pListener = pListener;
+}
+
+bool
+FeatureSetGenThread::Generate(Tizen::Base::String imPath, ResultInfo& resInfo)
+{
+    bool isRes = true;
+    int currObject = 0;
+    int objectID = 0;
+
+    if(!__pImageFeatureManager)
+    {
+        return false;
+    }
+
+    Tizen::Base::TimeSpan start(0, 0, 1), finish(0, 0, 1);
+    Tizen::System::SystemTime::GetUptime(start);
+    Tizen::Io::Directory dir;
+
+    result r = dir.Construct(imPath);
+    if (!IsFailed(r))
+    {
+
+        Tizen::Base::String folder(imPath);
+        if (folder[folder.GetLength() - 1] != '/')
+        {
+            folder += "/";
+        }
+
+        Tizen::Io::DirEnumerator* pDirEnum = dir.ReadN();
+        if (!pDirEnum)
+        {
+            return false;
+        }
+
+        while(pDirEnum->MoveNext() == E_SUCCESS)
+        {
+            Tizen::Io::DirEntry dirEntry = pDirEnum->GetCurrentDirEntry();
+            if (!dirEntry.IsDirectory())
+            {
+                if(Tizen::Io::File::IsFileExist(imPath + "/" + dirEntry.GetName()))
+                {
+                    __files.Add(imPath + "/" + dirEntry.GetName());
+                }
+            }
+        }
+        pDirEnum->Reset();
+
+    }
+    else
+    {
+
+        if(CheckExt(imPath) && Tizen::Io::File::IsFileExist(imPath))
+        {
+            __files.Add(imPath);
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    StrComparer* pStrComparer = new StrComparer();
+    __files.Sort(*pStrComparer);
+    delete pStrComparer;
+
+    // Uses an enumerator to access elements in the list
+    Tizen::Base::Collection::IEnumeratorT<Tizen::Base::String>*    pEnum = __files.GetEnumeratorN();
+    Tizen::Base::String     pName;
+
+    while (pEnum->MoveNext() == E_SUCCESS)
+    {
+        pEnum->GetCurrent(pName);
+
+        ++currObject;
+
+        if (__pListener)
+        {
+            __pListener->OnImageProcessed(currObject, __files.GetCount());
+        }
+
+        if (-1 != (objectID = __pImageFeatureManager->AddFeature(pName)))
+        {
+            ++resInfo.appendedObjectsNumber;
+        }
+        else
+        {
+            ++resInfo.rejectedObjectsNumber;
+        }
+    }
+    delete pEnum;
+    __files.RemoveAll();
+
+    resInfo.totalObjectsNumber = __pImageFeatureManager->GetTotalNumberOfFeatures();
+
+    Tizen::System::SystemTime::GetUptime(finish);
+    resInfo.appendTime = 60000 * (finish - start).GetMinutes() + 1000 * (finish - start).GetSeconds()
+        + (finish - start).GetMilliseconds();
+
+    Tizen::System::SystemTime::GetUptime(start);
+    Tizen::System::SystemTime::GetUptime(finish);
+    resInfo.writeTime = 60000 * (finish - start).GetMinutes() + 1000 * (finish - start).GetSeconds() + (finish - start).GetMilliseconds();
+
+    //Causing UI frees after exit
+    Sleep(500);
+
+    return isRes;
+}
+
+void
+FeatureSetGenThread::SetImagePath(const Tizen::Base::String& imPath)
+{
+    __imagePath = imPath;
+}
+
+void
+FeatureSetGenThread::GetResults(ResultInfo& resInfo)
+{
+    resInfo = __resultInfo;
+}
+
+bool
+FeatureSetGenThread::CheckExt(Tizen::Base::String fileName)
+{
+    int period = 0;
+    const Tizen::Base::String period_symbol = ".";
+    if (E_SUCCESS != fileName.LastIndexOf(period_symbol, fileName.GetLength()-1, period))
+    {
+        return false;
+    }
+    Tizen::Base::String extension;
+    if(E_SUCCESS != fileName.SubString(period + 1, extension))
+    {
+        return false;
+    }
+
+    if ( (extension.Equals(L"jpg",true)) ||
+         (extension.Equals(L"bmp",true)) ||
+         (extension.Equals(L"png",true)) ||
+         (extension.Equals(L"jpeg",true)))
+    {
+        return true;
+    }
+
+    return false;
+
+}
+
+void
+FeatureSetGenThread::SetFeatureManager(Tizen::Uix::Vision::ImageFeatureManager* pImageFeatureManager)
+{
+    __pImageFeatureManager = pImageFeatureManager;
+}
diff --git a/project/src/FileManagerForm.cpp b/project/src/FileManagerForm.cpp
new file mode 100644 (file)
index 0000000..766fc78
--- /dev/null
@@ -0,0 +1,392 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "FileManagerForm.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+
+FileManagerForm::FileManagerForm(void)
+    : __pList(0)
+    , __pEditField(0)
+    , __canChooseNew(false)
+    , __canChooseOne(true)
+{
+}
+
+FileManagerForm::~FileManagerForm(void)
+{
+}
+
+bool
+FileManagerForm::Initialize(const Tizen::Base::Collection::ArrayListT<Tizen::Base::String>& fileExt, bool isEditField)
+{
+    Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+
+    __fileExts.Construct(fileExt);
+    __canChooseNew = isEditField;
+
+    AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+    __pFileIcon   = pAppResource->GetBitmapN(L"home_type3.png");
+    __pFolderIcon = pAppResource->GetBitmapN(L"message_type3.png");
+
+    return true;
+}
+
+result
+FileManagerForm::OnInitializing(void)
+{
+    if (!CreateMainList())
+    {
+        return false;
+    }
+
+    Footer* pFooter = GetFooter();
+
+    pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+    Form::SetFormBackEventListener(this);
+
+    pFooter->AddActionEventListener(*this);
+
+    return E_SUCCESS;
+}
+
+result
+FileManagerForm::OnTerminating(void)
+{
+    result r = E_SUCCESS;
+    return r;
+}
+
+bool
+FileManagerForm::CreateMainList(void)
+{
+    __pList = new ListView();
+
+    if (__canChooseNew)
+    {
+        __pEditField = new EditField();
+        __pEditField->Construct(Rectangle(30, 0, GetClientAreaBounds().width - 60, 100));
+        __pEditField->SetKeypadEnabled(false);
+        this->AddControl(*__pEditField);
+
+        __pList->Construct(Rectangle(0, 130, GetClientAreaBounds().width, GetClientAreaBounds().height - 130), true, false);
+    }
+    else
+    {
+        __pList->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
+    }
+    __pList->SetItemProvider(*this);
+    __pList->AddListViewItemEventListener(*this);
+    AddControl(*__pList);
+
+    return true;
+}
+
+void
+FileManagerForm::OnActionPerformed (const Tizen::Ui::Control &source, int actionId)
+{
+    if (actionId == ID_BUTTON_EXIT)
+    {
+        SceneManager* pSceneManager = SceneManager::GetInstance();
+        AppAssert(pSceneManager);
+        ArrayList* pList = new (std::nothrow) ArrayList;
+        AppAssert(pList);
+        pList->Construct();
+        String* pFolder = new String("");
+        if (__canChooseNew)
+        {
+            String fileName = __pEditField->GetText();
+            if (fileName.IsEmpty())
+            {
+                fileName = "default.xdb";
+            }
+            if (!fileName.EndsWith(".xdb"))
+            {
+                fileName.Append(".xdb");
+            }
+            *pFolder = __currentPath + "/" + fileName;
+        }
+        else
+        {
+            *pFolder = __currentPath;
+        }
+        pList->Add(*pFolder);
+
+        pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_OUT), pList);
+    }
+}
+
+void
+FileManagerForm::OnFormBackRequested(Tizen::Ui::Controls::Form&  source)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+    pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_OUT), null /*pList*/);
+}
+
+
+int
+FileManagerForm::GetItemCount(void)
+{
+    return __files.GetCount();
+}
+
+bool
+FileManagerForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
+{
+    delete pItem;
+    pItem = null;
+    return true;
+}
+
+Tizen::Ui::Controls::ListItemBase*
+FileManagerForm::CreateItem(int index, int itemWidth)
+{
+    ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+    CustomItem* pItem = new CustomItem();
+    pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 100), style);
+
+    Tizen::Base::String fileName;
+    __files.GetAt(index, fileName);
+
+    Tizen::Io::FileAttributes fileAtt;
+
+    if (Tizen::Io::File::GetAttributes(__currentPath + "/" + fileName, fileAtt) == E_SUCCESS)
+    {
+        if (fileAtt.IsDirectory())
+        {
+            pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pFolderIcon, null, null);
+        }
+        else
+        {
+            pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pFileIcon, null, null);
+        }
+    }
+
+    pItem->AddElement(Rectangle(80, 25, 720, 50), ID_FORMAT_STRING, fileName, true);
+
+    return pItem;
+}
+
+void
+FileManagerForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &view, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
+{
+    Tizen::Base::String fileName;
+    __files.GetAt(index, fileName);
+
+    if (status == LIST_ITEM_STATUS_SELECTED)
+    {
+        // Load database on click
+        if (fileName == "..")
+        {
+            GoDownDir();
+            __pList->ScrollToItem(0);
+            GetDirs(__currentPath);
+        }
+        else if (CheckExt(fileName))
+        {
+            if (__canChooseNew)
+            {
+                __pEditField->SetText(fileName);
+                __pEditField->RequestRedraw(true);
+            }
+            else if (__canChooseOne)
+            {
+                SceneManager* pSceneManager = SceneManager::GetInstance();
+                AppAssert(pSceneManager);
+                ArrayList* pList = new (std::nothrow) ArrayList;
+                AppAssert(pList);
+                pList->Construct();
+                String* pFolder = new String(__currentPath + "/" + fileName);
+                pList->Add(*pFolder);
+
+                pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_OUT), pList);
+            }
+        }
+        else
+        {
+            GoUpDir(fileName);
+            __pList->ScrollToItem(0);
+            GetDirs(__currentPath);
+        }
+
+        __pList->UpdateList();
+        __pList->Draw(true);
+        __pList->Show();
+    }
+}
+
+void
+FileManagerForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction)
+{
+}
+
+void
+FileManagerForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
+{
+}
+
+void
+FileManagerForm::OnItemReordered(Tizen::Ui::Controls::ListView &listView, int oldIndex, int newIndex)
+{
+}
+
+bool
+FileManagerForm::CheckExt(Tizen::Base::String fileName)
+{
+    int period = 0;
+    const Tizen::Base::String period_symbol = ".";
+    if (E_SUCCESS != fileName.LastIndexOf(period_symbol, fileName.GetLength()-1, period))
+    {
+        return false;
+    }
+    Tizen::Base::String extension;
+    if(E_SUCCESS != fileName.SubString(period + 1, extension))
+    {
+        return false;
+    }
+
+    if (__fileExts.Contains(extension))
+    {
+        return true;
+    }
+
+    return false;
+
+}
+
+void
+FileManagerForm::GetDirs(Tizen::Base::String dirPath)
+{
+    Tizen::Io::Directory dir;
+    Tizen::Io::DirEnumerator *pDirEnum(null);
+    Tizen::Io::File file;
+    Tizen::Io::FileAttributes fileAtt;
+
+    if (dir.Construct(dirPath) == E_SUCCESS)
+    {
+        pDirEnum = dir.ReadN();
+        __files.RemoveAll();
+
+        while(pDirEnum->MoveNext() == E_SUCCESS)
+        {
+            Tizen::Io::DirEntry dirEntry = pDirEnum->GetCurrentDirEntry();
+            if (CheckExt(dirEntry.GetName()) || dirEntry.IsDirectory())
+            {
+                __files.Add(dirEntry.GetName());
+            }
+        }
+
+        StrComparer* pStrComparer = new StrComparer();
+        __files.Sort(*pStrComparer);
+        delete pStrComparer;
+
+        __files.Remove(".");
+    }
+    else if (Tizen::Io::File::GetAttributes(dirPath, fileAtt) == E_SUCCESS)
+    {
+        GoDownDir();
+    }
+
+    delete pDirEnum;
+}
+
+void
+FileManagerForm::GoDownDir(void)
+{
+    int separator_pos = 0;
+    const Tizen::Base::String separator_symbol = "/";
+    if (E_SUCCESS != __currentPath.LastIndexOf(separator_symbol, __currentPath.GetLength()-1, separator_pos))
+    {
+        return;
+    }
+    if (E_SUCCESS != __currentPath.SubString(0, separator_pos, __currentPath))
+    {
+        return;
+    }
+    if (__currentPath.IsEmpty())
+    {
+        __currentPath = "/";
+    }
+
+    if (__pEditField)
+    {
+       __pEditField->RequestRedraw(true);
+    }
+}
+
+void
+FileManagerForm::GoUpDir(Tizen::Base::String dir)
+{
+    if (!__currentPath.Equals(L"/", false))
+    {
+        __currentPath += "/";
+    }
+    __currentPath += dir;
+
+    if (__pEditField)
+    {
+       __pEditField->RequestRedraw(true);
+    }
+}
+
+bool
+FileManagerForm::IsFile(Tizen::Base::String filePath)
+{
+    Tizen::Io::File file;
+    Tizen::Io::FileAttributes fileAtt;
+    return Tizen::Io::File::GetAttributes(filePath, fileAtt) == E_SUCCESS;
+}
+
+void
+FileManagerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+        const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+
+    Footer* pFooter = GetFooter();
+    pFooter->RemoveAllButtons();
+    pFooter->SetBackButton();
+
+    if (currentSceneId == "ChooseImageScene")
+    {
+        FooterItem footerItemChooseFolder;
+        footerItemChooseFolder.Construct(ID_BUTTON_EXIT);
+        footerItemChooseFolder.SetText("Choose");
+        pFooter->AddItem(footerItemChooseFolder);
+    }
+    else if (currentSceneId == "ChooseNewFeatureSetScene")
+    {
+        __pEditField->SetKeypadEnabled(true);
+        FooterItem footerItemChooseFolder;
+        footerItemChooseFolder.Construct(ID_BUTTON_EXIT);
+        footerItemChooseFolder.SetText("Create");
+        pFooter->AddItem(footerItemChooseFolder);
+    }
+
+    __currentPath = "/opt/media";
+    __pList->ScrollToItem(0);
+    GetDirs(__currentPath);
+    __pList->UpdateList();
+}
+
+void
+FileManagerForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
diff --git a/project/src/GeneratePanel.cpp b/project/src/GeneratePanel.cpp
new file mode 100644 (file)
index 0000000..fe8e501
--- /dev/null
@@ -0,0 +1,177 @@
+#include "GeneratePanel.h"
+#include "MainForm.h"
+#include "FileManagerForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+GeneratePanel::GeneratePanel(void)
+    : __currentFeaturePath("/opt/media/default.xdb")
+    , __currentImagePath("/opt/media")
+{
+}
+
+GeneratePanel::~GeneratePanel(void)
+{
+}
+
+bool
+GeneratePanel::Initialize()
+{
+    Panel::Construct(L"IDC_GENERATION_MODE_PANEL");
+    return true;
+}
+
+result
+GeneratePanel::OnInitializing(void)
+{
+    result r = E_SUCCESS;
+
+    Button *pButton = null;
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    Rectangle clienRect = pForm->GetClientAreaBounds();
+    this->SetBounds(clienRect);
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_GENERATE_FEATURE_SET", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_GENERATE_FEATURE_SET);
+        pButton->AddActionEventListener(*this);
+    }
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_CHOOSE_IMAGE_FOLDER", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_CHOOSE_IMAGE_FOLDER_PATH);
+        pButton->AddActionEventListener(*this);
+    }
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_CHOOSE_FEATURE_SET_PATH", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_CHOOSE_FEATURE_SET_PATH);
+        pButton->AddActionEventListener(*this);
+    }
+
+    return r;
+}
+
+result
+GeneratePanel::OnTerminating(void)
+{
+    result r = E_SUCCESS;
+    return r;
+}
+
+
+void
+GeneratePanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+
+    switch (actionId)
+    {
+    case ID_BUTTON_CHOOSE_FEATURE_SET_PATH:
+    {
+        pSceneManager->GoForward(
+                ForwardSceneTransition("ChooseNewFeatureSetScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_IN,
+                        SCENE_HISTORY_OPTION_ADD_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP),0);
+    }
+    break;
+
+    case ID_BUTTON_CHOOSE_IMAGE_FOLDER_PATH:
+    {
+        pSceneManager->GoForward(
+                ForwardSceneTransition("ChooseImageScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_IN,
+                        SCENE_HISTORY_OPTION_ADD_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), 0);
+    }
+    break;
+
+    case ID_BUTTON_GENERATE_FEATURE_SET:
+    {
+        Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+        MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+        pForm->GetFeatureManager()->DeleteAllFeatures();
+        pForm->AppendImageFolder(__currentImagePath, this);
+    }
+    break;
+    }
+}
+
+
+void
+GeneratePanel::OnSceneActivatedN(
+        const Tizen::Ui::Scenes::SceneId& previousSceneId,
+        const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        Tizen::Base::Collection::IList* pArgs)
+{
+    if        ((previousSceneId == "ChooseImageScene") && pArgs)
+    {
+        if (pArgs->GetCount() > 0)
+        {
+            __currentImagePath   = *(dynamic_cast<String*>(pArgs->GetAt(0)));
+        }
+    }
+    else if ((previousSceneId == "ChooseNewFeatureSetScene") && pArgs)
+    {
+        if (pArgs->GetCount() > 0)
+        {
+            __currentFeaturePath   = *(dynamic_cast<String*>(pArgs->GetAt(0)));
+        }
+    }
+
+    if(pArgs)
+    {
+        pArgs->RemoveAll(true);
+        delete pArgs;
+    }
+
+    Button* pButtonPath = null;
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_CHOOSE_FEATURE_SET_PATH", true));
+    if (pButtonPath)
+    {
+        pButtonPath->SetText(__currentFeaturePath);
+    }
+
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_CHOOSE_IMAGE_FOLDER", true));
+    if (pButtonPath)
+    {
+        pButtonPath->SetText(__currentImagePath);
+    }
+}
+
+void
+GeneratePanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+GeneratePanel::OnImageProcessed(int imNo, int total)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    pForm->OnImageProcessed(imNo, total);
+}
+
+void
+GeneratePanel::OnFinish(void)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    pForm->GetFeatureManager()->Flush(&__currentFeaturePath);
+    pForm->OnFinish();
+}
diff --git a/project/src/ImageFeatureApp.cpp b/project/src/ImageFeatureApp.cpp
new file mode 100644 (file)
index 0000000..40da93d
--- /dev/null
@@ -0,0 +1,118 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "ImageFeatureApp.h"
+#include "ImageFeatureFormFactory.h"
+#include "ImageFeaturePanelFactory.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;
+
+
+ImageFeatureApp::ImageFeatureApp(void)
+{
+}
+
+ImageFeatureApp::~ImageFeatureApp(void)
+{
+}
+
+UiApp*
+ImageFeatureApp::CreateInstance(void)
+{
+    return new ImageFeatureApp();
+}
+
+bool
+ImageFeatureApp::OnAppInitializing(AppRegistry& appRegistry)
+{
+    PowerManager::SetScreenEventListener(*this);
+    PowerManager::KeepScreenOnState(true, false);
+    return true;
+}
+
+bool
+ImageFeatureApp::OnAppInitialized(void)
+{
+    Frame* pAppFrame = new Frame();
+    pAppFrame->Construct();
+    AddFrame(*pAppFrame);
+
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    static ImageFeatureFormFactory formFactory;
+    static ImageFeaturePanelFactory panelFactory;
+    pSceneManager->RegisterFormFactory(formFactory);
+    pSceneManager->RegisterPanelFactory(panelFactory);
+
+    pSceneManager->RegisterScene(L"GenerationModeScene", L"MainForm", L"PanelGenerate");
+    pSceneManager->RegisterScene(L"UpdateModeScene", L"MainForm", L"PanelUpdate");
+
+    pSceneManager->RegisterScene(L"ChooseExistingFeatureSetScene", L"ChooseExistingFeatureSetForm", L"");
+    pSceneManager->RegisterScene(L"ChooseNewFeatureSetScene", L"ChooseNewFeatureSetForm", L"");
+    pSceneManager->RegisterScene(L"ChooseImageScene", L"ChooseImageForm", L"");
+
+    pSceneManager->RegisterScene(L"ManageScene", L"DatabaseManagerForm", L"");
+
+    if (pSceneManager->GoForward(ForwardSceneTransition(L"GenerationModeScene")) != E_SUCCESS)
+        return false;
+
+    return true;
+}
+
+bool
+ImageFeatureApp::OnAppWillTerminate(void)
+{
+    return true;
+}
+
+bool
+ImageFeatureApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+    return true;
+}
+
+void
+ImageFeatureApp::OnForeground(void)
+{
+    PowerManager::KeepScreenOnState(true, false);
+}
+
+void
+ImageFeatureApp::OnBackground(void)
+{
+}
+
+void
+ImageFeatureApp::OnLowMemory(void)
+{
+}
+
+void
+ImageFeatureApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+}
+
+void
+ImageFeatureApp::OnScreenOn(void)
+{
+    PowerManager::KeepScreenOnState(true, false);
+}
+
+void
+ImageFeatureApp::OnScreenOff(void)
+{
+}
diff --git a/project/src/ImageFeatureAppEntry.cpp b/project/src/ImageFeatureAppEntry.cpp
new file mode 100644 (file)
index 0000000..12ea248
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+/**
+ * This file contains the Tizen application entry point.
+ */
+#include "ImageFeatureApp.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* pArgs = new ArrayList();
+    pArgs->Construct();
+    for (int i = 0; i < argc; i++)
+    {
+        pArgs->Add(*(new String(pArgv[i])));
+    }
+
+    r = Tizen::App::UiApp::Execute(ImageFeatureApp::CreateInstance, pArgs);
+    if (IsFailed(r))
+    {
+        AppLogException("Application execution failed-[%s].", GetErrorMessage(r));
+        r &= 0x0000FFFF;
+    }
+
+    pArgs->RemoveAll(true);
+    delete pArgs;
+    AppLog("Application finished.");
+
+    return static_cast<int>(r);
+}
+#ifdef __cplusplus
+}
+#endif // __cplusplus
diff --git a/project/src/ImageFeatureFormFactory.cpp b/project/src/ImageFeatureFormFactory.cpp
new file mode 100644 (file)
index 0000000..2608fe9
--- /dev/null
@@ -0,0 +1,97 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "ImageFeatureFormFactory.h"
+#include "MainForm.h"
+#include "FileManagerForm.h"
+#include "FeatureManagerForm.h"
+
+using namespace Tizen::Ui::Scenes;
+
+
+ImageFeatureFormFactory::ImageFeatureFormFactory(void)
+{
+}
+
+ImageFeatureFormFactory::~ImageFeatureFormFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Form*
+ImageFeatureFormFactory::CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+    Tizen::Ui::Controls::Form* pNewForm = null;
+    Tizen::Base::Collection::ArrayListT<Tizen::Base::String>   fileExts;
+
+    if (formId == L"MainForm")
+    {
+        MainForm* pForm = new MainForm();
+        pForm->Initialize();
+        pSceneManager->AddSceneEventListener(sceneId, *pForm);
+        pNewForm = pForm;
+    }
+
+    if (formId == L"ChooseNewFeatureSetForm")
+    {
+        fileExts.RemoveAll();
+        fileExts.Add(Tizen::Base::String(L"xdb"));
+
+        FileManagerForm* pForm = new FileManagerForm();
+        pForm->Initialize(fileExts, true);
+        Tizen::Ui::Controls::Header* pHeader = pForm->GetHeader();
+        pHeader->SetTitleText("Create New Feature Set");
+        pSceneManager->AddSceneEventListener(sceneId, *pForm);
+        pNewForm = pForm;
+    }
+
+    if (formId == L"ChooseExistingFeatureSetForm")
+    {
+        fileExts.RemoveAll();
+        fileExts.Add(Tizen::Base::String(L"xdb"));
+
+        FileManagerForm* pForm = new FileManagerForm();
+        pForm->Initialize(fileExts, false);
+        Tizen::Ui::Controls::Header* pHeader = pForm->GetHeader();
+        pHeader->SetTitleText("Choose Feature Set");
+        pSceneManager->AddSceneEventListener(sceneId, *pForm);
+        pNewForm = pForm;
+    }
+
+    if (formId == L"ChooseImageForm")
+    {
+        fileExts.RemoveAll();
+        fileExts.Add(Tizen::Base::String(L"jpg"));
+        fileExts.Add(Tizen::Base::String(L"jpeg"));
+        fileExts.Add(Tizen::Base::String(L"png"));
+        fileExts.Add(Tizen::Base::String(L"bmp"));
+
+        FileManagerForm* pForm = new FileManagerForm();
+        pForm->Initialize(fileExts, false);
+        Tizen::Ui::Controls::Header* pHeader = pForm->GetHeader();
+        pHeader->SetTitleText("Choose Image Folder");
+        pSceneManager->AddSceneEventListener(sceneId, *pForm);
+        pNewForm = pForm;
+    }
+
+    if (formId == L"DatabaseManagerForm")
+    {
+        FeatureManagerForm* pForm = new FeatureManagerForm();
+        pForm->Initialize();
+        pSceneManager->AddSceneEventListener(sceneId, *pForm);
+        pNewForm = pForm;
+    }
+
+    return pNewForm;
+}
diff --git a/project/src/ImageFeaturePanelFactory.cpp b/project/src/ImageFeaturePanelFactory.cpp
new file mode 100644 (file)
index 0000000..ce367de
--- /dev/null
@@ -0,0 +1,55 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include "ImageFeaturePanelFactory.h"
+#include <FUi.h>
+
+#include "GeneratePanel.h"
+#include "UpdatePanel.h"
+
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Ui::Controls;
+
+ImageFeaturePanelFactory::ImageFeaturePanelFactory(void)
+{
+}
+
+ImageFeaturePanelFactory::~ImageFeaturePanelFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Panel*
+ImageFeaturePanelFactory::CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId)
+{
+    Panel* pNewPanel = null;
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+
+    if (panelId == L"PanelGenerate")
+    {
+        GeneratePanel* pPanel = new GeneratePanel();
+        pPanel->Initialize();
+        pSceneManager->AddSceneEventListener(sceneId, *pPanel);
+        pNewPanel = pPanel;
+    }
+
+    else if (panelId == L"PanelUpdate")
+    {
+        UpdatePanel* pPanel = new UpdatePanel();
+        pPanel->Initialize();
+        pSceneManager->AddSceneEventListener(sceneId, *pPanel);
+        pNewPanel = pPanel;
+    }
+
+    return pNewPanel;
+}
diff --git a/project/src/MainForm.cpp b/project/src/MainForm.cpp
new file mode 100644 (file)
index 0000000..168fbcd
--- /dev/null
@@ -0,0 +1,261 @@
+//
+// Tizen Native SDK
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+// All rights reserved.
+//
+// This software contains confidential and proprietary information
+// of Samsung Electronics Co., Ltd.
+// The user of this software agrees not to disclose, disseminate or copy such
+// Confidential Information and shall use the software only in accordance with
+// the terms of the license agreement the user entered into with Samsung.
+//
+
+#include <FApp.h>
+#include "MainForm.h"
+#include "FileManagerForm.h"
+#include "GeneratePanel.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::App;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const String SAMPLE_TITLE = L"ImageFeatureManager";
+
+MainForm::MainForm(void)
+       : __headerTitle(SAMPLE_TITLE)
+       , __pRadioGroupMode(null)
+    , __pFeatureManager(null)
+    , __pMessagePopup(null)
+       , __pMessageLabel(null)
+{
+}
+
+MainForm::~MainForm(void)
+{
+    if(__pFeatureManager)
+    {
+        delete __pFeatureManager;
+    }
+    delete __pMessagePopup;
+}
+
+bool
+MainForm::Initialize(void)
+{
+    Construct(L"IDF_FORM");
+    return true;
+}
+
+result
+MainForm::OnInitializing(void)
+{
+    result r = E_SUCCESS;
+
+    SetFormBackEventListener(this);
+
+    CheckButton* pCheckButton = null;
+
+    __pRadioGroupMode = new RadioGroup();
+    __pRadioGroupMode->Construct();
+
+    pCheckButton = static_cast<CheckButton*>(GetControl(L"IDC_UPDATE_MODE_BUTTON", true));
+    if (pCheckButton)
+    {
+        pCheckButton->AddActionEventListener(*this);
+        pCheckButton->SetActionId(ID_BUTTON_UPDATE_MODE, 0, 0);
+        __pRadioGroupMode->Add(*pCheckButton);
+    }
+
+    pCheckButton = static_cast<CheckButton*>(GetControl(L"IDC_GENERATION_MODE_BUTTON", true));
+
+    if (pCheckButton)
+    {
+        pCheckButton->SetSelected(true);
+        pCheckButton->AddActionEventListener(*this);
+        pCheckButton->SetActionId(ID_BUTTON_GENERATE_MODE, 0, 0);
+        __pRadioGroupMode->Add(*pCheckButton);
+    }
+
+    Footer* pFooter = GetFooter();
+    pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+    pFooter->SetBackButton();
+    pFooter->AddActionEventListener(*this);
+
+    __dbGen.Construct();
+    __dbGen.SetListener(this);
+
+    __pFeatureManager = new Tizen::Uix::Vision::ImageFeatureManager();
+    __pFeatureManager->Construct();
+
+    __pMessagePopup = new Popup();
+    __pMessagePopup->Construct("IDC_MESSAGE_POPUP");
+    __pMessageLabel = static_cast<Label*>(__pMessagePopup->GetControl("IDC_LABEL_MASSEGE_TEXT", true));
+
+    Button* pButton = static_cast<Button*>(__pMessagePopup->GetControl("IDC_BUTTON_MESSAGE_CLOSE", true));
+    if (pButton)
+    {
+        pButton->AddActionEventListener(*this);
+        pButton->SetActionId(ID_BUTTON_CLOSE_RESULTS);
+    }
+
+    return r;
+}
+
+result
+MainForm::OnTerminating(void)
+{
+    result r = E_SUCCESS;
+    return r;
+}
+
+void
+MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+
+    switch (actionId)
+    {
+    case ID_BUTTON_GENERATE_MODE:
+    {
+        __pFeatureManager->DeleteAllFeatures();
+        pSceneManager->GoForward(
+                ForwardSceneTransition("GenerationModeScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                        SCENE_HISTORY_OPTION_NO_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), null);
+    }
+        break;
+    case ID_BUTTON_UPDATE_MODE:
+    {
+        __pFeatureManager->DeleteAllFeatures();
+        pSceneManager->GoForward(
+                ForwardSceneTransition("UpdateModeScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                        SCENE_HISTORY_OPTION_NO_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), null);
+    }
+        break;
+    case ID_BUTTON_CLOSE_RESULTS:
+        __pMessagePopup->SetShowState(false);
+        break;
+    default:
+        break;
+    }
+}
+
+void
+MainForm::AppendImageFolder(const Tizen::Base::String& imPath, IFeatureSetGeneratorListener* listener)
+{
+    if(listener != null)
+    {
+        __dbGen.SetListener(listener);
+    }
+    else
+    {
+        __dbGen.SetListener(this);
+    }
+    __dbGen.SetImagePath(imPath);
+    __dbGen.SetFeatureManager(__pFeatureManager);
+    this->SetEnabled(false);
+    __dbGen.Start();
+}
+
+void
+MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+    UiApp* pApp = UiApp::GetInstance();
+    AppAssert(pApp);
+    pApp->Terminate();
+}
+
+void
+MainForm::OnSceneActivatedN(
+        const Tizen::Ui::Scenes::SceneId& previousSceneId,
+        const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        Tizen::Base::Collection::IList* pArgs)
+{
+}
+
+void
+MainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+MainForm::OnImageProcessed(int imNo, int total)
+{
+    __headerTitle = "Generating... ";
+    __headerTitle.Append(Integer(imNo).ToString());
+    __headerTitle.Append('/');
+    __headerTitle.Append(Integer(total).ToString());
+    RequestRedraw(true);
+}
+
+void
+MainForm::OnFinish(void)
+{
+    SendUserEvent(REQUEST_RESULT, 0);
+}
+
+result
+MainForm::OnDraw(void)
+{
+    Header* pHeader = GetHeader();
+    pHeader->SetTitleText(__headerTitle);
+    return E_SUCCESS;
+}
+
+void
+MainForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+    switch(requestId)
+    {
+    case REQUEST_RESULT:
+    {
+        __dbGen.GetResults(__resInfo);
+        this->SetEnabled(true);
+        this->RequestRedraw(true);
+        __headerTitle = SAMPLE_TITLE;
+        if (__resInfo.appendTime > 0)
+        {
+            if (__resInfo.appendedObjectsNumber != 0)
+            {
+                __pMessageLabel->SetText(
+                        "\nTotal time: " + Integer(__resInfo.appendTime).ToString() + "ms" +
+                        "\nAverage time: " + Integer(__resInfo.appendTime / __resInfo.appendedObjectsNumber).ToString() + " ms" +
+                        "\nAdded images: " + Integer(__resInfo.appendedObjectsNumber).ToString() +
+                        "\nRejected files: " + Integer(__resInfo.rejectedObjectsNumber).ToString() +
+                        "\nTotal files count: " + Integer(__resInfo.totalObjectsNumber).ToString()
+                );
+            }
+            else
+            {
+                __pMessageLabel->SetText(
+                        "\nTotal time: " + Integer(__resInfo.appendTime).ToString() + "ms" +
+                        "\nAdded images: " + Integer(__resInfo.appendedObjectsNumber).ToString() +
+                        "\nRejected files: " + Integer(__resInfo.rejectedObjectsNumber).ToString() +
+                        "\nTotal files count: " + Integer(__resInfo.totalObjectsNumber).ToString()
+                );
+            }
+
+            __pMessagePopup->SetShowState(true);
+            __pMessagePopup->Show();
+        }
+        break;
+    }
+    default:
+        break;
+    }
+}
+
+Tizen::Uix::Vision::ImageFeatureManager*
+MainForm::GetFeatureManager(void)
+{
+    return __pFeatureManager;
+}
diff --git a/project/src/UpdatePanel.cpp b/project/src/UpdatePanel.cpp
new file mode 100644 (file)
index 0000000..e65835c
--- /dev/null
@@ -0,0 +1,253 @@
+#include "UpdatePanel.h"
+#include "FileManagerForm.h"
+#include "MainForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+UpdatePanel::UpdatePanel(void)
+    : __currentFeaturePath("")
+    , __currentImagePath("")
+{
+}
+
+UpdatePanel::~UpdatePanel(void)
+{
+}
+
+bool
+UpdatePanel::Initialize()
+{
+    Panel::Construct(L"IDC_UPDATE_MODE_PANEL");
+    return true;
+}
+
+result
+UpdatePanel::OnInitializing(void)
+{
+    result r = E_SUCCESS;
+
+    Button *pButton = null;
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    Rectangle clienRect = pForm->GetClientAreaBounds();
+    this->SetBounds(clienRect);
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_LOAD_FEATURE_SET", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_LOAD_FEATURE_SET);
+        pButton->AddActionEventListener(*this);
+    }
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_DELETE_FEATURES", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_DELETE_FEATURES);
+        pButton->AddActionEventListener(*this);
+    }
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_UPDATE_FEATURE_SET", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_UPDATE_FEATURE_SET);
+        pButton->AddActionEventListener(*this);
+    }
+
+    pButton = static_cast<Button*>(GetControl(L"IDC_BUTTON_UPDATE_IMAGE_FOLDER", true));
+    if (pButton)
+    {
+        pButton->SetActionId(ID_BUTTON_CHOOSE_IMAGE_FOLDER);
+        pButton->AddActionEventListener(*this);
+    }
+
+    return r;
+}
+
+result
+UpdatePanel::OnTerminating(void)
+{
+    result r = E_SUCCESS;
+    return r;
+}
+
+void
+UpdatePanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+    SceneManager* pSceneManager = SceneManager::GetInstance();
+    AppAssert(pSceneManager);
+
+    switch (actionId)
+    {
+    case ID_BUTTON_LOAD_FEATURE_SET:
+    {
+        pSceneManager->GoForward(
+                ForwardSceneTransition("ChooseExistingFeatureSetScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_IN,
+                        SCENE_HISTORY_OPTION_ADD_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), 0);
+    }
+    break;
+
+    case ID_BUTTON_DELETE_FEATURES:
+    {
+        pSceneManager->GoForward(
+                ForwardSceneTransition("ManageScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_IN,
+                        SCENE_HISTORY_OPTION_ADD_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), null);
+    }
+    break;
+
+    case ID_BUTTON_CHOOSE_IMAGE_FOLDER:
+    {
+        pSceneManager->GoForward(
+                ForwardSceneTransition("ChooseImageScene",
+                        SCENE_TRANSITION_ANIMATION_TYPE_ZOOM_IN,
+                        SCENE_HISTORY_OPTION_ADD_HISTORY,
+                        SCENE_DESTROY_OPTION_KEEP), /*pList*/null);
+    }
+    break;
+
+    case ID_BUTTON_UPDATE_FEATURE_SET:
+    {
+        Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+        MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+        pForm->GetFeatureManager()->Flush(0);
+        //Reloading feature set
+        //pForm->GetFeatureManager()->DeleteAllFeatures();
+        pForm->GetFeatureManager()->Load(__currentFeaturePath);
+    }
+    break;
+    }
+
+}
+
+
+void
+UpdatePanel::OnSceneActivatedN(
+        const Tizen::Ui::Scenes::SceneId& previousSceneId,
+        const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        Tizen::Base::Collection::IList* pArgs)
+{
+
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    if ((previousSceneId == "ChooseImageScene") && pArgs)
+    {
+        if (pArgs->GetCount() > 0)
+        {
+            __currentImagePath   = *(dynamic_cast<String*>(pArgs->GetAt(0)));
+            pForm->AppendImageFolder(__currentImagePath, this);
+        }
+    }
+    else if ((previousSceneId == "ChooseExistingFeatureSetScene") && pArgs)
+    {
+        if (pArgs->GetCount() > 0)
+        {
+            __currentFeaturePath   = *(dynamic_cast<String*>(pArgs->GetAt(0)));
+            if (E_SUCCESS != pForm->GetFeatureManager()->Load(__currentFeaturePath))
+            {
+                __currentFeaturePath = "";
+            }
+        }
+    }
+    else if(previousSceneId == "GenerationModeScene")
+    {
+        pForm->GetFeatureManager()->Load(__currentFeaturePath);
+    }
+
+    if(pArgs)
+    {
+        pArgs->RemoveAll(true);
+        delete pArgs;
+    }
+
+    Button* pButtonPath = null;
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_LOAD_FEATURE_SET", true));
+    if (pButtonPath)
+    {
+        pButtonPath->SetText(__currentFeaturePath);
+    }
+
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_UPDATE_IMAGE_FOLDER", true));
+    if (pButtonPath)
+    {
+        if (__currentFeaturePath.IsEmpty())
+        {
+            pButtonPath->SetEnabled(false);
+        }
+        else
+        {
+            pButtonPath->SetEnabled(true);
+        }
+
+        pButtonPath->SetText(__currentImagePath);
+    }
+
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_UPDATE_FEATURE_SET", true));
+    if (pButtonPath)
+    {
+        if (__currentFeaturePath.IsEmpty())
+        {
+            pButtonPath->SetEnabled(false);
+        }
+        else
+        {
+            pButtonPath->SetEnabled(true);
+        }
+    }
+
+    pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_DELETE_FEATURES", true));
+    if (pButtonPath)
+    {
+        if (__currentFeaturePath.IsEmpty())
+        {
+            pButtonPath->SetEnabled(false);
+        }
+        else
+        {
+            pButtonPath->SetEnabled(true);
+        }
+    }
+}
+
+void
+UpdatePanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+        const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+UpdatePanel::OnImageProcessed(int imNo, int total)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+    pForm->OnImageProcessed(imNo, total);
+}
+
+
+void
+UpdatePanel::OnFinish(void)
+{
+    Tizen::Ui::Controls::Frame *pFrame = Tizen::App::Application::GetInstance()->GetAppFrame()->GetFrame();
+    MainForm* pForm = static_cast<MainForm*>(pFrame->GetControl(L"IDF_FORM", true));
+
+    //pForm->GetFeatureManager()->Flush(null);
+    //pForm->GetFeatureManager()->Load(__currentFeaturePath);
+
+    __currentImagePath = "";
+    Button* pButtonPath = static_cast<Button*>(GetControl(L"IDC_BUTTON_UPDATE_IMAGE_FOLDER", true));
+    if (pButtonPath)
+    {
+        pButtonPath->SetText(__currentImagePath);
+    }
+
+    pForm->OnFinish();
+}
diff --git a/sample.xml b/sample.xml
new file mode 100644 (file)
index 0000000..f63ffae
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template>
+                
+       <slp-property>
+               <property-group>
+                       <sample-name>ImageFeatureManager</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 100755 (executable)
index 0000000..f877e32
Binary files /dev/null and b/screenshot.png differ