[Tizen] Add settings and about form

This commit is contained in:
Sergey Pisarchik 2014-05-17 11:29:52 +03:00 committed by Alex Zolotarev
parent 7eb92a5960
commit 45c958c21a
19 changed files with 1011 additions and 72 deletions

View file

@ -0,0 +1,20 @@
#pragma once
#include <FUi.h>
class AboutForm: public Tizen::Ui::Controls::Form
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::IActionEventListener
{
public:
AboutForm();
virtual ~AboutForm(void);
bool Initialize(void);
virtual result OnInitializing(void);
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form & source);
virtual void OnActionPerformed(const Tizen::Ui::Control & source, int actionId);
private:
static const int ID_CLOSE = 101;
};

View file

@ -0,0 +1,210 @@
#ifndef _APP_RESOURCE_ID_H_
#define _APP_RESOURCE_ID_H_
extern const wchar_t* IDC_ABOUT_BUTTON;
extern const wchar_t* IDC_CLOSE_BUTTON;
extern const wchar_t* IDC_ENABLE_SCALE_BUTTONS_CB;
extern const wchar_t* IDC_FOOTS_CHECKBUTTON;
extern const wchar_t* IDC_MEASUREMENT_NOTE;
extern const wchar_t* IDC_MEASUREMENT_UNITS_LABEL;
extern const wchar_t* IDC_METERS_CHECKBUTTON;
extern const wchar_t* IDC_SELECT_STORAGE_BUTTON;
extern const wchar_t* IDC_VERSION_LABEL;
extern const wchar_t* IDC_WEB;
extern const wchar_t* IDF_ABOUT_FORM;
extern const wchar_t* IDS_ABOUT;
extern const wchar_t* IDS_ABOUT_MENU_TITLE;
extern const wchar_t* IDS_ADDRESS;
extern const wchar_t* IDS_ADD_NEW_SET;
extern const wchar_t* IDS_ADD_TO_BOOKMARKS;
extern const wchar_t* IDS_ADVISE_UPDATE_MAPS;
extern const wchar_t* IDS_ALLOW_STATISTICS;
extern const wchar_t* IDS_ALLOW_STATISTICS_HINT;
extern const wchar_t* IDS_APPSTORE_MESSAGE;
extern const wchar_t* IDS_APP_NAME;
extern const wchar_t* IDS_ARE_YOU_SURE;
extern const wchar_t* IDS_ATM;
extern const wchar_t* IDS_BACK;
extern const wchar_t* IDS_BANK;
extern const wchar_t* IDS_BECOME_A_PRO;
extern const wchar_t* IDS_BOOKMARKS;
extern const wchar_t* IDS_BOOKMARKS_IN_PRO_VERSION;
extern const wchar_t* IDS_BOOKMARKS_USAGE_HINT;
extern const wchar_t* IDS_BOOKMARKS_USAGE_HINT_IMPORT_ONLY;
extern const wchar_t* IDS_BOOKMARK_COLOR;
extern const wchar_t* IDS_BOOKMARK_MOVE_FAIL;
extern const wchar_t* IDS_BOOKMARK_SETS;
extern const wchar_t* IDS_BOOKMARK_SET_NAME;
extern const wchar_t* IDS_BOOKMARK_SHARE_EMAIL;
extern const wchar_t* IDS_BOOKMARK_SHARE_EMAIL_SUBJECT;
extern const wchar_t* IDS_BOOKMARK_SHARE_SMS;
extern const wchar_t* IDS_CANCEL;
extern const wchar_t* IDS_CANCEL_DOWNLOAD;
extern const wchar_t* IDS_CANT_CHANGE_THIS_SETTING;
extern const wchar_t* IDS_CLOSE;
extern const wchar_t* IDS_COLOR;
extern const wchar_t* IDS_CONNECTION_SETTINGS;
extern const wchar_t* IDS_CONTINUE_DOWNLOAD;
extern const wchar_t* IDS_COPIED_TO_CLIPBOARD;
extern const wchar_t* IDS_COPY_LINK;
extern const wchar_t* IDS_COUNTRY_STATUS_ADDED_TO_QUEUE;
extern const wchar_t* IDS_COUNTRY_STATUS_DOWNLOAD;
extern const wchar_t* IDS_COUNTRY_STATUS_DOWNLOADING;
extern const wchar_t* IDS_COUNTRY_STATUS_DOWNLOAD_FAILED;
extern const wchar_t* IDS_DELETE;
extern const wchar_t* IDS_DELETE_OLD_MAPS;
extern const wchar_t* IDS_DESCRIPTION;
extern const wchar_t* IDS_DEVICE_DOESNOT_SUPPORT_LOCATION_SERVICES;
extern const wchar_t* IDS_DISCONNECT_USB_CABLE;
extern const wchar_t* IDS_DONE;
extern const wchar_t* IDS_DOWNLOAD;
extern const wchar_t* IDS_DOWNLOADED_TOUCH_TO_DELETE;
extern const wchar_t* IDS_DOWNLOADED_TOUCH_TO_UPDATE;
extern const wchar_t* IDS_DOWNLOADED_X_Y_TOUCH_TO_DELETE;
extern const wchar_t* IDS_DOWNLOADING;
extern const wchar_t* IDS_DOWNLOADING_COUNTRY_CAN_PROCEED;
extern const wchar_t* IDS_DOWNLOADING_IS_ACTIVE;
extern const wchar_t* IDS_DOWNLOADING_TOUCH_TO_CANCEL;
extern const wchar_t* IDS_DOWNLOADING_X_TOUCH_TO_CANCEL;
extern const wchar_t* IDS_DOWNLOAD_COUNTRY_ASK;
extern const wchar_t* IDS_DOWNLOAD_COUNTRY_FAILED;
extern const wchar_t* IDS_DOWNLOAD_COUNTRY_SUCCESS;
extern const wchar_t* IDS_DOWNLOAD_HAS_FAILED;
extern const wchar_t* IDS_DOWNLOAD_LOCATION_COUNTRY;
extern const wchar_t* IDS_DOWNLOAD_LOCATION_MAP_PROPOSAL;
extern const wchar_t* IDS_DOWNLOAD_LOCATION_MAP_UP_TO_DATE;
extern const wchar_t* IDS_DOWNLOAD_LOCATION_UPDATE_MAP_PROPOSAL;
extern const wchar_t* IDS_DOWNLOAD_MAPS;
extern const wchar_t* IDS_DOWNLOAD_MB_OR_KB;
extern const wchar_t* IDS_DOWNLOAD_RESOURCES;
extern const wchar_t* IDS_DOWNLOAD_RESOURCES_CONTINUE;
extern const wchar_t* IDS_DOWNLOAD_VIEWPORT_COUNTRY_TO_SEARCH;
extern const wchar_t* IDS_DOWNLOAD_X_KB;
extern const wchar_t* IDS_DOWNLOAD_X_MB;
extern const wchar_t* IDS_DO_NOTHING;
extern const wchar_t* IDS_DO_NOT_ASK_ME_AGAIN;
extern const wchar_t* IDS_DROPPED_PIN;
extern const wchar_t* IDS_EDIT;
extern const wchar_t* IDS_EMAIL;
extern const wchar_t* IDS_ENABLE_LOCATION_SERVICES;
extern const wchar_t* IDS_ENTERTAINMENT;
extern const wchar_t* IDS_ENTER_PROMOCODE_HINT;
extern const wchar_t* IDS_EXTERNAL_STORAGE_IS_NOT_AVAILABLE;
extern const wchar_t* IDS_FOOD;
extern const wchar_t* IDS_FREE_DISK_SPACE_FOR_COUNTRY_X;
extern const wchar_t* IDS_FREE_SPACE_FOR_COUNTRY;
extern const wchar_t* IDS_FUEL;
extern const wchar_t* IDS_GETTING_POSITION;
extern const wchar_t* IDS_GET_IT_NOW;
extern const wchar_t* IDS_GPS_IS_DISABLED_LONG_TEXT;
extern const wchar_t* IDS_HOSPITAL;
extern const wchar_t* IDS_HOTEL;
extern const wchar_t* IDS_INFO;
extern const wchar_t* IDS_KB;
extern const wchar_t* IDS_KILOMETRES;
extern const wchar_t* IDS_KITKAT_MIGRATE_FAILED;
extern const wchar_t* IDS_KITKAT_MIGRATE_OK;
extern const wchar_t* IDS_KITKAT_OPTIMIZATION_IN_PROGRESS;
extern const wchar_t* IDS_LATER;
extern const wchar_t* IDS_LEAVE_A_REVIEW;
extern const wchar_t* IDS_LEAVE_REVIEW_TEXT;
extern const wchar_t* IDS_LENGTH;
extern const wchar_t* IDS_LOAD_KMZ_FAILED;
extern const wchar_t* IDS_LOAD_KMZ_SUCCESSFUL;
extern const wchar_t* IDS_LOAD_KMZ_TITLE;
extern const wchar_t* IDS_LOCATION_IS_DISABLED_LONG_TEXT;
extern const wchar_t* IDS_LOCATION_SERVICES_ARE_NEEDED_DESC;
extern const wchar_t* IDS_MAPS;
extern const wchar_t* IDS_MAPS_STORAGE;
extern const wchar_t* IDS_MAPS_STORAGE_SUMMARY;
extern const wchar_t* IDS_MARKED_FOR_DOWNLOADING;
extern const wchar_t* IDS_MB;
extern const wchar_t* IDS_MEASUREMENT_UNITS;
extern const wchar_t* IDS_MEASUREMENT_UNITS_SUMMARY;
extern const wchar_t* IDS_MENU_SEARCH;
extern const wchar_t* IDS_MESSAGE;
extern const wchar_t* IDS_MILES;
extern const wchar_t* IDS_MORE_APPS_ADS;
extern const wchar_t* IDS_MORE_APPS_GUIDES;
extern const wchar_t* IDS_MORE_APPS_TITLE;
extern const wchar_t* IDS_MORE_INFO;
extern const wchar_t* IDS_MOVE_MAPS;
extern const wchar_t* IDS_MY_PLACES;
extern const wchar_t* IDS_MY_POSITION;
extern const wchar_t* IDS_MY_POSITION_SHARE_EMAIL;
extern const wchar_t* IDS_MY_POSITION_SHARE_EMAIL_SUBJECT;
extern const wchar_t* IDS_MY_POSITION_SHARE_SMS;
extern const wchar_t* IDS_NAME;
extern const wchar_t* IDS_NEVER;
extern const wchar_t* IDS_NEW_MAP_DATA_FORMAT_UPGRADE_DIALOG;
extern const wchar_t* IDS_NOT_ENOUGH_DISK_SPACE;
extern const wchar_t* IDS_NOT_ENOUGH_FREE_SPACE_ON_SDCARD;
extern const wchar_t* IDS_NOT_ENOUGH_MEMORY;
extern const wchar_t* IDS_NO_INTERNET_CONNECTION_DETECTED;
extern const wchar_t* IDS_NO_SEARCH_RESULTS_FOUND;
extern const wchar_t* IDS_NO_THANKS;
extern const wchar_t* IDS_NO_WIFI_ASK_CELLULAR_DOWNLOAD;
extern const wchar_t* IDS_OK;
extern const wchar_t* IDS_PARKING;
extern const wchar_t* IDS_PAUSE;
extern const wchar_t* IDS_PHARMACY;
extern const wchar_t* IDS_PLACEPAGE_COORDINATES;
extern const wchar_t* IDS_PLACEPAGE_DISTANCE;
extern const wchar_t* IDS_PLACEPAGE_UNSORTED;
extern const wchar_t* IDS_POLICE;
extern const wchar_t* IDS_POST;
extern const wchar_t* IDS_PREF_ZOOM_SUMMARY;
extern const wchar_t* IDS_PREF_ZOOM_TITLE;
extern const wchar_t* IDS_PROMOCODE_ACTIVATION;
extern const wchar_t* IDS_PROMOCODE_ERROR;
extern const wchar_t* IDS_PROMOCODE_FAILURE;
extern const wchar_t* IDS_PROMOCODE_SUCCESS;
extern const wchar_t* IDS_PRO_VERSION_AVAILABLE;
extern const wchar_t* IDS_REMIND_ME_LATER;
extern const wchar_t* IDS_REMOVE_PIN;
extern const wchar_t* IDS_REPORT_AN_ISSUE;
extern const wchar_t* IDS_SEARCH;
extern const wchar_t* IDS_SEARCH_AVAILABLE_IN_PRO_VERSION;
extern const wchar_t* IDS_SEARCH_MAP;
extern const wchar_t* IDS_SEARCH_MODE_ALL;
extern const wchar_t* IDS_SEARCH_MODE_NEARME;
extern const wchar_t* IDS_SEARCH_MODE_VIEWPORT;
extern const wchar_t* IDS_SEARCH_SHOW_ON_MAP;
extern const wchar_t* IDS_SEARCH_UPDATE_MAPS;
extern const wchar_t* IDS_SELECT_STORAGE;
extern const wchar_t* IDS_SET;
extern const wchar_t* IDS_SETTINGS;
extern const wchar_t* IDS_SHARE;
extern const wchar_t* IDS_SHARED_USER_LABEL;
extern const wchar_t* IDS_SHARE_BOOKMARKS_EMAIL_BODY;
extern const wchar_t* IDS_SHARE_BOOKMARKS_EMAIL_SUBJECT;
extern const wchar_t* IDS_SHARE_BY_EMAIL;
extern const wchar_t* IDS_SHARE_BY_MESSAGE;
extern const wchar_t* IDS_SHARE_MY_LOCATION;
extern const wchar_t* IDS_SHARE_ON_FACEBOOK_TEXT;
extern const wchar_t* IDS_SHOP;
extern const wchar_t* IDS_SHOW_ON_BACKSCREEN;
extern const wchar_t* IDS_STRING1;
extern const wchar_t* IDS_SUGGEST_UNINSTALL_LITE;
extern const wchar_t* IDS_TOILET;
extern const wchar_t* IDS_TOUCH_TO_DOWNLOAD;
extern const wchar_t* IDS_TOURISM;
extern const wchar_t* IDS_TRACKS;
extern const wchar_t* IDS_TRANSPORT;
extern const wchar_t* IDS_TRY_AGAIN;
extern const wchar_t* IDS_UNKNOWN_CURRENT_POSITION;
extern const wchar_t* IDS_UNSUPPORTED_PHONE;
extern const wchar_t* IDS_UPDATE_COUNTRY_ASK;
extern const wchar_t* IDS_UPDATE_MB_OR_KB;
extern const wchar_t* IDS_USE_CELLULAR_DATA;
extern const wchar_t* IDS_USE_WIFI_RECOMMENDATION_TEXT;
extern const wchar_t* IDS_VERSION;
extern const wchar_t* IDS_VISIBLE;
extern const wchar_t* IDS_WAIT_SEVERAL_MINUTES;
extern const wchar_t* IDS_WHICH_MEASUREMENT_SYSTEM;
extern const wchar_t* IDS_YOPME_PREF_SUMMARY;
extern const wchar_t* IDS_YOPME_PREF_TITLE;
extern const wchar_t* IDS_ZOOM_TO_COUNTRY;
extern const wchar_t* string_sample_ID;
#endif // _APP_RESOURCE_ID_H_

