--- /dev/null
+# Target name and AppID
+## TODO : set application name and PKG_ID
+SET(this_target Installer)
+SET(PKG_ID D7eOJquGtL)
+
+# 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-media osp-image pthread)
+TARGET_LINK_LIBRARIES(${this_target} -Xlinker --allow-shlib-undefined -pthread -pie)
+
+# Copy info, data, res, and icons directories
+INSTALL(TARGETS ${this_target} DESTINATION ../usr/apps/${PKG_ID}/bin)
+
+# Copy resource
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/manifest.xml DESTINATION ../usr/apps/${PKG_ID}/info)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ../usr/apps/${PKG_ID})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/shared DESTINATION ../usr/apps/${PKG_ID})
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstDetailForm.h
+ * @brief: This file contains the implementation of IstDetailForm class, which acts as a
+ * application installer displaying a list of all the privilege description in the TPK file
+ * and install a package that can be consist of several application.
+ */
+#ifndef _IST_DETAIL_FORM_H_
+#define _IST_DETAIL_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include <FApp.h>
+
+class DetailForm
+ : public Tizen::Ui::Controls::Form
+ , public Tizen::Ui::IActionEventListener
+ , public Tizen::Ui::Controls::IFormBackEventListener
+ , public Tizen::Ui::Controls::IGroupedTableViewItemEventListener
+ , public Tizen::Ui::Controls::IGroupedTableViewItemProvider
+ , public Tizen::Ui::Scenes::ISceneEventListener
+{
+
+// Construction
+public:
+ DetailForm(void);
+ virtual ~DetailForm(void);
+ bool Initialize();
+ void CreateTableView(void);
+ void ConfirmPopupOn();
+ result GetInfoValue(int groupIndex, int itemIndex, Tizen::Base::String& name, Tizen::Base::String& description);
+ result ParsingTPK();
+ result ResizeSubText(int lineCount, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TextBox* pSubTextBox);
+ void SetInfoTextBox();
+ void SetListItemImage(Tizen::App::AppResource* pAppResource);
+ void SetPopupControl();
+
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+ virtual void OnFormBackRequested(Form& source);
+ virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+ virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+ virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
+ virtual int GetGroupCount(void);
+ virtual int GetItemCount(int groupIndex);
+ virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
+ virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
+ virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
+ virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
+ virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
+ virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
+ virtual int GetDefaultGroupItemHeight(void);
+ virtual int GetDefaultItemHeight(void);
+ 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::Ui::Controls::Popup* __pPopup;
+ Tizen::Ui::Controls::TextBox* __pTextBox;
+ Tizen::Ui::Controls::ListView* __pInfoList;
+ Tizen::Ui::Controls::TableView* __pTableList;
+ Tizen::Ui::Controls::GroupedTableView* __pList;
+ Tizen::Ui::Controls::Label* __pShowAllImageLable;
+ Tizen::Ui::Controls::Label* __pPreInstallLabel;
+ Tizen::Graphics::Bitmap* __pHome;
+ Tizen::Graphics::Bitmap* __pHeaderImage;
+ Tizen::Graphics::Bitmap* __pDropDown;
+ Tizen::Graphics::Bitmap* __pDropDown2;
+ Tizen::Graphics::Bitmap* __pRollUp;
+ Tizen::Graphics::Bitmap* __pCheckImage;
+
+ Tizen::App::Package::PackageInfo* __pTargetPackageInfo;
+ Tizen::Base::Collection::IList* __pPrivilegeList;
+ Tizen::Ui::Controls::Header* __pHeader;
+
+ int __itemCount;
+ bool __isInstalled;
+ bool __isUpdatable;
+};
+
+#endif
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ *@file: IstFormFactory.h
+ *@brief: This file contains the implementation InstallServiceFormFactory class, which manages
+ *all the forms of the application.
+ */
+
+#ifndef _IST_FORM_FACTORY_H_
+#define _IST_FORM_FACTORY_H_
+
+#include <FUi.h>
+
+
+class FormFactory
+ : public Tizen::Ui::Scenes::IFormFactory
+{
+public:
+ FormFactory(void);
+ virtual ~FormFactory(void);
+
+ virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _IST_FORM_FACTORY_H_
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstAppInstall.h
+ * @brief: This file contains the implementation of IstAppInstall class, which acts as a
+ * application installer processing a installation of application. This form also notify
+ * completion of installation to IstAppInstallForm.
+ */
+
+#ifndef _IST_INSTALL_EVENT_LISTENER_H_
+#define _IST_INSTALL_EVENT_LISTENER_H_
+
+
+#include <FApp.h>
+
+class InstallEventListener
+ : public Tizen::App::Package::IPackageInstallationResponseListener
+{
+public:
+ InstallEventListener();
+ virtual ~InstallEventListener();
+
+ // package install Response Listener
+ virtual void OnPackageInstallationResponseReceived(const Tizen::Base::String& packageId,
+ Tizen::App::Package::PackageInstallationResult installationResult);
+ virtual void OnPackageInstallationInProgressResponseReceived(const Tizen::Base::String& packageId, int progress);
+};
+
+#endif /* _IST_INSTALL_EVENT_LISTENER_H_ */
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstAppInstallForm.h
+ * @brief: This file contains the implementation of IstAppInstallForm class, which acts as a
+ * application installer displaying a progress of installation of application. This form also open
+ * target application or close installer itself.
+ */
+#ifndef _IST_INSTALL_FORM_H_
+#define _IST_INSTALL_FORM_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+using namespace Tizen::Base::Runtime;
+
+class InstallForm
+ : public Tizen::Base::Runtime::ITimerEventListener
+ , public Tizen::Ui::IActionEventListener
+ , public Tizen::Ui::Controls::Form
+ , public Tizen::Ui::Controls::IFormBackEventListener
+ , public Tizen::Ui::Scenes::ISceneEventListener
+{
+
+public:
+ InstallForm(void);
+ virtual ~InstallForm(void);
+ bool Initialize();
+ void AddFooterItem();
+ void InstallApplication();
+ void OnPopup();
+ void SetPopupValueAndOn(Tizen::Base::String title, Tizen::Base::String content);
+ void SetPopupControl();
+
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+ virtual void OnTimerExpired(Timer& timer);
+ virtual void OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs);
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+ virtual void OnFormBackRequested(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:
+ int __timerCounter;
+ bool __isInstalling;
+ bool __isInstallSuccess;
+
+ Timer* __pTimer;
+ Tizen::Ui::Controls::Header* __pHeader;
+ Tizen::Ui::Controls::Label* __pProgressLabel;
+ Tizen::Ui::Controls::Label* __progressImageLabel;
+ Tizen::Ui::Controls::Progress* __pProgress;
+ Tizen::Ui::Controls::Popup* __pPopup;
+ Tizen::Ui::Controls::TextBox* __pPopupTextBox;
+
+ Tizen::Graphics::Bitmap* __pProgressImage;
+ Tizen::Graphics::Bitmap* __pProgressEfImage;
+
+ Tizen::Base::String __packageOperationId;
+ Tizen::Base::String __packageName;
+ Tizen::App::AppManager* __pAppManager;
+
+};
+
+#endif
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstInstallerApp.h
+ * @brief: This file contains the declaration of InstallerApp Class,
+ * which provides basic features necessary to define an UiApp.
+ */
+
+#ifndef _IST_INSTALLER_APP_H_
+#define _IST_INSTALLER_APP_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+
+
+class InstallerApp
+ : public Tizen::App::UiApp
+ , public Tizen::App::IAppControlProviderEventListener
+ , public Tizen::System::IScreenEventListener
+{
+public:
+ static Tizen::App::UiApp* CreateInstance(void);
+ InstallerApp(void);
+ virtual~InstallerApp(void);
+ Tizen::Base::String GetPackagePath();
+ bool IsValidAccess();
+
+ virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
+ virtual bool OnAppInitialized(void);
+ virtual bool OnAppWillTerminate(void);
+ virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
+ virtual void OnForeground(void);
+ virtual void OnBackground(void);
+ virtual void OnLowMemory(void);
+ virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
+ virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
+ const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
+ const Tizen::Base::Collection::IMap* pExtraData);
+ virtual void OnScreenOn(void);
+ virtual void OnScreenOff(void);
+
+private:
+ void SetUri(Tizen::Base::String uriData);
+ void SetPackagePath(Tizen::Base::String packagePath);
+
+ bool __isValidAccess;
+};
+
+#endif // _IST_INSTALLER_APP_H_
--- /dev/null
+#ifndef _IST_MAIN_FRAME_H_
+#define _IST_MAIN_FRAME_H_
+
+#include <FBase.h>
+#include <FUi.h>
+
+
+class MainFrame
+ : public Tizen::Ui::Controls::Frame
+{
+public:
+ MainFrame(void);
+ virtual ~MainFrame(void);
+
+public:
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+};
+
+#endif //_IST_MAIN_FRAME_H_
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstPanelFactory.h
+ * @brief: This file contains the implementation of InstallServicePanelFactory class, which manages
+ * all the panel containers used across the application.
+ */
+
+#ifndef _IST_PANEL_FACTORY_H_
+#define _IST_PANEL_FACTORY_H_
+
+#include <FUi.h>
+
+
+class PanelFactory
+ : public Tizen::Ui::Scenes::IPanelFactory
+{
+public:
+ PanelFactory(void);
+ virtual ~PanelFactory(void);
+
+ virtual Tizen::Ui::Controls::Panel* CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId);
+};
+
+#endif // _IST_PANEL_FACTORY_H_
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstTypes.h
+ * @brief: This file contains common enumerators, static constants used across the application
+ */
+
+#ifndef _IST_TYPES_H_
+#define _IST_TYPES_H_
+
+#include <FApp.h>
+#include <FUi.h>
+
+using namespace Tizen::Graphics;
+
+static const int INSTALL_SUCCESS_EVENT = 2000;
+static const int INSTALL_FAIL_STORAGE_FULL = 2001;
+static const int INSTALL_FAIL_INVALID_PACKAGE = 2002;
+
+extern const wchar_t* HEADER_IMAGE;
+extern const wchar_t* APP_NAME;
+extern const wchar_t* FILE_URI_SCHEME;
+
+extern Tizen::Base::String __uriData;
+extern Tizen::Base::String __packagePath;
+
+extern const int GAP_BETWEEN_FORM_POPUP;
+extern const int X_POPUP_LABLE;
+extern const int Y_POPUP_LABLE;
+extern const int H_POPUP_LABLE;
+extern const int GAP_BETWEEN_POPUP_LABEL;
+extern const int GAP_BETWEEN_POPUP_BUTTON;
+extern const int UI_H_POPUP;
+extern const int UI_H_POPUP_BUTTON;
+extern const int H_POPUP_TITLE;
+extern const int H_TEXT_LINE;
+extern const int GAP_BETWEEN_BUTTON;
+extern const int X_CANCEL_BTN_ALONE;
+
+#endif /* _IST_TYPES_H_ */
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Manifest xmlns="http://schemas.tizen.org/2012/12/manifest">
+ <Id>D7eOJquGtL</Id>
+ <Version>1.0.0</Version>
+ <Type>C++App</Type>
+ <Requirements>
+ <Feature Name="http://tizen.org/feature/platform.core.cpu.arch.x86">true</Feature>
+ <Feature Name="http://tizen.org/feature/platform.core.fpu.arch.vfpv3">true</Feature>
+ </Requirements>
+ <Apps>
+ <ApiVersion>2.0</ApiVersion>
+ <Privileges>
+ <Privilege>http://tizen.org/privilege/application.launch</Privilege>
+ <Privilege>http://tizen.org/privilege/packageinfo</Privilege>
+ <Privilege>http://tizen.org/privilege/application.kill</Privilege>
+ <Privilege>http://tizen.org/privilege/packagemanager.install</Privilege>
+ </Privileges>
+ <UiApp Main="True" MenuIconVisible="False" Name="Installer">
+ <UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720"/>
+ <UiTheme SystemTheme="White"/>
+ <DisplayNames>
+ <DisplayName Locale="eng-GB">Installer</DisplayName>
+ </DisplayNames>
+ <Icons>
+ <Icon Section="MainMenu" Type="Xhigh">mainmenu.png</Icon>
+ </Icons>
+ <AppControls>
+ <AppControl>
+ <Operation>http://tizen.org/appcontrol/operation/install</Operation>
+ </AppControl>
+ </AppControls>
+ <LaunchConditions/>
+ </UiApp>
+ </Apps>
+</Manifest>
--- /dev/null
+Name: apps.Installer
+Summary: Installer application
+Version: 1.0.1
+Release: 1
+Group: TO_BE/FILLED_IN
+License: TO BE FILLED IN
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+BuildRequires: pkgconfig(osp-appfw)
+BuildRequires: pkgconfig(osp-uifw)
+BuildRequires: pkgconfig(osp-media)
+BuildRequires: pkgconfig(osp-image)
+BuildRequires: pkgconfig(osp-image-core)
+
+%description
+Verification application: Installer
+
+%prep
+%setup -q
+
+%build
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%ifarch %{ix86}
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%else
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%endif
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post
+/sbin/ldconfig
+PKG_ID=D7eOJquGtL
+echo "/usr/etc/package-manager/backend/tpk -i /usr/apps/"${PKG_ID}
+/usr/etc/package-manager/backend/tpk -i /usr/apps/${PKG_ID}
+cp -f /usr/lib/osp/osp-service-app-loader /usr/apps/${PKG_ID}/bin/Installer
+
+%postun
+/sbin/ldconfig
+PKG_ID=D7eOJquGtL
+echo "/usr/etc/package-manager/backend/tpk -u "${PKG_ID}
+/usr/etc/package-manager/backend/tpk -u ${PKG_ID}
+
+%files
+%defattr(-,root,root,-)
+/usr/apps/*
+
+
--- /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="2.0.0.201302151107" Dversion="20120315">
+ <LogicalCoordinate>720</LogicalCoordinate>
+ <Form id="IDL_APP_INSTALL_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_ICON_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/>
+ </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="AppName INSTALL" titleTextColor=""/>
+ <itemSet/>
+ </Header>
+ <Progress id="IDF_PROGRESS" parent="IDL_APP_INSTALL_FORM">
+ <property backgroundColor="" barColor="" leftText="" max="20" min="0" rightText="" showValueState="true" value="0"/>
+ <layout height="93" mode="Portrait" style="PROGRESS_STYLE_NONE" width="650" x="36" y="463"/>
+ <layout height="52" mode="Landscape" style="PROGRESS_STYLE_NONE" width="533" x="280" y="48"/>
+ </Progress>
+ <Label id="IDC_PROGRESS_LABEL" parent="IDL_APP_INSTALL_FORM">
+ <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" text="Installing..." textColor="" textSize="33" textStyle="LABEL_TEXT_STYLE_NORMAL" verticalAlign="ALIGN_MIDDLE"/>
+ <layout height="46" mode="Portrait" width="444" x="46" y="436"/>
+ <layout height="52" mode="Landscape" width="533" x="94" y="21"/>
+ </Label>
+</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="2.0.0.201302151107" Dversion="20120315">
+ <LogicalCoordinate>720</LogicalCoordinate>
+ <Form id="IDL_DETAIL_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_ICON_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="101" disabledIconPath="" highlightedIconPath="" normalIconPath="" pressedIconPath="" selectedIconPath="" text="Install"/>
+ </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="APP NAME" titleTextColor=""/>
+ <itemSet/>
+ </Header>
+ <TextBox id="IDC_INFO_TEXTBOX" parent="IDL_DETAIL_FORM">
+ <property disabledBackgroundBitmapPath="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" highlightedBackgroundBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" lineSpacingExtra="1" lineSpacingMultiplier="1" normalBackgroundBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" text="" textAlignment="" textSize="33" textboxBorder="TEXT_BOX_BORDER_ROUNDED"/>
+ <layout height="221" mode="Portrait" width="629" x="47" y="22"/>
+ <layout height="166" mode="Landscape" width="1118" x="76" y="20"/>
+ </TextBox>
+ <ListView id="IDC_INFO_LIST" parent="IDL_DETAIL_FORM">
+ <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" bitmapPathOfEmptyList="" colorOfEmptyListText="" fastScroll="false" itemDivider="true" itemDividerColor="" sweepEnabled="false" textOfEmptyList=""/>
+ <layout height="737" mode="Portrait" width="625" x="49" y="265"/>
+ <layout height="414" mode="Landscape" width="1111" x="87" y="70"/>
+ </ListView>
+</Scene>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Workflow>
+ <Scene Form="IDL_DETAIL_FORM" Id="FORM_DETAIL"/>
+ <Scene Form="IDL_APP_INSTALL_FORM" Id="FORM_APP_INSTALL"/>
+ <SceneTransition AnimationType="none" DestroyOption="keep" DirectionType="forward" HistoryOption="add" Id="ID_SCNT_MAINSCENE" Method="" SourceId="" SourceResourceType="" TargetId="FORM_DETAIL"/>
+ <SceneTransition AnimationType="left" DestroyOption="keep" DirectionType="forward" HistoryOption="add" Id="ID_SCNT_1" Method="OnActionPerformed" SourceId="FORM_DETAIL" SourceResourceType="IDL_DETAIL_FORM" TargetId="FORM_APP_INSTALL"/>
+</Workflow>
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * This file contains the Tizen application entry point.
+ */
+#include "IstInstallerApp.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif // __cplusplus
+
+
+//
+// The entry function of Tizen application called by the operating system.
+//
+_EXPORT_ int
+OspMain(int argc, char* pArgv[])
+{
+ AppLog("Application started.");
+ ArrayList args(SingleObjectDeleter);
+ args.Construct();
+ for (int i = 0; i < argc; i++)
+ {
+ args.Add(new (std::nothrow) String(pArgv[i]));
+ }
+
+ result r = Tizen::App::UiApp::Execute(InstallerApp::CreateInstance, &args);
+ TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r));
+ AppLog("Application finished.");
+
+ return static_cast<int>(r);
+}
+#ifdef __cplusplus
+}
+#endif // __cplusplus
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstDetailForm.cpp
+ * @brief: This file contains the implementation of IstDetailForm class, which acts as a
+ * application installer displaying a list of all the privilege description in the TPK file
+ * and install a package that can be consist of several application.
+ */
+#include <FApp.h>
+#include <FSecPrivilegeInfo.h>
+#include "IstDetailForm.h"
+#include "IstInstallerApp.h"
+#include "IstInstallEventListener.h"
+#include "IstInstallerApp.h"
+#include "IstTypes.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+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::Security;
+using namespace Tizen::App::Package;
+
+static const int IDA_INSTALL_BTN = 101;
+
+static const int ID_BUTTON_CLOSE_POPUP = 503;
+static const int ID_BUTTON_INSTALL_POPUP = 502;
+static const wchar_t LIST_IMAGE_PATH1[] = L"00_button_radio_select_dim.png";
+static const wchar_t DROP_DOWN_IMAGE[] = L"00_list_expand_closed.png";
+static const wchar_t ROLL_UP_IMAGE[] = L"00_list_expand_opened.png";
+static const wchar_t ELM_CHECK_IMAGE[] = L"00_check_checking_dim.png";
+
+// Color
+static const Color UI_COLOR_WHITE = Color(248, 246, 239, 100);
+static const Color UI_COLOR_WHITE2 = Color(0, 0, 0, 0);
+// Font
+static const int FONT_SIZE_MAIN_TEXT = 33;
+static const int FONT_SIZE_SUB_TEXT = 30;
+// Control Position & Size
+static const int X_TABLE_VIEW_LIST = 0;
+static const int Y_TABLE_VIEW_LIST = 250;
+static const int X_MAIN_TEXT_LABEL = 80;
+static const int Y_MAIN_TEXT_LABEL = 0;
+static const int H_MAIN_TEXT_LABEL = 70;
+static const int X_SUB_TEXT_LABEL = 95;
+static const int Y_SUB_TEXT_LABEL = H_MAIN_TEXT_LABEL - 10;
+static const int H_SUB_TEXT_LABEL = 45;
+static const int X_MAIN_TEXT_IMAGE = 40;
+static const int Y_MAIN_TEXT_IMAGE = 9;
+static const int W_MAIN_TEXT_IMAGE = 50;
+static const int H_MAIN_TEXT_IMAGE = 50;
+static const int H_TABLE_VIEW_LIST_LINE = H_MAIN_TEXT_LABEL + H_SUB_TEXT_LABEL+ 20;
+
+
+DetailForm::DetailForm(void)
+{
+}
+
+DetailForm::~DetailForm(void)
+{
+}
+
+bool
+DetailForm::Initialize()
+{
+ Form::Construct(L"IDL_DETAIL_FORM");
+
+ return true;
+}
+
+void
+DetailForm::CreateTableView(void)
+{
+ Rectangle rect = GetClientAreaBounds();
+ __pList = new (std::nothrow) GroupedTableView();
+ __pList->Construct(Rectangle(X_TABLE_VIEW_LIST, Y_TABLE_VIEW_LIST, rect.width, rect.height - (__pTextBox->GetY() + __pTextBox->GetHeight())), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
+ __pList->SetItemProvider(this);
+ __pList->AddGroupedTableViewItemEventListener(*this);
+
+ AddControl(*__pList);
+
+}
+
+void
+DetailForm::ConfirmPopupOn()
+{
+ __pPopup->SetShowState(true);
+ __pPopup->Show();
+}
+
+result
+DetailForm::GetInfoValue(int groupIndex, int itemIndex, String& name, String& description)
+{
+ String value;
+ String privilege;
+
+ TryReturn(groupIndex == 0, E_FAILURE, "Group Index Error");
+ privilege = dynamic_cast <String*>(__pPrivilegeList->GetAt(itemIndex))->GetPointer();
+
+ name = PrivilegeInfo::GetName(privilege);
+ description = PrivilegeInfo::GetDescription(privilege);
+
+ return E_SUCCESS;
+}
+
+result
+DetailForm::ParsingTPK()
+{
+ PackageManager* pMgr = PackageManager::GetInstance();
+ String filePath;
+ String packageId;
+ String localVersion;
+ PackageInfo* pLocalPackageInfo;
+
+ filePath = static_cast<InstallerApp*>(UiApp::GetInstance())->GetPackagePath();
+ // 2. parsing tpk file with file-path
+ __pTargetPackageInfo = pMgr->GetPackageInfoFromFileN(filePath);
+ TryReturn(__pTargetPackageInfo, E_FAILURE, "Package Path is not delivered");
+
+ __pHeader->SetTitleText(__pTargetPackageInfo->GetDisplayName());
+ packageId = __pTargetPackageInfo->GetId().GetPointer();
+ TryReturn(packageId.IsEmpty() == false, E_FAILURE, "pakcageId is Empty!!!");
+
+ pLocalPackageInfo = pMgr->GetPackageInfoN(packageId);
+
+ // is the package already installed on local
+ if (pMgr->IsPackageInstalled(packageId))
+ {
+ TryReturn(pLocalPackageInfo != NULL, E_FAILURE, "Local Package Info get Error");
+
+ __isInstalled = true;
+ localVersion = pLocalPackageInfo->GetVersion();
+ // Upper Version Check
+ if (__pTargetPackageInfo->GetVersion().CompareTo(localVersion) <= 0){
+ __isUpdatable = false;
+ }
+ else{
+ __isUpdatable = true;
+ }
+ }
+ else{
+ __isInstalled = false;
+ }
+
+ __pPrivilegeList = __pTargetPackageInfo->GetPrivilegeListN();
+ if (__pPrivilegeList) {
+ __itemCount = __pPrivilegeList->GetCount();
+ }
+ else{
+ AppLog("No Privilege List");
+ }
+
+ return E_SUCCESS;
+}
+
+
+result
+DetailForm::ResizeSubText(int lineCount, TableViewItem* pItem, TextBox* pSubTextBox)
+{
+ result res = E_SUCCESS;
+ TryReturn(lineCount > 1, E_SUCCESS, "");
+
+ pItem->SetSize(pItem->GetWidth(), pItem->GetHeight() + H_SUB_TEXT_LABEL * (lineCount - 1));
+ pSubTextBox->SetSize(pSubTextBox->GetWidth(), H_SUB_TEXT_LABEL * lineCount);
+
+ return res;
+}
+
+void
+DetailForm::SetInfoTextBox()
+{
+ String installMsg = L"Do you want to install this application?\n\nAllow this application to:";
+ if (__isInstalled){
+ installMsg.Append(L"\n\n(application will be updated)");
+ }
+ __pTextBox = static_cast<TextBox *>(GetControl(L"IDC_INFO_TEXTBOX"));
+ __pTextBox->SetText(installMsg);
+ __pTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, UI_COLOR_WHITE);
+ __pTextBox->Invalidate(false);
+}
+
+void
+DetailForm::SetListItemImage(AppResource* pAppResource)
+{
+ __pHome = pAppResource->GetBitmapN(LIST_IMAGE_PATH1);
+ __pDropDown = pAppResource->GetBitmapN(DROP_DOWN_IMAGE);
+ __pHeaderImage = pAppResource->GetBitmapN(HEADER_IMAGE);
+ __pCheckImage = pAppResource->GetBitmapN(ELM_CHECK_IMAGE);
+ __pRollUp = pAppResource->GetBitmapN(ROLL_UP_IMAGE);
+}
+
+
+void
+DetailForm::SetPopupControl()
+{
+ int popupWidth = GetClientAreaBounds().width - GAP_BETWEEN_FORM_POPUP * 2;
+ __pPopup = new (std::nothrow) Popup();
+ __pPopup->Construct(true, Dimension(popupWidth, UI_H_POPUP));
+ __pPopup->SetTitleText(L"Install Application");
+ __pPopup->SetTitleTextColor(Color::GetColor(COLOR_ID_BLACK));
+
+ Label* popUpLabel = new (std::nothrow) Label();
+ popUpLabel->Construct(Rectangle(X_POPUP_LABLE, Y_POPUP_LABLE, __pPopup->GetBounds().width - GAP_BETWEEN_POPUP_LABEL*2, H_POPUP_LABLE), L"Application installation will be start.");
+ popUpLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ popUpLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
+
+ TextBox* pTextBox = new TextBox();
+ pTextBox->Construct(Rectangle(X_POPUP_LABLE, Y_POPUP_LABLE, __pPopup->GetBounds().width - GAP_BETWEEN_POPUP_LABEL*2, UI_H_POPUP - H_POPUP_TITLE), TEXT_BOX_BORDER_NONE);
+ pTextBox->SetText(L"Application is already installed\n\nInstallation will be closed.");
+ pTextBox->SetTextSize(33);
+
+ Button* pButtonInstall = new (std::nothrow) Button();
+ int buttonWidth = __pPopup->GetBounds().width/2 - GAP_BETWEEN_POPUP_BUTTON;
+ pButtonInstall->Construct(Rectangle(GetClientAreaBounds().x, pTextBox->GetBounds().y + H_TEXT_LINE, buttonWidth , UI_H_POPUP_BUTTON), L"Install");
+ pButtonInstall->SetActionId(ID_BUTTON_INSTALL_POPUP);
+ pButtonInstall->AddActionEventListener(*this);
+
+ Button* pButtonClose = new (std::nothrow) Button();
+ pButtonClose->Construct(Rectangle(GetClientAreaBounds().x + buttonWidth + GAP_BETWEEN_BUTTON , pTextBox->GetBounds().y + H_TEXT_LINE, __pPopup->GetBounds().width/2 - 30, UI_H_POPUP_BUTTON), L"Close");
+ pButtonClose->SetActionId(ID_BUTTON_CLOSE_POPUP);
+ pButtonClose->AddActionEventListener(*this);
+
+ InstallerApp* pUiApp = static_cast<InstallerApp*>(UiApp::GetInstance());
+ String packagePath = pUiApp->GetPackagePath();
+ if (packagePath.IsEmpty() || pUiApp->IsValidAccess() == false){
+ pTextBox->SetText(L"Wrong Execution.");
+ __pPopup->AddControl(*pTextBox);
+ pButtonClose->SetPosition(X_CANCEL_BTN_ALONE, pButtonClose->GetY());
+ }
+ else if (__isInstalled && !__isUpdatable){
+ __pPopup->AddControl(*pTextBox);
+ pButtonClose->SetPosition(X_CANCEL_BTN_ALONE, pButtonClose->GetY());
+ }
+ else{
+ __pPopup->AddControl(*popUpLabel);
+ __pPopup->AddControl(*pButtonInstall);
+ }
+ __pPopup->AddControl(*pButtonClose);
+}
+
+result
+DetailForm::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+ AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+
+ // Set Image Control
+ SetListItemImage(pAppResource);
+
+ // Header Item set
+ __pHeader = GetHeader();
+ __pHeader->SetTitleIcon(__pHeaderImage);
+
+ // Footer Item Set
+ Footer* pFooter = GetFooter();
+ SetFormBackEventListener(this);
+ pFooter->AddActionEventListener(*this);
+
+ // initialize variable
+ __itemCount = 0;
+ __isUpdatable = false;
+ __isInstalled = false;
+
+ // parsing tpk package info then get and set item count
+ ParsingTPK();
+
+ // Install Confirmation Popup
+ SetPopupControl();
+
+ SetInfoTextBox();
+ CreateTableView();
+
+ // Set Disable Controls and Open Popup
+ ConfirmPopupOn();
+ __pTextBox->SetShowState(false);
+ __pList->SetShowState(false);
+
+ Invalidate(true);
+
+ return r;
+}
+
+result
+DetailForm::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ if (__pTargetPackageInfo){
+ delete __pTargetPackageInfo;
+ }
+ if (__pPrivilegeList){
+ delete __pPrivilegeList;
+ }
+
+ return r;
+}
+
+void
+DetailForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ switch (actionId)
+ {
+ case IDA_INSTALL_BTN:
+ {
+ TryReturnVoid(__pTargetPackageInfo, "target package info is empty");
+
+ // In case of package update, previous running app has to be closed(killed)
+ AppManager* pAppManager = AppManager::GetInstance();
+ String pakcageId = __pTargetPackageInfo->GetId() + L"." + __pTargetPackageInfo->GetDisplayName();
+ AppLog("target package id : %ls" ,pakcageId.GetPointer());
+ if (pAppManager->IsRunning(pakcageId)){
+ AppLog("App is Running!!");
+ //TODO: is this check necessary?
+ pAppManager->TerminateApplication(pakcageId);
+ }
+
+ IList* pArgs = null;
+ pArgs = new (std::nothrow) ArrayList();
+ pArgs->Add(*(new (std::nothrow) String(__pTargetPackageInfo->GetDisplayName())));
+
+ pSceneManager->GoForward(SceneTransitionId(L"ID_SCNT_1"), pArgs);
+ }
+ break;
+ case ID_BUTTON_CLOSE_POPUP:
+ {
+ __pPopup->SetShowState(false);
+ Invalidate(true);
+ App::GetInstance()->Terminate();
+ }
+ break;
+ case ID_BUTTON_INSTALL_POPUP:
+ {
+ __pPopup->SetShowState(false);
+ __pTextBox->SetShowState(true);
+ __pList->SetShowState(true);
+ Invalidate(true);
+ }
+ break;
+ }
+}
+void
+DetailForm::OnFormBackRequested(Form& source)
+{
+ UiApp* pApp = UiApp::GetInstance();
+ AppAssert(pApp);
+ pApp->Terminate();
+}
+
+
+void
+DetailForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+}
+
+void
+DetailForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+}
+
+void
+DetailForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
+{
+}
+int
+DetailForm::GetGroupCount(void)
+{
+ return 1;
+}
+
+int
+DetailForm::GetItemCount(int groupIndex)
+{
+ return __itemCount;
+}
+
+Tizen::Ui::Controls::TableViewGroupItem*
+DetailForm::CreateGroupItem(int groupIndex, int itemWidth)
+{
+ TableViewGroupItem* pItem;
+ pItem = new (std::nothrow) TableViewGroupItem();
+ pItem->Construct(Dimension(itemWidth, 10));
+ return pItem;
+}
+
+
+
+
+Tizen::Ui::Controls::TableViewItem*
+DetailForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
+{
+ String name;
+ String description;
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ Rectangle rect = GetClientAreaBounds();
+
+ // Get Title and Description
+ GetInfoValue(groupIndex, itemIndex, name, description);
+
+ pItem->Construct(Tizen::Graphics::Dimension(rect.width, H_TABLE_VIEW_LIST_LINE), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryReturn(groupIndex == 0, null, "");
+ if (itemIndex < GetItemCount(groupIndex))
+ {
+ Label* pMainTextLable = null;
+ pMainTextLable = new (std::nothrow) Label();
+
+ pMainTextLable->Construct(Rectangle(X_MAIN_TEXT_LABEL, Y_MAIN_TEXT_LABEL, pItem->GetWidth() - X_MAIN_TEXT_LABEL, H_MAIN_TEXT_LABEL), name);
+
+ Label* pImageLable = null;
+ Label* pSubTextLabel = null;
+ TextBox* pSubTextBox = new TextBox();
+
+ pImageLable = new (std::nothrow) Label();
+ pSubTextLabel = new (std::nothrow) Label();
+ pSubTextBox = new TextBox();
+
+ pMainTextLable->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_BOLD);
+ pMainTextLable->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pMainTextLable->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+
+ pImageLable->Construct(Rectangle(X_MAIN_TEXT_IMAGE, Y_MAIN_TEXT_IMAGE, W_MAIN_TEXT_IMAGE, H_MAIN_TEXT_IMAGE), L"");
+ pImageLable->SetBackgroundBitmap(*__pCheckImage);
+
+ pSubTextBox->Construct(Rectangle(X_SUB_TEXT_LABEL, Y_SUB_TEXT_LABEL, pItem->GetWidth() - X_SUB_TEXT_LABEL, H_SUB_TEXT_LABEL), TEXT_BOX_BORDER_NONE);
+ pSubTextBox->SetText(description);
+ pSubTextBox->SetTextSize(FONT_SIZE_SUB_TEXT);
+ pSubTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, UI_COLOR_WHITE2);
+ pSubTextBox->SetColor(TEXT_BOX_STATUS_HIGHLIGHTED, UI_COLOR_WHITE2);
+ pSubTextBox->SetColor(TEXT_BOX_STATUS_DISABLED, UI_COLOR_WHITE2);
+ ResizeSubText(pSubTextBox->GetLineCount(), pItem, pSubTextBox);
+ pItem->AddControl(*pMainTextLable);
+ pItem->AddControl(*pImageLable);
+ pItem->AddControl(*pSubTextBox);
+ }
+ return pItem;
+}
+
+bool
+DetailForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
+{
+ delete pItem;
+
+ return true;
+}
+
+void
+DetailForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
+{
+
+}
+
+bool
+DetailForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
+{
+ delete pItem;
+
+ return true;
+}
+
+void
+DetailForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
+{
+
+}
+
+int
+DetailForm::GetDefaultGroupItemHeight(void)
+{
+ return 60;
+}
+
+int
+DetailForm::GetDefaultItemHeight(void)
+{
+ return 150;
+}
+
+void
+DetailForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+ const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+}
+
+void
+DetailForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+ const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ *@file: IstFormFactory.cpp
+ *@brief: This file contains the implementation InstallServiceFormFactory class, which manages
+ *all the forms of the application.
+ */
+
+#include "IstFormFactory.h"
+#include "IstDetailForm.h"
+#include "IstInstallForm.h"
+
+using namespace Tizen::Ui::Scenes;
+
+
+FormFactory::FormFactory(void)
+{
+}
+
+FormFactory::~FormFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Form*
+FormFactory::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 == L"IDL_DETAIL_FORM")
+ {
+ DetailForm* pForm = new DetailForm();
+ pForm->Initialize();
+ pNewForm = pForm;
+ }
+ else if (formId == L"IDL_APP_INSTALL_FORM")
+ {
+ InstallForm* pForm = new InstallForm();
+ pForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pForm);
+ pNewForm = pForm;
+ }
+
+ return pNewForm;
+}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstAppInstall.cpp
+ * @brief: This file contains the implementation of IstAppInstall class, which acts as a
+ * application installer processing a installation of application. This form also notify
+ * completion of installation to IstAppInstallForm.
+ */
+
+#include <FApp.h>
+#include <FUi.h>
+
+#include "IstInstallEventListener.h"
+#include "IstTypes.h"
+
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base;
+
+InstallEventListener::InstallEventListener() {
+
+}
+
+InstallEventListener::~InstallEventListener() {
+}
+
+void
+InstallEventListener::OnPackageInstallationResponseReceived(const PackageId& packageId, PackageInstallationResult installationResult)
+{
+ IList* pArgs = null;
+ switch(installationResult)
+ {
+ case PACKAGE_INSTALLATION_RESULT_SUCCESS:
+ {
+ String data = packageId;
+
+ pArgs = new (std::nothrow) ArrayList();
+ pArgs->Add(*(new (std::nothrow) String(data)));
+ UiApp::GetInstance()->GetFrame(APP_NAME)->GetCurrentForm()->SendUserEvent(INSTALL_SUCCESS_EVENT, pArgs);
+ }
+ break;
+ case PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE:
+ {
+ AppLogException("== PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE == package id : %ls", packageId.GetPointer());
+ UiApp::GetInstance()->GetFrame(APP_NAME)->GetCurrentForm()->SendUserEvent(INSTALL_FAIL_INVALID_PACKAGE, pArgs);
+ }
+ break;
+ case PACKAGE_INSTALLATION_RESULT_STORAGE_FULL:
+ {
+ AppLogException("== PACKAGE_INSTALLATION_RESULT_STORAGE_FULL == ");
+ UiApp::GetInstance()->GetFrame(APP_NAME)->GetCurrentForm()->SendUserEvent(INSTALL_FAIL_STORAGE_FULL, pArgs);
+ }
+ break;
+ default:
+ {
+ AppLogException("Installation result value is not proper");
+ }
+ break;
+ }
+}
+
+void
+InstallEventListener::OnPackageInstallationInProgressResponseReceived(const PackageId& packageId, int progress)
+{
+}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstAppInstallForm.cpp
+ * @brief: This file contains the implementation of IstAppInstallForm class, which acts as a
+ * application installer displaying a progress of installation of application. This form also open
+ * target application or close installer itself.
+ */
+#include <FApp.h>
+#include "IstInstallForm.h"
+#include "IstInstallEventListener.h"
+#include "IstInstallerApp.h"
+#include "IstTypes.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;
+using namespace Tizen::App::Package;
+
+static const int ID_FOOTER_OPEN = 101;
+static const int ID_BUTTON_CLOSE_POPUP = 103;
+static const wchar_t* PROGRESS_IMAGE = L"00_progress_pending_02_bg.png";
+static const wchar_t* PROGRESS_EF_IMAGE = L"00_progress_pending_ef_02_bg.png";
+static const wchar_t* POPUP_MSESSAGE_SUCCESS = L"Installation success";
+static const wchar_t* POPUP_MSESSAGE_FAIL = L"Installation fail";
+
+static const int TIME_COUNT = 40;
+InstallForm::InstallForm(void)
+{
+}
+
+InstallForm::~InstallForm(void)
+{
+}
+
+bool
+InstallForm::Initialize()
+{
+ Form::Construct(L"IDL_APP_INSTALL_FORM");
+
+ AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+ __pAppManager = AppManager::GetInstance();
+
+ SetFormBackEventListener(this);
+
+ // init variable
+ __timerCounter = 0;
+ __isInstalling = true;
+ __isInstallSuccess = false;
+
+ // Timer
+ __pTimer = new (std::nothrow) Timer();
+ __pTimer->Construct(*this);
+ __pTimer->StartAsRepeatable(500);
+
+ // progress test image
+ __pProgressEfImage = pAppResource->GetBitmapN(PROGRESS_EF_IMAGE);
+ __pProgressImage = pAppResource->GetBitmapN(PROGRESS_IMAGE);
+ __progressImageLabel = new (std::nothrow) Label();
+ __progressImageLabel->Construct(Rectangle(70, 550, 580, 20), L"");
+
+ AddControl(*__progressImageLabel);
+
+ InstallApplication();
+
+ return true;
+}
+
+void
+InstallForm::AddFooterItem()
+{
+ Footer* pFooter = GetFooter();
+
+ FooterItem footerItem1;
+ footerItem1.Construct(ID_FOOTER_OPEN);
+ footerItem1.SetText(L"Open");
+
+ pFooter->AddItem(footerItem1);
+
+ pFooter->AddActionEventListener(*this);
+}
+
+void
+InstallForm::InstallApplication()
+{
+ PackageManager* packManager = PackageManager::GetInstance();
+ InstallEventListener* appInstallObj = new InstallEventListener();
+ String packageId = L"sangs_temp_id";
+ String packagePath = static_cast<InstallerApp*>(UiApp::GetInstance())->GetPackagePath();
+ result res;
+
+ if (packagePath.IsEmpty()){
+ AppLogException("No Tpk File Path");
+ SetPopupValueAndOn(L"Installation Fail", L"No Tpk File Path");
+ OnPopup();
+ return;
+ }
+
+ res = packManager->InstallPackage(packageId, packagePath, appInstallObj);
+ if (res != E_SUCCESS)
+ {
+ TryLog(res != E_INVALID_ARG, "E_INVALID_ARG");
+ TryLog(res != E_SYSTEM, "E_SYSTEM");
+ TryLog(res != E_PRIVILEGE_DENIED, "E_PRIVILEGE_DENIED");
+ }
+ else{
+ AppLog("INSTALLTAION SUCCESS");
+ }
+}
+
+
+void
+InstallForm::SetPopupValueAndOn(String title, String content)
+{
+ __pPopup->SetTitleText(title);
+ __pPopupTextBox->SetText(content);
+}
+
+void
+InstallForm::OnPopup()
+{
+ __pPopup->SetShowState(true);
+ __pPopup->Show();
+}
+void
+InstallForm::SetPopupControl()
+{
+ int popupWidth = GetClientAreaBounds().width - GAP_BETWEEN_FORM_POPUP * 2;
+ __pPopup = new (std::nothrow) Popup();
+ __pPopup->Construct(true, Dimension(popupWidth, UI_H_POPUP));
+ __pPopup->SetTitleTextColor(Color::GetColor(COLOR_ID_BLACK));
+
+ Label* popUpLabel = new (std::nothrow) Label();
+ popUpLabel->Construct(Rectangle(X_POPUP_LABLE, Y_POPUP_LABLE, __pPopup->GetBounds().width - GAP_BETWEEN_POPUP_LABEL*2, H_POPUP_LABLE), L"Application installation will be start.");
+ popUpLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ popUpLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
+
+ __pPopupTextBox = new TextBox();
+ __pPopupTextBox->Construct(Rectangle(X_POPUP_LABLE, Y_POPUP_LABLE, __pPopup->GetBounds().width - GAP_BETWEEN_POPUP_LABEL*2, UI_H_POPUP - H_POPUP_TITLE), TEXT_BOX_BORDER_NONE);
+ __pPopupTextBox->SetTextSize(33);
+
+ Button* pButtonClose = new (std::nothrow) Button();
+ pButtonClose->Construct(Rectangle(GetClientAreaBounds().x, __pPopupTextBox->GetBounds().y + H_TEXT_LINE, __pPopup->GetBounds().width/2 - 30, UI_H_POPUP_BUTTON), L"Close");
+ pButtonClose->SetActionId(ID_BUTTON_CLOSE_POPUP);
+ pButtonClose->AddActionEventListener(*this);
+
+ __pPopup->AddControl(*__pPopupTextBox);
+ pButtonClose->SetPosition(X_CANCEL_BTN_ALONE, pButtonClose->GetY());
+ __pPopup->AddControl(*pButtonClose);
+}
+
+result
+InstallForm::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+
+ __pProgress = static_cast<Progress*>(GetControl(L"IDF_PROGRESS", true));
+ __pProgressLabel = static_cast<Label*>(GetControl(L"IDC_PROGRESS_LABEL", true));
+
+ // Install Confirmation Popup
+ SetPopupControl();
+
+ return r;
+}
+
+result
+InstallForm::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ if (__pTimer){
+ delete __pTimer;
+ }
+
+ return r;
+}
+
+
+void
+InstallForm::OnTimerExpired(Timer& timer)
+{
+ __timerCounter++;
+ // wait closing install app until new app is running for smooth view change
+ if (!__isInstalling)
+ {
+ if (__pAppManager->IsRunning(__packageOperationId)){
+ __pTimer->Cancel();
+ App::GetInstance()->Terminate();
+ }
+ return;
+ }
+
+ if (__timerCounter >= TIME_COUNT)
+ {
+ if (__isInstallSuccess){
+ __pProgressLabel->SetText(POPUP_MSESSAGE_SUCCESS);
+ __pTimer->Cancel();
+ __isInstalling = false;
+ }
+ else{
+ __pProgressLabel->SetText(POPUP_MSESSAGE_FAIL);
+ __pTimer->Cancel();
+ __isInstalling = false;
+ }
+ }
+ else
+ {
+ if (__timerCounter % 2 == 0){
+ __progressImageLabel->SetBackgroundBitmap(*__pProgressImage);
+ }
+ else{
+ __progressImageLabel->SetBackgroundBitmap(*__pProgressEfImage);
+ }
+
+ }
+ __pProgress->SetValue(__timerCounter);
+ __pProgress->Invalidate(false);
+ __pProgressLabel->Invalidate(false);
+}
+
+void
+InstallForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
+{
+ switch(requestId)
+ {
+ case INSTALL_SUCCESS_EVENT:
+ {
+ __isInstallSuccess = true;
+ AppLog("Install Success Event is Received");
+ __timerCounter = TIME_COUNT;
+ String *packageId = (String*)pArgs->GetAt(0);
+// AppLog("packageId : %ls", packageId->GetPointer());
+
+ PackageInfo* pLocalPackageInfo;
+ PackageManager* pMgr = PackageManager::GetInstance();
+ pLocalPackageInfo = pMgr->GetPackageInfoN(*packageId);
+
+ __packageOperationId = *packageId + L"." + pLocalPackageInfo->GetDisplayName();
+// AppLog("packageName : %ls", __packageOperationId.GetPointer());
+ AddFooterItem();
+ }
+ break;
+ case INSTALL_FAIL_INVALID_PACKAGE:
+ {
+ SetPopupValueAndOn(L"Installation Fail", L"Invalid Package Install Error");
+ OnPopup();
+ }
+ break;
+ case INSTALL_FAIL_STORAGE_FULL:
+ {
+ SetPopupValueAndOn(L"Installation Fail", L"Storage Full Install Error");
+ OnPopup();
+ }
+ break;
+ default:
+ {
+ AppLogException("error event request ID sended by EndpointThread");
+ }
+ break;
+ }
+}
+
+
+void
+InstallForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+ switch(actionId)
+ {
+ case ID_FOOTER_OPEN:
+ {
+ AppManager* pAppManager = AppManager::GetInstance();
+
+ // init timer
+ __timerCounter = 0;
+
+ pAppManager->LaunchApplication(__packageOperationId);
+ __pTimer->StartAsRepeatable(500);
+ }
+ break;
+ case ID_BUTTON_CLOSE_POPUP:
+ {
+ __pPopup->SetShowState(false);
+ Invalidate(true);
+ App::GetInstance()->Terminate();
+ }
+ break;
+ }
+}
+
+void
+InstallForm::OnFormBackRequested(Form& source)
+{
+ TryReturnVoid(!__isInstalling, null);
+
+ App::GetInstance()->Terminate();
+}
+
+
+void
+InstallForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+ const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+ Bitmap* pHeaderImage = pAppResource->GetBitmapN(HEADER_IMAGE);
+
+ String *packageName = (String*)pArgs->GetAt(0);
+ __pHeader = GetHeader();
+ __pHeader->SetTitleText(*packageName);
+ __pHeader->SetTitleIcon(pHeaderImage);
+
+}
+
+void
+InstallForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+ const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstInstallerApp.cpp
+ * @brief: This file contains the declaration of InstallerApp Class,
+ * which provides basic features necessary to define an UiApp.
+ */
+
+#include "IstInstallerApp.h"
+#include "IstMainFrame.h"
+#include "IstTypes.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;
+
+
+InstallerApp::InstallerApp(void)
+{
+}
+
+InstallerApp::~InstallerApp(void)
+{
+}
+
+UiApp*
+InstallerApp::CreateInstance(void)
+{
+ // Create the instance through the constructor.
+ return new InstallerApp();
+}
+
+String
+InstallerApp::GetPackagePath()
+{
+ return __packagePath;
+}
+
+bool
+InstallerApp::IsValidAccess()
+{
+ return __isValidAccess;
+}
+
+void
+InstallerApp::SetUri(String uriData)
+{
+ __uriData.Clear();
+ __uriData.Append(uriData);
+}
+
+void
+InstallerApp::SetPackagePath(String packagePath)
+{
+ __packagePath.Clear();
+ __packagePath.Append(packagePath);
+}
+
+bool
+InstallerApp::OnAppInitializing(AppRegistry& appRegistry)
+{
+ AppControlProviderManager* pProviderMgr = AppControlProviderManager::GetInstance();
+ pProviderMgr->SetAppControlProviderEventListener(this);
+
+ __isValidAccess = false;
+
+ return true;
+}
+
+bool
+InstallerApp::OnAppInitialized(void)
+{
+ // Create a Frame
+ MainFrame* pMainFrame = new MainFrame();
+ pMainFrame->Construct();
+ pMainFrame->SetName(APP_NAME);
+ AddFrame(*pMainFrame);
+
+ return true;
+}
+
+bool
+InstallerApp::OnAppWillTerminate(void)
+{
+ return true;
+}
+
+bool
+InstallerApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+ return true;
+}
+
+void
+InstallerApp::OnForeground(void)
+{
+}
+
+void
+InstallerApp::OnBackground(void)
+{
+}
+
+void
+InstallerApp::OnLowMemory(void)
+{
+}
+
+void
+InstallerApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+}
+
+void
+InstallerApp::OnScreenOn(void)
+{
+}
+
+void
+InstallerApp::OnScreenOff(void)
+{
+}
+void
+InstallerApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
+ const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
+ const Tizen::Base::Collection::IMap* pExtraData)
+{
+ if (pUriData != NULL && !pUriData->IsEmpty())
+ {
+ SetUri(*pUriData);
+
+ String filePath;
+ // 1. parsing file uri data
+ if ((*pUriData).StartsWith(FILE_URI_SCHEME, 0)){
+ __isValidAccess = true;
+ (*pUriData).SubString(String(FILE_URI_SCHEME).GetLength(), filePath);
+ AppLog("packageId : %ls", pUriData->GetPointer());
+ AppLog("filePath : %ls", filePath.GetPointer());
+ SetPackagePath(filePath);
+ }
+ else{
+ __isValidAccess = false;
+ }
+ }
+ else{
+ __isValidAccess = false;
+ }
+}
+
+
--- /dev/null
+#include "IstMainFrame.h"
+#include "IstFormFactory.h"
+#include "IstPanelFactory.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+MainFrame::MainFrame(void)
+{
+}
+
+MainFrame::~MainFrame(void)
+{
+}
+
+result
+MainFrame::OnInitializing(void)
+{
+ // Prepare Scene management.
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ static FormFactory formFactory;
+ static PanelFactory panelFactory;
+ pSceneManager->RegisterFormFactory(formFactory);
+ pSceneManager->RegisterPanelFactory(panelFactory);
+ pSceneManager->RegisterScene(L"workflow");
+
+ // Goto the scene.
+ result r = pSceneManager->GoForward(SceneTransitionId(L"ID_SCNT_MAINSCENE"));
+
+ return r;
+}
+
+result
+MainFrame::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+
+ return r;
+}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstPanelFactory.cpp
+ * @brief: This file contains the implementation of InstallServicePanelFactory class, which manages
+ * all the panel containers used across the application.
+ */
+
+
+#include "IstPanelFactory.h"
+
+using namespace Tizen::Ui::Scenes;
+
+
+PanelFactory::PanelFactory(void)
+{
+}
+
+PanelFactory::~PanelFactory(void)
+{
+}
+
+Tizen::Ui::Controls::Panel*
+PanelFactory::CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ Tizen::Ui::Controls::Panel* pNewPanel = null;
+
+ return pNewPanel;
+}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: IstTypes.cpp
+ * @brief: This file contains common enumerators, static constants used across the application
+ */
+
+
+#include "IstTypes.h"
+
+const int GAP_BETWEEN_FORM_POPUP = 28;
+const int X_POPUP_LABLE = 0;
+const int Y_POPUP_LABLE = 0;
+const int H_POPUP_LABLE = 300;
+const int GAP_BETWEEN_POPUP_LABEL = 25;
+const int GAP_BETWEEN_POPUP_BUTTON = GAP_BETWEEN_POPUP_LABEL;
+const int UI_H_POPUP = 330;
+const int UI_H_POPUP_BUTTON = 74;
+const int H_POPUP_TITLE = 50;
+const int H_TEXT_LINE = 150;
+const int GAP_BETWEEN_BUTTON = 10;
+const int X_CANCEL_BTN_ALONE = 160;
+
+
+const wchar_t* HEADER_IMAGE = L"home_type3.png";
+const wchar_t* APP_NAME = L"Installer";
+const wchar_t* FILE_URI_SCHEME = L"file://";
+
+Tizen::Base::String __uriData;
+Tizen::Base::String __packagePath;