--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+ADD_SUBDIRECTORY(project)
--- /dev/null
+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.
+
--- /dev/null
+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.
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type="text/xsl" href="../../../../description.xsl"?>
+
+<Overview version="0.17.1">
+ <SampleName> LiveboxViewer </SampleName>
+ <SampleVersion>1.0</SampleVersion>
+ <Preview>screenshot.png</Preview>
+ <Description>
+ The LiveboxViewer sample application demonstrates how you can construct LiveboxView control to implement user LiveboxViewer.
+ </Description>
+</Overview>
--- /dev/null
+# Target name and AppID
+## TODO : set application name and ID
+SET(this_target LiveboxViewer)
+SET(APPID EOE7JEjMWn)
+
+# include directory
+INCLUDE_DIRECTORIES(
+ /usr/include/osp
+ inc
+ )
+
+# Source files
+FILE(GLOB ${this_target}_SOURCE_FILES src/*.cpp)
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+
+# Create executable
+SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
+ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES})
+
+# Set link libraries and link options
+## TODO : add more link libraries and options
+TARGET_LINK_LIBRARIES(${this_target} -L/usr/lib/osp osp-appfw osp-uifw osp-shell pthread)
+TARGET_LINK_LIBRARIES(${this_target} -Xlinker --allow-shlib-undefined -pthread -pie)
+
+INSTALL(TARGETS ${this_target} DESTINATION ../opt/apps/org.tizen.${APPID}/bin)
+
+# Copy resource
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/project/manifest.xml DESTINATION ../opt/usr/apps/${APPID}/info)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/project/data DESTINATION ../opt/usr/apps/${APPID})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/project/res DESTINATION ../opt/usr/apps/${APPID})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/project/icons DESTINATION ../opt/usr/apps/${APPID})
--- /dev/null
+#ifndef _LIVEBOXVIEWER_H_
+#define _LIVEBOXVIEWER_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+/**
+ * [LiveboxViewerApp] UiApp must inherit from UiApp class
+ * which provides basic features necessary to define an UiApp.
+ */
+class LiveboxViewerApp
+ : public Tizen::App::UiApp
+ , public Tizen::System::IScreenEventListener
+{
+public:
+ /**
+ * [Test] UiApp must have a factory method that creates an instance of itself.
+ */
+ static Tizen::App::UiApp* CreateInstance(void);
+
+public:
+ LiveboxViewerApp(void);
+ virtual~LiveboxViewerApp(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);
+
+ void PrintLiveboxProviderInfos();
+};
+
+#endif // _LIVEBOXVIEWER_H_
--- /dev/null
+#ifndef _LIVEBOXVIEWER_FORM_FACTORY_H_
+#define _LIVEBOXVIEWER_FORM_FACTORY_H_
+
+#include <FUi.h>
+
+extern const wchar_t* MAIN_FORM;
+extern const wchar_t* VIEW_FORM;
+extern const wchar_t* MAIN_SCENE;
+extern const wchar_t* VIEW_SCENE;
+
+class LiveboxViewerFormFactory
+ : public Tizen::Ui::Scenes::IFormFactory
+{
+public:
+ LiveboxViewerFormFactory(void);
+ virtual ~LiveboxViewerFormFactory(void);
+
+ virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _LIVEBOXVIEWER_FORM_FACTORY_H_
--- /dev/null
+#ifndef _LIVEBOXVIEWERFRAME_H_
+#define _LIVEBOXVIEWERFRAME_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+
+class LiveboxViewerFrame
+ : public Tizen::Ui::Controls::Frame
+{
+public:
+ LiveboxViewerFrame(void);
+ virtual ~LiveboxViewerFrame(void);
+
+public:
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+};
+
+#endif //_LIVEBOXVIEWERFRAME_H_
--- /dev/null
+#ifndef _LIVEBOXVIEWER_MAIN_FORM_H_
+#define _LIVEBOXVIEWER_MAIN_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+
+class LiveboxViewerMainForm
+ : public Tizen::Ui::Controls::Form
+ , public Tizen::Ui::IActionEventListener
+ , public Tizen::Ui::Controls::IFormBackEventListener
+ , public Tizen::Ui::Scenes::ISceneEventListener
+ , public Tizen::Ui::Controls::IListViewItemEventListener
+ , public Tizen::Ui::Controls::IListViewItemProvider
+{
+public:
+ LiveboxViewerMainForm(void);
+ virtual ~LiveboxViewerMainForm(void);
+ bool Initialize(void);
+
+public:
+ 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);
+
+private:
+ //ListView
+ 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);
+
+private:
+ static const int ID_FORMAT_STRING = 500;
+ Tizen::Ui::Controls::ListView* __pList;
+ Tizen::Base::Collection::IList* __pLiveboxProviderList;
+};
+
+#endif //_LIVEBOXVIEWER_MAIN_FORM_H_
--- /dev/null
+#ifndef _LIVEBOXVIEWER_PANEL_FACTORY_H_
+#define _LIVEBOXVIEWER_PANEL_FACTORY_H_
+
+#include <FUi.h>
+
+
+class LiveboxViewerPanelFactory
+ : public Tizen::Ui::Scenes::IPanelFactory
+{
+public:
+ LiveboxViewerPanelFactory(void);
+ virtual ~LiveboxViewerPanelFactory(void);
+
+ virtual Tizen::Ui::Controls::Panel* CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _LIVEBOXVIEWER_PANEL_FACTORY_H_
--- /dev/null
+
+#ifndef _VIEWFORM_H_
+#define _VIEWFORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+namespace Tizen { namespace Shell
+{
+class LiveboxView;
+}}
+
+class ViewForm
+ : public Tizen::Ui::Controls::Form
+ , public Tizen::Ui::IActionEventListener
+ , public Tizen::Ui::Controls::IFormBackEventListener
+ , public Tizen::Ui::Scenes::ISceneEventListener
+{
+
+// Construction
+public:
+ ViewForm(void);
+ virtual ~ViewForm(void);
+ bool Initialize();
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+
+private:
+ void CreateLiveboxView(const Tizen::Base::String& appId, const Tizen::Base::String& liveboxProviderId);
+ 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);
+
+private:
+ Tizen::Shell::LiveboxView* __pLiveboxView;
+ Tizen::Ui::Controls::ContextMenu* __pContextMenu;
+ Tizen::Base::Collection::IList* __pSizeInfoList;
+ static const int ID_FOOTER_ITEM1 = 1001;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Manifest xmlns="http://schemas.tizen.org/2012/06/manifest">
+ <Id>rp9Sxzp10l</Id>
+ <Version>1.0.0</Version>
+ <Type>C++App</Type>
+ <Vendors/>
+ <Descriptions/>
+ <Url/>
+ <Requirements>
+ <Feature Name="tizen.platform.core.cpu.arch">armv7</Feature>
+ </Requirements>
+ <Apps>
+ <ApiVersion>2.1</ApiVersion>
+ <Secret/>
+ <Privileges/>
+ <UiApp Default="True" ExecutableName="LiveboxViewer" MainmenuVisible="True">
+ <UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720"/>
+ <UiTheme SystemTheme="White"/>
+ <Names>
+ <Name Locale="eng-GB">LiveboxViewer</Name>
+ </Names>
+ <Icons>
+ <Icon Section="MainMenu" Type="Xhigh">mainmenu.png</Icon>
+ </Icons>
+ <AppControls/>
+ <LaunchConditions/>
+ <Notifications/>
+ </UiApp>
+ </Apps>
+</Manifest>
--- /dev/null
+<?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.201211071904" Dversion="20120315">
+ <LogicalCoordinate>720</LogicalCoordinate>
+ <Form id="IDF_FORM">
+ <property backgroundColor="" backgroundColorOpacity="100" orientation="Automatic" 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="LAYOUT_RELATIVE"/>
+ <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+ </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="Hello Livebox!" titleTextColor=""/>
+ <itemSet/>
+ </Header>
+</Scene>
--- /dev/null
+<?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.201211071904" Dversion="20120315">
+ <LogicalCoordinate>720</LogicalCoordinate>
+ <Form id="IDF_VIEW_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="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
+ <itemSet>
+ <footerItem actionId="1001" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="Size list"/>
+ </itemSet>
+ </Footer>
+ <Header>
+ <property backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="Livebox" titleTextColor=""/>
+ <itemSet/>
+ </Header>
+</Scene>
--- /dev/null
+/**
+ * Name : LiveboxViewer
+ * Version :
+ * Vendor :
+ * Description :
+ */
+
+#include <unique_ptr.h>
+#include <FShellLiveboxManager.h>
+#include <FShellLiveboxProviderInfo.h>
+#include <FShellLiveboxSizeInfo.h>
+
+#include "LiveboxViewer.h"
+#include "LiveboxViewerFrame.h"
+#include "LiveboxViewerFormFactory.h"
+#include "LiveboxViewerPanelFactory.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Shell;
+
+
+LiveboxViewerApp::LiveboxViewerApp(void)
+{
+}
+
+LiveboxViewerApp::~LiveboxViewerApp(void)
+{
+}
+
+UiApp*
+LiveboxViewerApp::CreateInstance(void)
+{
+ // Create the instance through the constructor.
+ return new LiveboxViewerApp();
+}
+
+bool
+LiveboxViewerApp::OnAppInitializing(AppRegistry& appRegistry)
+{
+ // TODO:
+ // Initialize Frame and App specific data.
+ // The App's permanent data and context can be obtained from the appRegistry.
+ //
+ // If this method is successful, return true; otherwise, return false.
+ // If this method returns false, the App will be terminated.
+
+ // Uncomment the following statement to listen to the screen on/off events.
+ //PowerManager::SetScreenEventListener(*this);
+
+ // TODO:
+ // Add your initialization code here
+ return true;
+}
+
+bool
+LiveboxViewerApp::OnAppInitialized(void)
+{
+ PrintLiveboxProviderInfos();
+
+ // Create a Frame
+ LiveboxViewerFrame* pLiveboxViewerFrame = new LiveboxViewerFrame();
+ pLiveboxViewerFrame->Construct();
+ pLiveboxViewerFrame->SetName(L"LiveboxViewer");
+ AddFrame(*pLiveboxViewerFrame);
+
+ // Prepare Scene management.
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ static LiveboxViewerFormFactory formFactory;
+ static LiveboxViewerPanelFactory panelFactory;
+ pSceneManager->RegisterFormFactory(formFactory);
+ pSceneManager->RegisterPanelFactory(panelFactory);
+ pSceneManager->RegisterScene(MAIN_SCENE, MAIN_FORM, L"");
+ pSceneManager->RegisterScene(VIEW_SCENE, VIEW_FORM, L"");
+
+ // Goto the scene.
+ if (pSceneManager->GoForward(ForwardSceneTransition(MAIN_SCENE)) != E_SUCCESS)
+ return false;
+
+ return true;
+}
+
+void
+LiveboxViewerApp::PrintLiveboxProviderInfos()
+{
+ LiveboxManager* pLiveboxManager = LiveboxManager::GetInstance();
+ AppAssertf(pLiveboxManager, "LiveboxManager creation failed.");
+
+ std::unique_ptr<IList> pLiveboxProviderInfos(pLiveboxManager->GetLiveboxProviderInfosN() );
+ TryReturnVoid(pLiveboxProviderInfos.get(), "GetLiveboxProviderInfosN returns null!!" );
+ AppLog("All livebox count (%d)", pLiveboxProviderInfos->GetCount() );
+
+ for(int i = 0; i < pLiveboxProviderInfos->GetCount(); i++)
+ {
+ LiveboxProviderInfo* pProviderInfo = dynamic_cast<LiveboxProviderInfo*>(pLiveboxProviderInfos->GetAt(i) );
+
+ std::unique_ptr<IList> pSizeInfos(pProviderInfo->GetSizeInfosN() );
+ if(pSizeInfos.get() == null) continue;
+ AppLog("appId(%ls), Name(%ls), DisplayName(%ls), iconPath(%ls) support (%d) sizes", pProviderInfo->GetAppId().GetPointer(), pProviderInfo->GetName().GetPointer(), pProviderInfo->GetDisplayName().GetPointer(), pProviderInfo->GetIconPath().GetPointer(), pSizeInfos->GetCount() );
+
+ for(int j = 0; j < pSizeInfos->GetCount(); j ++)
+ {
+ LiveboxSizeInfo* pSizeInfo = dynamic_cast<LiveboxSizeInfo*>(pSizeInfos->GetAt(j) );
+ AppLog("(%d, %d), preview(%ls)", pSizeInfo->GetSize().width, pSizeInfo->GetSize().height, pSizeInfo->GetPreviewImagePath().GetPointer());
+ }
+ pSizeInfos->RemoveAll(true);
+ }
+ pLiveboxProviderInfos->RemoveAll(true);
+}
+
+bool
+LiveboxViewerApp::OnAppWillTerminate(void)
+{
+ // TODO:
+ // Comment.
+ return true;
+}
+
+bool
+LiveboxViewerApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+ // TODO:
+ // Deallocate resources allocated by this App for termination.
+ // The App's permanent data and context can be saved via appRegistry.
+ return true;
+}
+
+void
+LiveboxViewerApp::OnForeground(void)
+{
+ // TODO:
+ // Start or resume drawing when the application is moved to the foreground.
+}
+
+void
+LiveboxViewerApp::OnBackground(void)
+{
+ // TODO:
+ // Stop drawing when the application is moved to the background.
+}
+
+void
+LiveboxViewerApp::OnLowMemory(void)
+{
+ // TODO:
+ // Free unused resources or close the application.
+}
+
+void
+LiveboxViewerApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+ // TODO:
+ // Handle any changes in battery level here.
+ // Stop using multimedia features(camera, mp3 etc.) if the battery level is CRITICAL.
+}
+
+void
+LiveboxViewerApp::OnScreenOn(void)
+{
+ // TODO:
+ // Get the released resources or resume the operations that were paused or stopped in OnScreenOff().
+}
+
+void
+LiveboxViewerApp::OnScreenOff(void)
+{
+ // TODO:
+ // Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device
+ // to enter the sleep mode to save the battery.
+ // Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a
+ // callback before the device enters the sleep mode.
+ // Similarly, do not perform lengthy operations in this listener method. Any operation must be a quick one.
+}
--- /dev/null
+/**
+ * This file contains the Tizen application entry point.
+ */
+#include "LiveboxViewer.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(LiveboxViewerApp::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
--- /dev/null
+#include "LiveboxViewerFormFactory.h"
+#include "LiveboxViewerMainForm.h"
+#include "ViewForm.h"
+
+const wchar_t* MAIN_FORM = L"MainForm";
+const wchar_t* VIEW_FORM = L"ViewForm";
+const wchar_t* MAIN_SCENE = L"SceneMain";
+const wchar_t* VIEW_SCENE = L"SceneView";
+
+using namespace Tizen::Ui::Scenes;
+
+
+LiveboxViewerFormFactory::LiveboxViewerFormFactory(void)
+{
+}
+
+LiveboxViewerFormFactory::~LiveboxViewerFormFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Form*
+LiveboxViewerFormFactory::CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ Tizen::Ui::Controls::Form* pNewForm = null;
+
+ if (formId == MAIN_FORM)
+ {
+ LiveboxViewerMainForm* pForm = new LiveboxViewerMainForm();
+ pForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pForm);
+ pNewForm = pForm;
+ }
+ else if (formId == VIEW_FORM)
+ {
+ ViewForm* pViewForm = new (std::nothrow) ViewForm();
+ pViewForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pViewForm);
+ pNewForm = pViewForm;
+ }
+
+ return pNewForm;
+}
--- /dev/null
+#include "LiveboxViewerFrame.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
+LiveboxViewerFrame::LiveboxViewerFrame(void)
+{
+}
+
+LiveboxViewerFrame::~LiveboxViewerFrame(void)
+{
+}
+
+result
+LiveboxViewerFrame::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+
+ // TODO:
+ // Add your initialization code here
+ return r;
+}
+
+result
+LiveboxViewerFrame::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ // TODO:
+ // Add your termination code here
+ return r;
+}
+
+
--- /dev/null
+#include <FApp.h>
+#include <FShellLiveboxProviderInfo.h>
+#include <FShellLiveboxManager.h>
+#include <FShellLiveboxSizeInfo.h>
+#include "LiveboxViewerMainForm.h"
+#include "LiveboxViewerFormFactory.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Shell;
+
+LiveboxViewerMainForm::LiveboxViewerMainForm(void)
+ : __pList(null)
+ , __pLiveboxProviderList(null)
+{
+ __pLiveboxProviderList = LiveboxManager::GetInstance()->GetLiveboxProviderInfosN();
+ TryReturnVoid(__pLiveboxProviderList, "GetLiveboxListN returns null!!" );
+
+ AppLog("All livebox count (%d)", __pLiveboxProviderList->GetCount() );
+}
+
+LiveboxViewerMainForm::~LiveboxViewerMainForm(void)
+{
+}
+
+bool
+LiveboxViewerMainForm::Initialize(void)
+{
+ Construct(L"IDF_FORM");
+
+ return true;
+}
+
+result
+LiveboxViewerMainForm::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+
+ for(int i = 0; i < __pLiveboxProviderList->GetCount(); i++)
+ {
+ LiveboxProviderInfo* pLiveboxProviderInfo = dynamic_cast<LiveboxProviderInfo*>(__pLiveboxProviderList->GetAt(i) );
+
+ IList* pSizeList = pLiveboxProviderInfo->GetSizeInfosN();
+ if(pSizeList == null) continue;
+ AppLog("%ls, support (%d) sizes", pLiveboxProviderInfo->GetDisplayName().GetPointer(), pSizeList->GetCount() );
+
+ for(int j = 0; j < pSizeList->GetCount(); j ++)
+ {
+ LiveboxSizeInfo* pSizeInfo = dynamic_cast<LiveboxSizeInfo*>(pSizeList->GetAt(j) );
+ AppLog("(%d, %d)", pSizeInfo->GetSize().width, pSizeInfo->GetSize().height);
+ }
+ pSizeList->RemoveAll(true);
+ delete pSizeList;
+ }
+
+ // TODO:
+ // Add your initialization code here
+ __pList = new (std::nothrow) ListView();
+ __pList->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
+ __pList->SetItemProvider(*this);
+ __pList->AddListViewItemEventListener(*this);
+ AddControl(*__pList);
+
+ // Setup back event listener
+ SetFormBackEventListener(this);
+
+ return r;
+}
+
+result
+LiveboxViewerMainForm::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ // TODO:
+ // Add your termination code here
+ if (__pLiveboxProviderList)
+ {
+ __pLiveboxProviderList->RemoveAll(true);
+ delete __pLiveboxProviderList;
+ }
+
+ return r;
+}
+
+void
+LiveboxViewerMainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ switch(actionId)
+ {
+ default:
+ break;
+ }
+}
+
+void
+LiveboxViewerMainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ UiApp* pApp = UiApp::GetInstance();
+ AppAssert(pApp);
+ pApp->Terminate();
+}
+
+void
+LiveboxViewerMainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+ const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ // TODO:
+ // Add your scene activate code here
+ AppLog("OnSceneActivatedN");
+}
+
+void
+LiveboxViewerMainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+ const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+ // TODO:
+ // Add your scene deactivate code here
+ AppLog("OnSceneDeactivated");
+}
+
+void
+LiveboxViewerMainForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ if(status == LIST_ITEM_STATUS_SELECTED)
+ {
+ ArrayList* pList = new (std::nothrow) ArrayList;
+ AppAssert(pList);
+ pList->Construct();
+
+ LiveboxProviderInfo* pProviderInfo = dynamic_cast<LiveboxProviderInfo*>(__pLiveboxProviderList->GetAt(index));
+ AppAssert(pProviderInfo);
+
+ AppLog("%ls", pProviderInfo->GetDisplayName().GetPointer());
+
+ pList->Add(*(new (std::nothrow) String( pProviderInfo->GetAppId()) ));
+ pList->Add(*(new (std::nothrow) String( pProviderInfo->GetName()) ));
+
+ pSceneManager->GoForward(ForwardSceneTransition(VIEW_SCENE, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pList);
+ }
+}
+
+void
+LiveboxViewerMainForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction)
+{
+}
+
+void
+LiveboxViewerMainForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
+{
+}
+
+void
+LiveboxViewerMainForm::OnItemReordered(Tizen::Ui::Controls::ListView &view, int oldIndex, int newIndex)
+{
+}
+
+int
+LiveboxViewerMainForm::GetItemCount(void)
+{
+ return __pLiveboxProviderList->GetCount();
+}
+
+Tizen::Ui::Controls::ListItemBase*
+LiveboxViewerMainForm::CreateItem (int index, int itemWidth)
+{
+ ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+ CustomItem* pItem = new (std::nothrow) CustomItem();
+ pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112), style);
+ Rectangle mainListItemRect(10, 25, GetClientAreaBounds().width, 50);
+
+ LiveboxProviderInfo* pProviderInfo = dynamic_cast<LiveboxProviderInfo*>(__pLiveboxProviderList->GetAt(index));
+ if (pProviderInfo)
+ {
+ pItem->AddElement(mainListItemRect, ID_FORMAT_STRING, pProviderInfo->GetDisplayName()+" ("+pProviderInfo->GetAppId()+")", true);
+ }
+
+ return pItem;
+}
+
+bool
+LiveboxViewerMainForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth)
+{
+ delete pItem;
+ return true;
+}
--- /dev/null
+#include "LiveboxViewerPanelFactory.h"
+#include <FUi.h>
+
+using namespace Tizen::Ui::Scenes;
+
+
+LiveboxViewerPanelFactory::LiveboxViewerPanelFactory(void)
+{
+}
+
+LiveboxViewerPanelFactory::~LiveboxViewerPanelFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Panel*
+LiveboxViewerPanelFactory::CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ Tizen::Ui::Controls::Panel* pNewPanel = null;
+
+ // TODO:
+ // Add your panel creation code here
+ return pNewPanel;
+}
--- /dev/null
+
+#include <unique_ptr.h>
+#include <FShellLiveboxView.h>
+#include <FShellLiveboxManager.h>
+#include <FShellLiveboxProviderInfo.h>
+#include <FShellLiveboxSizeInfo.h>
+#include "ViewForm.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+using namespace Tizen::Shell;
+
+const int CONTEXT_MENU_X = 100;
+const int CONTEXT_MENU_Y = 200;
+const int VIEW_X = 0;
+const int VIEW_Y = 50;
+const int VIEW_WIDTH = 172;
+const int VIEW_HEIGHT = 172;
+
+ViewForm::ViewForm(void)
+ : __pLiveboxView(null)
+ , __pContextMenu(null)
+ , __pSizeInfoList(null)
+{
+}
+
+ViewForm::~ViewForm(void)
+{
+}
+
+bool
+ViewForm::Initialize()
+{
+ Form::Construct(L"IDF_VIEW_FORM");
+
+ return true;
+}
+
+result
+ViewForm::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+
+ // TODO: Add your initialization code here
+ SetFormBackEventListener(this);
+ Footer* pFooter = GetFooter();
+ pFooter->AddActionEventListener(*this);
+ return r;
+}
+
+result
+ViewForm::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ // TODO: Add your termination code here
+ delete __pContextMenu;
+ if (__pSizeInfoList)
+ {
+ __pSizeInfoList->RemoveAll(true);
+ delete __pSizeInfoList;
+ }
+
+ return r;
+}
+
+void
+ViewForm::CreateLiveboxView(const Tizen::Base::String& appId, const Tizen::Base::String& providerName)
+{
+ __pLiveboxView = new LiveboxView();
+ if (__pLiveboxView)
+ {
+ __pLiveboxView->Construct(appId, providerName, Rectangle(VIEW_X, VIEW_Y, VIEW_WIDTH, VIEW_HEIGHT));
+ AddControl(*__pLiveboxView);
+ }
+
+ __pContextMenu = new (std::nothrow) ContextMenu();
+ __pContextMenu->Construct(Point(CONTEXT_MENU_X, CONTEXT_MENU_Y), CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD);
+
+ std::unique_ptr<LiveboxProviderInfo> pProviderInfo(LiveboxManager::GetInstance()->GetLiveboxProviderInfoN(appId, providerName ));
+ TryReturnVoid(pProviderInfo.get(), "pProviderInfo is null!!");
+
+ __pSizeInfoList = pProviderInfo->GetSizeInfosN();
+ if (__pSizeInfoList)
+ {
+ for(int i = 0; i < __pSizeInfoList->GetCount(); i ++)
+ {
+ LiveboxSizeInfo* pSizeInfo = dynamic_cast<LiveboxSizeInfo*>(__pSizeInfoList->GetAt(i) );
+ if (!pSizeInfo)
+ {
+ AppLog("pSizeInfo is null");
+ continue;
+ }
+ AppLog("(%d, %d)", pSizeInfo->GetSize().width, pSizeInfo->GetSize().height);
+
+ String size;
+ size.Format(255, L"%dx%d", pSizeInfo->GetSize().width, pSizeInfo->GetSize().height);
+
+ __pContextMenu->AddItem(size, i);
+ }
+ }
+
+ Rectangle formBounds = GetBounds();
+ Rectangle contextMenuBounds = __pContextMenu->GetBounds();
+ Point anchor = __pContextMenu->GetAnchorPosition();
+ anchor.y = formBounds.height - contextMenuBounds.height;
+
+ AppLog("(%d %d %d %d) (%d %d)", contextMenuBounds.x, contextMenuBounds.y, contextMenuBounds.width, contextMenuBounds.height, anchor.x, anchor.y);
+
+ __pContextMenu->SetAnchorPosition(anchor);
+
+ __pContextMenu->AddActionEventListener(*this);
+}
+
+void
+ViewForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+ AppLog("(%d)", actionId);
+
+ if (actionId == ID_FOOTER_ITEM1)
+ {
+ if (__pContextMenu && (__pContextMenu->GetItemCount() > 0))
+ {
+ __pContextMenu->SetShowState(true);
+ __pContextMenu->Show();
+ }
+ }
+ else
+ {
+ LiveboxSizeInfo* pSizeInfo = null;
+ if (__pSizeInfoList)
+ {
+ pSizeInfo = dynamic_cast<LiveboxSizeInfo*>(__pSizeInfoList->GetAt(actionId) );
+ TryReturnVoid(pSizeInfo, "pSizeInfo is null!!");
+ }
+
+ if (__pLiveboxView)
+ {
+ __pLiveboxView->SetSize(pSizeInfo->GetSize());
+ }
+ }
+}
+
+void
+ViewForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+}
+
+void
+ViewForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ if (pArgs && (pArgs->GetCount() > 0))
+ {
+ String* pAppId = dynamic_cast<String*>(pArgs->GetAt(0));
+ String* pLiveboxProviderName = dynamic_cast<String*>(pArgs->GetAt(1));
+ if (pAppId != null && pLiveboxProviderName != null)
+ {
+ AppLog("%ls", pAppId->GetPointer());
+
+ Header* pHeader = GetHeader();
+ pHeader->SetTitleText(*pAppId);
+
+ CreateLiveboxView(*pAppId, *pLiveboxProviderName);
+ }
+
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
+}
+
+void
+ViewForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+ if (__pLiveboxView)
+ {
+ RemoveControl(*__pLiveboxView);
+ __pLiveboxView = null;
+ }
+}
+
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template>
+
+ <slp-property>
+ <property-group>
+ <sample-name>LiveboxViewer</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>