View file

@ -0,0 +1,19 @@
#pragma once
#include <FUi.h>
// Use 'extern' to eliminate duplicate data allocation.
extern const wchar_t* FORM_MAP;
extern const wchar_t* FORM_SETTINGS;
extern const wchar_t* FORM_DOWNLOAD;
extern const wchar_t* FORM_ABOUT;
class FormFactory
: public Tizen::Ui::Scenes::IFormFactory
{
public:
FormFactory(void);
virtual ~FormFactory(void);
virtual Tizen::Ui::Controls::Form * CreateFormN(Tizen::Base::String const & formId, Tizen::Ui::Scenes::SceneId const & sceneId);
};

View file

@ -54,7 +54,5 @@ private:
// Called when the screen switches off.
virtual void OnScreenOff(void);
private:
tizen::Framework * m_pFramework;
};

View file

@ -5,16 +5,20 @@
#include <FLocations.h>
#include "../../../std/vector.hpp"
class MapsWithMeApp;
namespace tizen
{
class Framework;
}
class MapsWithMeForm
: public Tizen::Ui::Controls::Form
, public Tizen::Ui::ITouchEventListener
, public Tizen::Ui::IActionEventListener
, public Tizen::Locations::ILocationProviderListener
, public Tizen::Ui::Controls::IFormBackEventListener
{
public:
MapsWithMeForm(MapsWithMeApp* pApp);
MapsWithMeForm();
virtual ~MapsWithMeForm(void);
virtual result OnDraw(void);
@ -45,14 +49,28 @@ public:
virtual void OnLocationUpdated(Tizen::Locations::Location const & location);
virtual void OnLocationUpdateStatusChanged(Tizen::Locations::LocationServiceStatus status);
virtual void OnAccuracyChanged(Tizen::Locations::LocationAccuracy accuracy);
// IFormBackEventListener
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
void UpdateButtons();
private:
bool m_locationEnabled;
std::vector<std::pair<double, double> > m_prev_pts;
static const int ID_BUTTON = 101;
static const int ID_BUTTON_GPS = 101;
static const int ID_BUTTON_SETTINGS = 102;
static const int ID_BUTTON_SCALE_PLUS = 103;
static const int ID_BUTTON_SCALE_MINUS = 104;
Tizen::Locations::LocationProvider * m_pLocProvider;
Tizen::Ui::Controls::Label * m_pLabel;
Tizen::Ui::Controls::Button * m_pButton;
MapsWithMeApp* m_pApp;
Tizen::Ui::Controls::Button * m_pButtonGPS;
Tizen::Ui::Controls::Button * m_pButtonSettings;
Tizen::Ui::Controls::Button * m_pButtonScalePlus;
Tizen::Ui::Controls::Button * m_pButtonScaleMinus;
tizen::Framework * m_pFramework;
};

View file

@ -0,0 +1,17 @@
#pragma once
// Use 'extern' to eliminate duplicate data allocation.
extern const wchar_t* SCENE_MAP;
extern const wchar_t* SCENE_SETTINGS;
extern const wchar_t* SCENE_DOWNLOAD;
extern const wchar_t* SCENE_ABOUT;
class SceneRegister
{
public:
static void RegisterAllScenes(void);
private:
SceneRegister(void);
~SceneRegister(void);
};

View file

@ -0,0 +1,29 @@
#pragma once
#include <FUi.h>
class MapsWithMeForm;
class SettingsForm: public Tizen::Ui::Controls::Form
, public Tizen::Ui::IActionEventListener
, public Tizen::Ui::Controls::IFormBackEventListener
{
public:
SettingsForm(MapsWithMeForm * pMainForm);
virtual ~SettingsForm(void);
bool Initialize(void);
virtual result OnInitializing(void);
virtual void OnActionPerformed(Tizen::Ui::Control const & source, int actionId);
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form & source);
private:
static const int ID_BUTTON_STORAGE = 101;
static const int ID_BUTTON_BACK = 102;
static const int ID_SCALE_CHECKED = 201;
static const int ID_SCALE_UNCHECKED = 202;
static const int ID_METER_CHECKED = 301;
static const int ID_FOOT_CHECKED = 302;
static const int ID_ABOUT_CHECKED = 401;
MapsWithMeForm * m_pMainForm;
};

View file

@ -9,17 +9,18 @@
<Apps>
<ApiVersion>2.2</ApiVersion>
<Privileges>
<Privilege>http://tizen.org/privilege/http</Privilege>
<Privilege>http://tizen.org/privilege/location</Privilege>
<Privilege>http://tizen.org/privilege/web.service</Privilege>
<Privilege>http://tizen.org/privilege/http</Privilege>
</Privileges>
<UiApp LaunchingHistoryVisible="True" Main="True" MenuIconVisible="True" Name="MapsWithMe">
<UiApp HwAcceleration="On" LaunchingHistoryVisible="True" Main="True" MenuIconVisible="True" Name="MapsWithMe">
<UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720"/>
<UiTheme SystemTheme="White"/>
<DisplayNames>
<DisplayName Locale="eng-GB">MapsWithMe</DisplayName>
</DisplayNames>
<Icons>
<Icon Section="MainMenu">mainmenu.png</Icon>
<Icon Section="MainMenu">ic_launcher.png</Icon>
</Icons>
<LaunchConditions/>
</UiApp>

View file

@ -0,0 +1,29 @@
<?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.201311071819" Dversion="20120315">
<LogicalCoordinate>720</LogicalCoordinate>
<Form id="IDF_ABOUT_FORM">
<property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" 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_PORTRAIT_INDICATOR" type="LAYOUT_RELATIVE"/>
<layout mode="Landscape" style="FORM_STYLE_PORTRAIT_INDICATOR" type="LAYOUT_RELATIVE"/>
</Form>
<Label id="IDC_VERSION_LABEL" parent="IDF_ABOUT_FORM">
<property accessibilityHint="" backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" leftMargin="16" text="::IDS_VERSION" textColor="" textSize="32.0" textStyle="LABEL_TEXT_STYLE_NORMAL" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="IDF_ABOUT_FORM" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="20.0" marginRight="20.0" marginTop="20.0" mode="Portrait" rightRelation="IDF_ABOUT_FORM" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDF_ABOUT_FORM" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="0" y="20.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="472.0"/>
</Label>
<Button id="IDC_CLOSE_BUTTON" parent="IDF_ABOUT_FORM">
<property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="::IDS_CANCEL" textSize="32.0" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="IDF_ABOUT_FORM" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDF_ABOUT_FORM" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="20.0" marginLeft="200.0" marginRight="200.0" marginTop="0.0" mode="Portrait" rightRelation="IDF_ABOUT_FORM" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="320.0" x="200.0" y="1080.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="137.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="267.0" x="251.0" y="583.0"/>
</Button>
<Web id="IDC_WEB" parent="IDF_ABOUT_FORM">
<property autoFittingEnabled="true" autoFormDataShowEnabled="true" autoImageLoadEnabled="true" autoLoginFormFillEnabled="false" cacheControl="WEB_CACHE_VALIDATED" certificateErrorHandlingMode="WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM" cookieEnabled="false" defaultTextEncoding="" fontSize="20" geoLocationEnabled="false" inputStyle="" javaScriptEnabled="false" javaScriptPopupEnabled="false" privateBrowsing="false" scrollEnabled="true" userAgent=""/>
<layout bottomRelation="" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="920.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="20.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="140.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="123.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="300.0" x="195.0" y="441.0"/>
</Web>
</Scene>

View file

@ -0,0 +1,44 @@
<?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.201311071819" Dversion="20120315">
<LogicalCoordinate>720</LogicalCoordinate>
<Form id="IDF_SETTINGS_FORM">
<property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" 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_PORTRAIT_INDICATOR" type="LAYOUT_RELATIVE"/>
<layout mode="Landscape" style="FORM_STYLE_PORTRAIT_INDICATOR" type="LAYOUT_RELATIVE"/>
</Form>
<Label id="IDC_MEASUREMENT_UNITS_LABEL" parent="IDF_SETTINGS_FORM">
<property accessibilityHint="" backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" leftMargin="16" text="::IDS_MEASUREMENT_UNITS" textColor="" textSize="50.0" textStyle="LABEL_TEXT_STYLE_NORMAL" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="60.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="20.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDF_SETTINGS_FORM" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="20.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="266.0"/>
</Label>
<Label id="IDC_MEASUREMENT_NOTE" parent="IDF_SETTINGS_FORM">
<property accessibilityHint="" backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" leftMargin="16" text="::IDS_MEASUREMENT_UNITS_SUMMARY" textColor="#0080FF" textSize="32.0" textStyle="LABEL_TEXT_STYLE_NORMAL" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="60.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDC_MEASUREMENT_UNITS_LABEL" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="80.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="608.0"/>
</Label>
<CheckButton id="IDC_METERS_CHECKBUTTON" parent="IDF_SETTINGS_FORM">
<property accessibilityHint1="" accessibilityHint2="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" colorOfText="" colorOfTitleText="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" disabledTitleTextColor="" groupId="0" groupStyle="GROUP_STYLE_TOP" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" highlightedTitleTextColor="" horizontalAlign="ALIGN_LEFT" normalColor="" normalColorOpacity="100" pressedColor="" pressedColorOpacity="100" pressedTextColor="" pressedTitleTextColor="" showTitleText="false" text="::IDS_KILOMETRES" titleText="" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="CHECK_BUTTON_STYLE_RADIO" topRelation="IDC_MEASUREMENT_NOTE" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="140.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" style="CHECK_BUTTON_STYLE_RADIO" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="688.0" x="32.0" y="395.0"/>
</CheckButton>
<CheckButton id="IDC_FOOTS_CHECKBUTTON" parent="IDF_SETTINGS_FORM">
<property accessibilityHint1="" accessibilityHint2="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" colorOfText="" colorOfTitleText="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" disabledTitleTextColor="" groupId="0" groupStyle="GROUP_STYLE_BOTTOM" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" highlightedTitleTextColor="" horizontalAlign="ALIGN_LEFT" normalColor="" normalColorOpacity="100" pressedColor="" pressedColorOpacity="100" pressedTextColor="" pressedTitleTextColor="" showTitleText="false" text="::IDS_MILES" titleText="" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="CHECK_BUTTON_STYLE_RADIO" topRelation="IDC_METERS_CHECKBUTTON" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="260.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" style="CHECK_BUTTON_STYLE_RADIO" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="688.0" x="32.0" y="533.0"/>
</CheckButton>
<CheckButton id="IDC_ENABLE_SCALE_BUTTONS_CB" parent="IDF_SETTINGS_FORM">
<property accessibilityHint1="" accessibilityHint2="" backgroundStyle="BACKGROUND_STYLE_DEFAULT" colorOfText="" colorOfTitleText="#0080FF" disabledColor="" disabledColorOpacity="100" disabledTextColor="" disabledTitleTextColor="" groupId="1" groupStyle="GROUP_STYLE_NONE" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" highlightedTitleTextColor="" horizontalAlign="ALIGN_LEFT" normalColor="" normalColorOpacity="100" pressedColor="" pressedColorOpacity="100" pressedTextColor="" pressedTitleTextColor="#0080FF" showTitleText="true" text="::IDS_PREF_ZOOM_TITLE" titleText="::IDS_PREF_ZOOM_SUMMARY" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="20.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="CHECK_BUTTON_STYLE_ONOFF_SLIDING" topRelation="IDC_FOOTS_CHECKBUTTON" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="400.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" style="CHECK_BUTTON_STYLE_ONOFF_SLIDING" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="688.0" x="32.0" y="608.0"/>
</CheckButton>
<Button id="IDC_ABOUT_BUTTON" parent="IDF_SETTINGS_FORM">
<property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="::IDS_ABOUT" textSize="32.0" verticalAlign="ALIGN_MIDDLE"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDC_SELECT_STORAGE_BUTTON" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="20.0" mode="Portrait" rightRelation="IDC_SELECT_STORAGE_BUTTON" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDC_ENABLE_SCALE_BUTTONS_CB" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="680.0" x="20.0" y="540.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="74.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="136.0" x="243.0" y="646.0"/>
</Button>
</Scene>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -0,0 +1,79 @@
#include "AboutForm.hpp"
#include "SceneRegister.hpp"
#include "MapsWithMeForm.hpp"
#include "AppResourceId.h"
#include "../../../base/logging.hpp"
#include "../../../platform/settings.hpp"
#include "../../../platform/tizen_string_utils.hpp"
#include <FWeb.h>
#include <FAppApp.h>
#include <FApp.h>
using namespace Tizen::Base;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::App;
using namespace Tizen::Web::Controls;
AboutForm::AboutForm()
{
}
AboutForm::~AboutForm(void)
{
}
bool AboutForm::Initialize(void)
{
Construct(IDF_ABOUT_FORM);
return true;
}
result AboutForm::OnInitializing(void)
{
Label * pCurrentVersionLabel = static_cast<Label*>(GetControl(IDC_VERSION_LABEL, true));
// version
AppResource* pApp = App::GetInstance()->GetAppResource();
String strVersionFormatter;
pApp->GetString(IDS_VERSION, strVersionFormatter);
String const strVersion = App::GetInstance()->GetAppVersion();
char buff[100];
sprintf(buff, FromTizenString(strVersionFormatter).c_str(), FromTizenString(strVersion).c_str());
pCurrentVersionLabel->SetText(buff);
// web page
Web * pWeb = static_cast<Web *>(GetControl(IDC_WEB, true));
Tizen::Base::String url = "file://";
url += (Tizen::App::App::GetInstance()->GetAppDataPath());
url += "about.html";
pWeb->LoadUrl(url);
Button * pButtonBack = static_cast<Button *>(GetControl(IDC_CLOSE_BUTTON, true));
pButtonBack->SetActionId(ID_CLOSE);
pButtonBack->AddActionEventListener(*this);
SetFormBackEventListener(this);
return E_SUCCESS;
}
void AboutForm::OnActionPerformed(const Tizen::Ui::Control & source, int actionId)
{
switch(actionId)
{
case ID_CLOSE:
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
break;
}
}
Invalidate(true);
}
void AboutForm::OnFormBackRequested(Tizen::Ui::Controls::Form & source)
{
SceneManager * pSceneManager = SceneManager::GetInstance();
pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
}

View file

@ -0,0 +1,207 @@
#include "AppResourceId.h"
const wchar_t* IDC_ABOUT_BUTTON = L"IDC_ABOUT_BUTTON";
const wchar_t* IDC_CLOSE_BUTTON = L"IDC_CLOSE_BUTTON";
const wchar_t* IDC_ENABLE_SCALE_BUTTONS_CB = L"IDC_ENABLE_SCALE_BUTTONS_CB";
const wchar_t* IDC_FOOTS_CHECKBUTTON = L"IDC_FOOTS_CHECKBUTTON";
const wchar_t* IDC_MEASUREMENT_NOTE = L"IDC_MEASUREMENT_NOTE";
const wchar_t* IDC_MEASUREMENT_UNITS_LABEL = L"IDC_MEASUREMENT_UNITS_LABEL";
const wchar_t* IDC_METERS_CHECKBUTTON = L"IDC_METERS_CHECKBUTTON";
const wchar_t* IDC_SELECT_STORAGE_BUTTON = L"IDC_SELECT_STORAGE_BUTTON";
const wchar_t* IDC_VERSION_LABEL = L"IDC_VERSION_LABEL";
const wchar_t* IDC_WEB = L"IDC_WEB";
const wchar_t* IDF_ABOUT_FORM = L"IDF_ABOUT_FORM";
const wchar_t* IDS_ABOUT = L"IDS_ABOUT";
const wchar_t* IDS_ABOUT_MENU_TITLE = L"IDS_ABOUT_MENU_TITLE";
const wchar_t* IDS_ADDRESS = L"IDS_ADDRESS";
const wchar_t* IDS_ADD_NEW_SET = L"IDS_ADD_NEW_SET";
const wchar_t* IDS_ADD_TO_BOOKMARKS = L"IDS_ADD_TO_BOOKMARKS";
const wchar_t* IDS_ADVISE_UPDATE_MAPS = L"IDS_ADVISE_UPDATE_MAPS";
const wchar_t* IDS_ALLOW_STATISTICS = L"IDS_ALLOW_STATISTICS";
const wchar_t* IDS_ALLOW_STATISTICS_HINT = L"IDS_ALLOW_STATISTICS_HINT";
const wchar_t* IDS_APPSTORE_MESSAGE = L"IDS_APPSTORE_MESSAGE";
const wchar_t* IDS_APP_NAME = L"IDS_APP_NAME";
const wchar_t* IDS_ARE_YOU_SURE = L"IDS_ARE_YOU_SURE";
const wchar_t* IDS_ATM = L"IDS_ATM";
const wchar_t* IDS_BACK = L"IDS_BACK";
const wchar_t* IDS_BANK = L"IDS_BANK";
const wchar_t* IDS_BECOME_A_PRO = L"IDS_BECOME_A_PRO";
const wchar_t* IDS_BOOKMARKS = L"IDS_BOOKMARKS";
const wchar_t* IDS_BOOKMARKS_IN_PRO_VERSION = L"IDS_BOOKMARKS_IN_PRO_VERSION";
const wchar_t* IDS_BOOKMARKS_USAGE_HINT = L"IDS_BOOKMARKS_USAGE_HINT";
const wchar_t* IDS_BOOKMARKS_USAGE_HINT_IMPORT_ONLY = L"IDS_BOOKMARKS_USAGE_HINT_IMPORT_ONLY";
const wchar_t* IDS_BOOKMARK_COLOR = L"IDS_BOOKMARK_COLOR";
const wchar_t* IDS_BOOKMARK_MOVE_FAIL = L"IDS_BOOKMARK_MOVE_FAIL";
const wchar_t* IDS_BOOKMARK_SETS = L"IDS_BOOKMARK_SETS";
const wchar_t* IDS_BOOKMARK_SET_NAME = L"IDS_BOOKMARK_SET_NAME";
const wchar_t* IDS_BOOKMARK_SHARE_EMAIL = L"IDS_BOOKMARK_SHARE_EMAIL";
const wchar_t* IDS_BOOKMARK_SHARE_EMAIL_SUBJECT = L"IDS_BOOKMARK_SHARE_EMAIL_SUBJECT";
const wchar_t* IDS_BOOKMARK_SHARE_SMS = L"IDS_BOOKMARK_SHARE_SMS";
const wchar_t* IDS_CANCEL = L"IDS_CANCEL";
const wchar_t* IDS_CANCEL_DOWNLOAD = L"IDS_CANCEL_DOWNLOAD";
const wchar_t* IDS_CANT_CHANGE_THIS_SETTING = L"IDS_CANT_CHANGE_THIS_SETTING";
const wchar_t* IDS_CLOSE = L"IDS_CLOSE";
const wchar_t* IDS_COLOR = L"IDS_COLOR";
const wchar_t* IDS_CONNECTION_SETTINGS = L"IDS_CONNECTION_SETTINGS";
const wchar_t* IDS_CONTINUE_DOWNLOAD = L"IDS_CONTINUE_DOWNLOAD";
const wchar_t* IDS_COPIED_TO_CLIPBOARD = L"IDS_COPIED_TO_CLIPBOARD";
const wchar_t* IDS_COPY_LINK = L"IDS_COPY_LINK";
const wchar_t* IDS_COUNTRY_STATUS_ADDED_TO_QUEUE = L"IDS_COUNTRY_STATUS_ADDED_TO_QUEUE";
const wchar_t* IDS_COUNTRY_STATUS_DOWNLOAD = L"IDS_COUNTRY_STATUS_DOWNLOAD";
const wchar_t* IDS_COUNTRY_STATUS_DOWNLOADING = L"IDS_COUNTRY_STATUS_DOWNLOADING";
const wchar_t* IDS_COUNTRY_STATUS_DOWNLOAD_FAILED = L"IDS_COUNTRY_STATUS_DOWNLOAD_FAILED";
const wchar_t* IDS_DELETE = L"IDS_DELETE";
const wchar_t* IDS_DELETE_OLD_MAPS = L"IDS_DELETE_OLD_MAPS";
const wchar_t* IDS_DESCRIPTION = L"IDS_DESCRIPTION";
const wchar_t* IDS_DEVICE_DOESNOT_SUPPORT_LOCATION_SERVICES = L"IDS_DEVICE_DOESNOT_SUPPORT_LOCATION_SERVICES";
const wchar_t* IDS_DISCONNECT_USB_CABLE = L"IDS_DISCONNECT_USB_CABLE";
const wchar_t* IDS_DONE = L"IDS_DONE";
const wchar_t* IDS_DOWNLOAD = L"IDS_DOWNLOAD";
const wchar_t* IDS_DOWNLOADED_TOUCH_TO_DELETE = L"IDS_DOWNLOADED_TOUCH_TO_DELETE";
const wchar_t* IDS_DOWNLOADED_TOUCH_TO_UPDATE = L"IDS_DOWNLOADED_TOUCH_TO_UPDATE";
const wchar_t* IDS_DOWNLOADED_X_Y_TOUCH_TO_DELETE = L"IDS_DOWNLOADED_X_Y_TOUCH_TO_DELETE";
const wchar_t* IDS_DOWNLOADING = L"IDS_DOWNLOADING";
const wchar_t* IDS_DOWNLOADING_COUNTRY_CAN_PROCEED = L"IDS_DOWNLOADING_COUNTRY_CAN_PROCEED";
const wchar_t* IDS_DOWNLOADING_IS_ACTIVE = L"IDS_DOWNLOADING_IS_ACTIVE";
const wchar_t* IDS_DOWNLOADING_TOUCH_TO_CANCEL = L"IDS_DOWNLOADING_TOUCH_TO_CANCEL";
const wchar_t* IDS_DOWNLOADING_X_TOUCH_TO_CANCEL = L"IDS_DOWNLOADING_X_TOUCH_TO_CANCEL";
const wchar_t* IDS_DOWNLOAD_COUNTRY_ASK = L"IDS_DOWNLOAD_COUNTRY_ASK";
const wchar_t* IDS_DOWNLOAD_COUNTRY_FAILED = L"IDS_DOWNLOAD_COUNTRY_FAILED";
const wchar_t* IDS_DOWNLOAD_COUNTRY_SUCCESS = L"IDS_DOWNLOAD_COUNTRY_SUCCESS";
const wchar_t* IDS_DOWNLOAD_HAS_FAILED = L"IDS_DOWNLOAD_HAS_FAILED";
const wchar_t* IDS_DOWNLOAD_LOCATION_COUNTRY = L"IDS_DOWNLOAD_LOCATION_COUNTRY";
const wchar_t* IDS_DOWNLOAD_LOCATION_MAP_PROPOSAL = L"IDS_DOWNLOAD_LOCATION_MAP_PROPOSAL";
const wchar_t* IDS_DOWNLOAD_LOCATION_MAP_UP_TO_DATE = L"IDS_DOWNLOAD_LOCATION_MAP_UP_TO_DATE";
const wchar_t* IDS_DOWNLOAD_LOCATION_UPDATE_MAP_PROPOSAL = L"IDS_DOWNLOAD_LOCATION_UPDATE_MAP_PROPOSAL";
const wchar_t* IDS_DOWNLOAD_MAPS = L"IDS_DOWNLOAD_MAPS";
const wchar_t* IDS_DOWNLOAD_MB_OR_KB = L"IDS_DOWNLOAD_MB_OR_KB";
const wchar_t* IDS_DOWNLOAD_RESOURCES = L"IDS_DOWNLOAD_RESOURCES";
const wchar_t* IDS_DOWNLOAD_RESOURCES_CONTINUE = L"IDS_DOWNLOAD_RESOURCES_CONTINUE";
const wchar_t* IDS_DOWNLOAD_VIEWPORT_COUNTRY_TO_SEARCH = L"IDS_DOWNLOAD_VIEWPORT_COUNTRY_TO_SEARCH";
const wchar_t* IDS_DOWNLOAD_X_KB = L"IDS_DOWNLOAD_X_KB";
const wchar_t* IDS_DOWNLOAD_X_MB = L"IDS_DOWNLOAD_X_MB";
const wchar_t* IDS_DO_NOTHING = L"IDS_DO_NOTHING";
const wchar_t* IDS_DO_NOT_ASK_ME_AGAIN = L"IDS_DO_NOT_ASK_ME_AGAIN";
const wchar_t* IDS_DROPPED_PIN = L"IDS_DROPPED_PIN";
const wchar_t* IDS_EDIT = L"IDS_EDIT";
const wchar_t* IDS_EMAIL = L"IDS_EMAIL";
const wchar_t* IDS_ENABLE_LOCATION_SERVICES = L"IDS_ENABLE_LOCATION_SERVICES";
const wchar_t* IDS_ENTERTAINMENT = L"IDS_ENTERTAINMENT";
const wchar_t* IDS_ENTER_PROMOCODE_HINT = L"IDS_ENTER_PROMOCODE_HINT";
const wchar_t* IDS_EXTERNAL_STORAGE_IS_NOT_AVAILABLE = L"IDS_EXTERNAL_STORAGE_IS_NOT_AVAILABLE";
const wchar_t* IDS_FOOD = L"IDS_FOOD";
const wchar_t* IDS_FREE_DISK_SPACE_FOR_COUNTRY_X = L"IDS_FREE_DISK_SPACE_FOR_COUNTRY_X";
const wchar_t* IDS_FREE_SPACE_FOR_COUNTRY = L"IDS_FREE_SPACE_FOR_COUNTRY";
const wchar_t* IDS_FUEL = L"IDS_FUEL";
const wchar_t* IDS_GETTING_POSITION = L"IDS_GETTING_POSITION";
const wchar_t* IDS_GET_IT_NOW = L"IDS_GET_IT_NOW";
const wchar_t* IDS_GPS_IS_DISABLED_LONG_TEXT = L"IDS_GPS_IS_DISABLED_LONG_TEXT";
const wchar_t* IDS_HOSPITAL = L"IDS_HOSPITAL";
const wchar_t* IDS_HOTEL = L"IDS_HOTEL";
const wchar_t* IDS_INFO = L"IDS_INFO";
const wchar_t* IDS_KB = L"IDS_KB";
const wchar_t* IDS_KILOMETRES = L"IDS_KILOMETRES";
const wchar_t* IDS_KITKAT_MIGRATE_FAILED = L"IDS_KITKAT_MIGRATE_FAILED";
const wchar_t* IDS_KITKAT_MIGRATE_OK = L"IDS_KITKAT_MIGRATE_OK";
const wchar_t* IDS_KITKAT_OPTIMIZATION_IN_PROGRESS = L"IDS_KITKAT_OPTIMIZATION_IN_PROGRESS";
const wchar_t* IDS_LATER = L"IDS_LATER";
const wchar_t* IDS_LEAVE_A_REVIEW = L"IDS_LEAVE_A_REVIEW";
const wchar_t* IDS_LEAVE_REVIEW_TEXT = L"IDS_LEAVE_REVIEW_TEXT";
const wchar_t* IDS_LENGTH = L"IDS_LENGTH";
const wchar_t* IDS_LOAD_KMZ_FAILED = L"IDS_LOAD_KMZ_FAILED";
const wchar_t* IDS_LOAD_KMZ_SUCCESSFUL = L"IDS_LOAD_KMZ_SUCCESSFUL";
const wchar_t* IDS_LOAD_KMZ_TITLE = L"IDS_LOAD_KMZ_TITLE";
const wchar_t* IDS_LOCATION_IS_DISABLED_LONG_TEXT = L"IDS_LOCATION_IS_DISABLED_LONG_TEXT";
const wchar_t* IDS_LOCATION_SERVICES_ARE_NEEDED_DESC = L"IDS_LOCATION_SERVICES_ARE_NEEDED_DESC";
const wchar_t* IDS_MAPS = L"IDS_MAPS";
const wchar_t* IDS_MAPS_STORAGE = L"IDS_MAPS_STORAGE";
const wchar_t* IDS_MAPS_STORAGE_SUMMARY = L"IDS_MAPS_STORAGE_SUMMARY";
const wchar_t* IDS_MARKED_FOR_DOWNLOADING = L"IDS_MARKED_FOR_DOWNLOADING";
const wchar_t* IDS_MB = L"IDS_MB";
const wchar_t* IDS_MEASUREMENT_UNITS = L"IDS_MEASUREMENT_UNITS";
const wchar_t* IDS_MEASUREMENT_UNITS_SUMMARY = L"IDS_MEASUREMENT_UNITS_SUMMARY";
const wchar_t* IDS_MENU_SEARCH = L"IDS_MENU_SEARCH";
const wchar_t* IDS_MESSAGE = L"IDS_MESSAGE";
const wchar_t* IDS_MILES = L"IDS_MILES";
const wchar_t* IDS_MORE_APPS_ADS = L"IDS_MORE_APPS_ADS";
const wchar_t* IDS_MORE_APPS_GUIDES = L"IDS_MORE_APPS_GUIDES";
const wchar_t* IDS_MORE_APPS_TITLE = L"IDS_MORE_APPS_TITLE";
const wchar_t* IDS_MORE_INFO = L"IDS_MORE_INFO";
const wchar_t* IDS_MOVE_MAPS = L"IDS_MOVE_MAPS";
const wchar_t* IDS_MY_PLACES = L"IDS_MY_PLACES";
const wchar_t* IDS_MY_POSITION = L"IDS_MY_POSITION";
const wchar_t* IDS_MY_POSITION_SHARE_EMAIL = L"IDS_MY_POSITION_SHARE_EMAIL";
const wchar_t* IDS_MY_POSITION_SHARE_EMAIL_SUBJECT = L"IDS_MY_POSITION_SHARE_EMAIL_SUBJECT";
const wchar_t* IDS_MY_POSITION_SHARE_SMS = L"IDS_MY_POSITION_SHARE_SMS";
const wchar_t* IDS_NAME = L"IDS_NAME";
const wchar_t* IDS_NEVER = L"IDS_NEVER";
const wchar_t* IDS_NEW_MAP_DATA_FORMAT_UPGRADE_DIALOG = L"IDS_NEW_MAP_DATA_FORMAT_UPGRADE_DIALOG";
const wchar_t* IDS_NOT_ENOUGH_DISK_SPACE = L"IDS_NOT_ENOUGH_DISK_SPACE";
const wchar_t* IDS_NOT_ENOUGH_FREE_SPACE_ON_SDCARD = L"IDS_NOT_ENOUGH_FREE_SPACE_ON_SDCARD";
const wchar_t* IDS_NOT_ENOUGH_MEMORY = L"IDS_NOT_ENOUGH_MEMORY";
const wchar_t* IDS_NO_INTERNET_CONNECTION_DETECTED = L"IDS_NO_INTERNET_CONNECTION_DETECTED";
const wchar_t* IDS_NO_SEARCH_RESULTS_FOUND = L"IDS_NO_SEARCH_RESULTS_FOUND";
const wchar_t* IDS_NO_THANKS = L"IDS_NO_THANKS";
const wchar_t* IDS_NO_WIFI_ASK_CELLULAR_DOWNLOAD = L"IDS_NO_WIFI_ASK_CELLULAR_DOWNLOAD";
const wchar_t* IDS_OK = L"IDS_OK";
const wchar_t* IDS_PARKING = L"IDS_PARKING";
const wchar_t* IDS_PAUSE = L"IDS_PAUSE";
const wchar_t* IDS_PHARMACY = L"IDS_PHARMACY";
const wchar_t* IDS_PLACEPAGE_COORDINATES = L"IDS_PLACEPAGE_COORDINATES";
const wchar_t* IDS_PLACEPAGE_DISTANCE = L"IDS_PLACEPAGE_DISTANCE";
const wchar_t* IDS_PLACEPAGE_UNSORTED = L"IDS_PLACEPAGE_UNSORTED";
const wchar_t* IDS_POLICE = L"IDS_POLICE";
const wchar_t* IDS_POST = L"IDS_POST";
const wchar_t* IDS_PREF_ZOOM_SUMMARY = L"IDS_PREF_ZOOM_SUMMARY";
const wchar_t* IDS_PREF_ZOOM_TITLE = L"IDS_PREF_ZOOM_TITLE";
const wchar_t* IDS_PROMOCODE_ACTIVATION = L"IDS_PROMOCODE_ACTIVATION";
const wchar_t* IDS_PROMOCODE_ERROR = L"IDS_PROMOCODE_ERROR";
const wchar_t* IDS_PROMOCODE_FAILURE = L"IDS_PROMOCODE_FAILURE";
const wchar_t* IDS_PROMOCODE_SUCCESS = L"IDS_PROMOCODE_SUCCESS";
const wchar_t* IDS_PRO_VERSION_AVAILABLE = L"IDS_PRO_VERSION_AVAILABLE";
const wchar_t* IDS_REMIND_ME_LATER = L"IDS_REMIND_ME_LATER";
const wchar_t* IDS_REMOVE_PIN = L"IDS_REMOVE_PIN";
const wchar_t* IDS_REPORT_AN_ISSUE = L"IDS_REPORT_AN_ISSUE";
const wchar_t* IDS_SEARCH = L"IDS_SEARCH";
const wchar_t* IDS_SEARCH_AVAILABLE_IN_PRO_VERSION = L"IDS_SEARCH_AVAILABLE_IN_PRO_VERSION";
const wchar_t* IDS_SEARCH_MAP = L"IDS_SEARCH_MAP";
const wchar_t* IDS_SEARCH_MODE_ALL = L"IDS_SEARCH_MODE_ALL";
const wchar_t* IDS_SEARCH_MODE_NEARME = L"IDS_SEARCH_MODE_NEARME";
const wchar_t* IDS_SEARCH_MODE_VIEWPORT = L"IDS_SEARCH_MODE_VIEWPORT";
const wchar_t* IDS_SEARCH_SHOW_ON_MAP = L"IDS_SEARCH_SHOW_ON_MAP";
const wchar_t* IDS_SEARCH_UPDATE_MAPS = L"IDS_SEARCH_UPDATE_MAPS";
const wchar_t* IDS_SELECT_STORAGE = L"IDS_SELECT_STORAGE";
const wchar_t* IDS_SET = L"IDS_SET";
const wchar_t* IDS_SETTINGS = L"IDS_SETTINGS";
const wchar_t* IDS_SHARE = L"IDS_SHARE";
const wchar_t* IDS_SHARED_USER_LABEL = L"IDS_SHARED_USER_LABEL";
const wchar_t* IDS_SHARE_BOOKMARKS_EMAIL_BODY = L"IDS_SHARE_BOOKMARKS_EMAIL_BODY";
const wchar_t* IDS_SHARE_BOOKMARKS_EMAIL_SUBJECT = L"IDS_SHARE_BOOKMARKS_EMAIL_SUBJECT";
const wchar_t* IDS_SHARE_BY_EMAIL = L"IDS_SHARE_BY_EMAIL";
const wchar_t* IDS_SHARE_BY_MESSAGE = L"IDS_SHARE_BY_MESSAGE";
const wchar_t* IDS_SHARE_MY_LOCATION = L"IDS_SHARE_MY_LOCATION";
const wchar_t* IDS_SHARE_ON_FACEBOOK_TEXT = L"IDS_SHARE_ON_FACEBOOK_TEXT";
const wchar_t* IDS_SHOP = L"IDS_SHOP";
const wchar_t* IDS_SHOW_ON_BACKSCREEN = L"IDS_SHOW_ON_BACKSCREEN";
const wchar_t* IDS_STRING1 = L"IDS_STRING1";
const wchar_t* IDS_SUGGEST_UNINSTALL_LITE = L"IDS_SUGGEST_UNINSTALL_LITE";
const wchar_t* IDS_TOILET = L"IDS_TOILET";
const wchar_t* IDS_TOUCH_TO_DOWNLOAD = L"IDS_TOUCH_TO_DOWNLOAD";
const wchar_t* IDS_TOURISM = L"IDS_TOURISM";
const wchar_t* IDS_TRACKS = L"IDS_TRACKS";
const wchar_t* IDS_TRANSPORT = L"IDS_TRANSPORT";
const wchar_t* IDS_TRY_AGAIN = L"IDS_TRY_AGAIN";
const wchar_t* IDS_UNKNOWN_CURRENT_POSITION = L"IDS_UNKNOWN_CURRENT_POSITION";
const wchar_t* IDS_UNSUPPORTED_PHONE = L"IDS_UNSUPPORTED_PHONE";
const wchar_t* IDS_UPDATE_COUNTRY_ASK = L"IDS_UPDATE_COUNTRY_ASK";
const wchar_t* IDS_UPDATE_MB_OR_KB = L"IDS_UPDATE_MB_OR_KB";
const wchar_t* IDS_USE_CELLULAR_DATA = L"IDS_USE_CELLULAR_DATA";
const wchar_t* IDS_USE_WIFI_RECOMMENDATION_TEXT = L"IDS_USE_WIFI_RECOMMENDATION_TEXT";
const wchar_t* IDS_VERSION = L"IDS_VERSION";
const wchar_t* IDS_VISIBLE = L"IDS_VISIBLE";
const wchar_t* IDS_WAIT_SEVERAL_MINUTES = L"IDS_WAIT_SEVERAL_MINUTES";
const wchar_t* IDS_WHICH_MEASUREMENT_SYSTEM = L"IDS_WHICH_MEASUREMENT_SYSTEM";
const wchar_t* IDS_YOPME_PREF_SUMMARY = L"IDS_YOPME_PREF_SUMMARY";
const wchar_t* IDS_YOPME_PREF_TITLE = L"IDS_YOPME_PREF_TITLE";
const wchar_t* IDS_ZOOM_TO_COUNTRY = L"IDS_ZOOM_TO_COUNTRY";
const wchar_t* string_sample_ID = L"string_sample_ID";

View file

@ -0,0 +1,54 @@
#include "FormFactory.hpp"
#include "MapsWithMeForm.hpp"
#include "SettingsForm.hpp"
#include "AboutForm.hpp"
#include "../../../base/logging.hpp"
#include "../../../platform/tizen_string_utils.hpp"
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Base;
// Definitions of extern.
const wchar_t* FORM_MAP = L"FormMap";
const wchar_t* FORM_SETTINGS = L"FormSettings";
const wchar_t* FORM_DOWNLOAD = L"FormDownload";
const wchar_t* FORM_ABOUT = L"FormAbout";
FormFactory::FormFactory(void)
{
}
FormFactory::~FormFactory(void)
{
}
Tizen::Ui::Controls::Form * FormFactory::CreateFormN(String const & formId, SceneId const & sceneId)
{
Tizen::Ui::Controls::Form * pNewForm = null;
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
static MapsWithMeForm * pMWMForm = 0;
if (formId == FORM_MAP)
{
pMWMForm = new (std::nothrow) MapsWithMeForm();
pMWMForm->Initialize();
pMWMForm->AddTouchEventListener(*pMWMForm);
pNewForm = pMWMForm;
}
else if (formId == FORM_SETTINGS)
{
SettingsForm * pForm = new (std::nothrow) SettingsForm(pMWMForm);
pForm->Initialize();
pNewForm = pForm;
}
else if (formId == FORM_ABOUT)
{
AboutForm * pForm = new (std::nothrow) AboutForm();
pForm->Initialize();
pNewForm = pForm;
}
return pNewForm;
}

View file

@ -1,6 +1,7 @@
#include "MapsWithMeApp.h"
#include "MapsWithMeFrame.h"
#include "MapsWithMeForm.hpp"
#include "SettingsForm.hpp"
#include "Framework.hpp"
#include "../../../base/logging.hpp"
#include <FUi.h>
@ -33,20 +34,11 @@ bool MapsWithMeApp::OnAppInitializing(AppRegistry& appRegistry)
pMapsWithMeFrame->SetName(L"MapsWithMe");
AddFrame(*pMapsWithMeFrame);
MapsWithMeForm * pForm = new MapsWithMeForm(this);
TryReturn(pForm != null, false, "The memory is insufficient.");
pForm->Initialize();
pMapsWithMeFrame->AddControl(pForm);
pForm->AddTouchEventListener(*pForm);
m_pFramework = new tizen::Framework(pForm);
return true;
}
result MapsWithMeApp::Draw()
{
m_pFramework->Draw();
return E_SUCCESS;
}

View file

@ -1,9 +1,11 @@
#include "MapsWithMeForm.hpp"
#include "MapsWithMeApp.h"
#include "Framework.hpp"
#include "SceneRegister.hpp"
#include "../../../map/framework.hpp"
#include "../../../gui/controller.hpp"
#include "../../../platform/tizen_string_utils.hpp"
#include "../../../platform/settings.hpp"
#include <FUi.h>
#include <FBase.h>
#include <FMedia.h>
@ -17,12 +19,15 @@ using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
using namespace Tizen::Locations;
using namespace Tizen::App;
using namespace Tizen::Ui::Scenes;
MapsWithMeForm::MapsWithMeForm(MapsWithMeApp* pApp)
MapsWithMeForm::MapsWithMeForm()
:m_pLocProvider(0),
m_pLabel(0),
m_pButton(0),
m_pApp(pApp)
m_pButtonGPS(0),
m_pButtonSettings(0),
m_pFramework(0)
{
SetMultipointTouchEnabled(true);
}
@ -34,54 +39,81 @@ MapsWithMeForm::~MapsWithMeForm(void)
m_pLocProvider->StopLocationUpdates();
delete m_pLocProvider;
}
if (m_pFramework)
{
delete m_pFramework;
}
}
bool MapsWithMeForm::Initialize(void)
{
LOG(LDEBUG, ("MapsWithMeForm::Initialize"));
Construct(Tizen::Ui::Controls::FORM_STYLE_NORMAL);
Construct(Tizen::Ui::Controls::FORM_STYLE_NORMAL | FORM_STYLE_PORTRAIT_INDICATOR);
return true;
}
result MapsWithMeForm::OnInitializing(void)
{
LOG(LDEBUG, ("MapsWithMeForm::OnInitializing"));
int width;
int height;
GetSize(width, height);
width = GetClientAreaBounds().width;
height = GetClientAreaBounds().height;
// Create a Label
m_pLabel = new (std::nothrow) Label();
m_pLabel->Construct(Rectangle(width / 4, 10, width *3/4, 120), L"GPS off");
m_pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
m_pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
AddControl(m_pLabel);
// Create a Button
m_pButton = new (std::nothrow) Button();
m_pButton->Construct(Rectangle(width - 150, height -150, 100, 100));
m_pButton->SetText(L"GPS\noff");
m_pButton->SetActionId(ID_BUTTON);
m_pButton->AddActionEventListener(*this);
AddControl(m_pButton);
// Create a Button GPS
m_pButtonGPS = new (std::nothrow) Button();
m_pButtonGPS->Construct(Rectangle(50, height -150, 100, 100));
m_pButtonGPS->SetText(L"GPS\noff");
m_pButtonGPS->SetActionId(ID_BUTTON_GPS);
m_pButtonGPS->AddActionEventListener(*this);
AddControl(m_pButtonGPS);
// Create a Button GPS
m_pButtonSettings = new (std::nothrow) Button();
m_pButtonSettings->Construct(Rectangle(width - 150, height -150, 100, 100));
m_pButtonSettings->SetText(L"Set\ntings");
m_pButtonSettings->SetActionId(ID_BUTTON_SETTINGS);
m_pButtonSettings->AddActionEventListener(*this);
AddControl(m_pButtonSettings);
m_pButtonScalePlus = new (std::nothrow) Button();
m_pButtonScalePlus->Construct(Rectangle(width - 150, height / 2, 100, 100));
m_pButtonScalePlus->SetText(L"+");
m_pButtonScalePlus->SetActionId(ID_BUTTON_SCALE_PLUS);
m_pButtonScalePlus->AddActionEventListener(*this);
AddControl(m_pButtonScalePlus);
m_pButtonScaleMinus = new (std::nothrow) Button();
m_pButtonScaleMinus->Construct(Rectangle(width - 150,( height / 2) + 120, 100, 100));
m_pButtonScaleMinus->SetText(L"-");
m_pButtonScaleMinus->SetActionId(ID_BUTTON_SCALE_MINUS);
m_pButtonScaleMinus->AddActionEventListener(*this);
AddControl(m_pButtonScaleMinus);
UpdateButtons();
m_locationEnabled = false;
SetFormBackEventListener(this);
m_pFramework = new tizen::Framework(this);
return E_SUCCESS;
}
void MapsWithMeForm::OnActionPerformed(Tizen::Ui::Control const & source, int actionId)
{
::Framework * pFramework = tizen::Framework::GetInstance();
switch(actionId)
{
case ID_BUTTON:
case ID_BUTTON_GPS:
{
::Framework * pFramework = tizen::Framework::GetInstance();
m_locationEnabled = !m_locationEnabled;
if (m_locationEnabled)
{
LocationCriteria criteria;
criteria.SetAccuracy(LOC_ACCURACY_FINEST);
//criteria.SetAccuracy(LOC_ACCURACY_TEN_METERS);
//criteria.SetAccuracy(LOC_ACCURACY_ANY);
if (m_pLocProvider == 0)
{
m_pLocProvider = new LocationProvider();
@ -89,22 +121,35 @@ void MapsWithMeForm::OnActionPerformed(Tizen::Ui::Control const & source, int ac
}
int updateInterval = 1;
m_pLocProvider->StartLocationUpdatesByInterval(updateInterval);
//double distanceThreshold = 1.0;
//m_pLocProvider->StartLocationUpdatesByDistance(distanceThreshold);
m_pLabel->SetText(L"GPS ENABLED");
m_pButton->SetText(L"GPS\nON");
m_pButtonGPS->SetText(L"GPS\nON");
pFramework->StartLocation();
}
else
{
m_pLocProvider->StopLocationUpdates();
delete m_pLocProvider;
m_pLocProvider = 0;
pFramework->StopLocation();
m_pLabel->SetText(L"GPS off");
m_pButton->SetText(L"GPS\noff");
m_pButtonGPS->SetText(L"GPS\noff");
}
break;
}
case ID_BUTTON_SCALE_PLUS:
pFramework->ScaleDefault(true);
break;
case ID_BUTTON_SCALE_MINUS:
pFramework->ScaleDefault(false);
break;
case ID_BUTTON_SETTINGS:
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoForward(ForwardSceneTransition(SCENE_SETTINGS, SCENE_TRANSITION_ANIMATION_TYPE_LEFT, SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_KEEP));
break;
}
break;
}
Invalidate(true);
}
@ -117,24 +162,24 @@ int ConverToSecondsFrom1970(DateTime const & time)
y1970.tm_year = 1970; y1970.tm_mon = 0; y1970.tm_mday = 1;
struct tm cur_t;
cur_t.tm_hour = time.GetHour(); cur_t.tm_min = time.GetMinute(); cur_t.tm_sec = time.GetSecond();
cur_t.tm_hour = time.GetHour(); cur_t.tm_min = time.GetMinute(); cur_t.tm_sec = time.GetSecond();
cur_t.tm_year = time.GetYear(); cur_t.tm_mon = time.GetMonth(); cur_t.tm_mday = time.GetDay();
return difftime(mktime(&cur_t),mktime(&y1970));
}
}
void MapsWithMeForm::OnLocationUpdated(Tizen::Locations::Location const & location)
void MapsWithMeForm::OnLocationUpdated(const Tizen::Locations::Location& location)
{
::Framework * pFramework = tizen::Framework::GetInstance();
location::GpsInfo info;
Coordinates const & coord = location.GetCoordinates();
Coordinates const & coord = location.GetCoordinates();
info.m_source = location::ETizen;
info.m_timestamp = detail::ConverToSecondsFrom1970(location.GetTimestamp());//!< seconds from 1st Jan 1970
info.m_latitude = coord.GetLatitude(); //!< degrees
info.m_longitude = coord.GetLongitude(); //!< degrees
info.m_latitude = coord.GetLatitude(); //!< degrees
info.m_longitude = coord.GetLongitude(); //!< degrees
info.m_horizontalAccuracy = location.GetHorizontalAccuracy(); //!< metres
info.m_altitude = coord.GetAltitude(); //!< metres
info.m_altitude = coord.GetAltitude(); //!< metres
if (!isnan(location.GetVerticalAccuracy()))
info.m_verticalAccuracy = location.GetVerticalAccuracy(); //!< metres
else
@ -165,37 +210,34 @@ void MapsWithMeForm::OnLocationUpdated(Tizen::Locations::Location const & locati
void MapsWithMeForm::OnLocationUpdateStatusChanged(Tizen::Locations::LocationServiceStatus status)
{
#ifdef _DEBUG
static string const ar[5] = {"LOC_SVC_STATUS_IDLE",
"LOC_SVC_STATUS_RUNNING",
"LOC_SVC_STATUS_PAUSED",
"LOC_SVC_STATUS_DENIED",
"LOC_SVC_STATUS_NOT_FIXED"};
LOG(LDEBUG,(ar[status]));
#endif
LOG(LINFO,(ar[status]));
}
void MapsWithMeForm::OnAccuracyChanged(Tizen::Locations::LocationAccuracy accuracy)
{
#ifdef _DEBUG
static string const ar[6] = {"LOC_ACCURACY_INVALID",
"LOC_ACCURACY_FINEST",
"LOC_ACCURACY_TEN_METERS",
"LOC_ACCURACY_HUNDRED_METERS",
"LOC_ACCURACY_ONE_KILOMETER",
"LOC_ACCURACY_ANY"};
LOG(LDEBUG,(ar[accuracy]));
#endif
LOG(LINFO,(ar[accuracy]));
}
result MapsWithMeForm::OnDraw(void)
{
return m_pApp->Draw();
// m_pFramework->Draw();
return E_SUCCESS;
}
namespace detail
{
std::vector<std::pair<double, double> > GetTouchedPoints()
{
std::vector<std::pair<double, double> > GetTouchedPoints(Tizen::Graphics::Rectangle const & rect)
{
std::vector<std::pair<double, double> > res;
IListT<TouchEventInfo *> * pList = TouchEventManager::GetInstance()->GetTouchInfoListN();
if (pList)
@ -207,21 +249,21 @@ std::vector<std::pair<double, double> > GetTouchedPoints()
TouchEventInfo * pTouchInfo;
pList->GetAt(i, pTouchInfo);
Point pt = pTouchInfo->GetCurrentPosition();
res.push_back(std::make_pair(pt.x, pt.y));
res.push_back(std::make_pair(pt.x - rect.x, pt.y - rect.y));
}
pList->RemoveAll();
delete pList;
}
return res;
}
}
}
void MapsWithMeForm::OnTouchPressed(Tizen::Ui::Control const & source,
Tizen::Graphics::Point const & currentPosition,
Tizen::Ui::TouchEventInfo const & touchInfo)
{
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints();
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints(GetClientAreaBounds());
::Framework * pFramework = tizen::Framework::GetInstance();
if (!pFramework->GetGuiController()->OnTapStarted(m2::PointD(pts[0].first, pts[0].second)))
@ -239,7 +281,7 @@ void MapsWithMeForm::OnTouchMoved(Tizen::Ui::Control const & source,
Tizen::Graphics::Point const & currentPosition,
Tizen::Ui::TouchEventInfo const & touchInfo)
{
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints();
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints(GetClientAreaBounds());
::Framework * pFramework = tizen::Framework::GetInstance();
if (!pFramework->GetGuiController()->OnTapMoved(m2::PointD(pts[0].first, pts[0].second)))
@ -270,7 +312,7 @@ void MapsWithMeForm::OnTouchReleased(Tizen::Ui::Control const & source,
Tizen::Graphics::Point const & currentPosition,
Tizen::Ui::TouchEventInfo const & touchInfo)
{
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints();
std::vector<std::pair<double, double> > pts = detail::GetTouchedPoints(GetClientAreaBounds());
::Framework * pFramework = tizen::Framework::GetInstance();
//using prev_pts because pts contains not all points
@ -298,3 +340,21 @@ void MapsWithMeForm::OnTouchFocusOut(Tizen::Ui::Control const & source,
Tizen::Ui::TouchEventInfo const & touchInfo)
{
}
void MapsWithMeForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
{
UiApp* pApp = UiApp::GetInstance();
AppAssert(pApp);
pApp->Terminate();
}
void MapsWithMeForm::UpdateButtons()
{
bool bEnableScaleButtons = true;
if (!Settings::Get("ScaleButtons", bEnableScaleButtons))
Settings::Set("ScaleButtons", bEnableScaleButtons);
m_pButtonScalePlus->SetShowState(bEnableScaleButtons);
m_pButtonScaleMinus->SetShowState(bEnableScaleButtons);
Invalidate(true);
}

View file

@ -1,7 +1,11 @@
#include "MapsWithMeFrame.h"
#include "SceneRegister.hpp"
#include <FUi.h>
using namespace Tizen::App;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Scenes;
MapsWithMeFrame::MapsWithMeFrame(void)
{
@ -15,7 +19,13 @@ result MapsWithMeFrame::OnInitializing(void)
{
result r = E_SUCCESS;
// TODO: Add your frame initialization code here.
SceneRegister::RegisterAllScenes();
// Go to the first scene.
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_MAP));
TryReturn(!IsFailed(r), r, "%s", GetErrorMessage(r));
SetPropagatedKeyEventListener(this);
return r;
@ -31,14 +41,14 @@ result MapsWithMeFrame::OnTerminating(void)
bool MapsWithMeFrame::OnKeyReleased(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
{
KeyCode keyCode = keyEventInfo.GetKeyCode();
if (keyCode == KEY_BACK)
{
UiApp* pApp = UiApp::GetInstance();
AppAssert(pApp);
pApp->Terminate();
}
// KeyCode keyCode = keyEventInfo.GetKeyCode();
//
// if (keyCode == KEY_BACK)
// {
// UiApp* pApp = UiApp::GetInstance();
// AppAssert(pApp);
// pApp->Terminate();
// }
return false;
}

View file

@ -0,0 +1,35 @@
#include "SceneRegister.hpp"
#include "FormFactory.hpp"
#include <FUi.h>
using namespace Tizen::Ui::Scenes;
// Definitions of extern.
const wchar_t* SCENE_MAP = L"ScnMap";
const wchar_t* SCENE_SETTINGS = L"ScnSettings";
const wchar_t* SCENE_DOWNLOAD = L"ScnDownload";
const wchar_t* SCENE_ABOUT = L"ScnAbout";
SceneRegister::SceneRegister(void)
{
}
SceneRegister::~SceneRegister(void)
{
}
void
SceneRegister::RegisterAllScenes(void)
{
static const wchar_t* PANEL_BLANK = L"";
static FormFactory formFactory;
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
pSceneManager->RegisterFormFactory(formFactory);
pSceneManager->RegisterScene(SCENE_MAP, FORM_MAP, PANEL_BLANK);
pSceneManager->RegisterScene(SCENE_SETTINGS, FORM_SETTINGS, PANEL_BLANK);
pSceneManager->RegisterScene(SCENE_DOWNLOAD, FORM_DOWNLOAD, PANEL_BLANK);
pSceneManager->RegisterScene(SCENE_ABOUT, FORM_ABOUT, PANEL_BLANK);
}

View file

@ -0,0 +1,117 @@
#include "SettingsForm.hpp"
#include "SceneRegister.hpp"
#include "MapsWithMeForm.hpp"
#include "Framework.hpp"
#include "AppResourceId.h"
#include "../../../base/logging.hpp"
#include "../../../platform/settings.hpp"
#include "../../../map/framework.hpp"
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Graphics;
using namespace Tizen::Media;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
using namespace Tizen::App;
using namespace Tizen::Ui::Scenes;
SettingsForm::SettingsForm(MapsWithMeForm * pForm)
: m_pMainForm(pForm)
{
}
SettingsForm::~SettingsForm(void)
{
}
bool SettingsForm::Initialize(void)
{
LOG(LDEBUG, ("SettingsForm::Initialize"));
Construct("IDF_SETTINGS_FORM");
return true;
}
result SettingsForm::OnInitializing(void)
{
Settings::Units u = Settings::Metric;
Settings::Get("Units", u);
CheckButton * pMetersButton = static_cast<CheckButton *>(GetControl(IDC_METERS_CHECKBUTTON, true));
pMetersButton->SetActionId(ID_METER_CHECKED, -1);
pMetersButton->AddActionEventListener(*this);
CheckButton * pFootsButton = static_cast<CheckButton *>(GetControl(IDC_FOOTS_CHECKBUTTON, true));
pFootsButton->SetActionId(ID_FOOT_CHECKED, -1);
pFootsButton->AddActionEventListener(*this);
pMetersButton->SetSelected(u == Settings::Metric);
pFootsButton->SetSelected(u == Settings::Foot);
bool bEnableScaleButtons = true;
Settings::Get("ScaleButtons", bEnableScaleButtons);
CheckButton * pScaleButton = static_cast<CheckButton *>(GetControl(IDC_ENABLE_SCALE_BUTTONS_CB, true));
pScaleButton->SetActionId(ID_SCALE_CHECKED, ID_SCALE_UNCHECKED);
pScaleButton->SetSelected(bEnableScaleButtons);
pScaleButton->AddActionEventListener(*this);
Button * pAboutButton = static_cast<Button *>(GetControl(IDC_ABOUT_BUTTON, true));
pAboutButton->SetActionId(ID_ABOUT_CHECKED);
pAboutButton->AddActionEventListener(*this);
SetFormBackEventListener(this);
return E_SUCCESS;
}
void SettingsForm::OnActionPerformed(Tizen::Ui::Control const & source, int actionId)
{
switch(actionId)
{
case ID_METER_CHECKED:
{
Settings::Set("Units", Settings::Metric);
::Framework * pFramework = tizen::Framework::GetInstance();
pFramework->SetupMeasurementSystem();
break;
}
case ID_FOOT_CHECKED:
{
Settings::Set("Units", Settings::Foot);
::Framework * pFramework = tizen::Framework::GetInstance();
pFramework->SetupMeasurementSystem();
break;
}
case ID_SCALE_CHECKED:
{
Settings::Set("ScaleButtons", true);
break;
}
case ID_SCALE_UNCHECKED:
{
Settings::Set("ScaleButtons", false);
break;
}
case ID_ABOUT_CHECKED:
{
SceneManager * pSceneManager = SceneManager::GetInstance();
pSceneManager->GoForward(ForwardSceneTransition(SCENE_ABOUT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT, SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
break;
}
case ID_BUTTON_BACK:
{
SceneManager * pSceneManager = SceneManager::GetInstance();
m_pMainForm->UpdateButtons();
pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
break;
}
}
Invalidate(true);
}
void SettingsForm::OnFormBackRequested(Tizen::Ui::Controls::Form & source)
{
SceneManager * pSceneManager = SceneManager::GetInstance();
m_pMainForm->UpdateButtons();
pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
}