Merge remote-tracking branch 'maps/tizen'
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 10 Aug 2017 01:00:30 +0000 (10:00 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 10 Aug 2017 01:00:30 +0000 (10:00 +0900)
Change-Id: I6256c0f32de88864e632651041e21ba498e564f3

872 files changed:
.editorconfig [new file with mode: 0644]
.gitattributes [deleted file]
.gitignore [deleted file]
LICENSE [deleted file]
packaging/csapi-maps.manifest [deleted file]
packaging/csapi-maps.spec [deleted file]
src/ElmSharp.Wearable/ElmSharp.Wearable.csproj [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs [new file with mode: 0644]
src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Evas.cs [new file with mode: 0644]
src/ElmSharp.Wearable/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp.csproj [new file with mode: 0644]
src/ElmSharp/ElmSharp.snk [new file with mode: 0644]
src/ElmSharp/ElmSharp/AccessRole.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/AccessibleObject.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/AccessibleRelation.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/AccessibleUtil.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Background.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Box.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Button.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Calendar.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Check.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Color.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ColorSelector.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ColorSelectorItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Conformant.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Container.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ContextPopup.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ContextPopupItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/DateChangedEventArgs.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/DateTimeSelector.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EcoreAnimator.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EcoreEvent.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EcoreMainloop.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EdjeObject.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/EffectBase.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Elementary.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/ElmScrollConfig.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Entry.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EvasCanvas.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/EvasMap.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/EvasObject.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/EvasObjectEvent.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/FlipSelector.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/FlipSelectorItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/FloatingButton.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/GenGrid.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GenGridItem.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GenItem.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GenItemClass.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GenList.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GenListItem.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/GestureLayer.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Hoversel.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/HoverselItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/IAccessibleObject.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Icon.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Image.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Index.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/IndexItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ItemObject.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/ItemObjectExtension.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Label.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Layout.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/List.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ListItem.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/MultiButtonEntry.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/NaviItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Naviframe.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Panel.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Panes.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Point.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Point3D.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Polygon.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Popup.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/PopupItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ProgressBar.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Radio.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/ReadingInfoType.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Rect.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Rectangle.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Scroller.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Size.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Slider.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/SmartEvent.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Spinner.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Table.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Toolbar.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/ToolbarItem.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Transit.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/TransitEffect.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Utility.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/Widget.cs [new file with mode: 0755]
src/ElmSharp/ElmSharp/Window.cs [new file with mode: 0644]
src/ElmSharp/ElmSharp/WrapType.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Ecore.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Eext.Event.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Eina.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Bg.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Box.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Button.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Entry.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.GenListView.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Elementary.Image.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Index.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Item.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Label.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Elementary.List.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Panel.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Panes.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Popup.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Slider.cs [new file with mode: 0755]
src/ElmSharp/Interop/Interop.Elementary.Spinner.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Table.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.Win.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Elementary.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Eo.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Evas.Image.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Evas.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Libc.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Libdl.cs [new file with mode: 0644]
src/ElmSharp/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Makefile [new file with mode: 0644]
src/Test.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Interop/Interop.Account.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.snk [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs [new file with mode: 0644]
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs [new file with mode: 0644]
src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj [new file with mode: 0644]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.snk [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs [new file with mode: 0755]
src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs [new file with mode: 0755]
src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs [new file with mode: 0755]
src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj [new file with mode: 0755]
src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.snk [new file with mode: 0755]
src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs [new file with mode: 0755]
src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.snk [new file with mode: 0644]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/GlobalSuppressions.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Interop/Interop.Badge.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications.Badge.snk [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.AppControl.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs [new file with mode: 0644]
src/Tizen.Applications.Common/Interop/Interop.Bundle.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.Glib.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.Libc.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications.Common.csproj [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications.Common.snk [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/Application.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs [new file with mode: 0644]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs [new file with mode: 0644]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs [new file with mode: 0644]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs [new file with mode: 0644]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs [new file with mode: 0755]
src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs [new file with mode: 0644]
src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj [new file with mode: 0644]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.snk [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs [new file with mode: 0755]
src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.snk [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Interop/Interop.Notification.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notification.snk [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs [new file with mode: 0755]
src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.snk [new file with mode: 0644]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs [new file with mode: 0644]
src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.snk [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs [new file with mode: 0644]
src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs [new file with mode: 0644]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs [new file with mode: 0644]
src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs [new file with mode: 0755]
src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Preference/Interop/Interop.Preference.cs [new file with mode: 0755]
src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj [new file with mode: 0755]
src/Tizen.Applications.Preference/Tizen.Applications.Preference.snk [new file with mode: 0755]
src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs [new file with mode: 0755]
src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Applications.Service/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.Service/Interop/Interop.Service.cs [new file with mode: 0755]
src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs [new file with mode: 0755]
src/Tizen.Applications.Service/Tizen.Applications.Service.csproj [new file with mode: 0755]
src/Tizen.Applications.Service/Tizen.Applications.Service.snk [new file with mode: 0755]
src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.snk [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs [new file with mode: 0755]
src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs [new file with mode: 0755]
src/Tizen.Applications.UI/Interop/Interop.Application.cs [new file with mode: 0755]
src/Tizen.Applications.UI/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs [new file with mode: 0755]
src/Tizen.Applications.UI/Tizen.Applications.UI.csproj [new file with mode: 0755]
src/Tizen.Applications.UI/Tizen.Applications.UI.snk [new file with mode: 0755]
src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs [new file with mode: 0755]
src/Tizen.Content.Download/Interop/Interop.Download.cs [new file with mode: 0755]
src/Tizen.Content.Download/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download.csproj [new file with mode: 0644]
src/Tizen.Content.Download/Tizen.Content.Download.snk [new file with mode: 0644]
src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download/Request.cs [new file with mode: 0755]
src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Context/Interop/Interop.AppHistory.cs [new file with mode: 0644]
src/Tizen.Context/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.csproj [new file with mode: 0644]
src/Tizen.Context/Tizen.Context.snk [new file with mode: 0644]
src/Tizen.Convergence/Interop/Interop.Common.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Libc.cs [new file with mode: 0755]
src/Tizen.Convergence/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence.csproj [new file with mode: 0644]
src/Tizen.Convergence/Tizen.Convergence.snk [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalService.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs [new file with mode: 0755]
src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Interop/Interop.Location.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj [new file with mode: 0644]
src/Tizen.Location.Geofence/Tizen.Location.Geofence.snk [new file with mode: 0644]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs [new file with mode: 0644]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs [new file with mode: 0755]
src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs [new file with mode: 0755]
src/Tizen.Location/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Location/Interop/Interop.Location.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location.csproj [new file with mode: 0644]
src/Tizen.Location/Tizen.Location.snk [new file with mode: 0644]
src/Tizen.Location/Tizen.Location/GpsSatellite.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/Location.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/LocationBoundary.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/LocationError.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/Locator.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/LocatorHelper.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/NamespaceDoc.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Log/Interop/Interop.Dlog.cs [new file with mode: 0644]
src/Tizen.Log/Tizen.Log.csproj [new file with mode: 0644]
src/Tizen.Log/Tizen.Log.snk [new file with mode: 0644]
src/Tizen.Log/Tizen/Log.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs [new file with mode: 0755]
src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.snk [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs [new file with mode: 0644]
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs [new file with mode: 0644]
src/Tizen.Network.Connection/Interop/Interop.Connection.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Network.Connection/Tizen.Network.Connection.csproj [new file with mode: 0644]
src/Tizen.Network.Connection/Tizen.Network.Connection.snk [new file with mode: 0644]
src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs [new file with mode: 0755]
src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj [new file with mode: 0644]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.snk [new file with mode: 0644]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs [new file with mode: 0755]
src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Database.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Filter.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Libraries.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.List.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Query.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Record.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Reminder.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Service.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Vcalendar.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.nuspec [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarFilter.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Contacts.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Database.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Interop/Interop.Group.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.List.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Person.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Query.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Record.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs [new file with mode: 0755]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs [new file with mode: 0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/.gitignore [new file with mode: 0644]
src/Tizen.Security.TEEC/Interop/Interop.Errors.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Interop/Interop.Types.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj [new file with mode: 0644]
src/Tizen.Security.TEEC/Tizen.Security.TEEC.snk [new file with mode: 0755]
src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Feedback/Feedback.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Feedback/FeedbackType.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Interop/Interop.Feedback.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.System.Feedback/Tizen.System.Feedback.csproj [new file with mode: 0644]
src/Tizen.System.Feedback/Tizen.System.Feedback.snk [new file with mode: 0755]
src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo [new file with mode: 0644]
src/Tizen.System.Information/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs [new file with mode: 0644]
src/Tizen.System.Information/Interop/Interop.SystemInfo.cs [new file with mode: 0644]
src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs [new file with mode: 0755]
src/Tizen.System.Information/RuntimeInfo/Enumerations.cs [new file with mode: 0755]
src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs [new file with mode: 0755]
src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs [new file with mode: 0644]
src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs [new file with mode: 0755]
src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs [new file with mode: 0755]
src/Tizen.System.Information/SystemInfo/SystemInfo.cs [new file with mode: 0755]
src/Tizen.System.Information/Tizen.System.Information.csproj [new file with mode: 0644]
src/Tizen.System.Information/Tizen.System.Information.snk [new file with mode: 0644]
src/filelist.lst [new file with mode: 0644]
test/ElmSharp.Test/ElmSharp.Test.csproj [new file with mode: 0644]
test/ElmSharp.Test/ElmSharp.Test.project.json [new file with mode: 0755]
test/ElmSharp.Test/Log.cs [new file with mode: 0644]
test/ElmSharp.Test/Properties/AssemblyInfo.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/AccessibilityRelationTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/AccessibilityRoleTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/AccessibilityTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BackgroundColorTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BackgroundTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BackgroundTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BackgroundTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BoxLayoutTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/BoxTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ButtonTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/CalendarTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/CheckTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ClipperTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ColorSelectorTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ContextPopupTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EcoreTimerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EntryTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EntryTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EntryTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EvasMapTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/EvasMapTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/FlipSelectorTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/FloatingButtonTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/FocusTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenGridTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenGridTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest10.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest5.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest6.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest7.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest8.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GenListTest9.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/GestureLayerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/HoverselTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/IconTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ImageTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ImageTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ImageTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ImageTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/IndexTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/IndexTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/KeyEventTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest5.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelTest6.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/LabelValignTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ListTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/NaviframeTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/NaviframeTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/NaviframeTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PanelTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PanelTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PanesTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PerformanceTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PolygonTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/PopupTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ProgressBarTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ProgressBarTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/RadioTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/RectangleTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ScreenInformationTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ScrollerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ScrollerTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ScrollerTest3.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/SliderTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/SliderTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/SpinnerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/TableTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ToolbarTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ToolbarTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ToolbarTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/ToolbarTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/TooltipTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/TransitTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/CheckTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/CircleTool.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EntryTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EntryTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EntryTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EntryTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/FocusTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest10.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest5.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest6.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest7.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest8.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GenListTest9.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/IconTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ImageTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ImageTest2.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ImageTest3.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ImageTest4.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/IndexTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/IndexTest2.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/LabelTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/LabelTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/LabelTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/LabelTest4.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/LabelTest5.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ListTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PanelTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PanelTest2.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PanesTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/PopupTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/RadioTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/SliderTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/SliderTest2.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/TableTest1.cs [new file with mode: 0644]
test/ElmSharp.Test/TC/Wearable/TransitTest.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs [new file with mode: 0755]
test/ElmSharp.Test/TC/WindowInternalTest.cs [new file with mode: 0644]
test/ElmSharp.Test/TestCaseBase.cs [new file with mode: 0644]
test/ElmSharp.Test/TestRunner.cs [new file with mode: 0644]
test/ElmSharp.Test/res/TED/app_icn_ted.png [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/a.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/b.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/c.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/d.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/e.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/f.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/g.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/a.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/b.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/c.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/d.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/e.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/f.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/g.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/btn_delete.png [new file with mode: 0644]
test/ElmSharp.Test/res/picture.png [new file with mode: 0644]
test/ElmSharp.Test/shared/res/ElmSharp.Test.png [new file with mode: 0644]
test/ElmSharp.Test/test.sh [new file with mode: 0755]
test/ElmSharp.Test/tizen-manifest.xml [new file with mode: 0644]
test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj [new file with mode: 0644]
test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.project.json [new file with mode: 0644]
test/ElmSharp.Wearable.Test/Properties/AssemblyInfo.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/Log.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TestCaseBase.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/TestRunner.cs [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/bg_black.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/bg_red.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/bg_white.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/make_icon.sh [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/me.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/me_circle.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/me_small.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/pressed.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_content_black.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/res/icons/round_content_red.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png [new file with mode: 0644]
test/ElmSharp.Wearable.Test/tizen-manifest.xml [new file with mode: 0644]

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..ed9502e
--- /dev/null
@@ -0,0 +1,8 @@
+root = true
+
+[*]
+end_of_line = lf
+
+[*.{cs,xaml}]
+indent_style = space
+indent_size = 4
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644 (file)
index 5896c16..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-###############################################################################
-# Set default behavior to automatically normalize line endings.
-###############################################################################
-* text=auto
-
-###############################################################################
-# Set default behavior for command prompt diff.
-#
-# This is need for earlier builds of msysgit that does not have it on by
-# default for csharp files.
-# Note: This is only used by command line
-###############################################################################
-#*.cs     diff=csharp
-
-###############################################################################
-# Set the merge driver for project and solution files
-#
-# Merging from the command prompt will add diff markers to the files if there
-# are conflicts (Merging from VS is not affected by the settings below, in VS
-# the diff markers are never inserted). Diff markers may cause the following
-# file extensions to fail to load in VS. An alternative would be to treat
-# these files as binary and thus will always conflict and require user
-# intervention with every merge. To do so, just uncomment the entries below
-###############################################################################
-#*.sln       merge=binary
-#*.csproj    merge=binary
-#*.vbproj    merge=binary
-#*.vcxproj   merge=binary
-#*.vcproj    merge=binary
-#*.dbproj    merge=binary
-#*.fsproj    merge=binary
-#*.lsproj    merge=binary
-#*.wixproj   merge=binary
-#*.modelproj merge=binary
-#*.sqlproj   merge=binary
-#*.wwaproj   merge=binary
-
-###############################################################################
-# behavior for image files
-#
-# image files are treated as binary by default.
-###############################################################################
-#*.jpg   binary
-#*.png   binary
-#*.gif   binary
-
-###############################################################################
-# diff behavior for common document formats
-#
-# Convert binary document formats to text before diffing them. This feature
-# is only available from the command line. Turn it on by uncommenting the
-# entries below.
-###############################################################################
-#*.doc   diff=astextplain
-#*.DOC   diff=astextplain
-#*.docx  diff=astextplain
-#*.DOCX  diff=astextplain
-#*.dot   diff=astextplain
-#*.DOT   diff=astextplain
-#*.pdf   diff=astextplain
-#*.PDF   diff=astextplain
-#*.rtf   diff=astextplain
-#*.RTF   diff=astextplain
diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index 46619d5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bin/
-obj/
-*.exe
-*.dll
-*.csproj.user
-*.lock.json
-.vs/
diff --git a/LICENSE b/LICENSE
deleted file mode 100644 (file)
index d645695..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/packaging/csapi-maps.manifest b/packaging/csapi-maps.manifest
deleted file mode 100644 (file)
index 75b0fa5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<manifest>
-    <request>
-        <domain name="_"/>
-    </request>
-</manifest>
diff --git a/packaging/csapi-maps.spec b/packaging/csapi-maps.spec
deleted file mode 100644 (file)
index 3279a08..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-Name:       csapi-maps
-Summary:    Tizen Map Service API for C#
-Version:    1.0.16
-Release:    1
-Group:      Development/Libraries
-License:    Apache-2.0 and SAMSUNG
-URL:        https://www.tizen.org
-Source0:    %{name}-%{version}.tar.gz
-Source1:    %{name}.manifest
-
-AutoReqProv: no
-ExcludeArch: aarch64
-
-BuildRequires: dotnet-build-tools
-
-# NuGet for Dependencies
-BuildRequires: csapi-tizen-nuget
-BuildRequires: elm-sharp-nuget
-
-%define Assemblies Tizen.Maps
-
-%description
-%{summary}
-
-%dotnet_import_sub_packages
-
-%prep
-%setup -q
-cp %{SOURCE1} .
-
-%build
-for ASM in %{Assemblies}; do
-%dotnet_build $ASM
-%dotnet_pack $ASM
-done
-
-%install
-mkdir -p %{buildroot}%{dotnet_assembly_path}/res
-for ASM in %{Assemblies}; do
-%dotnet_install $ASM
-install -p -m 644 $ASM/res/*.png %{buildroot}%{dotnet_assembly_path}/res
-done
-
-%files
-%manifest %{name}.manifest
-%license LICENSE
-%attr(644,root,root) %{dotnet_assembly_files}
-%attr(644,root,root) %{dotnet_assembly_path}/res/*.png
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable.csproj b/src/ElmSharp.Wearable/ElmSharp.Wearable.csproj
new file mode 100644 (file)
index 0000000..30674e5
--- /dev/null
@@ -0,0 +1,8 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\ElmSharp\ElmSharp.csproj" />
+  </ItemGroup>
+</Project>
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs
new file mode 100644 (file)
index 0000000..7834970
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+    /// <summary>
+    /// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event
+    /// Inherits <see cref="DateTimeSelector"/>
+    /// </summary>
+    public class CircleDateTimeSelector : DateTimeSelector
+    {
+        IntPtr circleHandle;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Circle DateTime class
+        /// </summary>
+        /// <param name="parent">The parent of new Circle DateTime instance</param>
+        public CircleDateTimeSelector(EvasObject parent) : base(parent) { }
+
+        /// <summary>
+        /// Sets or gets the disabled state of the Circle DateTime Selector
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the color of the marker
+        /// </summary>
+        public Color MarkerColor
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+                return new Color(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line width of the marker
+        /// </summary>
+        public int MarkerLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the radius at which the center of the marker lies
+        /// </summary>
+        public double MarkerRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            var handle = base.CreateHandle(parent);
+
+            IntPtr surface = IntPtr.Zero;
+
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent);
+            }
+
+            circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while (!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(circleHandle, w, h);
+            }
+
+            Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs
new file mode 100644 (file)
index 0000000..c987009
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+    /// <summary>
+    /// The Circle GenList Selector is a widget to display and handle genlist items by rotary event
+    /// Inherits <see cref="GenList"/>
+    /// </summary>
+    public class CircleGenList : GenList
+    {
+        IntPtr circleHandle;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Circle GenList class
+        /// </summary>
+        /// <param name="parent">The parent of new Circle GenList instance</param>
+        public CircleGenList(EvasObject parent) : base(parent) { }
+
+        /// <summary>
+        /// Sets or gets the disabled state of the Circle GenList Selector
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the color of the scroll background
+        /// </summary>
+        public Color VerticalScrollBackgroundColor
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Eext.eext_circle_object_item_color_get(circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+                return new Color(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line width of the scroll background
+        /// </summary>
+        public int VerticalScrollBackgroundLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "vertical,scroll,bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "vertical,scroll,bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the redius of the scroll background
+        /// </summary>
+        public double VerticalScrollBackgroundRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "vertical,scroll,bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "vertical,scroll,bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the color of the scroll bar
+        /// </summary>
+        public Color VerticalScrollBarColor
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+                return new Color(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line width of the scroll bar
+        /// </summary>
+        public int VerticalScrollBarLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the redius of the scroll bar
+        /// </summary>
+        public double VerticalScrollBarRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the policy if the scroll bar is visible
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, IntPtr.Zero, out policy);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                int h;
+                Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, out h, IntPtr.Zero);
+                Interop.Eext.eext_circle_object_genlist_scroller_policy_set(circleHandle, (int)h, (int)value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            var handle = base.CreateHandle(parent);
+
+            IntPtr surface = IntPtr.Zero;
+
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent);
+            }
+
+            circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while(!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(circleHandle, w, h);
+            }
+
+            Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs
new file mode 100644 (file)
index 0000000..95fcbae
--- /dev/null
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+
+    /// <summary>
+    /// The Circle ProgressBar is a widget for visually representing the progress status of a given job/task with the circular design.
+    /// </summary>
+    public class CircleProgressBar : EvasObject
+    {
+        private IntPtr _circleHandle;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Circle Progressbar class.
+        /// </summary>
+        /// <param name="parent">The parent of new Circle Progressbar instance</param>
+        public CircleProgressBar(EvasObject parent) : base(parent)
+        {
+        }
+
+
+        /// <summary>
+        /// Sets or gets the value of ProgressBar.
+        /// </summary>
+        public double Value
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_value_get(_circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_value_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum value of ProgressBar.
+        /// </summary>
+        public double Maximum
+        {
+            get
+            {
+                double max = 0;
+                double min = 0;
+                Interop.Eext.eext_circle_object_value_min_max_get(_circleHandle, out min, out max);
+                return max;
+            }
+            set
+            {
+                double min = Minimum;
+                Interop.Eext.eext_circle_object_value_min_max_set(_circleHandle, min, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum value of ProgressBar.
+        /// </summary>
+        public double Minimum
+        {
+            get
+            {
+                double max = 0;
+                double min = 0;
+                Interop.Eext.eext_circle_object_value_min_max_get(_circleHandle, out min, out max);
+                return min;
+            }
+            set
+            {
+                double max = Maximum;
+                Interop.Eext.eext_circle_object_value_min_max_set(_circleHandle, value, max);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle value of ProgressBar.
+        /// </summary>
+        public double BarAngle
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_angle_get(_circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_angle_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle value of Background ProgressBar.
+        /// </summary>
+        public double BackgroundAngle
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_angle_get(_circleHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_angle_set(_circleHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle offset value of ProgressBar.
+        /// </summary>
+        public double BarAngleOffset
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_angle_offset_get(_circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_angle_offset_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle offset value of Background ProgressBar.
+        /// </summary>
+        public double BackgroundAngleOffset
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_angle_offset_get(_circleHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_angle_offset_set(_circleHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum angle value of ProgressBar.
+        /// </summary>
+        public double BarAngleMaximum
+        {
+            get
+            {
+                double max = 0;
+                double min = 0;
+                Interop.Eext.eext_circle_object_angle_min_max_get(_circleHandle, out min, out max);
+                return max;
+            }
+            set
+            {
+                double min = BarAngleMinimum;
+                Interop.Eext.eext_circle_object_angle_min_max_set(_circleHandle, min, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum angle value of ProgressBar.
+        /// </summary>
+        public double BarAngleMinimum
+        {
+            get
+            {
+                double max = 0;
+                double min = 0;
+                Interop.Eext.eext_circle_object_angle_min_max_get(_circleHandle, out min, out max);
+                return min;
+            }
+            set
+            {
+                double max = BarAngleMaximum;
+                Interop.Eext.eext_circle_object_angle_min_max_set(_circleHandle, value, max);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets disable status of Circle ProgressBar.
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(_circleHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of ProgressBar.
+        /// </summary>
+        public Color BarColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_color_get(_circleHandle, out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_color_set(_circleHandle, value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of Background ProgressBar.
+        /// </summary>
+        public Color BackgroundColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "bg", out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "bg", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of ProgressBar.
+        /// </summary>
+        public int BarLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of Background ProgressBar.
+        /// </summary>
+        public int BackgroundLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of ProgressBar.
+        /// </summary>
+        public double BarRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_radius_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of Background ProgressBar.
+        /// </summary>
+        public double BackgroundRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "bg"); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "bg", value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr surface = IntPtr.Zero;
+
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+
+            _circleHandle = Interop.Eext.eext_circle_object_progressbar_add(parent.Handle, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while (!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(_circleHandle, w, h);
+            }
+
+            Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+            return parent.Handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs
new file mode 100644 (file)
index 0000000..c786615
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+    /// <summary>
+    /// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event.
+    /// </summary>
+    public class CircleScroller : Scroller
+    {
+        private IntPtr _circleHandle;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the CircleScroller class.
+        /// </summary>
+        /// <param name="parent">The <see cref="EvasObject"/> to which the new CircleScroller will be attached as a child.</param>
+        public CircleScroller(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets disabled state of the circle scroller object.
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public override ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, out policy, IntPtr.Zero);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
+                Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)value, (int)v);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of VerticalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public override ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, IntPtr.Zero, out policy);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
+                Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)h, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the vertical scroll bar.
+        /// </summary>
+        public Color VerticalScrollBarColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_color_get(_circleHandle, out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_color_set(_circleHandle, value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the horizontal scroll bar.
+        /// </summary>
+        public Color HorizontalScrollBarColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bar", out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bar", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the vertical scroll background.
+        /// </summary>
+        public Color VerticalScrollBackgroundColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the horizontal scroll background.
+        /// </summary>
+        public Color HorizontalScrollBackgroundColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bg", out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bg", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of the vertical scroll bar.
+        /// </summary>
+        public int VerticalScrollBarLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of the horizontal scroll bar.
+        /// </summary>
+        public int HorizontalScrollBarLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bar");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bar", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of the vertical scroll background.
+        /// </summary>
+        public int VerticalScrollBackgroundLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "vertical,scroll,bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "vertical,scroll,bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets line width of the horizontal scroll background.
+        /// </summary>
+        public int HorizontalScrollBackgroundLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of the vertical scroll bar.
+        /// </summary>
+        public double VerticalScrollBarRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_radius_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of the horizontal scroll bar.
+        /// </summary>
+        public double HorizontalScrollBarRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bar"); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bar", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of the vertical scroll background.
+        /// </summary>
+        public double VerticalScrollBackgroundRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "vertical,scroll,bg"); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "vertical,scroll,bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets radius of the horizontal scroll background.
+        /// </summary>
+        public double HorizontalScrollBackgroundRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bg"); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bg", value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = base.CreateHandle(parent);
+            IntPtr surface = IntPtr.Zero;
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+
+            _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while (!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(_circleHandle, w, h);
+            }
+            Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs
new file mode 100644 (file)
index 0000000..8cf026c
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+    /// <summary>
+    /// Circle slider is circular designed widget to select a value in a range by rotary event.
+    /// </summary>
+    public class CircleSlider : EvasObject
+    {
+        public event EventHandler Changed;
+
+        SmartEvent _changedEvent;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the CircleSlider class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new CircleSlider will be attached as a child.</param>
+        public CircleSlider(EvasObject parent) : base(parent)
+        {
+            _changedEvent = new SmartEvent(this, "value,changed");
+
+            _changedEvent.On += (s, e) => Changed?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Sets or gets the step by which the circle slider bar moves.
+        /// </summary>
+        /// <remarks>
+        /// This value is used when circle slider value is changed by an drag or rotary event
+        /// The value of the slider is increased/decreased by the step value.
+        /// </remarks>
+        public double Step
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_slider_step_get(RealHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_slider_step_set(RealHandle, (double)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets disabled state of the circle slider object.
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(RealHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the circle slider bar.
+        /// </summary>
+        public Color BarColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_color_get(RealHandle, out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_color_set(RealHandle, value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets color of the circle slider background.
+        /// </summary>
+        public Color BackgroundColor
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                Interop.Eext.eext_circle_object_item_color_get(RealHandle, "bg", out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(RealHandle, "bg", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line with of the circle slider bar.
+        /// </summary>
+        public int BarLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_line_width_get(RealHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_line_width_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line with of the circle slider background.
+        /// </summary>
+        public int BackgroundLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(RealHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(RealHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle in degree of the circle slider bar.
+        /// </summary>
+        public double BarAngle
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_angle_get(RealHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_angle_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle in degree of the circle slider background.
+        /// </summary>
+        public double BackgroundAngle
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_angle_get(RealHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_angle_set(RealHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle offset for the slider bar.
+        /// offset value means start position of the slider bar.
+        /// </summary>
+        public double BarAngleOffset
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_angle_offset_get(RealHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_angle_offset_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the angle offset for the circle slider background.
+        /// offset value means start position of the slider background.
+        /// </summary>
+        public double BackgroundAngleOffset
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_angle_offset_get(RealHandle, "bg");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_angle_offset_set(RealHandle, "bg", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum angle of the circle slider bar.
+        /// </summary>
+        public double BarAngleMinimum
+        {
+            get
+            {
+                double min;
+                double max;
+                Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+                return min;
+            }
+            set
+            {
+                double max = BarAngleMaximum;
+                Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, (double)value, max);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum angle of the circle slider bar.
+        /// </summary>
+        public double BarAngleMaximum
+        {
+            get
+            {
+                double min;
+                double max;
+                Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+                return max;
+            }
+            set
+            {
+                double min = BarAngleMinimum;
+                Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, min, (double)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum values for the circle slider.
+        /// </summary>
+        /// <remarks>
+        /// This defines the allowed minimum values to be selected by the user.
+        /// If the actual value is less than min, it is updated to min.
+        /// Actual value can be obtained with Value.By default, min is equal to 0.0.
+        /// </remarks>
+        public double Minimum
+        {
+            get
+            {
+                double min;
+                double max;
+                Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+                return min;
+            }
+            set
+            {
+                double max = Maximum;
+                Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, (double)value, max);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum values for the circle slider.
+        /// </summary>
+        /// <remarks>
+        /// This defines the allowed maximum values to be selected by the user.
+        /// If the actual value is bigger then max, it is updated to max.
+        /// Actual value can be obtained with Value.By default, min is equal to 0.0, and max is equal to 1.0.
+        /// Maximum must be greater than minimum, otherwise the behavior is undefined.
+        /// </remarks>
+        public double Maximum
+        {
+            get
+            {
+                double min;
+                double max;
+                Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+                return max;
+            }
+            set
+            {
+                double min = Minimum;
+                Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, min, (double)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the value displayed by the circle slider.
+        /// </summary>
+        /// <remarks>
+        /// The value must to be between Minimum and Maximum values.
+        /// </remarks>
+        public double Value
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_value_set(RealHandle, (double)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the radius value for the circle slider bar.
+        /// </summary>
+        public double BarRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_radius_get(RealHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_radius_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the radius value for the circle slider background.
+        /// </summary>
+        public double BackgroundRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(RealHandle, "bg"); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(RealHandle, "bg", value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr surface = IntPtr.Zero;
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+
+            IntPtr handle = Interop.Eext.eext_circle_object_slider_add(parent, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while (!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(handle, w, h);
+            }
+
+            Interop.Eext.eext_rotary_object_event_activated_set(handle, true);
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs
new file mode 100644 (file)
index 0000000..e85d589
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+
+    /// <summary>
+    /// The Circle Spinner is a widget to display and handle spinner value by rotary event
+    /// Inherits <see cref="Spinner"/>.
+    /// </summary>
+    public class CircleSpinner : Spinner
+    {
+        private IntPtr _circleHandle;
+        private double _angleRatio = 1.0;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Circle Spinner class.
+        /// </summary>
+        /// <param name="parent">The parent of new Circle Spinner instance</param>
+        public CircleSpinner(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets the circle spinner angle per each spinner value.
+        /// </summary>
+        public double AngleRatio
+        {
+            get
+            {
+                return _angleRatio;
+            }
+            set
+            {
+                _angleRatio = value;
+                Interop.Eext.eext_circle_object_spinner_angle_set(_circleHandle, _angleRatio);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets disabled state of the circle spinner object.
+        /// </summary>
+        public bool Disabled
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line width of the marker
+        /// </summary>
+        public int MarkerLineWidth
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "default", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the color of the marker
+        /// </summary>
+        public Color MarkerColor
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "default", out r, out g, out b, out a);
+                return new Color(r, g, b, a);
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "default", value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the radius at which the center of the marker lies
+        /// </summary>
+        public double MarkerRadius
+        {
+            get
+            {
+                return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "default");
+            }
+            set
+            {
+                Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "default", value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = base.CreateHandle(parent);
+
+            IntPtr surface = IntPtr.Zero;
+
+            if (parent is Conformant)
+            {
+                surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
+            }
+            else if (parent is Naviframe)
+            {
+                surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
+            }
+            else if (parent is Layout)
+            {
+                surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
+            }
+
+            _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle, surface);
+            if (surface == IntPtr.Zero)
+            {
+                EvasObject p = parent;
+                while (!(p is Window))
+                {
+                    p = p.Parent;
+                }
+                var w = (p as Window).ScreenSize.Width;
+                var h = (p as Window).ScreenSize.Height;
+                Interop.Evas.evas_object_resize(_circleHandle, w, h);
+            }
+
+            Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs
new file mode 100644 (file)
index 0000000..7f75cc1
--- /dev/null
@@ -0,0 +1,89 @@
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace ElmSharp.Wearable
+{
+    public class MoreOption : Layout
+    {
+
+        public IList<MoreOptionItem> Items { get; private set; }
+
+        public event EventHandler<MoreOptionItemEventArgs> Selected;
+        public event EventHandler<MoreOptionItemEventArgs> Clicked;
+        public event EventHandler Opened;
+        public event EventHandler Closed;
+
+        SmartEvent<PointerEventArgs> _selectedEvent;
+        SmartEvent<PointerEventArgs> _clickedEvent;
+        SmartEvent _openedEvent;
+        SmartEvent _closedEvent;
+
+        public MoreOption(EvasObject parent) : base(parent)
+        {
+            Items = new MoreOptionList(this);
+
+            _selectedEvent = new SmartEvent<PointerEventArgs>(this, "item,selected", (d, o, info) => new PointerEventArgs { Pointer = info });
+            _clickedEvent = new SmartEvent<PointerEventArgs>(this, "item,clicked", (d, o, info) => new PointerEventArgs { Pointer = info });
+            _openedEvent = new SmartEvent(this, "more,option,opened");
+            _closedEvent = new SmartEvent(this, "more,option,closed");
+
+            _selectedEvent.On += (s, e) =>
+            {
+                MoreOptionItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer);
+                Selected?.Invoke(this, new MoreOptionItemEventArgs() { Item = selected });
+            };
+
+            _clickedEvent.On += (s, e) =>
+            {
+                MoreOptionItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer);
+                Clicked?.Invoke(this, new MoreOptionItemEventArgs() { Item = selected });
+            };
+
+            _openedEvent.On += (s, e) => Opened?.Invoke(this, EventArgs.Empty);
+            _closedEvent.On += (s, e) => Closed?.Invoke(this, EventArgs.Empty);
+
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Eext.eext_more_option_add(parent);
+        }
+
+        public MoreOptionDirection Direction
+        {
+            get
+            {
+                int dir = Interop.Eext.eext_more_option_direction_get(this);
+                return (MoreOptionDirection)dir;
+            }
+
+            set
+            {
+                Interop.Eext.eext_more_option_direction_set(this, (int)value);
+            }
+        }
+
+        public bool IsOpened
+        {
+            get
+            {
+                return Interop.Eext.eext_more_option_opened_get(this);
+            }
+
+            set
+            {
+                Interop.Eext.eext_more_option_opened_set(this, value);
+            }
+        }
+    }
+
+    public enum MoreOptionDirection
+    {
+        Top,
+        Bottom,
+        Left,
+        Right
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs
new file mode 100644 (file)
index 0000000..ad5bf58
--- /dev/null
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    public class MoreOptionItem
+    {
+        const string MainTextPartName = "selector,main_text";
+        const string SubTextPartName = "selector,sub_text";
+        const string IconPartName = "item,icon";
+
+        string _mainText;
+        string _subText;
+        Image _icon;
+        IntPtr _handle;
+
+        public IntPtr Handle
+        {
+            get
+            {
+                return _handle;
+            }
+            set
+            {
+                if (_handle == value) return;
+                _handle = value;
+                if (_mainText != null)
+                    Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText);
+                if (_subText != null)
+                    Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText);
+                if (_icon != null)
+                    Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon);
+            }
+        }
+
+        public MoreOptionItem()
+        {
+            _icon = null;
+        }
+
+        public string MainText
+        {
+            set
+            {
+                if (_mainText == value) return;
+                _mainText = value;
+                if (Handle != IntPtr.Zero)
+                {
+                    Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText);
+                }
+            }
+
+            get
+            {
+                return _mainText;
+            }
+        }
+
+        public string SubText
+        {
+            set
+            {
+                if (_subText == value) return;
+                _subText = value;
+                if (Handle != IntPtr.Zero)
+                {
+                    Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText);
+                }
+            }
+
+            get
+            {
+                return _subText;
+            }
+        }
+
+        public Image Icon
+        {
+            set
+            {
+                if (_icon == value) return;
+                _icon = value;
+                if (Handle != IntPtr.Zero)
+                {
+                    Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon);
+                }
+            }
+            get
+            {
+                return _icon;
+            }
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs
new file mode 100644 (file)
index 0000000..7bc9723
--- /dev/null
@@ -0,0 +1,10 @@
+
+using System;
+
+namespace ElmSharp.Wearable
+{
+    public class MoreOptionItemEventArgs : EventArgs
+    {
+        public MoreOptionItem Item { get; set; }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs
new file mode 100644 (file)
index 0000000..577bc8e
--- /dev/null
@@ -0,0 +1,121 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    class MoreOptionList : IList<MoreOptionItem>
+    {
+        MoreOption Owner { get; set; }
+
+        List<MoreOptionItem> Items { get; set; }
+
+        public int Count => Items.Count;
+
+        public bool IsReadOnly => false;
+
+        public MoreOptionItem this[int index]
+        {
+            get
+            {
+                return Items[index];
+            }
+
+            set
+            {
+                Items[index] = value;
+            }
+        }
+
+        public MoreOptionList(MoreOption owner)
+        {
+            Owner = owner;
+            Items = new List<MoreOptionItem>();
+        }
+
+        public void Add(MoreOptionItem item)
+        {
+            item.Handle = Interop.Eext.eext_more_option_item_append(Owner);
+            Items.Add(item);
+        }
+
+        public void AddFirst(MoreOptionItem item)
+        {
+            item.Handle = Interop.Eext.eext_more_option_item_prepend(Owner);
+            Items.Insert(0, item);
+        }
+
+        public void AddLast(MoreOptionItem item)
+        {
+            Add(item);
+        }
+
+        public int IndexOf(MoreOptionItem item)
+        {
+            return Items.IndexOf(item);
+        }
+
+        public void Insert(int index, MoreOptionItem item)
+        {
+            if (Items.Count < index + 1 || index < 0)
+                throw new ArgumentOutOfRangeException("index is not valid in the MoreOption");
+
+            MoreOptionItem target = Items[index];
+            item.Handle = Interop.Eext.eext_more_option_item_insert_after(Owner, target.Handle);
+            Items.Insert(index, item);
+        }
+
+        public void RemoveAt(int index)
+        {
+            if (Items.Count < index + 1 || index < 0)
+                throw new ArgumentOutOfRangeException("index is not valid in the MoreOptionList");
+
+            MoreOptionItem item = Items[index];
+            Interop.Eext.eext_more_option_item_del(item.Handle);
+            item.Handle = IntPtr.Zero;
+            Items.RemoveAt(index);
+        }
+
+        public void Clear()
+        {
+            Interop.Eext.eext_more_option_items_clear(Owner);
+            foreach (MoreOptionItem item in Items)
+            {
+                item.Handle = IntPtr.Zero;
+            }
+            Items.Clear();
+        }
+
+        public bool Contains(MoreOptionItem item)
+        {
+            return Items.Contains(item);
+        }
+
+        public void CopyTo(MoreOptionItem[] array, int arrayIndex)
+        {
+            Items.CopyTo(array, arrayIndex);
+        }
+
+        public bool Remove(MoreOptionItem item)
+        {
+            if (Items.Contains(item))
+            {
+                Interop.Eext.eext_more_option_item_del(item.Handle);
+                Items.Remove(item);
+                return true;
+            }
+            return false;
+        }
+
+        public IEnumerator<MoreOptionItem> GetEnumerator()
+        {
+            return Items.GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return Items.GetEnumerator();
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs
new file mode 100644 (file)
index 0000000..d746824
--- /dev/null
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    class PointerEventArgs : EventArgs
+    {
+        public IntPtr Pointer { get; set; }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs
new file mode 100644 (file)
index 0000000..eb0181c
--- /dev/null
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    public class RotarySelector : Layout
+    {
+        const string IconPartName = "selector,icon";
+        const string ContentPartName = "selector,content";
+        const string BgPartName = "selector,bg_image";
+
+        const string ItemSelectedEventName = "item,selected";
+        const string ItemClickedEventName = "item,clicked";
+
+        public event EventHandler<RotarySelectorItemEventArgs> Selected;
+        public event EventHandler<RotarySelectorItemEventArgs> Clicked;
+
+        SmartEvent<PointerEventArgs> _selectedEvent;
+        SmartEvent<PointerEventArgs> _clickedEvent;
+        Image _normalBgImage;
+
+        public IList<RotarySelectorItem> Items { get; private set; }
+
+        public RotarySelector(EvasObject parent) : base(parent)
+        {
+            Items = new RotarySelectorList(this);
+
+            _selectedEvent = new SmartEvent<PointerEventArgs>(this, "item,selected", (d, o, info) => new PointerEventArgs { Pointer = info });
+            _clickedEvent = new SmartEvent<PointerEventArgs>(this, "item,clicked", (d, o, info) => new PointerEventArgs { Pointer = info });
+            _selectedEvent.On += (s, e) =>
+            {
+                RotarySelectorItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer);
+                Selected?.Invoke(this, new RotarySelectorItemEventArgs { Item = selected });
+            };
+
+            _clickedEvent.On += (s, e) =>
+            {
+                RotarySelectorItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer);
+                Clicked?.Invoke(this, new RotarySelectorItemEventArgs { Item = selected });
+            };
+        }
+
+        public RotarySelectorItem SelectedItem
+        {
+            get
+            {
+                IntPtr selectedPtr = Interop.Eext.eext_rotary_selector_selected_item_get(this);
+                if (selectedPtr == IntPtr.Zero) return null;
+                RotarySelectorItem item = Items.FirstOrDefault(i => i.Handle == selectedPtr);
+                return item;
+            }
+
+            set
+            {
+                if (!Items.Contains(value)) return;
+                Interop.Eext.eext_rotary_selector_selected_item_set(this, value.Handle);
+            }
+        }
+
+        void setPart(ref Image prop, string partName, State state, Image img)
+        {
+            if (prop == img) return;
+            prop = img;
+            if (this != null)
+            {
+                Interop.Eext.eext_rotary_selector_part_content_set(this, partName, (int)state, prop);
+            }
+        }
+        void setPart(ref Color prop, string partName, State state, Color color)
+        {
+            if (prop == color) return;
+            if (this != null)
+            {
+                Interop.Eext.eext_rotary_selector_part_color_set(this, partName, (int)state, color.R, color.G, color.B, color.A);
+            }
+        }
+
+        public Image BackgroundImage { set => setPart(ref _normalBgImage, BgPartName, State.Normal, value); get => _normalBgImage; }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr ptr = Interop.Eext.eext_rotary_selector_add(parent);
+            Interop.Eext.eext_rotary_object_event_activated_set(ptr, true);
+            return ptr;
+        }
+
+        internal enum State
+        {
+            Normal,
+            Pressed
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs
new file mode 100644 (file)
index 0000000..d6abba8
--- /dev/null
@@ -0,0 +1,163 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    public class RotarySelectorItem
+    {
+        const string MainTextPartName = "selector,main_text";
+        const string SubTextPartName = "selector,sub_text";
+        const string IconPartName = "item,icon";
+        const string BgPartName = "item,bg_image";
+        const string SelectorIconPartName = "selector,icon";
+
+        string _mainText;
+        string _subText;
+
+        Color _mainTextColor;
+        Color _subTextColor;
+
+        Image _normalIconImage;
+        Image _pressedIconImage;
+        Image _disabledIconImage;
+        Image _selectedIconImage;
+
+        Image _normalBgImage;
+        Image _pressedBgImage;
+        Image _disabledBgImage;
+        Image _selectedBgImage;
+
+        Color _normalBgColor;
+        Color _pressedBgColor;
+        Color _disabledBgColor;
+        Color _selectedBgColor;
+
+        Image _selectorIconImage;
+
+        IntPtr _handle;
+
+        public IntPtr Handle
+        {
+            set
+            {
+                if (_handle == value) return;
+                _handle = value;
+
+                if (_handle == null) return;
+
+                setPart(ref _mainText, MainTextPartName);
+                setPart(ref _subText, SubTextPartName);
+                setPart(ref _mainTextColor, MainTextPartName, ItemState.Normal);
+                setPart(ref _subTextColor, SubTextPartName, ItemState.Normal);
+
+                setPart(ref _normalIconImage, IconPartName, ItemState.Normal);
+                setPart(ref _pressedIconImage, IconPartName, ItemState.Pressed);
+                setPart(ref _disabledIconImage, IconPartName, ItemState.Disabled);
+                setPart(ref _selectedIconImage, IconPartName, ItemState.Selected);
+
+                setPart(ref _normalBgImage, BgPartName, ItemState.Normal);
+                setPart(ref _pressedBgImage, BgPartName, ItemState.Pressed);
+                setPart(ref _disabledBgImage, BgPartName, ItemState.Disabled);
+                setPart(ref _selectedBgImage, BgPartName, ItemState.Selected);
+
+                setPart(ref _normalBgColor, BgPartName, ItemState.Normal);
+                setPart(ref _pressedBgColor, BgPartName, ItemState.Pressed);
+                setPart(ref _disabledBgColor, BgPartName, ItemState.Disabled);
+                setPart(ref _selectedBgColor, BgPartName, ItemState.Selected);
+
+                setPart(ref _selectorIconImage, SelectorIconPartName, ItemState.Normal);
+            }
+
+            get
+            {
+                return _handle;
+            }
+        }
+
+        void setPart(ref Image prop, string partName, ItemState state)
+        {
+            if (prop != null)
+            {
+                Interop.Eext.eext_rotary_selector_item_part_content_set(Handle, partName, (int)state, prop);
+            }
+        }
+        void setPart(ref Color prop, string partName, ItemState state)
+        {
+            if (prop != default(Color))
+            {
+                Interop.Eext.eext_rotary_selector_item_part_color_set(Handle, partName, (int)state, prop.R, prop.G, prop.B, prop.A);
+            }
+        }
+
+        void setPart(ref string prop, string partName)
+        {
+            if (prop != null)
+            {
+                Interop.Eext.eext_rotary_selector_item_part_text_set(Handle, partName, prop);
+            }
+        }
+
+        void setPart(ref Image prop, string partName, ItemState state, Image img)
+        {
+            if (prop == img) return;
+            prop = img;
+            if (Handle != null)
+            {
+                Interop.Eext.eext_rotary_selector_item_part_content_set(Handle, partName, (int)state, img);
+            }
+        }
+
+        void setPart(ref Color prop, string partName, ItemState state, Color color)
+        {
+            if (prop == color) return;
+            prop = color;
+            if (Handle != null)
+            {
+                Interop.Eext.eext_rotary_selector_item_part_color_set(Handle, partName, (int)state, color.R, color.G, color.B, color.A);
+            }
+        }
+
+        void setPart(ref string prop, string partName, string txt)
+        {
+            if (prop == txt) return;
+            prop = txt;
+            if (Handle != null)
+            {
+                Interop.Eext.eext_rotary_selector_item_part_text_set(Handle, partName, txt);
+            }
+        }
+
+        public string MainText { set => setPart(ref _mainText, MainTextPartName, value); get => _mainText; }
+        public string SubText { set => setPart(ref _subText, SubTextPartName, value); get => _subText; }
+
+        public Color MainTextColor { set => setPart(ref _mainTextColor, MainTextPartName, ItemState.Normal, value); get => _mainTextColor; }
+        public Color SubextColor { set => setPart(ref _subTextColor, SubTextPartName, ItemState.Normal, value); get => _subTextColor; }
+
+        public Image NormalIconImage { set => setPart(ref _normalIconImage, IconPartName, ItemState.Normal, value); get => _normalIconImage; }
+        public Image PressedIconImage { set => setPart(ref _pressedIconImage, IconPartName, ItemState.Pressed, value); get => _pressedIconImage; }
+        public Image DisabledIconImage { set => setPart(ref _disabledIconImage, IconPartName, ItemState.Disabled, value); get => _disabledIconImage; }
+        public Image SelectedIconImage { set => setPart(ref _selectedIconImage, IconPartName, ItemState.Selected, value); get => _selectedIconImage; }
+
+
+        public Image NormalBackgroundImage { set => setPart(ref _normalBgImage, BgPartName, ItemState.Normal, value); get => _normalBgImage; }
+        public Image PressedBackgroundImage { set => setPart(ref _pressedBgImage, BgPartName, ItemState.Pressed, value); get => _pressedBgImage; }
+        public Image DisabledBackgroundImage { set => setPart(ref _disabledBgImage, BgPartName, ItemState.Disabled, value); get => _disabledBgImage; }
+        public Image SelectedBackgroundImage { set => setPart(ref _selectedBgImage, BgPartName, ItemState.Selected, value); get => _selectedBgImage; }
+
+        public Color NormalBackgroundColor { set => setPart(ref _normalBgColor, BgPartName, ItemState.Normal, value); get => _normalBgColor; }
+        public Color PressedBackgroundColor { set => setPart(ref _pressedBgColor, BgPartName, ItemState.Pressed, value); get => _pressedBgColor; }
+        public Color DisabledBackgroundColor { set => setPart(ref _disabledBgColor, BgPartName, ItemState.Disabled, value); get => _disabledBgColor; }
+        public Color SelectedBackgroundColor { set => setPart(ref _selectedBgColor, BgPartName, ItemState.Selected, value); get => _selectedBgColor; }
+
+        public Image SelectorIconImage { set => setPart(ref _selectorIconImage, SelectorIconPartName, ItemState.Normal, value); get => _selectorIconImage; }
+
+        internal enum ItemState
+        {
+            Normal,
+            Pressed,
+            Disabled,
+            Selected
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs
new file mode 100644 (file)
index 0000000..401be2f
--- /dev/null
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    public class RotarySelectorItemEventArgs : EventArgs
+    {
+        public RotarySelectorItem Item { get; set; }
+    }
+}
diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs
new file mode 100644 (file)
index 0000000..2f73984
--- /dev/null
@@ -0,0 +1,96 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+    class RotarySelectorList : IList<RotarySelectorItem>
+    {
+        RotarySelector _owner;
+        List<RotarySelectorItem> Items { get; set; }
+
+        public RotarySelectorList(RotarySelector owner)
+        {
+            this._owner = owner;
+            Items = new List<RotarySelectorItem>();
+        }
+
+        public RotarySelectorItem this[int index] { get => Items[index]; set => Items[index] = value; }
+
+        public int Count => Items.Count;
+
+        public bool IsReadOnly => false;
+
+        public void Add(RotarySelectorItem item)
+        {
+            item.Handle = Interop.Eext.eext_rotary_selector_item_append(_owner);
+            Items.Add(item);
+        }
+
+        public void Clear()
+        {
+            Interop.Eext.eext_rotary_selector_items_clear(_owner);
+        }
+
+        public bool Contains(RotarySelectorItem item)
+        {
+            return Items.Contains(item);
+        }
+
+        public void CopyTo(RotarySelectorItem[] array, int arrayIndex)
+        {
+            Items.CopyTo(array, arrayIndex);
+        }
+
+        public IEnumerator<RotarySelectorItem> GetEnumerator()
+        {
+            return Items.GetEnumerator();
+        }
+
+        public int IndexOf(RotarySelectorItem item)
+        {
+            return Items.IndexOf(item);
+        }
+
+        public void Insert(int index, RotarySelectorItem item)
+        {
+            if (Items.Count <= index || index < 0)
+            {
+                throw new ArgumentOutOfRangeException("index is not valid in the RotarySelector");
+            }
+            RotarySelectorItem target = Items[index];
+            item.Handle = Interop.Eext.eext_rotary_selector_item_insert_after(_owner, target.Handle);
+            Items.Insert(index, item);
+        }
+
+        public bool Remove(RotarySelectorItem item)
+        {
+            if (Items.Contains(item))
+            {
+                Interop.Eext.eext_rotary_selector_item_del(item.Handle);
+                Items.Remove(item);
+                return true;
+            }
+            return false;
+        }
+
+        public void RemoveAt(int index)
+        {
+            if (Items.Count < index + 1 || index < 0)
+            {
+                throw new ArgumentOutOfRangeException("index is not valid in the RotarySelector");
+            }
+
+            RotarySelectorItem target = Items[index];
+            Interop.Eext.eext_rotary_selector_item_del(target.Handle);
+            target.Handle = IntPtr.Zero;
+            Items.RemoveAt(index);
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return Items.GetEnumerator();
+        }
+    }
+}
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs
new file mode 100644 (file)
index 0000000..4bbd8d9
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_datetime_add(IntPtr datetime, IntPtr surface);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs
new file mode 100644 (file)
index 0000000..b3581ca
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_genlist_add(IntPtr genlist, IntPtr surface);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_genlist_scroller_policy_set(IntPtr circleGenlist, int policyHorisontal, int policyVertical);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, out int policyHorisontal, out int policyVertical);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, out int policyHorisontal, IntPtr policyVertical);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, IntPtr policyHorisontal, out int policyVertical);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs
new file mode 100644 (file)
index 0000000..e1940f6
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_add(IntPtr obj, IntPtr surface);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_circle_object_disabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_line_width_set(IntPtr obj, int lineWidth);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern int eext_circle_object_line_width_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_angle_set(IntPtr obj, double angle);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_angle_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_angle_offset_set(IntPtr obj, double offset);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_angle_offset_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_angle_min_max_set(IntPtr obj, double min, double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_angle_min_max_get(IntPtr obj, out double min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_value_min_max_set(IntPtr obj, double min, double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_value_min_max_get(IntPtr obj, out double min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_value_set(IntPtr obj, double value);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_radius_set(IntPtr obj, double radius);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_radius_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_line_width_set(IntPtr obj, string item, int lineWidth);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern int eext_circle_object_item_line_width_get(IntPtr obj, string item);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_set(IntPtr obj, string item, double angle);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_item_angle_get(IntPtr obj, string item);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_offset_set(IntPtr obj, string item, double offset);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_item_angle_offset_get(IntPtr obj, string item);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_min_max_set(IntPtr obj, string item, double min, double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, out double min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, out double min, IntPtr max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, IntPtr min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_value_min_max_set(IntPtr obj, string item, double min, double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, out double min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, out double min, IntPtr max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, IntPtr min, out double max);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_value_set(IntPtr obj, string item, double value);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_item_value_get(IntPtr obj, string item);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_color_set(IntPtr obj, string item, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_color_get(IntPtr obj, string item, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_item_radius_set(IntPtr obj, string item, double radius);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_item_radius_get(IntPtr obj, string item);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs
new file mode 100644 (file)
index 0000000..8c60209
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_progressbar_add(IntPtr parent, IntPtr surface);
+
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs
new file mode 100644 (file)
index 0000000..2502100
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_scroller_add(IntPtr scroller, IntPtr surface);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_scroller_policy_set(IntPtr obj, int policy_h, int policy_v);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, IntPtr policy_h, IntPtr policy_v);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, out int policy_h, IntPtr policy_v);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, IntPtr policy_h, out int policy_v);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs
new file mode 100644 (file)
index 0000000..d2eeef3
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_slider_add(IntPtr parent, IntPtr surface);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_circle_object_slider_step_set(IntPtr obj, double value);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern double eext_circle_object_slider_step_get(IntPtr obj);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs
new file mode 100644 (file)
index 0000000..eb221eb
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_spinner_add(IntPtr spinner, IntPtr surface);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_object_spinner_angle_set(IntPtr spinner, double angle);
+
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs
new file mode 100644 (file)
index 0000000..4b5f820
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_surface_conformant_add(IntPtr conformant);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_surface_layout_add(IntPtr layout);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_surface_naviframe_add(IntPtr naviframe);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_circle_surface_del(IntPtr surface);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs
new file mode 100644 (file)
index 0000000..95b1de8
--- /dev/null
@@ -0,0 +1,65 @@
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_add(IntPtr parent);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_direction_set(IntPtr obj, int direction);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern int eext_more_option_direction_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_item_append(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_item_del(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_item_domain_translatable_part_text_set(IntPtr item, string part_name, string domain, string text);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_item_insert_after(IntPtr obj, IntPtr after);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_item_insert_before(IntPtr obj, IntPtr before);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_item_part_content_get(IntPtr obj, string part_name);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_item_part_content_set(IntPtr item, string part_name, IntPtr content);
+
+        [DllImport(Libraries.Eext, EntryPoint = "eext_more_option_item_part_text_get")]
+        static extern IntPtr _eext_more_option_item_part_text_get(IntPtr item, string part_name);
+
+        internal static string eext_more_option_item_part_text_get(IntPtr item, string part_name)
+        {
+            var ptr = _eext_more_option_item_part_text_get(item, part_name);
+            return Marshal.PtrToStringAnsi(ptr);
+        }
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_item_part_text_set(IntPtr item, string part_name, string text);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_item_prepend(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_items_clear(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_more_option_items_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_more_option_opened_get(IntPtr obj);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_more_option_opened_set(IntPtr obj, bool opened);
+    }
+}
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs
new file mode 100644 (file)
index 0000000..5348d39
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_object_event_activated_set(IntPtr circleObject, bool activated);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs
new file mode 100644 (file)
index 0000000..457cfbb
--- /dev/null
@@ -0,0 +1,51 @@
+using System;
+using System.Runtime.InteropServices;
+
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_add(IntPtr parent);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_item_append(IntPtr obj);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_item_prepend(IntPtr obj);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_item_insert_after(IntPtr obj, IntPtr after);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_item_insert_before(IntPtr obj, IntPtr before);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_del(IntPtr item);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_items_clear(IntPtr obj);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_part_text_set(IntPtr item, string part_name, string text);
+        [DllImport(Libraries.Eext)]
+        internal static extern string eext_rotary_selector_item_part_text_get(IntPtr item, string part_name);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_domain_translatable_part_text_set(IntPtr item, string part_name, string domain, string text);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_part_content_set(IntPtr item, string part_name, int state, IntPtr content);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_item_part_content_get(IntPtr item, string part_name, int state);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_part_content_set(IntPtr obj, string part_name, int state, IntPtr content);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_part_content_get(IntPtr obj, string part_name, int state);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_part_color_set(IntPtr item, string part_name, int state, int r, int g, int b, int a);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_item_part_color_get(IntPtr item, string part_name, int state, out int r, out int g, out int b, out int a);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_part_color_set(IntPtr obj, string part_name, int state, int r, int g, int b, int a);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_part_color_get(IntPtr obj, string part_name, int state, out int r, out int g, out int b, out int a);
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_rotary_selector_selected_item_set(IntPtr obj, IntPtr item);
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_rotary_selector_selected_item_get(IntPtr obj);
+
+    }
+}
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Evas.cs b/src/ElmSharp.Wearable/Interop/Interop.Evas.cs
new file mode 100644 (file)
index 0000000..dbe48e8
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Evas
+    {
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_resize(IntPtr obj, int w, int h);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp.Wearable/Interop/Interop.Libraries.cs b/src/ElmSharp.Wearable/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..3668358
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static class Libraries
+    {
+        internal const string Elementary = "libelementary.so.1";
+        internal const string Eext = "libefl-extension.so.0";
+        internal const string Evas = "libevas.so.1";
+    }
+}
diff --git a/src/ElmSharp/ElmSharp.csproj b/src/ElmSharp/ElmSharp.csproj
new file mode 100644 (file)
index 0000000..3016921
--- /dev/null
@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.2.3</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>
+      ElmSharp is the top-most library based on the Tizen Native UI Framwork (EFL).
+      It provides a variety of pre-built UI components, such as layout objects and widgets,
+      that allow you to build rich graphical user interfaces.
+      This is in the beta stage and will be refined based on developer feedback.
+      Backward compatibility issues may be raised when updating the platform version.
+    </Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+</Project>
diff --git a/src/ElmSharp/ElmSharp.snk b/src/ElmSharp/ElmSharp.snk
new file mode 100644 (file)
index 0000000..0420708
Binary files /dev/null and b/src/ElmSharp/ElmSharp.snk differ
diff --git a/src/ElmSharp/ElmSharp/AccessRole.cs b/src/ElmSharp/ElmSharp/AccessRole.cs
new file mode 100755 (executable)
index 0000000..b49b2a2
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// Enumeration for AccessRole.
+    /// </summary>
+    public enum AccessRole
+    {
+        /// <summary>
+        /// Invalid
+        /// </summary>
+        Invalid,
+        /// <summary>
+        /// AcceleratorLabel role
+        /// </summary>
+        AcceleratorLabel,
+        /// <summary>
+        /// Alert role
+        /// </summary>
+        Alert,
+        /// <summary>
+        /// Animation role
+        /// </summary>
+        Animation,
+        /// <summary>
+        /// Arrow role
+        /// </summary>
+        Arrow,
+        /// <summary>
+        /// Calendar role
+        /// </summary>
+        Calendar,
+        /// <summary>
+        /// Canvas role
+        /// </summary>
+        Canvas,
+        /// <summary>
+        /// CheckBox role
+        /// </summary>
+        CheckBox,
+        /// <summary>
+        /// CheckMenuItem role
+        /// </summary>
+        CheckMenuItem,
+        /// <summary>
+        /// ColorChooser role
+        /// </summary>
+        ColorChooser,
+        /// <summary>
+        /// ColumnHeader role
+        /// </summary>
+        ColumnHeader,
+        /// <summary>
+        /// ComboBox role
+        /// </summary>
+        ComboBox,
+        /// <summary>
+        /// DateEditor role
+        /// </summary>
+        DateEditor,
+        /// <summary>
+        /// DesktopIcon role
+        /// </summary>
+        DesktopIcon,
+        /// <summary>
+        /// DesktopFrame role
+        /// </summary>
+        DesktopFrame,
+        /// <summary>
+        /// Dial role
+        /// </summary>
+        Dial,
+        /// <summary>
+        /// Dialog role
+        /// </summary>
+        Dialog,
+        /// <summary>
+        /// DirectoryPane role
+        /// </summary>
+        DirectoryPane,
+        /// <summary>
+        /// DrawingArea role
+        /// </summary>
+        DrawingArea,
+        /// <summary>
+        /// FileChooser role
+        /// </summary>
+        FileChooser,
+        /// <summary>
+        /// Filler role
+        /// </summary>
+        Filler,
+        /// <summary>
+        /// FocusTraversable role
+        /// </summary>
+        FocusTraversable,
+        /// <summary>
+        /// FontChooser role
+        /// </summary>
+        FontChooser,
+        /// <summary>
+        /// Frame role
+        /// </summary>
+        Frame,
+        /// <summary>
+        /// GlassPane role
+        /// </summary>
+        GlassPane,
+        /// <summary>
+        /// HtmlContainer role
+        /// </summary>
+        HtmlContainer,
+        /// <summary>
+        /// Icon role
+        /// </summary>
+        Icon,
+        /// <summary>
+        /// Image role
+        /// </summary>
+        Image,
+        /// <summary>
+        /// InternalFrame role
+        /// </summary>
+        InternalFrame,
+        /// <summary>
+        /// Label role
+        /// </summary>
+        Label,
+        /// <summary>
+        /// LayeredPane role
+        /// </summary>
+        LayeredPane,
+        /// <summary>
+        /// List role
+        /// </summary>
+        List,
+        /// <summary>
+        /// ListItem role
+        /// </summary>
+        ListItem,
+        /// <summary>
+        /// Menu role
+        /// </summary>
+        Menu,
+        /// <summary>
+        /// MenuBar role
+        /// </summary>
+        MenuBar,
+        /// <summary>
+        /// MenuItem role
+        /// </summary>
+        MenuItem,
+        /// <summary>
+        /// OptionPane role
+        /// </summary>
+        OptionPane,
+        /// <summary>
+        /// PageTab role
+        /// </summary>
+        PageTab,
+        /// <summary>
+        /// PageTabList role
+        /// </summary>
+        PageTabList,
+        /// <summary>
+        /// Panel role
+        /// </summary>
+        Panel,
+        /// <summary>
+        /// PasswordText role
+        /// </summary>
+        PasswordText,
+        /// <summary>
+        /// PopupMenu role
+        /// </summary>
+        PopupMenu,
+        /// <summary>
+        /// ProgressBar role
+        /// </summary>
+        ProgressBar,
+        /// <summary>
+        /// PushButton role
+        /// </summary>
+        PushButton,
+        /// <summary>
+        /// RadioButton role
+        /// </summary>
+        RadioButton,
+        /// <summary>
+        /// RadioMenuItem role
+        /// </summary>
+        RadioMenuItem,
+        /// <summary>
+        /// RootPane role
+        /// </summary>
+        RootPane,
+        /// <summary>
+        /// RowHeader role
+        /// </summary>
+        RowHeader,
+        /// <summary>
+        /// ScrollBar role
+        /// </summary>
+        ScrollBar,
+        /// <summary>
+        /// ScrollPane role
+        /// </summary>
+        ScrollPane,
+        /// <summary>
+        /// Separator role
+        /// </summary>
+        Separator,
+        /// <summary>
+        /// Slider role
+        /// </summary>
+        Slider,
+        /// <summary>
+        /// SpinButton role
+        /// </summary>
+        SpinButton,
+        /// <summary>
+        /// SplitPane role
+        /// </summary>
+        SplitPane,
+        /// <summary>
+        /// StatusBar role
+        /// </summary>
+        StatusBar,
+        /// <summary>
+        /// Table role
+        /// </summary>
+        Table,
+        /// <summary>
+        /// TableCell role
+        /// </summary>
+        TableCell,
+        /// <summary>
+        /// TableColumnHeader role
+        /// </summary>
+        TableColumnHeader,
+        /// <summary>
+        /// TableRowHeader role
+        /// </summary>
+        TableRowHeader,
+        /// <summary>
+        /// TearoffMenuItem role
+        /// </summary>
+        TearoffMenuItem,
+        /// <summary>
+        /// Terminal role
+        /// </summary>
+        Terminal,
+        /// <summary>
+        /// Text role
+        /// </summary>
+        Text,
+        /// <summary>
+        /// ToggleButton role
+        /// </summary>
+        ToggleButton,
+        /// <summary>
+        /// ToolBar role
+        /// </summary>
+        ToolBar,
+        /// <summary>
+        /// ToolTip role
+        /// </summary>
+        ToolTip,
+        /// <summary>
+        /// Tree role
+        /// </summary>
+        Tree,
+        /// <summary>
+        /// TreeTable role
+        /// </summary>
+        TreeTable,
+        /// <summary>
+        /// Unknown
+        /// </summary>
+        Unknown,
+        /// <summary>
+        /// Viewport role
+        /// </summary>
+        Viewport,
+        /// <summary>
+        /// Window role
+        /// </summary>
+        Window,
+        /// <summary>
+        /// Extended role
+        /// </summary>
+        Extended,
+        /// <summary>
+        /// Header role
+        /// </summary>
+        Header,
+        /// <summary>
+        /// Footer role
+        /// </summary>
+        Footer,
+        /// <summary>
+        /// Paragraph
+        /// </summary>
+        Paragraph,
+        /// <summary>
+        /// Ruler role
+        /// </summary>
+        Ruler,
+        /// <summary>
+        /// Application role
+        /// </summary>
+        Application,
+        /// <summary>
+        /// Autocomplete role
+        /// </summary>
+        Autocomplete,
+        /// <summary>
+        /// Editbar role
+        /// </summary>
+        Editbar,
+        /// <summary>
+        /// Embedded role
+        /// </summary>
+        Embedded,
+        /// <summary>
+        /// Entry role
+        /// </summary>
+        Entry,
+        /// <summary>
+        /// Chart role
+        /// </summary>
+        Chart,
+        /// <summary>
+        /// Caption role
+        /// </summary>
+        Caption,
+        /// <summary>
+        /// DocumentFrame role
+        /// </summary>
+        DocumentFrame,
+        /// <summary>
+        /// Heading role
+        /// </summary>
+        Heading,
+        /// <summary>
+        /// Page role
+        /// </summary>
+        Page,
+        /// <summary>
+        /// Section role
+        /// </summary>
+        Section,
+        /// <summary>
+        /// RedundantObject role
+        /// </summary>
+        RedundantObject,
+        /// <summary>
+        /// Form role
+        /// </summary>
+        Form,
+        /// <summary>
+        /// Link role
+        /// </summary>
+        Link,
+        /// <summary>
+        /// InputMethodWindow role
+        /// </summary>
+        InputMethodWindow,
+        /// <summary>
+        /// TableRow role
+        /// </summary>
+        TableRow,
+        /// <summary>
+        /// TreeItem role
+        /// </summary>
+        TreeItem,
+        /// <summary>
+        /// DocumentSpreadsheet role
+        /// </summary>
+        DocumentSpreadsheet,
+        /// <summary>
+        /// DocumentPresentation role
+        /// </summary>
+        DocumentPresentation,
+        /// <summary>
+        /// DocumentText role
+        /// </summary>
+        DocumentText,
+        /// <summary>
+        /// DocumentWeb role
+        /// </summary>
+        DocumentWeb,
+        /// <summary>
+        /// DocumentEmail role
+        /// </summary>
+        DocumentEmail,
+        /// <summary>
+        /// Comment role
+        /// </summary>
+        Comment,
+        /// <summary>
+        /// ListBox role
+        /// </summary>
+        ListBox,
+        /// <summary>
+        /// Grouping role
+        /// </summary>
+        Grouping,
+        /// <summary>
+        /// ImageMap role
+        /// </summary>
+        ImageMap,
+        /// <summary>
+        /// Notification role
+        /// </summary>
+        Notification,
+        /// <summary>
+        /// InfoBar role
+        /// </summary>
+        InfoBar
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/AccessibleObject.cs b/src/ElmSharp/ElmSharp/AccessibleObject.cs
new file mode 100755 (executable)
index 0000000..08eedcb
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// The delegate to define how to provide informations for <see cref="IAccessibleObject.Name"/> or <see cref="IAccessibleObject.Description"/>.
+    /// </summary>
+    /// <param name="obj">The sender obj.</param>
+    /// <returns>Return information for Name or Description.</returns>
+    public delegate string AccessibleInfoProvider (AccessibleObject obj);
+
+    /// <summary>
+    /// It's a base abstract class for <see cref="Widget"/>.
+    /// It provides available definitions for the screen reader, such as <see cref="IAccessibleObject.Name"/>, <see cref="IAccessibleObject.Description"/>, <see cref="IAccessibleObject.ReadingInfoType"/>, etc.
+    /// There's many the relationship between two accessible objects, like <see cref="ChildOf"/>, <see cref="ParentOf"/>, <see cref="FlowsTo"/>, <see cref="FlowsFrom"/>, etc.
+    /// </summary>
+    public abstract class AccessibleObject : EvasObject, IAccessibleObject
+    {
+
+        AccessibleInfoProvider _nameProvider;
+        AccessibleInfoProvider _descriptionProvider;
+
+        Interop.Elementary.Elm_Atspi_Reading_Info_Cb _nameProviderInternal;
+        Interop.Elementary.Elm_Atspi_Reading_Info_Cb _descriptionProviderInternal;
+
+        /// <summary>
+        /// Gets or sets the reading information types of an accessible object.
+        /// </summary>
+        ReadingInfoType IAccessibleObject.ReadingInfoType
+        {
+            get
+            {
+                return (ReadingInfoType)Interop.Elementary.elm_atspi_accessible_reading_info_type_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_reading_info_type_set(RealHandle,
+                        (Interop.Elementary.Elm_Accessible_Reading_Info_Type)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the role of the object in accessibility domain.
+        /// </summary>
+        AccessRole IAccessibleObject.Role
+        {
+            get
+            {
+                return (AccessRole)Interop.Elementary.elm_atspi_accessible_role_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_role_set(RealHandle,
+                        (Interop.Elementary.Elm_Atspi_Role)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets highlightable of given widget.
+        /// </summary>
+        bool IAccessibleObject.CanHighlight
+        {
+            get
+            {
+                return Interop.Elementary.elm_atspi_accessible_can_highlight_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_can_highlight_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the translation domain of "name" and "description" properties.
+        /// Translation domain should be set if application wants to support i18n for accessibily "name" and "description" properties.
+        /// When translation domain is set values of "name" and "description" properties will be translated with dgettext function using current translation domain as "domainname" parameter.
+        /// It is application developer responsibility to ensure that translation files are loaded and binded to translation domain when accessibility is enabled.
+        /// </summary>
+        string IAccessibleObject.TranslationDomain
+        {
+            get
+            {
+                return Interop.Elementary.elm_atspi_accessible_translation_domain_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_translation_domain_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets an accessible name of the object.
+        /// </summary>
+        string IAccessibleObject.Name
+        {
+            get
+            {
+                return Interop.Elementary.elm_atspi_accessible_name_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_name_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets contextual information about object.
+        /// </summary>
+        string IAccessibleObject.Description
+        {
+            get
+            {
+                return Interop.Elementary.elm_atspi_accessible_description_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_atspi_accessible_description_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the delegate for <see cref="IAccessibleObject.Name"/>.
+        /// </summary>
+        AccessibleInfoProvider IAccessibleObject.NameProvider
+        {
+            get
+            {
+                return _nameProvider;
+            }
+
+            set
+            {
+                if (_nameProviderInternal == null)
+                {
+                    _nameProviderInternal = (data, obj) => _nameProvider(this);
+                }
+                if (value == null)
+                {
+                    _nameProvider = null;
+                    Interop.Elementary.elm_atspi_accessible_name_cb_set(RealHandle, null, IntPtr.Zero);
+                }
+                else
+                {
+                    _nameProvider = new AccessibleInfoProvider(value);
+                    Interop.Elementary.elm_atspi_accessible_name_cb_set(RealHandle, _nameProviderInternal, IntPtr.Zero);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the delegate for <see cref = "IAccessibleObject.Description" />.
+        /// </summary>
+        AccessibleInfoProvider IAccessibleObject.DescriptionProvider
+        {
+            get
+            {
+                return _descriptionProvider;
+            }
+
+            set
+            {
+                if (_descriptionProviderInternal == null)
+                {
+                    _descriptionProviderInternal = (data, obj) => _descriptionProvider(this);
+                }
+                if (value == null)
+                {
+                    _descriptionProvider = null;
+                    Interop.Elementary.elm_atspi_accessible_description_cb_set(RealHandle, null, IntPtr.Zero);
+                }
+                else
+                {
+                    _descriptionProvider = new AccessibleInfoProvider(value);
+                    Interop.Elementary.elm_atspi_accessible_description_cb_set(RealHandle, _descriptionProviderInternal, IntPtr.Zero);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the AccessibleObject class with parent EvasObject class parameter.
+        /// </summary>
+        /// <param name="parent">Parent EvasObject class </param>
+        public AccessibleObject(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the AccessibleObject class.
+        /// </summary>
+        public AccessibleObject() : base()
+        {
+        }
+
+        /// <summary>
+        /// Defines the relationship between two accessible objects.
+        /// Relationships can be queried by Assistive Technology clients to provide customized feedback, improving overall user experience.
+        /// AppendRelation API is asymmetric, which means that appending, for example, relation <see cref="FlowsTo"/> from object A to B, do not append relation <see cref="FlowsFrom"/> from object B to object A.
+        /// </summary>
+        /// <param name="relation">The relationship between source object and target object of a given type.</param>
+        void IAccessibleObject.AppendRelation(IAccessibleRelation relation)
+        {
+            if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null");
+            Interop.Elementary.elm_atspi_accessible_relationship_append(RealHandle, relation.Type, relation.Target.Handle);
+        }
+
+        /// <summary>
+        /// Removes the relationship between two accessible objects.
+        /// </summary>
+        /// <param name="relation">The relationship between source object and target object of a given type.</param>
+        void IAccessibleObject.RemoveRelation(IAccessibleRelation relation)
+        {
+            if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null");
+            Interop.Elementary.elm_atspi_accessible_relationship_remove(RealHandle, relation.Type, relation.Target.Handle);
+        }
+
+        /// <summary>
+        /// Highlights accessible widget.
+        /// </summary>
+        public void Highlight()
+        {
+            Interop.Elementary.elm_atspi_component_highlight_grab(RealHandle);
+        }
+
+        /// <summary>
+        /// Clears highlight of accessible widget.
+        /// </summary>
+        public void Unhighlight()
+        {
+            Interop.Elementary.elm_atspi_component_highlight_clear(RealHandle);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/AccessibleRelation.cs b/src/ElmSharp/ElmSharp/AccessibleRelation.cs
new file mode 100755 (executable)
index 0000000..4d24e98
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// IAccessibleRelation is a interface which defines the relationship between two accessible objects.
+    /// </summary>
+    public interface IAccessibleRelation
+    {
+
+        AccessibleObject Target { get; set; }
+        int Type { get; }
+    }
+
+    /// <summary>
+    /// To define label info for accessible object.
+    /// </summary>
+    public class LabelledBy : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is LabelledBy.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the LabelledBy type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABELLED_BY; }
+        }
+    }
+
+    /// <summary>
+    /// To define label info for accessible object.
+    /// </summary>
+    public class LabelFor : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is LabelFor.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the LabelFor type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABEL_FOR; }
+        }
+    }
+
+    /// <summary>
+    /// To define control relationship for accessible object.
+    /// </summary>
+    public class ControllerFor : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is ControllerFor.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the ControllerFor type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLER_FOR; }
+        }
+    }
+
+    /// <summary>
+    /// To define control relationship for accessible object.
+    /// </summary>
+    public class ControlledBy : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is ControlledBy.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the ControlledBy type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLED_BY; }
+        }
+    }
+
+    /// <summary>
+    /// To define member relationship for accessible object.
+    /// </summary>
+    public class MemberOf : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is MemberOf.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the MemberOf type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_MEMBER_OF; }
+        }
+    }
+
+    /// <summary>
+    /// To define tooltip for accessible object.
+    /// </summary>
+    public class TooltipFor : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is TooltipFor.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the TooltipFor type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_TOOLTIP_FOR; }
+        }
+    }
+
+    /// <summary>
+    /// To define child for accessible object.
+    /// </summary>
+    public class ChildOf : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is ChildOf.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the ChildOf type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_CHILD_OF; }
+        }
+    }
+
+    /// <summary>
+    /// To define parent for accessible object.
+    /// </summary>
+    public class ParentOf : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is ParentOf.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the ParentOf type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_PARENT_OF; }
+        }
+    }
+
+    /// <summary>
+    /// To define extend for accessible object.
+    /// </summary>
+    public class Extended : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is Extended.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the Extended type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EXTENDED; }
+        }
+    }
+
+    /// <summary>
+    /// To define the custom reading order.
+    /// </summary>
+    public class FlowsTo : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is FlowsTo.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the FlowsTo type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_TO; }
+        }
+    }
+
+    /// <summary>
+    /// To define the custom reading order.
+    /// </summary>
+    public class FlowsFrom : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is FlowsFrom.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the FlowsFrom type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_FROM; }
+        }
+    }
+
+    /// <summary>
+    /// To define subwindow for accessible object.
+    /// </summary>
+    public class SubwindowOf : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is SubwindowOf.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the SubwindowOf type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_SUBWINDOW_OF; }
+        }
+    }
+
+    /// <summary>
+    /// To define embed for accessible object.
+    /// </summary>
+    public class Embeds : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is Embeds.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the Embeds type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDS; }
+        }
+    }
+
+    /// <summary>
+    /// To define embed for accessible object.
+    /// </summary>
+    public class EmbeddedBy : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is EmbeddedBy.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the EmbeddedBy type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDDED_BY; }
+        }
+    }
+
+    /// <summary>
+    /// To define popup for accessible object.
+    /// </summary>
+    public class PopupFor : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is PopupFor.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the PopupFor type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_POPUP_FOR; }
+        }
+    }
+
+    /// <summary>
+    /// To define parent window for accessible object.
+    /// </summary>
+    public class ParentWindowOf : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is ParentWindowOf.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the ParentWindowOf type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_PARENT_WINDOW_OF; }
+        }
+    }
+
+    /// <summary>
+    /// To define description for accessible object.
+    /// </summary>
+    public class DescriptionFor : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is DescriptionFor.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the DescriptionFor type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIPTION_FOR; }
+        }
+    }
+
+    /// <summary>
+    /// To define description for accessible object.
+    /// </summary>
+    public class DescribedBy : IAccessibleRelation
+    {
+        /// <summary>
+        /// Gets or sets the target object which is DescribedBy.
+        /// </summary>
+        public AccessibleObject Target { get; set; }
+
+        /// <summary>
+        /// Gets the DescribedBy type.
+        /// </summary>
+        public int Type
+        {
+            get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIBED_BY; }
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/AccessibleUtil.cs b/src/ElmSharp/ElmSharp/AccessibleUtil.cs
new file mode 100755 (executable)
index 0000000..720fca4
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// Enumeration for ReadingStatus.
+    /// </summary>
+    public enum ReadingStatus
+    {
+        /// <summary>
+        /// Unknown status
+        /// </summary>
+        Unknown,
+        /// <summary>
+        /// Cancelled status
+        /// </summary>
+        Cancelled,
+        /// <summary>
+        /// Stopped status
+        /// </summary>
+        Stoppped,
+        /// <summary>
+        /// Skipped status
+        /// </summary>
+        Skipped
+    }
+
+    /// <summary>
+    /// AccessibleUtil provides a method to set the reading information.
+    /// </summary>
+    public static class AccessibleUtil
+    {
+
+        static void AtspiSignalCallback(IntPtr data, string say_signal)
+        {
+            GCHandle gch = GCHandle.FromIntPtr(data);
+            TaskCompletionSource<ReadingStatus> tcs = (TaskCompletionSource<ReadingStatus>) gch.Target;
+            if (say_signal.Equals("ReadingCancelled"))
+            {
+                tcs.SetResult(ReadingStatus.Cancelled);
+            }
+            else if (say_signal.Equals("ReadingStopped"))
+            {
+                tcs.SetResult(ReadingStatus.Stoppped);
+            }
+            else if (say_signal.Equals("ReadingSkipped"))
+            {
+                tcs.SetResult(ReadingStatus.Skipped);
+            }
+            else
+            {
+                tcs.SetException(new InvalidOperationException("unknown signal : " + say_signal));
+            }
+
+            gch.Free();
+        }
+
+        /// <summary>
+        /// Reads given text by screen reader.
+        /// </summary>
+        /// <param name="text">The reading text.</param>
+        /// <param name="discardable">If true, reading can be discarded by subsequent reading requests, if false the reading must finish before next reading request can be started.</param>
+        /// <returns>Return a task with reading status.</returns>
+        public static Task<ReadingStatus> Say(string text, bool discardable)
+        {
+            var tcs = new TaskCompletionSource<ReadingStatus>();
+            GCHandle gch = GCHandle.Alloc(tcs);
+            Interop.Elementary.elm_atspi_bridge_utils_say(text, discardable, AtspiSignalCallback, GCHandle.ToIntPtr(gch));
+            return tcs.Task;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Background.cs b/src/ElmSharp/ElmSharp/Background.cs
new file mode 100644 (file)
index 0000000..e5348b0
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Background is a widget that use for setting (solid) background decorations to a window (unless it has transparency enabled)
+    /// or to any container object.
+    /// </summary>
+    public class Background : Layout
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the Background class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Background will be attached as a child.</param>
+        public Background(EvasObject parent) : base(parent)
+        {
+            Style = "transparent";
+        }
+
+        /// <summary>
+        /// Sets or gets color to Background.
+        /// </summary>
+        public override Color Color
+        {
+            get
+            {
+                int r = 0;
+                int g = 0;
+                int b = 0;
+                int a = 0;
+                var swallowContent = GetPartContent("elm.swallow.rectangle");
+                if (swallowContent != IntPtr.Zero)
+                {
+                    Interop.Evas.evas_object_color_get(swallowContent, out r, out g, out b, out a);
+                }
+                return new Color(r, g, b, a);
+            }
+            set
+            {
+                var swallowContent = GetPartContent("elm.swallow.rectangle");
+                if (swallowContent == IntPtr.Zero)
+                {
+                    Interop.Elementary.elm_bg_color_set(RealHandle, value.R, value.G, value.B);
+                    swallowContent = GetPartContent("elm.swallow.rectangle");
+                }
+                Interop.Evas.evas_object_color_set(swallowContent, value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets image to Background.
+        /// </summary>
+        public string File
+        {
+            get
+            {
+                return Interop.Elementary.BackgroundFileGet(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_bg_file_set(RealHandle, value, IntPtr.Zero);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the mode of display for a given background widget's image.
+        /// </summary>
+        /// <remarks>
+        /// This sets how the background widget will display its image.
+        /// This will only work if the File was previously set with an image file on obj.
+        /// The image can be display tiled, scaled, centered or stretched. scaled by default.
+        /// </remarks>
+        public BackgroundOptions BackgroundOption
+        {
+            get
+            {
+                return (BackgroundOptions)Interop.Elementary.elm_bg_option_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_bg_option_set(RealHandle, (Interop.Elementary.BackgroundOptions)value);
+            }
+        }
+
+        /// <summary>
+        /// Set the size of the pixmap representation of the image set on a given background widget.
+        /// This method just makes sense if an image file was set.
+        /// This is just a hint for the underlying system.
+        /// The real size of the pixmap may differ depending on the type of image being loaded, being bigger than requested.
+        /// </summary>
+        /// <param name="w">The new width of the image pixmap representation.</param>
+        /// <param name="h">The new height of the image pixmap representation.</param>
+        public void SetFileLoadSize(int w, int h)
+        {
+            if (File != null)
+            {
+                Interop.Elementary.elm_bg_load_size_set(RealHandle, w, h);
+            }
+            else
+            {
+                throw new Exception("This method just makes sense if an image file was set.");
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_bg_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+
+    /// <summary>
+    /// Enumeration for the background type.
+    /// </summary>
+    public enum BackgroundOptions
+    {
+        /// <summary>
+        /// Centers the background image
+        /// </summary>
+        Center,
+
+        /// <summary>
+        /// Scales the background image, retaining the aspect ratio
+        /// </summary>
+        Scale,
+
+        /// <summary>
+        /// Stretches the background image to fill the UI component's area.
+        /// </summary>
+        Stretch,
+
+        /// <summary>
+        /// Tiles the background image at its original size
+        /// </summary>
+        Tile
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Box.cs b/src/ElmSharp/ElmSharp/Box.cs
new file mode 100644 (file)
index 0000000..3436c64
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Box is a container used to arranges UI components in a linear order.
+    /// </summary>
+    public class Box : Container
+    {
+        private Interop.Elementary.BoxLayoutCallback _layoutCallback;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Box class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Box will be attached as a child.</param>
+        public Box(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets IsHorizontal value which describe pack direction, vertical is default.
+        /// </summary>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_box_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_box_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the box to arrange its children homogeneously.
+        /// </summary>
+        public bool IsHomogeneous
+        {
+            get
+            {
+                return Interop.Elementary.elm_box_homogeneous_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_box_homogeneous_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Adds an object at the end of the pack list.
+        /// </summary>
+        /// <remarks>
+        /// Packs "content" object into the Box, placing it last in the list of children objects.
+        /// The actual position the object will get on screen depends on the layout used.
+        /// If no custom layout is set, it will be at the bottom or right,
+        /// depending if the Box is vertical or horizontal, respectively.
+        /// </remarks>
+        /// <param name="content">The oject be packed</param>
+        public void PackEnd(EvasObject content)
+        {
+            Interop.Elementary.elm_box_pack_end(RealHandle, content);
+            AddChild(content);
+        }
+
+        /// <summary>
+        /// Adds an "content" object to the beginning of the pack list.
+        /// </summary>
+        /// <remarks>
+        /// Pack "content" object into the Box obj, placing it first in the list of children objects.
+        /// The actual position the object will get on screen depends on the layout used.
+        /// If no custom layout is set, it will be at the top or left,
+        /// depending if the Box is vertical or horizontal, respectively.
+        /// </remarks>
+        /// <param name="content">The object to be packed.</param>
+        public void PackStart(EvasObject content)
+        {
+            Interop.Elementary.elm_box_pack_start(RealHandle, content);
+            AddChild(content);
+        }
+
+        /// <summary>
+        /// Adds an "content "object to the Box after the "after" object.
+        /// </summary>
+        /// <remarks>
+        /// This will add the "content" to the Box indicated after the object indicated with "after".
+        /// If "after" is not already in the Box, results are undefined.
+        /// After means either to the right of the "after" object or below it depending on orientation.
+        /// </remarks>
+        /// <param name="content">The object will be added in Box</param>
+        /// <param name="after">The object has been added in Box</param>
+        public void PackAfter(EvasObject content, EvasObject after)
+        {
+            Interop.Elementary.elm_box_pack_after(RealHandle, content, after);
+            AddChild(content);
+        }
+
+        /// <summary>
+        /// Adds an "content "object to the Box before the "before" object.
+        /// </summary>
+        /// <remarks>
+        /// This will add the "content" to the Box indicated before the object indicated with "before".
+        /// If "before" is not already in the Box, results are undefined.
+        /// before means either to the left of the "before" object or below it depending on orientation.
+        /// </remarks>
+        /// <param name="content">The object will be added in Box</param>
+        /// <param name="before">The object has been added in Box</param>
+        public void PackBefore(EvasObject content, EvasObject before)
+        {
+            Interop.Elementary.elm_box_pack_before(RealHandle, content, before);
+            AddChild(content);
+        }
+
+        /// <summary>
+        /// Remove the "content" oject from Box without deleting it.
+        /// </summary>
+        /// <param name="content">The object to unpack</param>
+        public void UnPack(EvasObject content)
+        {
+            Interop.Elementary.elm_box_unpack(RealHandle, content);
+            RemoveChild(content);
+        }
+
+        /// <summary>
+        /// Removes all objects from Box container.
+        /// </summary>
+        public void UnPackAll()
+        {
+            Interop.Elementary.elm_box_unpack_all(RealHandle);
+            ClearChildren();
+        }
+
+        /// <summary>
+        /// Whenever anything changes that requires the Box in obj to recalculate the size and position of its elements,
+        /// the function cb will be called to determine what the layout of the children will be.
+        /// </summary>
+        /// <param name="action">The callback function used for layout </param>
+        public void SetLayoutCallback(Action action)
+        {
+            _layoutCallback = (obj, priv, data) =>
+            {
+                action();
+            };
+            Interop.Elementary.elm_box_layout_set(RealHandle, _layoutCallback, IntPtr.Zero, null);
+        }
+
+        /// <summary>
+        /// Sets the color of exact part to Box's layout parent.
+        /// </summary>
+        /// <param name="part">The name of part class, it could be 'bg', 'elm.swllow.content'.</param>
+        /// <param name="color">The color value.</param>
+        public override void SetPartColor(string part, Color color)
+        {
+            Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255,
+                                                                              color.G * color.A / 255,
+                                                                              color.B * color.A / 255,
+                                                                              color.A);
+        }
+
+        /// <summary>
+        /// Gets the color of exact part of Box's layout parent.
+        /// </summary>
+        /// <param name="part">The name of part class, it could be 'bg', 'elm.swllow.content'.</param>
+        /// <returns></returns>
+        public override Color GetPartColor(string part)
+        {
+            int r, g, b, a;
+            Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a);
+            return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+        }
+
+        /// <summary>
+        /// Force the box to recalculate its children packing.
+        /// If any children was added or removed, box will not calculate the values immediately rather leaving it to the next main loop iteration.
+        /// While this is great as it would save lots of recalculation, whenever you need to get the position of a just added item you must force recalculate before doing so.
+        /// </summary>
+        public void Recalculate()
+        {
+            Interop.Elementary.elm_box_recalculate(RealHandle);
+        }
+
+        /// <summary>
+        /// Clear the box of all children.
+        /// Remove all the elements contained by the box, deleting the respective objects.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_box_clear(RealHandle);
+            ClearChildren();
+        }
+
+        /// <summary>
+        /// Sets or gets the alignment of the whole bounding box of contents.
+        /// </summary>
+        /// <param name="horizontal">Horizontal alignment</param>
+        /// <param name="vertical">Vertical alignment</param>
+        public void SetBoxAlignment(double horizontal, double vertical)
+        {
+            Interop.Elementary.elm_box_align_set(RealHandle, horizontal, vertical);
+        }
+
+        /// <summary>
+        /// Sets or gets the space(padding) between the box's elements.
+        /// </summary>
+        /// <param name="horizontal">Horizontal padding</param>
+        /// <param name="vertical">vertical padding</param>
+        public void SetPadding(int horizontal, int vertical)
+        {
+            Interop.Elementary.elm_box_padding_set(RealHandle, horizontal, vertical);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+            RealHandle = Interop.Elementary.elm_box_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Button.cs b/src/ElmSharp/ElmSharp/Button.cs
new file mode 100644 (file)
index 0000000..3ed6aa8
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Button is a widget works as a clickable input element to trigger events.
+    /// </summary>
+    public class Button : Layout
+    {
+        private SmartEvent _clicked;
+        private SmartEvent _repeated;
+        private SmartEvent _pressed;
+        private SmartEvent _released;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Button class.
+        /// </summary>
+        /// <param name="parent">
+        /// The EvasObject to which the new Button will be attached as a child.
+        /// </param>
+        public Button(EvasObject parent) : base(parent)
+        {
+            _clicked = new SmartEvent(this, this.RealHandle, "clicked");
+            _repeated = new SmartEvent(this, this.RealHandle, "repeated");
+            _pressed = new SmartEvent(this, this.RealHandle, "pressed");
+            _released = new SmartEvent(this, this.RealHandle, "unpressed");
+
+            _clicked.On += (sender, e) =>
+            {
+                Clicked?.Invoke(this, EventArgs.Empty);
+            };
+
+            _repeated.On += (sender, e) =>
+            {
+                Repeated?.Invoke(this, EventArgs.Empty);
+            };
+
+            _pressed.On += (sender, e) =>
+            {
+                Pressed?.Invoke(this, EventArgs.Empty);
+            };
+
+            _released.On += (sender, e) =>
+            {
+                Released?.Invoke(this, EventArgs.Empty);
+            };
+        }
+
+        /// <summary>
+        /// Clicked will be triggered when Button is clicked.
+        /// </summary>
+        public event EventHandler Clicked;
+
+        /// <summary>
+        /// Repeated will be triggered when Button is pressed without releasing it.
+        /// </summary>
+        public event EventHandler Repeated;
+
+        /// <summary>
+        /// Pressed will be triggered when the Button is pressed.
+        /// </summary>
+        public event EventHandler Pressed;
+
+        /// <summary>
+        /// Released will be triggered when the Button is released after being pressed.
+        /// </summary>
+        public event EventHandler Released;
+
+        /// <summary>
+        /// Sets or gets the autorepeat feature of a given Button.
+        /// </summary>
+        /// <remarks>
+        /// Autorepeat feature means autorepeat event generated when the button is kept pressed.
+        /// When set AutoRepeat to false, no autorepeat is performed and buttons will trigger Clicked event when they are clicked.
+        /// When set to true, keeping a button pressed continuously trigger Repeated event until the button is released.
+        /// The time it takes until it starts triggering Repeated is given by AutoRepeatInitialTime,
+        /// and the time between each new emission is given by AutoRepeatGapTimeout.
+        /// </remarks>
+        public bool AutoRepeat
+        {
+            get
+            {
+                return !Interop.Elementary.elm_button_autorepeat_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_button_autorepeat_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the initial timeout before the Repeat event is generated.
+        /// </summary>
+        public double AutoRepeatInitialTime
+        {
+            get
+            {
+                return Interop.Elementary.elm_button_autorepeat_initial_timeout_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_button_autorepeat_initial_timeout_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the interval between each generated Repeat event.
+        /// </summary>
+        public double AutoRepeatGapTimeout
+        {
+            get
+            {
+                return Interop.Elementary.elm_button_autorepeat_gap_timeout_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_button_autorepeat_gap_timeout_set(RealHandle, value);
+            }
+        }
+
+        [Obsolete("DeleteColorClass is obsolete, please use EdjeObject.DeleteColorClass(string)")]
+        public void DeleteColorClass(string part)
+        {
+            Interop.Elementary.edje_object_color_class_del(Handle, part);
+        }
+
+        /// <summary>
+        /// Sets or gets the BackgroundColor of a given Button in normal and pressed status.
+        /// </summary>
+        public override Color BackgroundColor
+        {
+            set
+            {
+                if (value.IsDefault)
+                {
+                    EdjeObject.DeleteColorClass("button/bg");
+                    EdjeObject.DeleteColorClass("button/bg_pressed");
+                    EdjeObject.DeleteColorClass("button/bg_disabled");
+                }
+                else
+                {
+                    SetPartColor("bg", value);
+                    SetPartColor("bg_pressed", value);
+                    SetPartColor("bg_disabled", value);
+                }
+                _backgroundColor = value;
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_button_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Calendar.cs b/src/ElmSharp/ElmSharp/Calendar.cs
new file mode 100755 (executable)
index 0000000..ef87281
--- /dev/null
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for event periodicity, used to define if a mark should be repeated beyond event's day. It's set when a mark is added.
+    /// </summary>
+    public enum CalendarMarkRepeatType
+    {
+        /// <summary>
+        /// Default value. Marks will be displayed only on event day.
+        /// </summary>
+        Unique,
+
+        /// <summary>
+        /// Marks will be displayed every day after event day.
+        /// </summary>
+        Daily,
+
+        /// <summary>
+        /// Marks will be displayed every week after event day.
+        /// </summary>
+        Weekly,
+
+        /// <summary>
+        /// Marks will be displayed every month day that coincides to event day.
+        /// </summary>
+        Monthly,
+
+        /// <summary>
+        /// Marks will be displayed every year that coincides to event day.
+        /// </summary>
+        Annually,
+
+        /// <summary>
+        /// Marks will be displayed every last day of month after event day.
+        /// </summary>
+        LastDayOfMonth
+    }
+
+    /// <summary>
+    /// Enumeration for the mode, which determine how user could select a day.
+    /// </summary>
+    public enum CalendarSelectMode
+    {
+        /// <summary>
+        /// Default value. a day is always selected.
+        /// </summary>
+        Default,
+
+        /// <summary>
+        /// A day is always selected.
+        /// </summary>
+        Always,
+
+        /// <summary>
+        /// None of the days can be selected.
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// User may have selected a day or not.
+        /// </summary>
+        OnDemand
+    }
+
+    /// <summary>
+    /// Enumeration used to define which fields of a tm struct will be taken into account
+    /// </summary>
+    [Flags]
+    public enum CalendarSelectable
+    {
+        /// <summary>
+        /// None will be taken into account
+        /// </summary>
+        None = 0,
+        /// <summary>
+        /// Year will be taken into account
+        /// </summary>
+        Year = 1 << 0,
+        /// <summary>
+        /// Month will be taken into account
+        /// </summary>
+        Month = 1 << 1,
+        /// <summary>
+        /// Day will be taken into account
+        /// </summary>
+        Day = 1 << 2
+    }
+
+    /// <summary>
+    /// The CalendarMark is a Item for marking a Calendar's type,date and repeat type.
+    /// </summary>
+    public class CalendarMark
+    {
+        internal IntPtr Handle;
+
+        /// <summary>
+        /// A string used to define the type of mark.
+        /// </summary>
+        public string Type;
+
+        /// <summary>
+        /// A time struct to represent the date of inclusion of the mark.
+        /// </summary>
+        public DateTime Date;
+
+        /// <summary>
+        /// Repeat the event following this periodicity.
+        /// </summary>
+        public CalendarMarkRepeatType Repeat;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the CalendarMark class.
+        /// </summary>
+        /// <param name="type">Type of mark</param>
+        /// <param name="date">Date of inclusion of the mark</param>
+        /// <param name="repeat">Repeat type</param>
+        public CalendarMark(string type, DateTime date, CalendarMarkRepeatType repeat)
+        {
+            Handle = IntPtr.Zero;
+            Type = type;
+            Date = date;
+            Repeat = repeat;
+        }
+    }
+
+    /// <summary>
+    /// The Calendar is a widget that helps applications to flexibly display a calender with day of the week, date, year and month.
+    /// </summary>
+    public class Calendar : Layout
+    {
+        SmartEvent _changed;
+        DateTime _cacheSelectedDate;
+        SmartEvent _displayedMonthChanged;
+        int _cacheDisplayedMonth;
+
+        Interop.Elementary.Elm_Calendar_Format_Cb _calendarFormat;
+        DateFormatDelegate _dateFormatDelegate = null;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Calendar class.
+        /// </summary>
+        /// <param name="parent">
+        /// The EvasObject to which the new Calendar will be attached as a child.
+        /// </param>
+        public Calendar(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (sender, e) =>
+            {
+                DateTime selectedDate = SelectedDate;
+                DateChanged?.Invoke(this, new DateChangedEventArgs(_cacheSelectedDate, selectedDate));
+                _cacheSelectedDate = selectedDate;
+            };
+
+            _displayedMonthChanged = new SmartEvent(this, this.RealHandle, "display,changed");
+            _displayedMonthChanged.On += (sender, e) =>
+            {
+                int currentDisplayedMonth = DisplayedTime.Month;
+                DisplayedMonthChanged?.Invoke(this, new DisplayedMonthChangedEventArgs(_cacheDisplayedMonth, currentDisplayedMonth));
+                _cacheDisplayedMonth = currentDisplayedMonth;
+            };
+
+            _calendarFormat = (t) => { return _dateFormatDelegate(t); };
+        }
+
+        /// <summary>
+        /// DateChanged will be triggered when the date in the calendar is changed.
+        /// </summary>
+        public event EventHandler<DateChangedEventArgs> DateChanged;
+
+        /// <summary>
+        /// DisplayedMonthChanged will be triggered when the current month displayed in the calendar is changed.
+        /// </summary>
+        public event EventHandler<DisplayedMonthChangedEventArgs> DisplayedMonthChanged;
+
+        /// <summary>
+        /// This delegate type is used to format the string that will be used to display month and year.
+        /// </summary>
+        /// <param name="time">DateTime</param>
+        /// <returns></returns>
+        public delegate string DateFormatDelegate(DateTime time);
+
+        /// <summary>
+        /// Sets or gets the minimum for year.
+        /// </summary>
+        public int MinimumYear
+        {
+            get
+            {
+                int minimumYear;
+                int unused;
+                Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out minimumYear, out unused);
+                return minimumYear;
+            }
+            set
+            {
+                int maximumYear;
+                int unused;
+                Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out unused, out maximumYear);
+                if (maximumYear < 1902)
+                {
+                    maximumYear = DateTime.MaxValue.Year;
+                }
+                Interop.Elementary.elm_calendar_min_max_year_set(RealHandle, value, maximumYear);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum for the year.
+        /// </summary>
+        public int MaximumYear
+        {
+            get
+            {
+                int maximumYear;
+                int unused;
+                Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out unused, out maximumYear);
+                return maximumYear;
+            }
+            set
+            {
+                int minimumYear;
+                int unused;
+                Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out minimumYear, out unused);
+                Interop.Elementary.elm_calendar_min_max_year_set(RealHandle, minimumYear, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the first day of week, who are used on Calendar.
+        /// </summary>
+        public DateTime DisplayedTime
+        {
+            get
+            {
+                var tm = new Interop.Libc.SystemTime();
+                Interop.Elementary.elm_calendar_displayed_time_get(RealHandle, out tm);
+                ///TODO
+                ///If the defect is fixed, it will be removed.
+                var daysInMonth = DateTime.DaysInMonth(tm.tm_year + 1900, tm.tm_mon + 1);
+                var day = tm.tm_mday;
+
+                if (day > daysInMonth)
+                {
+                    day = daysInMonth;
+                }
+
+                DateTime date = new DateTime(tm.tm_year + 1900, tm.tm_mon + 1, day, tm.tm_hour, tm.tm_min, tm.tm_sec);
+
+                return date;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the first day of week, who are used on Calendar.
+        /// </summary>
+        public DayOfWeek FirstDayOfWeek
+        {
+            get
+            {
+                return (DayOfWeek)Interop.Elementary.elm_calendar_first_day_of_week_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_calendar_first_day_of_week_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the weekdays names to be displayed by the Calendar.
+        /// </summary>
+        /// <remarks>
+        /// The usage should be like this;
+        /// List<string> weekDayNames = new List<string>() { "S", "M", "T", "W", "T", "F", "S" };
+        /// Calendar.WeekDayNames = weekDayNames;
+        /// </remarks>
+        public IReadOnlyList<string> WeekDayNames
+        {
+            get
+            {
+                IntPtr stringArrayPtr = Interop.Elementary.elm_calendar_weekdays_names_get(RealHandle);
+                string[] stringArray;
+                IntPtrToStringArray(stringArrayPtr, 7, out stringArray);
+                return stringArray;
+            }
+            set
+            {
+                if (value != null && value.Count == 7)
+                {
+                    Interop.Elementary.elm_calendar_weekdays_names_set(RealHandle, value.ToArray());
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the selected date.
+        /// </summary>
+        /// <remarks>
+        /// Selected date changes when the user goes to next/previous month or select a day pressing over it on calendar.
+        /// </remarks>
+        public DateTime SelectedDate
+        {
+            get
+            {
+                var tm = new Interop.Libc.SystemTime();
+                Interop.Elementary.elm_calendar_selected_time_get(RealHandle, ref tm);
+                if (tm.tm_year == 0 && tm.tm_mon == 0 && tm.tm_mday == 0)
+                {
+                    return DateTime.Now;
+                }
+                return tm;
+            }
+            set
+            {
+                Interop.Libc.SystemTime tm = value;
+                Interop.Elementary.elm_calendar_selected_time_set(RealHandle, ref tm);
+                _cacheSelectedDate = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the interval on time updates for an user mouse button
+        /// hold on calendar widgets' month/year selection.
+        /// </summary>
+        public double Interval
+        {
+            get
+            {
+                return Interop.Elementary.elm_calendar_interval_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_calendar_interval_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the select day mode used.
+        /// </summary>
+        public CalendarSelectMode SelectMode
+        {
+            get
+            {
+                return (CalendarSelectMode)Interop.Elementary.elm_calendar_select_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_calendar_select_mode_set(RealHandle, (Interop.Elementary.Elm_Calendar_Select_Mode)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets fields of a datetime will be taken into account, when SelectedDate set is invoked.
+        /// </summary>
+        public CalendarSelectable Selectable
+        {
+            get
+            {
+                return (CalendarSelectable)Interop.Elementary.elm_calendar_selectable_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_calendar_selectable_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets date format the string that will be used to display month and year.
+        /// By default it uses strftime with "%B %Y" format string.
+        /// It should allocate the memory that will be used by the string, that will be freed by the widget after usage.A pointer to the string and a pointer to the time struct will be provided.
+        /// </summary>
+        public DateFormatDelegate DateFormat
+        {
+            get
+            {
+                return _dateFormatDelegate;
+            }
+            set
+            {
+                _dateFormatDelegate = value;
+                if (value != null)
+                {
+                    Interop.Elementary.elm_calendar_format_function_set(RealHandle, _calendarFormat);
+                }
+                else
+                {
+                    Interop.Elementary.elm_calendar_format_function_set(RealHandle, null);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Add a new mark to the calendar.
+        /// </summary>
+        /// <param name="type">A string used to define the type of mark. It will be emitted to the theme, that should display a related modification on these days representation.</param>
+        /// <param name="date">A time struct to represent the date of inclusion of the mark. For marks that repeats it will just be displayed after the inclusion date in the calendar.</param>
+        /// <param name="repeat">Repeat the event following this periodicity. Can be a unique mark (that don't repeat), daily, weekly, monthly or annually.</param>
+        /// <returns>Item for a calendar mark.</returns>
+        public CalendarMark AddMark(string type, DateTime date, CalendarMarkRepeatType repeat)
+        {
+            CalendarMark mark = new CalendarMark(type, date, repeat);
+            Interop.Libc.SystemTime tm = date;
+            IntPtr nativeHandle = Interop.Elementary.elm_calendar_mark_add(RealHandle, type, ref tm, (Interop.Elementary.Elm_Calendar_Mark_Repeat_Type)repeat);
+            mark.Handle = nativeHandle;
+
+            return mark;
+        }
+
+        /// <summary>
+        /// Delete mark from the calendar.
+        /// </summary>
+        /// <param name="mark">Item for a calendar mark</param>
+        public void DeleteMark(CalendarMark mark)
+        {
+            Interop.Elementary.elm_calendar_mark_del(mark.Handle);
+        }
+
+        /// <summary>
+        /// Draw calendar marks.
+        /// </summary>
+        public void DrawMarks()
+        {
+            Interop.Elementary.elm_calendar_marks_draw(RealHandle);
+        }
+
+        /// <summary>
+        /// Remove all calendar's marks.
+        /// </summary>
+        public void ClearMarks()
+        {
+            Interop.Elementary.elm_calendar_marks_clear(RealHandle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_calendar_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        static void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray)
+        {
+            managedArray = new string[size];
+            IntPtr[] IntPtrArray = new IntPtr[size];
+
+            Marshal.Copy(unmanagedArray, IntPtrArray, 0, size);
+
+            for (int iterator = 0; iterator < size; iterator++)
+            {
+                managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Check.cs b/src/ElmSharp/ElmSharp/Check.cs
new file mode 100755 (executable)
index 0000000..ae153d8
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The check is a widget allows for toggling a value between true and false.
+    /// </summary>
+    public class Check : Layout
+    {
+        private SmartEvent _changed;
+        private bool _currentState;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Check class.
+        /// </summary>
+        /// <param name="parent">
+        /// The EvasObject to which the new Check will be attached as a child.
+        /// </param>
+        public Check(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (sender, e) =>
+            {
+                StateChanged?.Invoke(this, new CheckStateChangedEventArgs(_currentState, IsChecked));
+            };
+        }
+
+        /// <summary>
+        /// StateChanged will be triggered when the IsChecked in the Check is changed.
+        /// </summary>
+        public event EventHandler<CheckStateChangedEventArgs> StateChanged;
+
+        /// <summary>
+        /// Sets or gets whether the given Check is checked or not.
+        /// </summary>
+        /// <remarks>
+        /// When object is checked, the value will set to true, Conversely will set to false.
+        /// </remarks>
+        public bool IsChecked
+        {
+            get
+            {
+                _currentState = Interop.Elementary.elm_check_state_get(RealHandle);
+                return _currentState;
+            }
+            set
+            {
+                Interop.Elementary.elm_check_state_set(RealHandle, value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_check_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs b/src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..461798f
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// The CheckStateChangedEventArgs is EventArgs to record Check's state.
+    /// Include old state and new state.
+    /// </summary>
+    public class CheckStateChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the OldState property.The return type is bool.
+        /// </summary>
+        public bool OldState { get; private set; }
+
+        /// <summary>
+        /// Gets the NewState property.The return type is bool.
+        /// </summary>
+        public bool NewState { get; private set; }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the CheckStateChangedEventArgs class.
+        /// </summary>
+        /// <param name="oldState">Old state of Check which to use this CheckStateChangedEventArgs.</param>
+        /// <param name="newState">New state of Check which to use this CheckStateChangedEventArgs.</param>
+        public CheckStateChangedEventArgs(bool oldState, bool newState)
+        {
+            this.OldState = oldState;
+            this.NewState = newState;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Color.cs b/src/ElmSharp/ElmSharp/Color.cs
new file mode 100644 (file)
index 0000000..9b27f0f
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Globalization;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Color is a struct to record Check's state.
+    /// </summary>
+    public struct Color
+    {
+        readonly int _a;
+        readonly int _r;
+        readonly int _g;
+        readonly int _b;
+
+        readonly Mode _mode;
+
+        enum Mode
+        {
+            Default,
+            Rgb
+        }
+
+        /// <summary>
+        /// Gets a default Color instance.
+        /// </summary>
+        /// <remarks>
+        /// In default Color instance,Mode type is Default,RGBA all set as -1.
+        /// </remarks>
+        public static Color Default
+        {
+            get { return new Color(-1, -1, -1, -1, Mode.Default); }
+        }
+
+        /// <summary>
+        /// Gets whether the Color instance's mode is default or not.
+        /// Return type is bool.
+        /// </summary>
+        public bool IsDefault
+        {
+            get { return _mode == Mode.Default; }
+        }
+
+        /// <summary>
+        /// Gets A value of RGBA.
+        /// A means the Alpha in color.
+        /// </summary>
+        public int A
+        {
+            get { return _a; }
+        }
+
+        /// <summary>
+        /// Gets R value of RGBA.
+        /// R means the Red in color.
+        /// </summary>
+        public int R
+        {
+            get { return _r; }
+        }
+
+        /// <summary>
+        /// Gets G value of RGBA.
+        /// G means the Green in color.
+        /// </summary>
+        public int G
+        {
+            get { return _g; }
+        }
+
+        /// <summary>
+        /// Gets B value of RGBA.
+        /// B means the Blue in color.
+        /// </summary>
+        public int B
+        {
+            get { return _b; }
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Color class.
+        /// With RGB parameters.
+        /// </summary>
+        /// <param name="r">Red of RGB</param>
+        /// <param name="g">Green of RGB</param>
+        /// <param name="b">Blue of RGB</param>
+        public Color(int r, int g, int b) : this(r, g, b, 255)
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Color class.
+        /// With RGBA parameters.
+        /// </summary>
+        /// <param name="r">Red of RGBA</param>
+        /// <param name="g">Green of RGBA<</param>
+        /// <param name="b">Blue of RGBA<</param>
+        /// <param name="a">Alpha of RGBA<</param>
+        public Color(int r, int g, int b, int a) : this(r, g, b, a, Mode.Rgb)
+        {
+        }
+
+        Color(int r, int g, int b, int a, Mode mode)
+        {
+            _mode = mode;
+            if (mode == Mode.Rgb)
+            {
+                _r = Clamp(r, 0, 255);
+                _g = Clamp(g, 0, 255);
+                _b = Clamp(b, 0, 255);
+                _a = Clamp(a, 0, 255);
+            }
+            else // Default
+            {
+                _r = _g = _b = _a = -1;
+            }
+        }
+
+        public override int GetHashCode()
+        {
+            int hashcode = _r.GetHashCode();
+            hashcode = (hashcode * 397) ^ _g.GetHashCode();
+            hashcode = (hashcode * 397) ^ _b.GetHashCode();
+            hashcode = (hashcode * 397) ^ _a.GetHashCode();
+            return hashcode;
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (obj is Color)
+            {
+                return EqualsInner(this, (Color)obj);
+            }
+            return base.Equals(obj);
+        }
+
+        /// <summary>
+        /// Compare whether two Color instance is same or not.
+        /// </summary>
+        /// <param name="a">A Color instance.</param>
+        /// <param name="b">A Color instance.</param>
+        /// <returns>The result whether two instance is same or not.
+        /// Return type is bool.If they are same, return true.
+        /// </returns>
+        public static bool operator ==(Color a, Color b)
+        {
+            if (ReferenceEquals(a, b))
+                return true;
+
+            if ((object)a == null || (object)b == null)
+                return false;
+
+            return EqualsInner(a, b);
+        }
+
+        /// <summary>
+        /// Compare whether two Color instance is different or not.
+        /// </summary>
+        /// <param name="a">A Color instance.</param>
+        /// <param name="b">A Color instance.</param>
+        /// <returns>The result whether two instance is different or not.
+        /// Return type is bool.If they are different, return true.
+        /// </returns>
+        public static bool operator !=(Color a, Color b)
+        {
+            return !(a == b);
+        }
+
+        static bool EqualsInner(Color color1, Color color2)
+        {
+            if (color1._mode == Mode.Default && color2._mode == Mode.Default)
+                return true;
+            return color1._r == color2._r && color1._g == color2._g && color1._b == color2._b && color1._a == color2._a;
+        }
+
+        public override string ToString()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "[Color: R={0}, G={1}, B={2}, A={3}]", R, G, B, A);
+        }
+
+        /// <summary>
+        /// Gets a Color instance with a hexadecimal string parameter.
+        /// </summary>
+        /// <param name="hex">Hexadecimal string.</param>
+        /// <returns>New instance of Color struct.</returns>
+        public static Color FromHex(string hex)
+        {
+            hex = hex.Replace("#", "");
+            switch (hex.Length)
+            {
+                case 3: //#rgb => ffrrggbb
+                    hex = string.Format("ff{0}{1}{2}{3}{4}{5}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2]);
+                    break;
+                case 4: //#argb => aarrggbb
+                    hex = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2], hex[3], hex[3]);
+                    break;
+                case 6: //#rrggbb => ffrrggbb
+                    hex = string.Format("ff{0}", hex);
+                    break;
+            }
+            return FromUint(Convert.ToUInt32(hex.Replace("#", ""), 16));
+        }
+
+        /// <summary>
+        /// Gets a Color instance with a Unsigned integer parameter.
+        /// </summary>
+        /// <param name="argb">Unsigned integer indicates RGBA.</param>
+        /// <returns>New instance of Color struct.</returns>
+        public static Color FromUint(uint argb)
+        {
+            return FromRgba((byte)((argb & 0x00ff0000) >> 0x10), (byte)((argb & 0x0000ff00) >> 0x8), (byte)(argb & 0x000000ff), (byte)((argb & 0xff000000) >> 0x18));
+        }
+
+        /// <summary>
+        /// Gets a Color instance with R,G,B,A parameters.
+        /// </summary>
+        /// <param name="r">Red in RGBA.</param>
+        /// <param name="g">Green in RGBA.</param>
+        /// <param name="b">Blue in RGBA.</param>
+        /// <param name="a">Alpha in RGBA.</param>
+        /// <returns>New instance of Color struct.</returns>
+        public static Color FromRgba(int r, int g, int b, int a)
+        {
+            return new Color(r, g, b, a);
+        }
+
+        /// <summary>
+        /// Gets a Color instance with R,G,B,A parameters.
+        /// </summary>
+        /// <param name="r">Red in RGB.</param>
+        /// <param name="g">Green in RGB.</param>
+        /// <param name="b">Blue in RGB.</param>
+        /// <returns>New instance of Color struct.</returns>
+        public static Color FromRgb(int r, int g, int b)
+        {
+            return FromRgba(r, g, b, 255);
+        }
+
+        internal static int Clamp(int self, int min, int max)
+        {
+            return Math.Min(max, Math.Max(self, min));
+        }
+
+        #region Color Definitions
+        /// <summary>
+        /// The Tansparent is a predefined Color, it's rgba value is (0, 0, 0, 0).
+        /// </summary>
+        public static readonly Color Transparent = FromRgba(0, 0, 0, 0);
+        /// <summary>
+        /// The Aqua is a predefined Color instance, it's rgb value is (0, 255, 255).
+        /// </summary>
+        public static readonly Color Aqua = FromRgb(0, 255, 255);
+        /// <summary>
+        /// The Black is a predefined Color instance, it's rgb value is (0, 0, 0).
+        /// </summary>
+        public static readonly Color Black = FromRgb(0, 0, 0);
+        /// <summary>
+        /// The Blue is a predefined Color instance, it's rgb value is (0, 0, 255).
+        /// </summary>
+        public static readonly Color Blue = FromRgb(0, 0, 255);
+        /// <summary>
+        /// The Fuchsia is a predefined Color instance, it's rgb value is (255, 0, 255).
+        /// </summary>
+        public static readonly Color Fuchsia = FromRgb(255, 0, 255);
+        /// <summary>
+        /// The Gray is a predefined Color instance, it's rgb value is (128, 128, 128).
+        /// </summary>
+        public static readonly Color Gray = FromRgb(128, 128, 128);
+        /// <summary>
+        /// The Green is a predefined Color instance, it's rgb value is (0, 128, 0).
+        /// </summary>
+        public static readonly Color Green = FromRgb(0, 128, 0);
+        /// <summary>
+        /// The Lime is a predefined Color instance, it's rgb value is (0, 255, 0).
+        /// </summary>
+        public static readonly Color Lime = FromRgb(0, 255, 0);
+        /// <summary>
+        /// The Maroon is a predefined Color instance, it's rgb value is (128, 0, 0).
+        /// </summary>
+        public static readonly Color Maroon = FromRgb(128, 0, 0);
+        /// <summary>
+        /// The Navy is a predefined Color instance, it's rgb value is (0, 0, 128).
+        /// </summary>
+        public static readonly Color Navy = FromRgb(0, 0, 128);
+        /// <summary>
+        /// The Olive is a predefined Color instance, it's rgb value is (128, 128, 0).
+        /// </summary>
+        public static readonly Color Olive = FromRgb(128, 128, 0);
+        /// <summary>
+        /// The Orange is a predefined Color instance, it's rgb value is (255, 165, 0).
+        /// </summary>
+        public static readonly Color Orange = FromRgb(255, 165, 0);
+        /// <summary>
+        /// The Purple is a predefined Color instance, it's rgb value is (128, 0, 128).
+        /// </summary>
+        public static readonly Color Purple = FromRgb(128, 0, 128);
+        /// <summary>
+        /// The Pink is a predefined Color instance, it's rgb value is (255, 102, 255).
+        /// </summary>
+        public static readonly Color Pink = FromRgb(255, 102, 255);
+        /// <summary>
+        /// The Red is a predefined Color instance, it's rgb value is (255, 0, 0).
+        /// </summary>
+        public static readonly Color Red = FromRgb(255, 0, 0);
+        /// <summary>
+        /// The Silver is a predefined Color instance, it's rgb value is (192, 192, 192).
+        /// </summary>
+        public static readonly Color Silver = FromRgb(192, 192, 192);
+        /// <summary>
+        /// The Teal is a predefined Color instance, it's rgb value is (0, 128, 128).
+        /// </summary>
+        public static readonly Color Teal = FromRgb(0, 128, 128);
+        /// <summary>
+        /// The White is a predefined Color instance, it's rgb value is (255, 255, 255).
+        /// </summary>
+        public static readonly Color White = FromRgb(255, 255, 255);
+        /// <summary>
+        /// The Yellow is a predefined Color instance, it's rgb value is (255, 255, 0).
+        /// </summary>
+        public static readonly Color Yellow = FromRgb(255, 255, 0);
+        #endregion
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs b/src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..b1090de
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// Event ColorChanged of ColorSelector contain ColorChangedEventArgs as a parameter.
+    /// Refer to <see cref="ColorSelector"/>type.
+    /// </summary>
+    public class ColorChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets old color in color changed event.
+        /// </summary>
+        public Color OldColor { get; private set; }
+
+        /// <summary>
+        /// Gets new color in color changed event.
+        /// </summary>
+        public Color NewColor { get; private set; }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the ColorChangedEventArgs class.
+        /// </summary>
+        /// <param name="oldColor">old color</param>
+        /// <param name="newColor">new color</param>
+        public ColorChangedEventArgs(Color oldColor, Color newColor)
+        {
+            this.OldColor = oldColor;
+            this.NewColor = newColor;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ColorSelector.cs b/src/ElmSharp/ElmSharp/ColorSelector.cs
new file mode 100755 (executable)
index 0000000..cf16a99
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for mode of ColorSelector
+    /// </summary>
+    public enum ColorSelectorMode
+    {
+        /// <summary>
+        /// Only color palette is displayed, default
+        /// </summary>
+        Palette,
+        /// <summary>
+        /// Only color selector is displayed
+        /// </summary>
+        [Obsolete("Components is obsolete as of version 1.2.3 and is no longer supported.")]
+        Components,
+        /// <summary>
+        /// Both Palette and selector is displayed
+        /// </summary>
+        [Obsolete("Both is obsolete as of version 1.2.3 and is no longer supported.")]
+        Both,
+        /// <summary>
+        /// Only color picker is displayed
+        /// </summary>
+        [Obsolete("Picker is obsolete as of version 1.2.3 and is no longer supported.")]
+        Picker,
+        /// <summary>
+        /// This mode is not supported. If you use this, nothing will be shown
+        /// </summary>
+        [Obsolete("Plane is obsolete as of version 1.2.3 and is no longer supported.")]
+        Plane,
+        /// <summary>
+        /// This mode is not supported. If you use this, it will be shown same with Palette mode
+        /// </summary>
+        [Obsolete("PallettePlane is obsolete as of version 1.2.3 and is no longer supported.")]
+        PallettePlane,
+        /// <summary>
+        /// This mode is not supported. If you use this, it will be shown same with Palette mode
+        /// </summary>
+        [Obsolete("All is obsolete as of version 1.2.3 and is no longer supported.")]
+        All
+    }
+
+    /// <summary>
+    /// The ColorSelector is a widget to set a series of colors.
+    /// It also allows to load/save colors from/to config with a unique identifier.
+    /// </summary>
+    /// <remarks>
+    /// By default, the colors are loaded/saved from/to config using "default" identifier.
+    /// The colors can be picked by user from the color set by clicking on individual
+    /// color item on the palette or by selecting it from selector.
+    /// </remarks>
+    public class ColorSelector : Layout
+    {
+        private readonly SmartEvent<ColorChangedEventArgs> _changed;
+        private Color _currentColor;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the ColorSelector class.
+        /// </summary>
+        /// <param name="parent"></param>
+        public ColorSelector(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent<ColorChangedEventArgs>(this, "changed", (data, obj, info) =>
+            {
+                return new ColorChangedEventArgs(_currentColor, SelectedColor);
+            });
+        }
+
+        /// <summary>
+        /// ColorChanged will be triggered when the SelectedColor changed.
+        /// </summary>
+        public event EventHandler<ColorChangedEventArgs> ColorChanged
+        {
+            add { _changed.On += value; }
+            remove { _changed.On -= value; }
+        }
+
+        /// <summary>
+        /// Gets or sets color of colorselector.
+        /// </summary>
+        public Color SelectedColor
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Elementary.elm_colorselector_color_get(Handle, out r, out g, out b, out a);
+                _currentColor = new Color(r, g, b, a);
+                return _currentColor;
+            }
+            set
+            {
+                Interop.Elementary.elm_colorselector_color_set(Handle, value.R, value.G, value.B, value.A);
+                _currentColor = new Color(value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Gets Alpha of a default Color Class(Value is -1).
+        /// </summary>
+        public override int Opacity
+        {
+            get
+            {
+                return Color.Default.A;
+            }
+
+            set
+            {
+                Console.WriteLine("ColorSelector instance doesn't support to set Opacity.");
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets Colorselector's mode.
+        /// </summary>
+        public ColorSelectorMode Mode
+        {
+            get
+            {
+                return (ColorSelectorMode)Interop.Elementary.elm_colorselector_mode_get(Handle);
+            }
+            set
+            {
+                if (ColorSelectorMode.Palette == value)
+                {
+                    Interop.Elementary.elm_colorselector_mode_set(Handle, (Interop.Elementary.Elm_Colorselector_Mode)value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Get or set current palette's name.
+        /// </summary>
+        public string PaletteName
+        {
+            get
+            {
+                return Interop.Elementary.elm_colorselector_palette_name_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_colorselector_palette_name_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Adds a new color item to palette.
+        /// </summary>
+        /// <param name="color">Color item to add</param>
+        /// <returns>A new color palette Item.</returns>
+        public ColorSelectorItem AddPaletteColor(Color color)
+        {
+            ColorSelectorItem item = new ColorSelectorItem();
+            item.Handle = Interop.Elementary.elm_colorselector_palette_color_add(Handle, color.R, color.G, color.B, color.A);
+            return item;
+        }
+
+        /// <summary>
+        /// Clear the palette items.
+        /// </summary>
+        public void ClearPalette()
+        {
+            Interop.Elementary.elm_colorselector_palette_clear(Handle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_colorselector_add(parent.Handle);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ColorSelectorItem.cs b/src/ElmSharp/ElmSharp/ColorSelectorItem.cs
new file mode 100755 (executable)
index 0000000..10205e2
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// A instance to the ColorSelector item added.
+    /// </summary>
+    public class ColorSelectorItem : ItemObject
+    {
+        internal ColorSelectorItem() : base(IntPtr.Zero)
+        {
+        }
+
+        /// <summary>
+        /// Gets or sets the Palette item's color
+        /// </summary>
+        public Color Color
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Elementary.elm_colorselector_palette_item_color_get(Handle, out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                if (Handle != IntPtr.Zero)
+                {
+                    Interop.Elementary.elm_colorselector_palette_item_color_set(Handle, value.R, value.G, value.B, value.A);
+                }
+            }
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Conformant.cs b/src/ElmSharp/ElmSharp/Conformant.cs
new file mode 100755 (executable)
index 0000000..84da0e3
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The check is a widget that can be used in elementary apps
+    /// to account for space taken up by the indicator,
+    /// virtual keypad & softkey windows when running the illume2 module of E17.
+    /// </summary>
+    public class Conformant : Widget
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the Conformant class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Conformant
+        /// as a child.It's <see cref="EvasObject"/> type.</param>
+        public Conformant(Window parent) : base(parent)
+        {
+            Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0);
+            Interop.Elementary.elm_win_conformant_set(parent.Handle, true);
+            parent.AddResizeObject(this);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_conformant_add(parent.Handle);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Container.cs b/src/ElmSharp/ElmSharp/Container.cs
new file mode 100755 (executable)
index 0000000..6abb589
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="Widget"/>.
+    /// The Container is a abstract class.
+    /// Other class inherits it to Elementary is about displaying
+    /// its widgets in a nice layout.
+    /// </summary>
+    public abstract class Container : Widget
+    {
+        HashSet<EvasObject> _children = new HashSet<EvasObject>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of class which inherit from Container.
+        /// </summary>
+        /// <param name="parent">The parent is a given object which will be attached by Container
+        /// as a child.It's <see cref="EvasObject"/> type.</param>
+        public Container(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets the background color of a given Container.
+        /// </summary>
+        public override Color BackgroundColor
+        {
+            set
+            {
+                if (value.IsDefault)
+                {
+                    SetPartColor("bg", Color.Transparent);
+                }
+                else
+                {
+                    SetPartColor("bg", value);
+                }
+                _backgroundColor = value;
+            }
+        }
+
+        protected IEnumerable<EvasObject> Children => _children;
+
+        protected void AddChild(EvasObject obj)
+        {
+            _children.Add(obj);
+            obj.Deleted += OnChildDeleted;
+        }
+
+        protected void RemoveChild(EvasObject obj)
+        {
+            _children.Remove(obj);
+        }
+
+        protected void ClearChildren()
+        {
+            _children.Clear();
+        }
+
+        void OnChildDeleted(object sender, EventArgs a)
+        {
+            _children.Remove((EvasObject)sender);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ContextPopup.cs b/src/ElmSharp/ElmSharp/ContextPopup.cs
new file mode 100755 (executable)
index 0000000..3be2baa
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration of ContextPopup direction type.
+    /// </summary>
+    public enum ContextPopupDirection
+    {
+        /// <summary>
+        /// ContextPopup show appear below clicked area
+        /// /// </summary>
+        Down,
+        /// <summary>
+        /// ContextPopup show appear to the right of the clicked area
+        /// </summary>
+        Right,
+        /// <summary>
+        /// ContextPopup show appear to the left of the clicked area
+        /// </summary>
+        Left,
+        /// <summary>
+        /// ContextPopup show appear above the clicked area
+        /// </summary>
+        Up,
+        /// <summary>
+        /// ContextPopup does not determine it's direction yet
+        /// </summary>
+        Unknown
+    }
+
+    /// <summary>
+    /// It inherits <see cref="Layout"/>.
+    /// The ContextPopup is a widget that when it shown, pops up a list of items.
+    /// </summary>
+    public class ContextPopup : Layout
+    {
+        HashSet<ContextPopupItem> _children = new HashSet<ContextPopupItem>();
+        SmartEvent _dismissed;
+        Interop.Evas.SmartCallback _onSelected;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the ContextPopup class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by ContextPopup
+        /// as a child.It's <see cref="EvasObject"/> type.</param>
+        public ContextPopup(EvasObject parent) : base(parent)
+        {
+            _dismissed = new SmartEvent(this, this.RealHandle, "dismissed");
+            _dismissed.On += (sender, e) =>
+            {
+                Dismissed?.Invoke(this, EventArgs.Empty);
+            };
+            _onSelected = (data, obj, info) =>
+            {
+                ContextPopupItem item = ItemObject.GetItemById((int)data) as ContextPopupItem;
+                item?.SendSelected();
+            };
+        }
+
+        /// <summary>
+        /// Dismissed is raised when the ContextPopup item is dismissed.
+        /// </summary>
+        /// <remarks>
+        /// Outside of ContextPopup was clicked or it's parent area is changed or the language is changed. and then ContextPopup is dismissed.
+        /// </remarks>
+        public event EventHandler Dismissed;
+
+        /// <summary>
+        /// Gets the current direction of a ContextPopup.
+        /// </summary>
+        /// <remarks>
+        /// Once the ContextPopup showed up, the direction would be determined.
+        /// </remarks>
+        public ContextPopupDirection Direction
+        {
+            get
+            {
+                return (ContextPopupDirection)Interop.Elementary.elm_ctxpopup_direction_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the value of current ContextPopup object's orientation.
+        /// True for horizontal mode, False for vertical mode (or errors)
+        /// </summary>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_ctxpopup_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_ctxpopup_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether ContextPopup hide automatically
+        /// or not when parent of ContextPopup is resized.
+        /// </summary>
+        /// <remarks>
+        /// Default value of AutoHide is False.
+        /// </remarks>
+        public bool AutoHide
+        {
+            get
+            {
+                return !Interop.Elementary.elm_ctxpopup_auto_hide_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_ctxpopup_auto_hide_disabled_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Clears all items in the given ContextPopup object.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_ctxpopup_clear(Handle);
+        }
+
+        /// <summary>
+        /// Sets the direction priority of a ContextPopup.
+        /// </summary>
+        /// <param name="first">1st priority of direction </param>
+        /// <param name="second">2nd priority of direction </param>
+        /// <param name="third">3th priority of direction </param>
+        /// <param name="fourth">4th priority of direction</param>
+        public void SetDirectionPriorty(ContextPopupDirection first, ContextPopupDirection second, ContextPopupDirection third, ContextPopupDirection fourth)
+        {
+            Interop.Elementary.elm_ctxpopup_direction_priority_set(RealHandle, (int)first, (int)second, (int)third, (int)fourth);
+        }
+
+        /// <summary>
+        /// Gets the direction priority of a ContextPopup.
+        /// </summary>
+        /// <param name="first">1st priority of direction to be returned</param>
+        /// <param name="second">2nd priority of direction to be returned</param>
+        /// <param name="third">2nd priority of direction to be returned </param>
+        /// <param name="fourth">4th priority of direction to be returned</param>
+        public void GetDirectionPriority(out ContextPopupDirection first, out ContextPopupDirection second, out ContextPopupDirection third, out ContextPopupDirection fourth)
+        {
+            int firstOut, secondOut, thirdOut, fourthOut;
+            Interop.Elementary.elm_ctxpopup_direction_priority_get(Handle, out firstOut, out secondOut, out thirdOut, out fourthOut);
+            first = (ContextPopupDirection)firstOut;
+            second = (ContextPopupDirection)secondOut;
+            third = (ContextPopupDirection)thirdOut;
+            fourth = (ContextPopupDirection)fourthOut;
+        }
+
+        /// <summary>
+        /// Adds a new item to a ContextPopup object with label.
+        /// </summary>
+        /// <param name="label">The Label of the new item</param>
+        /// <returns>
+        /// A ContextPopupItem added or NULL, on errors
+        /// </returns>
+        public ContextPopupItem Append(string label)
+        {
+            return Append(label, null);
+        }
+
+        /// <summary>
+        /// Adds a new item to a ContextPopup object with label and icon.
+        /// </summary>
+        /// <param name="label">The Label of the new item</param>
+        /// <param name="icon">Icon to be set on new item</param>
+        /// <returns>A ContextPopupItem added or NULL, on errors</returns>
+        public ContextPopupItem Append(string label, EvasObject icon)
+        {
+            ContextPopupItem item = new ContextPopupItem(label, icon);
+            item.Handle = Interop.Elementary.elm_ctxpopup_item_append(RealHandle, label, icon, _onSelected, (IntPtr)item.Id);
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Dismiss a ContextPopup object. The ContextPopup will be hidden and the "clicked" signal will be emitted.
+        /// </summary>
+        public void Dismiss()
+        {
+            Interop.Elementary.elm_ctxpopup_dismiss(RealHandle);
+        }
+
+        /// <summary>
+        /// Gets the possibility that the direction would be available
+        /// </summary>
+        /// <param name="direction">A direction user wants to check</param>
+        /// <returns>
+        /// Get false if you cannot put it in the direction. Gets true if it's possible.
+        /// </returns>
+        public bool IsAvailableDirection(ContextPopupDirection direction)
+        {
+            return Interop.Elementary.elm_ctxpopup_direction_available_get(RealHandle, (int)direction);
+        }
+
+        /// <summary>
+        /// Gets Alpha of a default Color Class.
+        /// </summary>
+        public override int Opacity
+        {
+            get
+            {
+                return Color.Default.A;
+            }
+
+            set
+            {
+                Console.WriteLine("ContextPopup instance doesn't support to set Opacity.");
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_ctxpopup_add(parent.Handle);
+        }
+
+        void AddInternal(ContextPopupItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((ContextPopupItem)sender);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ContextPopupItem.cs b/src/ElmSharp/ElmSharp/ContextPopupItem.cs
new file mode 100755 (executable)
index 0000000..35c908b
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="ItemObject"/>.
+    /// A instance to the ContextPopup item added.
+    /// </summary>
+    public class ContextPopupItem : ItemObject
+    {
+        internal ContextPopupItem(string text, EvasObject icon) : base(IntPtr.Zero)
+        {
+            Text = text;
+            Icon = icon;
+        }
+
+        /// <summary>
+        /// Gets the Text property of the given ContextPopupItem.
+        /// </summary>
+        public string Text { get; internal set; }
+
+        /// <summary>
+        /// Gets the Icon(type is <see cref="EvasObject"/>) property of the given ContextPopupItem.
+        /// </summary>
+        public EvasObject Icon { get; internal set; }
+
+        /// <summary>
+        /// Selected will be triggered when the ContextPopupItem is Selected.
+        /// </summary>
+        public event EventHandler Selected;
+
+        internal void SendSelected()
+        {
+            Selected?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/DateChangedEventArgs.cs b/src/ElmSharp/ElmSharp/DateChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..25d622c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// The DateChanged event in Calendar and DateTimeChanged event in DateTimeSelector.
+    /// contain DateChangedEventArgs as a parameter.
+    /// </summary>
+    public class DateChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the OldDate property of the given DateChangedEventArgs.
+        /// </summary>
+        public DateTime OldDate { get; private set; }
+
+        /// <summary>
+        /// Gets the NewDate property of the given DateChangedEventArgs.
+        /// </summary>
+        public DateTime NewDate { get; private set; }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the DateChangedEventArgs class.
+        /// </summary>
+        /// <param name="oldDate">
+        /// Old date when DateChanged event or DateTimeChanged event triggered
+        /// </param>
+        /// <param name="newDate">
+        /// New date when DateChanged event or DateTimeChanged event triggered
+        /// </param>
+        public DateChangedEventArgs(DateTime oldDate, DateTime newDate)
+        {
+            this.OldDate = oldDate;
+            this.NewDate = newDate;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/DateTimeSelector.cs b/src/ElmSharp/ElmSharp/DateTimeSelector.cs
new file mode 100755 (executable)
index 0000000..584c236
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration of datetime field types for DateTimeSelector.
+    /// </summary>
+    public enum DateTimeFieldType
+    {
+        Year,
+        Month,
+        Date,
+        Hour,
+        Minute,
+        AmPm
+    }
+
+    /// <summary>
+    /// It inherits <see cref="Layout"/>
+    /// DateTimeSelector is a widget to display and input date & time values.
+    /// This widget displays date and time as per the system's locale settings
+    /// (Date includes Day, Month & Year along with the defined separators and Time includes Hour, Minute & AM/PM fields. Separator for AM/PM field is ignored.
+    /// </summary>
+    public class DateTimeSelector : Layout
+    {
+        SmartEvent _changed;
+        DateTime _cacheDateTime;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the DateTimeSelector class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by DateTimeSelector
+        ///as a child.It's <see cref="EvasObject"/> type.</param>
+        public DateTimeSelector(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (s, e) =>
+            {
+                DateTime newDateTime = DateTime;
+                DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
+                DateTime = newDateTime;
+            };
+        }
+
+        /// <summary>
+        /// ItemSelected is raised when Datetime field value changed.
+        /// </summary>
+        public event EventHandler<DateChangedEventArgs> DateTimeChanged;
+
+        /// <summary>
+        /// Gets or sets the datetime format.
+        /// </summary>
+        /// <remarks>
+        /// format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p".
+        /// </remarks>
+        public string Format
+        {
+            get
+            {
+                return Interop.Elementary.elm_datetime_format_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_datetime_format_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the upper boundary of DateTime field.
+        /// </summary>
+        public DateTime MaximumDateTime
+        {
+            get
+            {
+                var tm = new Interop.Libc.SystemTime();
+                Interop.Elementary.elm_datetime_value_max_get(RealHandle, ref tm);
+                return tm;
+            }
+            set
+            {
+                Interop.Libc.SystemTime tm = value;
+                Interop.Elementary.elm_datetime_value_max_set(RealHandle, ref tm);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the lower boundary of DateTime field.
+        /// </summary>
+        public DateTime MinimumDateTime
+        {
+            get
+            {
+                var tm = new Interop.Libc.SystemTime();
+                Interop.Elementary.elm_datetime_value_min_get(RealHandle, ref tm);
+                return tm;
+            }
+            set
+            {
+                Interop.Libc.SystemTime tm = value;
+                Interop.Elementary.elm_datetime_value_min_set(RealHandle, ref tm);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the current value of DateTime field.
+        /// </summary>
+        public DateTime DateTime
+        {
+            get
+            {
+                var tm = new Interop.Libc.SystemTime();
+                Interop.Elementary.elm_datetime_value_get(RealHandle, ref tm);
+                return tm;
+            }
+            set
+            {
+                Interop.Libc.SystemTime tm = value;
+                Interop.Elementary.elm_datetime_value_set(RealHandle, ref tm);
+                _cacheDateTime = value;
+            }
+        }
+
+        /// <summary>
+        /// Gets whether a field can be visible.
+        /// </summary>
+        /// <param name="type">Enumeration <see cref="DateTimeFieldType"/></param>
+        /// <returns>
+        /// The field is visible or not.
+        /// Type is bool.If visible, return true.
+        /// </returns>
+        public bool IsFieldVisible(DateTimeFieldType type)
+        {
+            return Interop.Elementary.elm_datetime_field_visible_get(RealHandle, (int)type);
+        }
+
+        /// <summary>
+        /// Sets the field limits of a field.
+        /// </summary>
+        /// <param name="type">Enumeration <see cref="DateTimeFieldType"/></param>
+        /// <param name="minimum">minimum limit</param>
+        /// <param name="maximum">maximum limit</param>
+        public void SetFieldLimit(DateTimeFieldType type, int minimum, int maximum)
+        {
+            Interop.Elementary.elm_datetime_field_limit_set(RealHandle, (int)type, minimum, maximum);
+        }
+
+        /// <summary>
+        /// Gets whether a field can be visible.
+        /// </summary>
+        /// <param name="type">Enumeration <see cref="DateTimeFieldType"/></param>
+        /// <param name="visible">When set as true, the field type visible.</param>
+        public void SetFieldVisible(DateTimeFieldType type, bool visible)
+        {
+            Interop.Elementary.elm_datetime_field_visible_set(RealHandle, (int)type, visible);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_datetime_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs b/src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..8407f6d
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// The DisplayedMonthChangedEvent in Calendar contain
+    /// DisplayedMonthChangedEventArgs as a parameter.
+    /// </summary>
+    public class DisplayedMonthChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the OldMonth property of the given DisplayedMonthChangedEventArgs.
+        /// </summary>
+        public int OldMonth { get; private set; }
+
+        /// <summary>
+        /// Gets the NewMonth property of the given DisplayedMonthChangedEventArgs.
+        /// </summary>
+        public int NewMonth { get; private set; }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the DisplayedMonthChangedEventArgs class.
+        /// </summary>
+        /// <param name="oldMonth">
+        /// old month of date when DisplayedMonthChangedEvent triggered.
+        /// </param>
+        /// <param name="newMonth">
+        /// new month of date when DisplayedMonthChangedEvent triggered.
+        /// </param>
+        public DisplayedMonthChangedEventArgs(int oldMonth, int newMonth)
+        {
+            this.OldMonth = oldMonth;
+            this.NewMonth = newMonth;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EcoreAnimator.cs b/src/ElmSharp/ElmSharp/EcoreAnimator.cs
new file mode 100755 (executable)
index 0000000..64a548d
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// EcoreAnimator is a helper class, it provides functions to manager animations.
+    /// </summary>
+    public static class EcoreAnimator
+    {
+        static readonly Dictionary<int, Func<bool>> _taskMap = new Dictionary<int, Func<bool>>();
+        static readonly Object _taskLock = new Object();
+        static int _newTaskId = 0;
+
+        static Interop.Ecore.EcoreTaskCallback _nativeHandler;
+
+        static EcoreAnimator()
+        {
+            _nativeHandler = NativeHandler;
+        }
+
+        /// <summary>
+        /// Gets current system time as a floating point value in seconds.
+        /// </summary>
+        /// <returns>Current system time</returns>
+        public static double GetCurrentTime()
+        {
+            return Interop.Ecore.ecore_time_get();
+        }
+
+        /// <summary>
+        /// Adds an animator to call <paramref name="handler"/> at every animation tick during main loop execution.
+        /// </summary>
+        /// <param name="handler">The function to call when it ticks off</param>
+        /// <returns>A handle to the new animator</returns>
+        public static IntPtr AddAnimator(Func<bool> handler)
+        {
+            int id = RegistHandler(handler);
+            return Interop.Ecore.ecore_animator_add(_nativeHandler, (IntPtr)id);
+        }
+
+        /// <summary>
+        /// Removes the specified animator from the animator list.
+        /// </summary>
+        /// <param name="anim">The specified animator handle</param>
+        public static void RemoveAnimator(IntPtr anim)
+        {
+            int taskId = (int)Interop.Ecore.ecore_animator_del(anim);
+            _taskMap.Remove(taskId);
+        }
+
+        static int RegistHandler(Func<bool> task)
+        {
+            int taskId;
+            lock (_taskLock)
+            {
+                taskId = _newTaskId++;
+            }
+            _taskMap[taskId] = task;
+            return taskId;
+        }
+
+        static bool NativeHandler(IntPtr userData)
+        {
+            int task_id = (int)userData;
+            Func<bool> userAction = null;
+            _taskMap.TryGetValue(task_id, out userAction);
+            return (userAction != null) ? userAction() : false;
+        }
+
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EcoreEvent.cs b/src/ElmSharp/ElmSharp/EcoreEvent.cs
new file mode 100755 (executable)
index 0000000..e42310c
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The EcoreEventType is type of EcoreEvent.
+    /// It includes some predefined instance.
+    /// </summary>
+    public class EcoreEventType
+    {
+        /// <summary>
+        /// Key down Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType KeyDown = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_KEY_DOWN");
+        /// <summary>
+        /// Key Up Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType KeyUp = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_KEY_UP");
+        /// <summary>
+        /// Mouse Button Down Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseButtonDown = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_DOWN");
+        /// <summary>
+        /// Mouse Button Up Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseButtonUp = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_UP");
+        /// <summary>
+        /// Mouse Button Cancel Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseButtonCancel = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_CANCEL");
+        /// <summary>
+        /// Mouse Move Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseMove = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_MOVE");
+        /// <summary>
+        /// Mouse Wheel Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseWheel = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_WHEEL");
+        /// <summary>
+        /// Mouse In Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseIn = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_IN");
+        /// <summary>
+        /// Mouse Out Ecore event type.
+        /// </summary>
+        public static readonly EcoreEventType MouseOut = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_OUT");
+
+        private string _lib;
+        private string _name;
+        private int _typeValue;
+
+        private EcoreEventType(string lib, string name)
+        {
+            _lib = lib;
+            _name = name;
+            _typeValue = -1;
+        }
+
+        /// <summary>
+        /// Gets the value associated with the specified type.
+        /// </summary>
+        /// <returns>The value of type.</returns>
+        public int GetValue()
+        {
+            if (_typeValue < 0)
+            {
+                IntPtr hDll = Interop.Libdl.LoadLibrary(_lib);
+                if (hDll != IntPtr.Zero)
+                {
+                    IntPtr pValue = Interop.Libdl.GetProcAddress(hDll, _name);
+                    if (pValue != IntPtr.Zero)
+                    {
+                        _typeValue = Marshal.ReadInt32(pValue);
+                    }
+                    Interop.Libdl.FreeLibrary(hDll);
+                }
+            }
+            return _typeValue;
+        }
+    }
+
+    /// <summary>
+    /// The EcoreEvent is a class to help to create events are being notified of events.
+    /// </summary>
+    /// <typeparam name="TEventArgs">Kinds of EventArgs</typeparam>
+    public class EcoreEvent<TEventArgs> : IDisposable where TEventArgs : EventArgs
+    {
+        public delegate TEventArgs EventInfoParser(IntPtr data, EcoreEventType type, IntPtr info);
+
+        private bool _disposed = false;
+        private EcoreEventType _eventType;
+        private readonly EventInfoParser _parser;
+        private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EcoreEvent class.
+        /// </summary>
+        /// <param name="type">EcoreEventType</param>
+        public EcoreEvent(EcoreEventType type) : this(type, null)
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EcoreEvent class.
+        /// </summary>
+        /// <param name="type">EcoreEventType</param>
+        /// <param name="parser">EventInfoParser</param>
+        public EcoreEvent(EcoreEventType type, EventInfoParser parser)
+        {
+            _eventType = type;
+            _parser = parser;
+        }
+
+        ~EcoreEvent()
+        {
+            Dispose(false);
+        }
+
+        private struct NativeCallback
+        {
+            public Interop.Ecore.EcoreEventCallback callback;
+            public IntPtr nativeHandler;
+            public EventHandler<TEventArgs> eventHandler;
+        }
+
+        /// <summary>
+        /// On Event Handler of EcoreEvent.
+        /// </summary>
+        public event EventHandler<TEventArgs> On
+        {
+            add
+            {
+                EventHandler<TEventArgs> handler = value;
+                var cb = new Interop.Ecore.EcoreEventCallback((data, type, info) =>
+                {
+                    TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(data, _eventType, info);
+                    handler(this, ea);
+                });
+                IntPtr hNative = Interop.Ecore.ecore_event_handler_add(_eventType.GetValue(), cb, IntPtr.Zero);
+                _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler, nativeHandler = hNative });
+            }
+            remove
+            {
+                EventHandler<TEventArgs> handler = value;
+                var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+                foreach (var cb in callbacks)
+                {
+                    Interop.Ecore.ecore_event_handler_del(cb.nativeHandler);
+                }
+            }
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (disposing)
+                {
+                    // Place holder to dispose managed state (managed objects).
+                }
+                foreach (var cb in _nativeCallbacks)
+                {
+                    Interop.Ecore.ecore_event_handler_del(cb.nativeHandler);
+                }
+                _nativeCallbacks.Clear();
+                _disposed = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+
+    /// <summary>
+    /// Event class for EcoreEvent
+    /// </summary>
+    public class EcoreEvent : EcoreEvent<EventArgs>
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the EcoreEvent class.
+        /// </summary>
+        /// <param name="type">EcoreEventType</param>
+        public EcoreEvent(EcoreEventType type) : base(type)
+        {
+        }
+    }
+}
+
diff --git a/src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs b/src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs
new file mode 100755 (executable)
index 0000000..d057716
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// The EcoreKeyEventArgs is a EventArgs to record Ecore event's key name and key code.
+    /// </summary>
+    public class EcoreKeyEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the KeyName property.The return type is string.
+        /// </summary>
+        public string KeyName { get; private set; }
+        /// <summary>
+        /// Gets the KeyCode property.The return type is int.
+        /// </summary>
+        public int KeyCode { get; private set; }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EcoreKeyEventArgs class.
+        /// </summary>
+        /// <param name="data">data</param>
+        /// <param name="type">type</param>
+        /// <param name="info">information </param>
+        /// <returns>new instance of the EcoreKeyEventArgs class</returns>
+        public static EcoreKeyEventArgs Create(IntPtr data, EcoreEventType type, IntPtr info)
+        {
+            var evt = Marshal.PtrToStructure<EcoreEventKey>(info);
+            return new EcoreKeyEventArgs { KeyName = evt.keyname, KeyCode = (int)evt.keycode };
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        struct EcoreEventKey
+        {
+            public string keyname;
+            public string key;
+            public string str;
+            public string compose;
+            public IntPtr window;
+            public IntPtr root_window;
+            public IntPtr event_window;
+            public uint timestamp;
+            public uint modifiers;
+            public int same_screen;
+            public uint keycode;
+            public IntPtr data;
+            public IntPtr dev;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EcoreMainloop.cs b/src/ElmSharp/ElmSharp/EcoreMainloop.cs
new file mode 100755 (executable)
index 0000000..505e2c0
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// EcoreMainloop is a helper class, it provide functions relative Ecore's main loop.
+    /// </summary>
+    public static class EcoreMainloop
+    {
+        static readonly Dictionary<int, Func<bool>> _taskMap = new Dictionary<int, Func<bool>>();
+        static readonly Object _taskLock = new Object();
+        static int _newTaskId = 0;
+
+        static Interop.Ecore.EcoreTaskCallback _nativeHandler;
+
+        static EcoreMainloop()
+        {
+            Interop.Ecore.ecore_init();
+            Interop.Ecore.ecore_main_loop_glib_integrate();
+            _nativeHandler = NativeHandler;
+        }
+
+        /// <summary>
+        /// Checks if you are calling this function from the main thread.
+        /// </summary>
+        /// <remarks>True is the calling function is the same thread, false otherwise.</remarks>
+        public static bool IsMainThread => Interop.Eina.eina_main_loop_is();
+
+        /// <summary>
+        /// Runs the application main loop.
+        /// </summary>
+        public static void Begin()
+        {
+            Interop.Ecore.ecore_main_loop_begin();
+        }
+
+        /// <summary>
+        /// Quits the main loop once all the events currently on the queue have been processed.
+        /// </summary>
+        public static void Quit()
+        {
+            Interop.Ecore.ecore_main_loop_quit();
+        }
+
+        /// <summary>
+        /// Adds an idler handler.
+        /// </summary>
+        /// <param name="task">The action to call when idling</param>
+        public static void Post(Action task)
+        {
+            int id = RegistHandler(() => { task(); return false; });
+            Interop.Ecore.ecore_idler_add(_nativeHandler, (IntPtr)id);
+        }
+
+        /// <summary>
+        /// Calls callback asynchronously in the main loop.
+        /// </summary>
+        /// <param name="task">The action wanted to be called</param>
+        public static void PostAndWakeUp(Action task)
+        {
+            int id = RegistHandler(() => { task(); return false; });
+            Interop.Ecore.ecore_main_loop_thread_safe_call_async(_nativeHandler, (IntPtr)id);
+        }
+
+        /// <summary>
+        /// Calls callback synchronously in the main loop.
+        /// </summary>
+        /// <param name="task">The action wanted to be called</param>
+        public static void Send(Action task)
+        {
+            int id = RegistHandler(() => { task(); return false; });
+            Interop.Ecore.ecore_main_loop_thread_safe_call_sync(_nativeHandler, (IntPtr)id);
+        }
+
+        /// <summary>
+        /// Creates a timer to call the given function in the given period of time.
+        /// </summary>
+        /// <param name="interval">The interval in seconds.</param>
+        /// <param name="handler">The given function.</param>
+        /// <returns>A timer object handler on success, NULL on failure.</returns>
+        public static IntPtr AddTimer(double interval, Func<bool> handler)
+        {
+            int id = RegistHandler(handler);
+            return Interop.Ecore.ecore_timer_add(interval, _nativeHandler, (IntPtr)id);
+        }
+
+        /// <summary>
+        /// Removes the specified timer from the timer list.
+        /// </summary>
+        /// <param name="id">The specified timer handler</param>
+        public static void RemoveTimer(IntPtr id)
+        {
+            int taskId = (int)Interop.Ecore.ecore_timer_del(id);
+            _taskMap.Remove(taskId);
+        }
+
+        static int RegistHandler(Func<bool> task)
+        {
+            int taskId;
+            lock (_taskLock)
+            {
+                taskId = _newTaskId++;
+            }
+            _taskMap[taskId] = task;
+            return taskId;
+        }
+
+        static bool NativeHandler(IntPtr user_data)
+        {
+            int task_id = (int)user_data;
+            Func<bool> userAction = null;
+            if (_taskMap.TryGetValue(task_id, out userAction))
+            {
+                bool result = false;
+
+                if (userAction != null)
+                    result = userAction();
+
+                if (result == false)
+                    _taskMap.Remove(task_id);
+
+                return result;
+            }
+            return false;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs b/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs
new file mode 100755 (executable)
index 0000000..0fa013b
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System.Threading;
+
+namespace ElmSharp
+{
+
+    /// <summary>
+    /// Provides a synchronization context for the efl application.
+    /// </summary>
+    public class EcoreSynchronizationContext : SynchronizationContext
+    {
+        /// <summary>
+        /// Initializes a new instance of the EcoreSynchronizationContext class.
+        /// </summary>
+        public EcoreSynchronizationContext()
+        {
+        }
+
+        /// <summary>
+        /// Initilizes a new EcoreSynchronizationContext and install into current thread
+        /// </summary>
+        /// <remarks>
+        /// It is equivalent
+        /// <code>
+        /// SetSynchronizationContext(new EcoreSynchronizationContext());
+        /// </code>
+        /// </remarks>
+        public static void Initialize()
+        {
+            SetSynchronizationContext(new EcoreSynchronizationContext());
+        }
+
+        /// <summary>
+        /// Dispatches an asynchronous message to a Ecore main loop.
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>The Post method starts an asynchronous request to post a message.</remarks>
+        public override void Post(SendOrPostCallback d, object state)
+        {
+            EcoreMainloop.PostAndWakeUp(() =>
+            {
+                d(state);
+            });
+        }
+
+        /// <summary>
+        /// Dispatches a synchronous message to a Ecore main loop
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>
+        /// The Send method starts a synchronous request to send a message.</remarks>
+        public override void Send(SendOrPostCallback d, object state)
+        {
+            EcoreMainloop.Send(() =>
+            {
+                d(state);
+            });
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EdjeObject.cs b/src/ElmSharp/ElmSharp/EdjeObject.cs
new file mode 100644 (file)
index 0000000..6bd1fb6
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The EdjeObject is a class that evas object exist in
+    /// </summary>
+    public class EdjeObject
+    {
+        IntPtr _edjeHandle;
+        Dictionary<SignalData, Interop.Elementary.Edje_Signal_Cb> _signalDatas = new Dictionary<SignalData, Interop.Elementary.Edje_Signal_Cb>();
+
+        internal EdjeObject(IntPtr handle)
+        {
+            _edjeHandle = handle;
+        }
+
+        /// <summary>
+        /// Checks whether an edje part exists in a given edje object's group definition.
+        /// This function returns if a given part exists in the edje group bound to object obj
+        /// </summary>
+        /// <remarks>This call is useful, for example, when one could expect a given GUI element, depending on the theme applied to obj.</remarks>
+        /// <param name="part">The part's name to check for existence in obj's group</param>
+        /// <returns>TRUE, if the edje part exists in obj's group, otherwise FALSE</returns>
+        public EdjeTextPartObject this[string part]
+        {
+            get
+            {
+                if (Interop.Elementary.edje_object_part_exists(_edjeHandle, part))
+                {
+                    return new EdjeTextPartObject(_edjeHandle, part);
+                }
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Sends/emits an edje signal to a given edje object.
+        /// </summary>
+        /// <param name="emission">The signal's "emission" string</param>
+        /// <param name="source">The signal's "source" string</param>
+        public void EmitSignal(string emission, string source)
+        {
+            Interop.Elementary.edje_object_signal_emit(_edjeHandle, emission, source);
+        }
+
+        /// <summary>
+        /// Deletes the object color class.
+        /// This function deletes any values at the object level for the specified object and color class.
+        /// </summary>
+        /// <remarks>Deleting the color class defined in the theme file.</remarks>
+        /// <param name="part">The color class to be deleted</param>
+        public void DeleteColorClass(string part)
+        {
+            Interop.Elementary.edje_object_color_class_del(_edjeHandle, part);
+        }
+
+        /// <summary>
+        /// Sets the object color class.
+        /// </summary>
+        /// <param name="colorClass">The color class name.</param>
+        /// <param name="red">The object Red value.</param>
+        /// <param name="green">The object Green value.</param>
+        /// <param name="blue">The object Blue value.</param>
+        /// <param name="alpha">The object Alpha value.</param>
+        /// <param name="outlineRed">The outline Red value.</param>
+        /// <param name="outlineGreen">The outline Green value.</param>
+        /// <param name="outlineBlue">The outline Blue value.</param>
+        /// <param name="outlineAlpha">The outline Alpha value.</param>
+        /// <param name="shadowRed">The shadow Red value.</param>
+        /// <param name="shadowGreen">The shadow Green value.</param>
+        /// <param name="shadowBlue">The shadow Blue value.</param>
+        /// <param name="shadowAlpha">The shadow Alpha value.</param>
+        /// <returns>True if succeed, otherwise False</returns>
+        public bool SetColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha,
+            int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha)
+        {
+            return Interop.Elementary.edje_object_color_class_set(_edjeHandle, colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha,
+                shadowRed, shadowGreen, shadowBlue, shadowAlpha);
+        }
+
+        /// <summary>
+        /// Gets the object color class.
+        /// </summary>
+        /// <param name="colorClass">The color class name.</param>
+        /// <param name="red">The object Red value.</param>
+        /// <param name="green">The object Green value.</param>
+        /// <param name="blue">The object Blue value.</param>
+        /// <param name="alpha">The object Alpha value.</param>
+        /// <param name="outlineRed">The outline Red value.</param>
+        /// <param name="outlineGreen">The outline Green value.</param>
+        /// <param name="outlineBlue">The outline Blue value.</param>
+        /// <param name="outlineAlpha">The outline Alpha value.</param>
+        /// <param name="shadowRed">The shadow Red value.</param>
+        /// <param name="shadowGreen">The shadow Green value.</param>
+        /// <param name="shadowBlue">The shadow Blue value.</param>
+        /// <param name="shadowAlpha">The shadow Alpha value.</param>
+        /// <returns>True if succeed, otherwise False</returns>
+        public bool GetColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue, out int outlineAlpha,
+            out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha)
+        {
+            return Interop.Elementary.edje_object_color_class_get(_edjeHandle, colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha,
+                out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha);
+        }
+
+        /// <summary>
+        /// Sets Edje text class.
+        /// </summary>
+        /// <param name="textClass">The text class name.</param>
+        /// <param name="font">        Font name.</param>
+        /// <param name="fontSize">Font size.</param>
+        /// <returns>True if succeed, otherwise False</returns>
+        public bool SetTextClass(string textClass, string font, int fontSize)
+        {
+            return Interop.Elementary.edje_object_text_class_set(_edjeHandle, textClass, font, fontSize);
+        }
+
+        /// <summary>
+        /// Gets Edje text class.
+        /// </summary>
+        /// <param name="textClass">The text class name.</param>
+        /// <param name="font">Font name.</param>
+        /// <param name="fontSize">Font size.</param>
+        /// <returns>True if succeed, otherwise False</returns>
+        public bool GetTextClass(string textClass, out string font, out int fontSize)
+        {
+            return Interop.Elementary.edje_object_text_class_get(_edjeHandle, textClass, out font, out fontSize);
+        }
+
+        /// <summary>
+        /// Adds Action for an arriving edje signal, emitted by a given Ejde object.
+        /// </summary>
+        /// <param name="emission">The signal's "emission" string</param>
+        /// <param name="source">The signal's "source" string</param>
+        /// <param name="action">The action to be executed when the signal is emitted</param>
+        public void AddSignalAction(string emission, string source, Action<string, string> action)
+        {
+            if (emission != null && source != null && action != null)
+            {
+                var signalData = new SignalData(emission, source, action);
+                if (!_signalDatas.ContainsKey(signalData))
+                {
+                    var signalCallback = new Interop.Elementary.Edje_Signal_Cb((d, o, e, s) =>
+                    {
+                        action(e, s);
+                    });
+
+                    Interop.Elementary.edje_object_signal_callback_add(_edjeHandle, emission, source, signalCallback, IntPtr.Zero);
+                    _signalDatas.Add(signalData, signalCallback);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Deletes a signal-triggered action from an object.
+        /// </summary>
+        /// <param name="emission">The signal's "emission" string</param>
+        /// <param name="source">The signal's "source" string</param>
+        /// <param name="action">The action to be executed when the signal is emitted</param>
+        public void DeleteSignalAction(string emission, string source, Action<string, string> action)
+        {
+            if (emission != null && source != null && action != null)
+            {
+                var signalData = new SignalData(emission, source, action);
+
+                Interop.Elementary.Edje_Signal_Cb signalCallback = null;
+                _signalDatas.TryGetValue(signalData, out signalCallback);
+
+                if (signalCallback != null)
+                {
+                    Interop.Elementary.edje_object_signal_callback_del(_edjeHandle, emission, source, signalCallback);
+                    _signalDatas.Remove(signalData);
+                }
+            }
+        }
+
+        class SignalData
+        {
+            public string Emission { get; set; }
+            public string Source { get; set; }
+
+            public Action<string, string> Action { get; set; }
+
+            public SignalData(string emission, string source, Action<string, string> action)
+            {
+                Emission = emission;
+                Source = source;
+                Action = action;
+            }
+
+            public override bool Equals(object obj)
+            {
+                SignalData s = obj as SignalData;
+                if (s == null)
+                {
+                    return false;
+                }
+                return (Emission == s.Emission) && (Source == s.Source) && (Action == s.Action);
+            }
+
+            public override int GetHashCode()
+            {
+                int hashCode = Emission.GetHashCode();
+                hashCode ^= Source.GetHashCode();
+                hashCode ^= Action.GetHashCode();
+                return hashCode;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An EdjeTextPartObject is a class dealing with parts of type text.
+    /// </summary>
+    public class EdjeTextPartObject
+    {
+        string _part;
+        IntPtr _edjeHandle;
+
+        internal EdjeTextPartObject(IntPtr edjeHandle, string part)
+        {
+            _edjeHandle = edjeHandle;
+            _part = part;
+        }
+
+        /// <summary>
+        /// Gets the name of the EdjeTextPartObject
+        /// </summary>
+        public string Name { get { return _part; } }
+
+        /// <summary>
+        /// Gets or sets the text for an object part.
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return Interop.Elementary.edje_object_part_text_get(_edjeHandle, _part);
+            }
+            set
+            {
+                Interop.Elementary.edje_object_part_text_set(_edjeHandle, _part, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the style of the object part.
+        /// </summary>
+        public string TextStyle
+        {
+            get
+            {
+                return Interop.Elementary.edje_object_part_text_style_user_peek(_edjeHandle, _part);
+            }
+            set
+            {
+                if (value == null)
+                {
+                    Interop.Elementary.edje_object_part_text_style_user_pop(_edjeHandle, _part);
+                }
+                else
+                {
+                    Interop.Elementary.edje_object_part_text_style_user_push(_edjeHandle, _part, value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the geometry of a given edje part, in a given edje object's group definition, relative to the object's area.
+        /// </summary>
+        public Rect Geometry
+        {
+            get
+            {
+                int x, y, w, h;
+                Interop.Elementary.edje_object_part_geometry_get(_edjeHandle, _part, out x, out y, out w, out h);
+                return new Rect(x, y, w, h);
+            }
+        }
+
+        /// <summary>
+        /// Gets the native width and height.
+        /// </summary>
+        public Size TextBlockNativeSize
+        {
+            get
+            {
+                int w;
+                int h;
+                IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part);
+                Interop.Evas.evas_object_textblock_size_native_get(part, out w, out h);
+                return new Size(w, h);
+            }
+        }
+
+        /// <summary>
+        /// Gets the formatted width and height.
+        /// </summary>
+        public Size TextBlockFormattedSize
+        {
+            get
+            {
+                int w;
+                int h;
+                IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part);
+                Interop.Evas.evas_object_textblock_size_formatted_get(part, out w, out h);
+                return new Size(w, h);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/EffectBase.cs b/src/ElmSharp/ElmSharp/EffectBase.cs
new file mode 100755 (executable)
index 0000000..19eddb0
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// EffectBase class for the TransitEffect
+    /// </summary>
+    public abstract class EffectBase
+    {
+        /// <summary>
+        /// EffectEneded event will be triggered when be effect ended.
+        /// </summary>
+        public event EventHandler EffectEnded;
+
+        internal abstract IntPtr CreateEffect(IntPtr transit);
+
+        internal void SendEffectEnd()
+        {
+            EffectEnded?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Elementary.cs b/src/ElmSharp/ElmSharp/Elementary.cs
new file mode 100644 (file)
index 0000000..7984f83
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+using System.IO;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Focus Autoscroll Mode
+    /// </summary>
+    public enum FocusAutoScrollMode
+    {
+        /// <summary>
+        /// Directly show the focused region or item automatically
+        /// </summary>
+        Show,
+        /// <summary>
+        /// Do not show the focused region or item automatically
+        /// </summary>
+        None,
+        /// <summary>
+        /// Bring in the focused region or item automatically which might invole the scrolling
+        /// </summary>
+        BringIn
+    }
+
+    /// <summary>
+    /// The Elementary is a General Elementary,a VERY SIMPLE toolkit.
+    /// </summary>
+    public static class Elementary
+    {
+        private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj";
+
+        /// <summary>
+        /// Gets or sets the configured finger size.
+        /// </summary>
+        public static int FingerSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_finger_size_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_finger_size_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the enable status of the focus highlight animation
+        /// </summary>
+        public static bool IsFocusHighlightAnimation
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_focus_highlight_animate_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_focus_highlight_animate_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the system mirrored mode.
+        /// This determines the default mirrored mode of widgets.
+        /// </summary>
+        public static bool IsMirrored
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_mirrored_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_mirrored_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the enable status of the focus highlight.
+        /// </summary>
+        public static bool CanFocusHighlight
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_focus_highlight_enabled_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_focus_highlight_enabled_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the base scale of the application.
+        /// </summary>
+        public static double AppBaseScale
+        {
+            get
+            {
+                return Interop.Elementary.elm_app_base_scale_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_app_base_scale_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the global scaling factor.
+        /// </summary>
+        public static double Scale
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_scale_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_scale_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the amount of inertia a scroller imposes during region bring animations.
+        /// </summary>
+        public static double BringInScrollFriction
+        {
+            get
+            {
+                return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value);
+            }
+        }
+
+        /// <summary>
+        /// Gets of sets focus auto scroll mode.
+        /// </summary>
+        public static FocusAutoScrollMode FocusAutoScrollMode
+        {
+            get
+            {
+                return (FocusAutoScrollMode)Interop.Elementary.elm_config_focus_autoscroll_mode_get();
+            }
+            set
+            {
+                Interop.Elementary.elm_config_focus_autoscroll_mode_set((Interop.Elementary.Elm_Focus_Autoscroll_Mode)value);
+            }
+        }
+
+        /// <summary>
+        /// Initializes Elementary.
+        /// </summary>
+        public static void Initialize()
+        {
+            Interop.Elementary.elm_init(0, null);
+        }
+
+        /// <summary>
+        /// Shuts down Elementary.
+        /// </summary>
+        public static void Shutdown()
+        {
+            Interop.Elementary.elm_shutdown();
+        }
+
+        /// <summary>
+        /// Runs Elementary's main loop.
+        /// </summary>
+        public static void Run()
+        {
+            Interop.Elementary.elm_run();
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void ThemeOverlay()
+        {
+            if (File.Exists(_themeFilePath))
+            {
+                AddThemeOverlay(_themeFilePath);
+            }
+        }
+
+        /// <summary>
+        /// Prepends a theme overlay to the list of overlays
+        /// </summary>
+        /// <param name="filePath">The Edje file path to be used.</param>
+        public static void AddThemeOverlay(string filePath)
+        {
+            Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath);
+        }
+
+        /// <summary>
+        /// Delete a theme overlay from the list of overlays
+        /// </summary>
+        /// <param name="filePath">The name of the theme overlay.</param>
+        public static void DeleteThemeOverlay(string filePath)
+        {
+            Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath);
+        }
+
+        /// <summary>
+        /// Free a theme
+        /// </summary>
+        public static void FreeTheme()
+        {
+            Interop.Elementary.elm_theme_free(IntPtr.Zero);
+        }
+
+        /// <summary>
+        /// Set the theme search order for the given theme
+        /// </summary>
+        /// <param name="theme">Theme search string</param>
+        /// <remarks>This sets the search string for the theme in path-notation from first theme to search, to last, delimited by the : character. Example:"shiny:/path/to/file.edj:default"</remarks>
+        public static void SetTheme(string theme)
+        {
+            Interop.Elementary.elm_theme_set(IntPtr.Zero, theme);
+        }
+
+        /// <summary>
+        /// Flush the current theme.
+        /// </summary>
+        public static void FlushTheme()
+        {
+            Interop.Elementary.elm_theme_flush(IntPtr.Zero);
+        }
+
+        /// <summary>
+        /// This flushes all themes (default and specific ones).
+        /// </summary>
+        public static void FlushAllThemes()
+        {
+            Interop.Elementary.elm_theme_full_flush();
+        }
+
+        /// <summary>
+        /// Deletes a theme extension from the list of extensions.
+        /// </summary>
+        /// <param name="item">The name of the theme extension.</param>
+        public static void DeleteThemeExtention(string item)
+        {
+            Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static double GetSystemScrollFriction()
+        {
+            return BringInScrollFriction;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void SetSystemScrollFriction(double timeSet)
+        {
+            BringInScrollFriction = timeSet;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static string GetProfile()
+        {
+            return Interop.Elementary.elm_config_profile_get();
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void SetScale(double scale)
+        {
+            Scale = scale;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static double GetScale()
+        {
+            return Scale;
+        }
+
+        /// <summary>
+        /// Flush all caches.
+        /// Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje's, Evas' and Eet's cache.
+        /// </summary>
+        public static void FlushAllCashe()
+        {
+            Interop.Elementary.elm_cache_all_flush();
+        }
+
+        /// <summary>
+        /// Changes the language of the current application.
+        /// </summary>
+        /// <param name="language">The language to set, must be the full name of the locale.</param>
+        public static void SetLanguage(string language)
+        {
+            Interop.Elementary.elm_language_set(language);
+        }
+
+        /// <summary>
+        /// Sets a new policy's value (for a given policy group/identifier).
+        /// </summary>
+        /// <param name="policy">The policy identifier</param>
+        /// <param name="value">The policy value, which depends on the identifier</param>
+        /// <returns></returns>
+        public static bool SetPolicy(uint policy, int value)
+        {
+            return Interop.Elementary.elm_policy_set(policy, value);
+        }
+
+        /// <summary>
+        /// Reloads Elementary's configuration, bounded to the current selected profile.
+        /// </summary>
+        public static void ReloadConfig()
+        {
+            Interop.Elementary.elm_config_reload();
+        }
+
+        /// <summary>
+        /// Flushes all config settings and then applies those settings to all applications using elementary on the current display.
+        /// </summary>
+        public static void FlushAllConfig()
+        {
+            Interop.Elementary.elm_config_all_flush();
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ElmScrollConfig.cs b/src/ElmSharp/ElmSharp/ElmScrollConfig.cs
new file mode 100644 (file)
index 0000000..974d74f
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The ElmScrollConfig is a scrollable views's config
+    /// </summary>
+    public static class ElmScrollConfig
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static double BringInScrollFriction
+        {
+            get
+            {
+                return Elementary.BringInScrollFriction;
+            }
+            set
+            {
+                Elementary.BringInScrollFriction = value;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Entry.cs b/src/ElmSharp/ElmSharp/Entry.cs
new file mode 100755 (executable)
index 0000000..50f3c4a
--- /dev/null
@@ -0,0 +1,1025 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for describing InputPanel layout type.
+    /// </summary>
+    public enum InputPanelLayout
+    {
+        /// <summary>
+        /// InputPanel layout type default.
+        /// </summary>
+        Normal,
+
+        /// <summary>
+        /// InputPanel layout type number.
+        /// </summary>
+        Number,
+
+        /// <summary>
+        /// InputPanel layout type email.
+        /// </summary>
+        Email,
+
+        /// <summary>
+        /// InputPanel layout type url.
+        /// </summary>
+        Url,
+
+        /// <summary>
+        /// InputPanel layout type phone.
+        /// </summary>
+        PhoneNumber,
+
+        /// <summary>
+        /// InputPanel layout type ip.
+        /// </summary>
+        Ip,
+
+        /// <summary>
+        /// InputPanel layout type month.
+        /// </summary>
+        Month,
+
+        /// <summary>
+        /// InputPanel layout type number.
+        /// </summary>
+        NumberOnly,
+
+        /// <summary>
+        /// InputPanel layout type error type. Do not use it directly!
+        /// </summary>
+        Invalid,
+
+        /// <summary>
+        /// InputPanel layout type hexadecimal.
+        /// </summary>
+        Hex,
+
+        /// <summary>
+        /// InputPanel layout type terminal type, esc, alt, ctrl, etc.
+        /// </summary>
+        Terminal,
+
+        /// <summary>
+        /// InputPanel layout type password.
+        /// </summary>
+        Password,
+
+        /// <summary>
+        /// Keyboard layout type date and time.
+        /// </summary>
+        DateTime,
+
+        /// <summary>
+        /// InputPanel layout type emoticons.
+        /// </summary>
+        Emoticon
+    }
+
+    /// <summary>
+    /// Enumeration that defines the "Return" key types on the input panel (virtual keyboard).
+    /// </summary>
+    public enum InputPanelReturnKeyType
+    {
+        /// <summary>
+        /// Default key type
+        /// </summary>
+        Default,
+
+        /// <summary>
+        /// Done key type
+        /// </summary>
+        Done,
+
+        /// <summary>
+        /// Go key type
+        /// </summary>
+        Go,
+
+        /// <summary>
+        /// Join key type
+        /// </summary>
+        Join,
+
+        /// <summary>
+        /// Login key type
+        /// </summary>
+        Login,
+
+        /// <summary>
+        /// Next key type
+        /// </summary>
+        Next,
+
+        /// <summary>
+        /// Search string or magnifier icon key type
+        /// </summary>
+        Search,
+
+        /// <summary>
+        /// Send key type
+        /// </summary>
+        Send,
+
+        /// <summary>
+        /// Sign-in key type
+        /// </summary>
+        Signin
+    }
+
+    /// <summary>
+    /// Enumeration that defines the autocapitalization types.
+    /// </summary>
+    public enum AutoCapital
+    {
+        /// <summary>
+        /// No autocapitalization when typing
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// Autocapitalize each typed word
+        /// </summary>
+        Word,
+
+        /// <summary>
+        /// Autocapitalize the start of each sentence
+        /// </summary>
+        Sentence,
+
+        /// <summary>
+        /// Autocapitalize all letters
+        /// </summary>
+        All
+    }
+
+    /// <summary>
+    /// Enumeration that defines the entry's copy & paste policy.
+    /// </summary>
+    public enum CopyAndPasteMode
+    {
+        /// <summary>
+        /// Copy & paste text with markup tag
+        /// </summary>
+        Markup,
+
+        /// <summary>
+        /// Copy & paste text without item(image) tag
+        /// </summary>
+        NoImage,
+
+        /// <summary>
+        /// Copy & paste text without markup tag
+        /// </summary>
+        PlainText
+    }
+
+    /// <summary>
+    /// Enumeration that defines the text format types.
+    /// </summary>
+    public enum TextFormat
+    {
+        /// <summary>
+        /// Plain type
+        /// </summary>
+        Plain,
+
+        /// <summary>
+        /// Markup type
+        /// </summary>
+        Markup
+    }
+
+    /// <summary>
+    /// Enumeration that defines the types of Input Hints.
+    /// </summary>
+    public enum InputHints
+    {
+        /// <summary>
+        /// No active hints
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// suggest word auto completion
+        /// </summary>
+        AutoComplete,
+
+        /// <summary>
+        /// typed text should not be stored.
+        /// </summary>
+        SensitiveData,
+    }
+
+    /// <summary>
+    /// Enumeration that defines the input panel (virtual keyboard) language modes.
+    /// </summary>
+    public enum InputPanelLanguage
+    {
+        /// <summary>
+        /// Automatic language mode
+        /// </summary>
+        Automatic,
+
+        /// <summary>
+        /// Alphabet language mode
+        /// </summary>
+        Alphabet,
+    }
+
+    /// <summary>
+    /// The entry is a convenience widget that shows a box in which the user can enter text.
+    /// </summary>
+    public class Entry : Layout
+    {
+        SmartEvent _clicked;
+        SmartEvent _changedByUser;
+        SmartEvent _cursorChanged;
+        SmartEvent _activated;
+
+        Dictionary<Func<string, EvasObject>, Interop.Elementary.Elm_Entry_Item_Provider_Cb> _itemsProvider = new Dictionary<Func<string, EvasObject>, Interop.Elementary.Elm_Entry_Item_Provider_Cb>();
+        Dictionary<Func<Entry, string, string>, Interop.Elementary.Elm_Entry_Filter_Cb> _textFilters = new Dictionary<Func<Entry, string, string>, Interop.Elementary.Elm_Entry_Filter_Cb>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Entry class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Entry will be attached as a child.</param>
+        public Entry(EvasObject parent) : base(parent)
+        {
+            _clicked = new SmartEvent(this, this.RealHandle, "clicked");
+            _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty);
+
+            _changedByUser = new SmartEvent(this, this.RealHandle, "changed,user");
+            _changedByUser.On += (s, e) => ChangedByUser?.Invoke(this, EventArgs.Empty);
+
+            _cursorChanged = new SmartEvent(this, this.RealHandle, "cursor,changed");
+            _cursorChanged.On += (s, e) => CursorChanged?.Invoke(this, EventArgs.Empty);
+
+            _activated = new SmartEvent(this, this.RealHandle, "activated");
+            _activated.On += (s, e) => Activated?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Activated will be triggered when the entry in Activated stated.
+        /// </summary>
+        public event EventHandler Activated;
+
+        /// <summary>
+        /// Clicked will be triggered when the entry is clicked.
+        /// </summary>
+        public event EventHandler Clicked;
+
+        /// <summary>
+        /// ChangedByUser will be triggered when the entry changed by user.
+        /// </summary>
+        public event EventHandler ChangedByUser;
+
+        /// <summary>
+        /// CursorChanged will be triggered when the Cursor in the entry is changed.
+        /// </summary>
+        public event EventHandler CursorChanged;
+
+        /// <summary>
+        /// Sets or gets the entry to the single line mode.
+        /// </summary>
+        public bool IsSingleLine
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_single_line_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_single_line_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the entry to the password mode.
+        /// </summary>
+        public bool IsPassword
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_password_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_password_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the entry is editable.
+        /// </summary>
+        public bool IsEditable
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_editable_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_editable_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the entry is empty.
+        /// </summary>
+        public bool IsEmpty
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_is_empty(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets text currently shown in the object entry.
+        /// </summary>
+        public override string Text
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_entry_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_entry_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the style on the top of the user style stack.
+        /// </summary>
+        /// <remarks>If there is styles in the user style stack, the properties in the top style of user style stack will replace the properties in current theme. The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold').</remarks>
+        public string TextStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_text_style_user_peek(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_text_style_user_push(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the current position of the cursor in the entry.
+        /// </summary>
+        public int CursorPosition
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_cursor_pos_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_cursor_pos_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the scrollable state of the entry.
+        /// </summary>
+        public bool Scrollable
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_scrollable_get(RealHandle);
+            }
+            set
+            {
+                // HACK: Enabling the scrollable property of an entry causes its internal
+                //       hierarchy to change, making the internal edje object inaccessible.
+                //       Access it before the property is set, to cache the edje object's handle.
+                if (value)
+                {
+                    var dummy = EdjeObject;
+                }
+                Interop.Elementary.elm_entry_scrollable_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets the autocapitalization type on the immodule.
+        /// </summary>
+        public AutoCapital AutoCapital
+        {
+            get
+            {
+                return (AutoCapital)Interop.Elementary.elm_entry_autocapital_type_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_autocapital_type_set(RealHandle, (Interop.Elementary.AutocapitalType)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets the entry object's 'autosave' status.
+        /// </summary>
+        public bool IsAutoSave
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_autosave_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_autosave_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets entry text paste/drop mode.
+        /// </summary>
+        public CopyAndPasteMode CopyAndPasteMode
+        {
+            get
+            {
+                return (CopyAndPasteMode)Interop.Elementary.elm_entry_cnp_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_cnp_mode_set(RealHandle, (Interop.Elementary.CopyAndPasteMode)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the geometry of the cursor.
+        /// </summary>
+        public Rect CursorGeometry
+        {
+            get
+            {
+                int x, y, w, h;
+                Interop.Elementary.elm_entry_cursor_geometry_get(RealHandle, out x, out y, out w, out h);
+                return new Rect(x, y, w, h);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether a format node exists at the current cursor position.
+        /// </summary>
+        public bool IsCursorFormat
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_cursor_is_format_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets if the current cursor position holds a visible format node.
+        /// </summary>
+        public bool IsCursorVisibelFormat
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_cursor_is_visible_format_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets the value of input hint.
+        /// </summary>
+        public InputHints InputHint
+        {
+            get
+            {
+                return (InputHints)Interop.Elementary.elm_entry_input_hint_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_input_hint_set(RealHandle, (Interop.Elementary.InputHints)value);
+            }
+        }
+
+        /// <summary>
+        ///  Sets or gets the language mode of the input panel.
+        /// </summary>
+        public InputPanelLanguage InputPanelLanguage
+        {
+            get
+            {
+                return (InputPanelLanguage)Interop.Elementary.elm_entry_input_panel_language_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_input_panel_language_set(RealHandle, (Interop.Elementary.InputPanelLanguage)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the input panel layout variation of the entry.
+        /// </summary>
+        public int InputPanelVariation
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_input_panel_layout_variation_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_input_panel_layout_variation_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the line wrap type to use on multi-line entries.
+        /// </summary>
+        public WrapType LineWrapType
+        {
+            get
+            {
+                return (WrapType)Interop.Elementary.elm_entry_line_wrap_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_line_wrap_set(RealHandle, (Interop.Elementary.WrapType)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the entry should allow to use the text prediction.
+        /// </summary>
+        public bool PredictionAllowed
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_prediction_allow_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_prediction_allow_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the return key on the input panel should be disabled or not.
+        /// </summary>
+        public bool InputPanelReturnKeyDisabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_input_panel_return_key_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_input_panel_return_key_disabled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the attribute to show the input panel in case of only an user's explicit Mouse Up event.
+        /// It doesn't request to show the input panel even though it has focus.
+        /// If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)
+        /// </summary>
+        public bool InputPanelShowByOnDemand
+        {
+            get
+            {
+                return Interop.Elementary.elm_entry_input_panel_show_on_demand_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_entry_input_panel_show_on_demand_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the file (and implicitly loads it) for the text to display and then edit.
+        /// </summary>
+        /// <param name="file">The path to the file to load and save</param>
+        /// <param name="textFormat">The file format</param>
+        public void SetFile(string file, TextFormat textFormat)
+        {
+            Interop.Elementary.elm_entry_file_set(RealHandle, file, (Interop.Elementary.TextFormat)textFormat);
+        }
+
+        /// <summary>
+        /// Converts a markup (HTML-like) string into UTF-8.
+        /// </summary>
+        /// <param name="markup">The string (in markup) to be converted</param>
+        /// <returns>The converted string (in UTF-8) </returns>
+        public static string ConvertMarkupToUtf8(string markup)
+        {
+            return Interop.Elementary.elm_entry_markup_to_utf8(markup);
+        }
+
+        /// <summary>
+        /// Moves the cursor by one position to the right within the entry.
+        /// </summary>
+        /// <returns></returns>
+        public bool MoveCursorNext()
+        {
+            return Interop.Elementary.elm_entry_cursor_next(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor one place to the left within the entry.
+        /// </summary>
+        /// <returns>TRUE on success, otherwise FALSE on failure</returns>
+        public bool MoveCursorPrev()
+        {
+            return Interop.Elementary.elm_entry_cursor_prev(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor one line up within the entry.
+        /// </summary>
+        /// <returns>TRUE on success, otherwise FALSE on failure</returns>
+        public bool MoveCursorUp()
+        {
+            return Interop.Elementary.elm_entry_cursor_up(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor one line down within the entry.
+        /// </summary>
+        /// <returns>TRUE on success, otherwise FALSE on failure</returns>
+        public bool MoveCursorDown()
+        {
+            return Interop.Elementary.elm_entry_cursor_down(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor to the beginning of the entry.
+        /// </summary>
+        public void MoveCursorBegin()
+        {
+            Interop.Elementary.elm_entry_cursor_begin_set(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor to the end of the entry.
+        /// </summary>
+        public void MoveCursorEnd()
+        {
+            Interop.Elementary.elm_entry_cursor_end_set(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor to the beginning of the current line.
+        /// </summary>
+        public void MoveCursorLineBegin()
+        {
+            Interop.Elementary.elm_entry_cursor_line_begin_set(RealHandle);
+        }
+
+        /// <summary>
+        /// Moves the cursor to the end of the current line.
+        /// </summary>
+        public void MoveCursorLineEnd()
+        {
+            Interop.Elementary.elm_entry_cursor_line_end_set(RealHandle);
+        }
+
+        /// <summary>
+        /// Sets the input panel layout of the entry.
+        /// </summary>
+        /// <param name="layout">The layout type</param>
+        public void SetInputPanelLayout(InputPanelLayout layout)
+        {
+            Interop.Elementary.elm_entry_input_panel_layout_set(RealHandle, (Interop.Elementary.InputPanelLayout)layout);
+        }
+
+        /// <summary>
+        /// Sets the attribute to show the input panel automatically.
+        /// </summary>
+        /// <param name="enabled">If true the input panel appears when the entry is clicked or has focus, otherwise false</param>
+        public void SetInputPanelEnabled(bool enabled)
+        {
+            Interop.Elementary.elm_entry_input_panel_enabled_set(RealHandle, enabled);
+        }
+
+        /// <summary>
+        /// Sets the "return" key type. This type is used to set the string or icon on the "return" key of the input panel.
+        /// </summary>
+        /// <param name="keyType">The type of "return" key on the input panel</param>
+        public void SetInputPanelReturnKeyType(InputPanelReturnKeyType keyType)
+        {
+            Interop.Elementary.elm_entry_input_panel_return_key_type_set(RealHandle, (Interop.Elementary.ReturnKeyType)keyType);
+        }
+
+        /// <summary>
+        /// Hides the input panel (virtual keyboard).
+        /// </summary>
+        /// <remark>
+        /// Note that the input panel is shown or hidden automatically according to the focus state of the entry widget.
+        /// This API can be used in case of manually controlling by using SetInputPanelEnabled(false).
+        /// </remark>
+        public void HideInputPanel()
+        {
+            Interop.Elementary.elm_entry_input_panel_hide(RealHandle);
+        }
+
+        /// <summary>
+        /// Selects all the text within the entry.
+        /// </summary>
+        public void SelectAll()
+        {
+            Interop.Elementary.elm_entry_select_all(RealHandle);
+        }
+
+        /// <summary>
+        /// Drops any existing text selection within the entry.
+        /// </summary>
+        public void SelectNone()
+        {
+            Interop.Elementary.elm_entry_select_none(RealHandle);
+        }
+
+        /// <summary>
+        /// Forces calculation of the entry size and text layouting.
+        /// </summary>
+        public void ForceCalculation()
+        {
+            Interop.Elementary.elm_entry_calc_force(RealHandle);
+        }
+
+        /// <summary>
+        /// Gets the string by the cursor at its current position.
+        /// </summary>
+        /// <returns></returns>
+        public string GetCursorContent()
+        {
+            return Interop.Elementary.elm_entry_cursor_content_get(RealHandle);
+        }
+
+        /// <summary>
+        /// Begins a selection within the entry as though the user were holding down the mouse button to make a selection.
+        /// </summary>
+        public void BeginCursorSelection()
+        {
+            Interop.Elementary.elm_entry_cursor_selection_begin(RealHandle);
+        }
+
+        /// <summary>
+        /// Appends the text of the entry.
+        /// </summary>
+        /// <param name="text">The text to be displayed</param>
+        public void AppendText(string text)
+        {
+            Interop.Elementary.elm_entry_entry_append(RealHandle, text);
+        }
+
+        /// <summary>
+        /// Inserts the given text into the entry at the current cursor position.
+        /// </summary>
+        /// <param name="text"></param>
+        public void InsertTextToCursor(string text)
+        {
+            Interop.Elementary.elm_entry_entry_insert(RealHandle, text);
+        }
+
+        /// <summary>
+        /// Ends a selection within the entry as though the user had just released the mouse button while making a selection.
+        /// </summary>
+        public void EndCursorSelection()
+        {
+            Interop.Elementary.elm_entry_cursor_selection_end(RealHandle);
+        }
+
+        /// <summary>
+        /// Writes any changes made to the file that is set by File.
+        /// </summary>
+        public void SaveFile()
+        {
+            Interop.Elementary.elm_entry_file_save(RealHandle);
+        }
+
+        /// <summary>
+        /// Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on.
+        /// </summary>
+        /// <remarks>
+        /// Note that input panel is shown or hidden automatically according to the focus state of entry widget.
+        /// This API can be used in the case of manually controlling by using SetInputPanelEnabled(false).
+        /// </remarks>
+        public void ShowInputPanel()
+        {
+            Interop.Elementary.elm_entry_input_panel_show(RealHandle);
+        }
+
+        /// <summary>
+        /// This appends a custom item provider to the list for that entry.
+        /// </summary>
+        /// <param name="func">This function is used to provide items.</param>
+        public void AppendItemProvider(Func<string, EvasObject> func)
+        {
+            if (func != null)
+            {
+                if (!_itemsProvider.ContainsKey(func))
+                {
+                    Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback;
+
+                    itemProviderCallback = (d, o, t) =>
+                    {
+                        return func?.Invoke(t);
+                    };
+                    Interop.Elementary.elm_entry_item_provider_append(RealHandle, itemProviderCallback, IntPtr.Zero);
+                    _itemsProvider.Add(func, itemProviderCallback);
+                }
+            }
+        }
+
+        /// <summary>
+        /// This prepends a custom item provider to the list for that entry.
+        /// </summary>
+        /// <param name="func">This function is used to provide items.</param>
+        public void PrependItemProvider(Func<string, EvasObject> func)
+        {
+            if (!_itemsProvider.ContainsKey(func))
+            {
+                Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback;
+
+                itemProviderCallback = (d, o, t) =>
+                {
+                    return func?.Invoke(t);
+                };
+                Interop.Elementary.elm_entry_item_provider_prepend(RealHandle, itemProviderCallback, IntPtr.Zero);
+                _itemsProvider.Add(func, itemProviderCallback);
+            }
+        }
+
+        /// <summary>
+        /// This removes a custom item provider to the list for that entry.
+        /// </summary>
+        /// <param name="itemProvider">This function is used to provide items.</param>
+        public void RemoveItemProvider(Func<string, EvasObject> func)
+        {
+            if (_itemsProvider.ContainsKey(func))
+            {
+                Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback;
+                _itemsProvider.TryGetValue(func, out itemProviderCallback);
+
+                Interop.Elementary.elm_entry_item_provider_remove(RealHandle, itemProviderCallback, IntPtr.Zero);
+                _itemsProvider.Remove(func);
+            }
+        }
+
+        /// <summary>
+        /// Append a markup filter function for text inserted in the entry.
+        /// </summary>
+        /// <param name="filter">This function type is used by entry filters to modify text.</param>
+        public void AppendMarkUpFilter(Func<Entry, string, string> filter)
+        {
+            if (!_textFilters.ContainsKey(filter))
+            {
+                Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback = (IntPtr d, IntPtr e, ref IntPtr t) =>
+                {
+                    var text = Marshal.PtrToStringAnsi(t);
+
+                    var updateText = filter(this, text);
+
+                    if (updateText != text)
+                    {
+                        Interop.Libc.Free(t);
+                        t = Marshal.StringToHGlobalAnsi(updateText);
+                    }
+                };
+                Interop.Elementary.elm_entry_markup_filter_append(RealHandle, textFilterCallback, IntPtr.Zero);
+                _textFilters.Add(filter, textFilterCallback);
+            }
+        }
+
+        /// <summary>
+        /// Prepend a markup filter function for text inserted in the entry.
+        /// </summary>
+        /// <param name="filter">This function type is used by entry filters to modify text.</param>
+        public void PrependMarkUpFilter(Func<Entry, string, string> filter)
+        {
+            if (!_textFilters.ContainsKey(filter))
+            {
+                Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback = (IntPtr d, IntPtr e, ref IntPtr t) =>
+                {
+                    var text = Marshal.PtrToStringAnsi(t);
+
+                    var updateText = filter(this, text);
+
+                    if (updateText != text)
+                    {
+                        Interop.Libc.Free(t);
+                        t = Marshal.StringToHGlobalAnsi(updateText);
+                    }
+                };
+                Interop.Elementary.elm_entry_markup_filter_prepend(RealHandle, textFilterCallback, IntPtr.Zero);
+                _textFilters.Add(filter, textFilterCallback);
+            }
+        }
+
+        /// <summary>
+        /// Remove a markup filter
+        /// </summary>
+        /// <param name="filter">This function type is used by entry filters to modify text.</param>
+        public void RemoveMarkUpFilter(Func<Entry, string, string> filter)
+        {
+            if (_textFilters.ContainsKey(filter))
+            {
+                Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback;
+                _textFilters.TryGetValue(filter, out textFilterCallback);
+
+                Interop.Elementary.elm_entry_markup_filter_remove(RealHandle, textFilterCallback, IntPtr.Zero);
+                _textFilters.Remove(filter);
+            }
+        }
+
+        /// <summary>
+        /// This executes a "copy" action on the selected text in the entry.
+        /// </summary>
+        public void CopySelection()
+        {
+            Interop.Elementary.elm_entry_selection_copy(RealHandle);
+        }
+
+        /// <summary>
+        /// This executes a "cut" action on the selected text in the entry.
+        /// </summary>
+        public void CutSelection()
+        {
+            Interop.Elementary.elm_entry_selection_cut(RealHandle);
+        }
+
+        /// <summary>
+        /// This executes a "paste" action in the entry.
+        /// </summary>
+        public void PasteSelection()
+        {
+            Interop.Elementary.elm_entry_selection_paste(RealHandle);
+        }
+
+        /// <summary>
+        /// This disabled the entry's selection.
+        /// </summary>
+        /// <param name="disable">If true, the selection are disabled.</param>
+        public void DisableSelection(bool disable)
+        {
+            Interop.Elementary.elm_entry_selection_handler_disabled_set(RealHandle, disable);
+        }
+
+        /// <summary>
+        /// Get any selected text within the entry.
+        /// </summary>
+        /// <returns>Selection's value</returns>
+        public string GetSelection()
+        {
+            return Interop.Elementary.elm_entry_selection_get(RealHandle);
+        }
+
+        /// <summary>
+        /// This selects a region of text within the entry.
+        /// </summary>
+        /// <param name="start">The starting position.</param>
+        /// <param name="end">The end position.</param>
+        public void SetSelectionRegion(int start, int end)
+        {
+            Interop.Elementary.elm_entry_select_region_set(RealHandle, start, end);
+        }
+
+        /// <summary>
+        /// Sets the visibility of the left-side widget of the entry
+        /// </summary>
+        /// <param name="isDisplay">true if the object should be displayed, false if not.</param>
+        public void SetIconVisible(bool isDisplay)
+        {
+            Interop.Elementary.elm_entry_icon_visible_set(RealHandle, isDisplay);
+        }
+
+        /// <summary>
+        /// Set whether the return key on the input panel is disabled automatically when entry has no text.
+        /// </summary>
+        /// <param name="enable">If enabled is true, the return key is automatically disabled when the entry has no text.</param>
+        public void SetInputPanelReturnKeyAutoEnable(bool enable)
+        {
+            Interop.Elementary.elm_entry_input_panel_return_key_autoenabled_set(RealHandle, enable);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_entry_add(parent.Handle);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/EvasCanvas.cs b/src/ElmSharp/ElmSharp/EvasCanvas.cs
new file mode 100644 (file)
index 0000000..6f778c6
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Low level Evas canvas functions. Sub groups will present more high level ones, though.
+    /// Most of these functions deal with low level Evas actions, like:
+    /// create/destroy raw canvases, not bound to any displaying engine
+    /// tell a canvas i got focused(in a windowing context, for example)
+    /// tell a canvas a region should not be calculated anymore in rendering
+    /// tell a canvas to render its contents, immediately
+    /// Most users will be using Evas by means of the Ecore_Evas wrapper, which deals with all the above mentioned issues automatically for them.Thus, you'll be looking at this section only if you're building low level stuff.
+    /// The groups within present you functions that deal with the canvas directly, too, and not yet with its objects.They are the functions you need to use at a minimum to get a working canvas.
+    /// </summary>
+    public class EvasCanvas
+    {
+        IntPtr _handle = IntPtr.Zero;
+        Dictionary<EventData, Interop.Evas.EvasCallback> _eventDatas = new Dictionary<EventData, Interop.Evas.EvasCallback>();
+
+        internal EvasCanvas(IntPtr evasObject)
+        {
+            _handle = CreateHandle(evasObject);
+        }
+
+        /// <summary>
+        /// Gets or sets the image cache.
+        /// This function returns the image cache size of canvas in bytes.
+        /// </summary>
+        public int ImageCacheSize
+        {
+            get
+            {
+                return Interop.Evas.evas_image_cache_get(_handle);
+            }
+            set
+            {
+                Interop.Evas.evas_image_cache_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Flush the image cache of the canvas.
+        /// </summary>
+        public void FlushImageCache()
+        {
+            Interop.Evas.evas_image_cache_flush(_handle);
+        }
+
+        /// <summary>
+        /// Add a damage rectangle.
+        /// </summary>
+        /// <param name="x">The rectangle's top left corner's horizontal coordinate.</param>
+        /// <param name="y">The rectangle's top left corner's vertical coordinate.</param>
+        /// <param name="width">The rectangle's width.</param>
+        /// <param name="height">The rectangle's height.</param>
+        public void AddDamageRectangle(int x, int y, int width, int height)
+        {
+            Interop.Evas.evas_damage_rectangle_add(_handle, x, y, width, height);
+        }
+
+        /// <summary>
+        /// Add an "obscured region" to an Evas canvas.
+        /// </summary>
+        /// <param name="x">The rectangle's top left corner's horizontal coordinate.</param>
+        /// <param name="y">The rectangle's top left corner's vertical coordinate.</param>
+        /// <param name="width">The rectangle's width.</param>
+        /// <param name="height">The rectangle's height.</param>
+        public void AddObscuredRectangle(int x, int y, int width, int height)
+        {
+            Interop.Evas.evas_obscured_rectangle_add(_handle, x, y, width, height);
+        }
+
+        /// <summary>
+        /// Remove all "obscured regions" from an Evas canvas.
+        /// </summary>
+        public void ClearObscuredRectangle()
+        {
+            Interop.Evas.evas_obscured_clear(_handle);
+        }
+
+        /// <summary>
+        /// Adds or registers a event to a given canvas event.
+        /// </summary>
+        /// <param name="type">The type of event that triggers</param>
+        /// <param name="action">The action to be called when the event is triggered</param>
+        public void AddEventAction(EvasObjectCallbackType type, Action action)
+        {
+            if (action != null)
+            {
+                var eventData = new EventData(type, action);
+
+                if (!_eventDatas.ContainsKey(eventData))
+                {
+                    var evasCallback = new Interop.Evas.EvasCallback((d, o, t) => action());
+                    Interop.Evas.evas_event_callback_add(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback, IntPtr.Zero);
+                    _eventDatas.Add(eventData, evasCallback);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Deletes a event to a given canvas event.
+        /// </summary>
+        /// <param name="type">The type of event that triggers</param>
+        /// <param name="action">The action to be called when the event is triggered</param>
+        public void DeleteEventAction(EvasObjectCallbackType type, Action action)
+        {
+            if (action != null)
+            {
+                var eventData = new EventData(type, action);
+                Interop.Evas.EvasCallback evasCallback = null;
+                _eventDatas.TryGetValue(eventData, out evasCallback);
+
+                if (evasCallback != null)
+                {
+                    Interop.Evas.evas_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback);
+                    _eventDatas.Remove(eventData);
+                }
+            }
+        }
+
+        IntPtr CreateHandle(IntPtr evasObject)
+        {
+            return Interop.Evas.evas_object_evas_get(evasObject);
+        }
+
+        class EventData
+        {
+            public EvasObjectCallbackType Type { get; set; }
+            public Action Action { get; set; }
+
+            public EventData(EvasObjectCallbackType type, Action action)
+            {
+                Type = type;
+                Action = action;
+            }
+
+            public override bool Equals(object obj)
+            {
+                EventData e = obj as EventData;
+                if (e == null)
+                {
+                    return false;
+                }
+                return (Type == e.Type) && (Action == e.Action);
+            }
+
+            public override int GetHashCode()
+            {
+                int hashCode = Type.GetHashCode();
+                hashCode ^= Action.GetHashCode();
+                return hashCode;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs b/src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs
new file mode 100644 (file)
index 0000000..8955904
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The EvasKeyEventArgs is an EvasKey EventArgs
+    /// </summary>
+    public class EvasKeyEventArgs : EventArgs
+    {
+        IntPtr _nativeEventInfo;
+
+        EvasEventFlag _eventFlags;
+
+        /// <summary>
+        /// BackButton name in Platform
+        /// </summary>
+        public const string PlatformBackButtonName = "XF86Back";
+        /// <summary>
+        /// MenuButton name in Platform
+        /// </summary>
+        public const string PlatformMenuButtonName = "XF86Menu";
+        /// <summary>
+        /// HomeButton name in Platform
+        /// </summary>
+        public const string PlatformHomeButtonName = "XF86Home";
+
+        /// <summary>
+        /// Gets the name of Key
+        /// </summary>
+        public string KeyName { get; private set; }
+
+        public EvasEventFlag Flags
+        {
+            get
+            {
+                IntPtr offset = Marshal.OffsetOf<EvasEventKeyDown>("event_flags");
+                return (EvasEventFlag)Marshal.ReadIntPtr(_nativeEventInfo, (int)offset);
+            }
+            set
+            {
+                IntPtr offset = Marshal.OffsetOf<EvasEventKeyDown>("event_flags");
+                Marshal.WriteIntPtr(_nativeEventInfo, (int)offset, (IntPtr)value);
+            }
+        }
+
+        EvasKeyEventArgs(IntPtr info)
+        {
+            _nativeEventInfo = info;
+            var evt = Marshal.PtrToStructure<EvasEventKeyDown>(info);
+            KeyName = evt.keyname;
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasKeyEventArgs class.
+        /// </summary>
+        /// <param name="data">data info</param>
+        /// <param name="obj"> object </param>
+        /// <param name="info">information </param>
+        /// <returns>EvasKey eventArgs</returns>
+        static public EvasKeyEventArgs Create(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            return new EvasKeyEventArgs(info);
+        }
+
+        /// <summary>
+        /// Event structure for Key Down event callbacks.
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        struct EvasEventKeyDown
+        {
+            /// <summary>
+            /// Name string of the key pressed
+            /// </summary>
+            public string keyname;
+            /// <summary>
+            /// Data to be passed to the event
+            /// </summary>
+            public IntPtr data;
+            /// <summary>
+            /// Modifier keys pressed during the event
+            /// </summary>
+            public IntPtr modifiers;
+            /// <summary>
+            /// Locks info
+            /// </summary>
+            public IntPtr locks;
+            /// <summary>
+            /// Logical key: (example, shift+1 == exclamation)
+            /// </summary>
+            public string key;
+            /// <summary>
+            /// UTF8 string if this keystroke has produced a visible string to be ADDED
+            /// </summary>
+            public string str;
+            /// <summary>
+            /// UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one
+            /// </summary>
+            public string compose;
+
+            public uint timestamp;
+
+            /// <summary>
+            /// Event_flags
+            /// </summary>
+            public EvasEventFlag event_flags;
+            /// <summary>
+            ///
+            /// </summary>
+            public IntPtr dev;
+            /// <summary>
+            /// Keycode
+            /// </summary>
+            public uint keycode;
+        };
+    }
+
+    /// <summary>
+    /// Flags for Events
+    /// </summary>
+    [Flags]
+    public enum EvasEventFlag
+    {
+        /// <summary>
+        /// No fancy flags set
+        /// </summary>
+        None = 0,
+        /// <summary>
+        ///This event is being delivered but should be put "on hold" until the on hold flag is unset. the event should be used for informational purposes and maybe some indications visually, but not actually perform anything
+        /// </summary>
+        OnHold = 1,
+    }
+
+}
diff --git a/src/ElmSharp/ElmSharp/EvasMap.cs b/src/ElmSharp/ElmSharp/EvasMap.cs
new file mode 100755 (executable)
index 0000000..b67264e
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The EvasMap is an opaque handle to map points.
+    /// </summary>
+    public class EvasMap
+    {
+        IntPtr _evasMap;
+        bool _ownership;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasMap class.
+        /// </summary>
+        /// <param name="count">The number of points in the map</param>
+        public EvasMap(int count)
+        {
+            _evasMap = Interop.Evas.evas_map_new(count);
+            _ownership = true;
+        }
+
+        internal EvasMap(IntPtr handle)
+        {
+            _evasMap = handle;
+            _ownership = false;
+        }
+
+        ~EvasMap()
+        {
+            if (_ownership)
+            {
+                Interop.Evas.evas_map_free(_evasMap);
+            }
+        }
+
+        internal IntPtr Handle
+        {
+            get
+            {
+                return _evasMap;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the flag of the object move synchronization for map rendering.
+        /// </summary>
+        public bool IsMoveSync
+        {
+            get
+            {
+                return Interop.Evas.evas_map_util_object_move_sync_get(_evasMap);
+            }
+            set
+            {
+                Interop.Evas.evas_map_util_object_move_sync_set(_evasMap, value);
+            }
+        }
+
+        /// <summary>
+        /// Populates source and destination map points to exactly match the object.
+        /// </summary>
+        /// <param name="obj">The object to use unmapped geometry to populate map coordinates</param>
+        /// <param name="z">
+        /// The point Z coordinate hint (pre-perspective transform)This value is used for all four points.
+        /// </param>
+        public void PopulatePoints(EvasObject obj, int z)
+        {
+            Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, z);
+        }
+
+        /// <summary>
+        /// Populates the source and destination map points to match the given geometry.
+        /// </summary>
+        /// <param name="geometry">The geometry value contains X coordinate,Y coordinate,the width and height to use to calculate second and third points</param>
+        /// <param name="z">The Z coordinate hint (pre-perspective transform) This value is used for all four points.</param>
+        public void PopulatePoints(Rect geometry, int z)
+        {
+            Interop.Evas.evas_map_util_points_populate_from_geometry(_evasMap, geometry.X, geometry.Y, geometry.Width, geometry.Height, z);
+        }
+
+        /// <summary>
+        /// Rotates the map around 3 axes in 3D.
+        /// </summary>
+        /// <param name="dx">The amount of degrees from 0.0 to 360.0 to rotate around X axis</param>
+        /// <param name="dy">The amount of degrees from 0.0 to 360.0 to rotate around Y axis</param>
+        /// <param name="dz">The amount of degrees from 0.0 to 360.0 to rotate around Z axis</param>
+        /// <param name="cx">The rotation's center horizontal position</param>
+        /// <param name="cy">The rotation's center vertical position</param>
+        /// <param name="cz">The rotation's center vertical position</param>
+        public void Rotate3D(double dx, double dy, double dz, int cx, int cy, int cz)
+        {
+            Interop.Evas.evas_map_util_3d_rotate(_evasMap, dx, dy, dz, cx, cy, cz);
+        }
+
+        /// <summary>
+        /// Changes the map point's coordinate.
+        /// </summary>
+        /// <param name="idx">The index of point to change ,this must be smaller than map size.</param>
+        /// <param name="point">3D Point coordinate</param>
+        public void SetPointCoordinate(int idx, Point3D point)
+        {
+            Interop.Evas.evas_map_point_coord_set(_evasMap, idx, point.X, point.Y, point.Z);
+        }
+
+        /// <summary>
+        /// Gets the map point's coordinate.
+        /// </summary>
+        /// <param name="idx">The index of point to change ,this must be smaller than map size.</param>
+        /// <returns>The coordinates of the given point in the map.</returns>
+        public Point3D GetPointCoordinate(int idx)
+        {
+            Point3D point;
+            Interop.Evas.evas_map_point_coord_get(_evasMap, idx, out point.X, out point.Y, out point.Z);
+            return point;
+        }
+
+        /// <summary>
+        /// Changes the map to apply the given zooming.
+        /// </summary>
+        /// <param name="x">The horizontal zoom to use</param>
+        /// <param name="y">The vertical zoom to use</param>
+        /// <param name="cx">The zooming center horizontal position</param>
+        /// <param name="cy">The zooming center vertical position</param>
+        public void Zoom(double x, double y, int cx, int cy)
+        {
+            Interop.Evas.evas_map_util_zoom(_evasMap, x, y, cx, cy);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/EvasObject.cs b/src/ElmSharp/ElmSharp/EvasObject.cs
new file mode 100644 (file)
index 0000000..9c5b71b
--- /dev/null
@@ -0,0 +1,964 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace ElmSharp
+{
+    public enum TooltipOrientation
+    {
+        None,
+        TopLeft,
+        Top,
+        TopRight,
+        Left,
+        Center,
+        Right,
+        BottomLeft,
+        Bottom,
+        BottomRight,
+    }
+
+    public enum AspectControl
+    {
+        None = 0, /* Preference on scaling unset */
+        Neither = 1, /* Same effect as unset preference on scaling */
+        Horizontal = 2, /* Use all horizontal container space to place an object, using the given aspect */
+        Vertical = 3, /* Use all vertical container space to place an object, using the given aspect */
+        Both = 4 /* Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
+    }
+
+    /// <summary>
+    /// The EcasObject is a base class for other widget class
+    /// </summary>
+    public abstract class EvasObject
+    {
+        private IntPtr _realHandle = IntPtr.Zero;
+        private EvasCanvas _evasCanvas;
+
+        private event EventHandler _backButtonPressed;
+
+        private event EventHandler _moreButtonPressed;
+
+        private Interop.Eext.EextEventCallback _backButtonHandler;
+        private Interop.Eext.EextEventCallback _moreButtonHandler;
+
+        public IntPtr Handle { get; protected set; }
+        public EvasObject Parent { get; private set; }
+
+        public IntPtr RealHandle
+        {
+            get
+            {
+                return _realHandle == IntPtr.Zero ? Handle : _realHandle;
+            }
+            protected set
+            {
+                _realHandle = value;
+            }
+        }
+
+        EvasObjectEvent _deleted;
+        EvasObjectEvent<EvasKeyEventArgs> _keyup;
+        EvasObjectEvent<EvasKeyEventArgs> _keydown;
+        EvasObjectEvent _moved;
+        EvasObjectEvent _resized;
+        EventHandler _renderPost;
+        Interop.Evas.EvasCallback _renderPostCallback = null;
+        Interop.Elementary.Elm_Tooltip_Content_Cb _tooltipContentCallback = null;
+
+        GetTooltipContentDelegate _tooltipContentDelegate = null;
+
+        readonly HashSet<IInvalidatable> _eventStore = new HashSet<IInvalidatable>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasObject class with parent EvasObject class parameter.
+        /// </summary>
+        /// <param name="parent">Parent EvasObject class </param>
+        protected EvasObject(EvasObject parent) : this()
+        {
+            Debug.Assert(parent == null || parent.IsRealized);
+            Realize(parent);
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasObject class.
+        /// </summary>
+        protected EvasObject()
+        {
+            _backButtonHandler = new Interop.Eext.EextEventCallback((d, o, i) => { _backButtonPressed?.Invoke(this, EventArgs.Empty); });
+            _moreButtonHandler = new Interop.Eext.EextEventCallback((d, o, i) => { _moreButtonPressed?.Invoke(this, EventArgs.Empty); });
+
+            OnInstantiated();
+
+            _tooltipContentCallback = (d, o, t) =>
+            {
+                return _tooltipContentDelegate?.Invoke();
+            };
+        }
+
+        // C# Finalizer was called on GC thread
+        // So, We can't access to EFL object
+        // And When Finalizer was called, Field can be already released.
+        //~EvasObject()
+        //{
+        //    Unrealize();
+        //}
+
+        /// <summary>
+        /// Deleted will be triggered when widght is deleted
+        /// </summary>
+        public event EventHandler Deleted;
+
+        /// <summary>
+        /// KeyUp will be triggered when key is loose
+        /// </summary>
+        public event EventHandler<EvasKeyEventArgs> KeyUp;
+
+        /// <summary>
+        /// KeyDown will be triggered when key is preesd down
+        /// </summary>
+        public event EventHandler<EvasKeyEventArgs> KeyDown;
+
+        /// <summary>
+        /// BackButtonPressed will be triggered when Back button is pressed
+        /// </summary>
+        public event EventHandler BackButtonPressed
+        {
+            add
+            {
+                if (_backButtonPressed == null)
+                {
+                    Interop.Eext.eext_object_event_callback_add(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_BACK, _backButtonHandler, IntPtr.Zero);
+                }
+                _backButtonPressed += value;
+            }
+            remove
+            {
+                _backButtonPressed -= value;
+                if (_backButtonPressed == null)
+                {
+                    Interop.Eext.eext_object_event_callback_del(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_BACK, _backButtonHandler);
+                }
+            }
+        }
+
+        /// <summary>
+        /// MoreButtonPressed will be triggered when More button is pressed
+        /// </summary>
+        public event EventHandler MoreButtonPressed
+        {
+            add
+            {
+                if (_moreButtonPressed == null)
+                {
+                    Interop.Eext.eext_object_event_callback_add(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_MORE, _moreButtonHandler, IntPtr.Zero);
+                }
+                _moreButtonPressed += value;
+            }
+            remove
+            {
+                _moreButtonPressed -= value;
+                if (_moreButtonPressed == null)
+                {
+                    Interop.Eext.eext_object_event_callback_del(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_MORE, _moreButtonHandler);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Moved will be triggered when widght is moved
+        /// </summary>
+        public event EventHandler Moved
+        {
+            add { _moved.On += value; }
+            remove { _moved.On -= value; }
+        }
+
+        /// <summary>
+        /// Current widget's size Resized Event Handler
+        /// </summary>
+        public event EventHandler Resized
+        {
+            add { _resized.On += value; }
+            remove { _resized.On -= value; }
+        }
+
+        /// <summary>
+        /// Current widget RenderPost Event Handler
+        /// </summary>
+        public event EventHandler RenderPost
+        {
+            add
+            {
+                _renderPost += value;
+                if (_renderPostCallback == null)
+                {
+                    _renderPostCallback = new Interop.Evas.EvasCallback((o, e, d) => _renderPost?.Invoke(this, EventArgs.Empty));
+                    Interop.Evas.evas_event_callback_add(Interop.Evas.evas_object_evas_get(RealHandle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback, IntPtr.Zero);
+                }
+            }
+            remove
+            {
+                _renderPost -= value;
+                if (_renderPost?.GetInvocationList().Length == 0)
+                {
+                    Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(RealHandle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
+                    _renderPostCallback = null;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Called back when a widget's tooltip is activated and needs content.
+        /// </summary>
+        /// <returns></returns>
+        public delegate EvasObject GetTooltipContentDelegate();
+
+        /// <summary>
+        /// Get widget's status of Realized or not.
+        /// </summary>
+        public bool IsRealized { get { return Handle != IntPtr.Zero; } }
+
+        /// <summary>
+        /// Gets EvasCanvas
+        /// </summary>
+        public EvasCanvas EvasCanvas
+        {
+            get
+            {
+                if (_evasCanvas == null)
+                    _evasCanvas = new EvasCanvas(Handle);
+                return _evasCanvas;
+            }
+        }
+
+        /// <summary>
+        /// Gets the current class's Name.
+        /// </summary>
+        public string ClassName
+        {
+            get
+            {
+                return Interop.Eo.eo_class_name_get(Interop.Eo.eo_class_get(RealHandle));
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the horizontal pointer hints for an object's weight.
+        /// </summary>
+        public double WeightX
+        {
+            get
+            {
+                return Interop.Evas.GetWeightX(Handle);
+            }
+            set
+            {
+                Interop.Evas.SetWeightX(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the vertical pointer hints for an object's weight.
+        /// </summary>
+        public double WeightY
+        {
+            get
+            {
+                return Interop.Evas.GetWeightY(Handle);
+            }
+            set
+            {
+                Interop.Evas.SetWeightY(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the horizontal alignment hint of an object's alignment.
+        /// </summary>
+        public virtual double AlignmentX
+        {
+            get
+            {
+                return Interop.Evas.GetAlignX(Handle);
+            }
+            set
+            {
+                Interop.Evas.SetAlignX(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the vertical alignment hint of an object's alignment.
+        /// </summary>
+        public virtual double AlignmentY
+        {
+            get
+            {
+                return Interop.Evas.GetAlignY(Handle);
+            }
+            set
+            {
+                Interop.Evas.SetAlignY(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the Width hints for an object's minimum size.
+        /// </summary>
+        public int MinimumWidth
+        {
+            get
+            {
+                int w, h;
+                Interop.Evas.evas_object_size_hint_min_get(RealHandle, out w, out h);
+                return w;
+            }
+            set
+            {
+                int h = MinimumHeight;
+                Interop.Evas.evas_object_size_hint_min_set(RealHandle, value, h);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the Height hints for an object's minimum size.
+        /// </summary>
+        public int MinimumHeight
+        {
+            get
+            {
+                int w, h;
+                Interop.Evas.evas_object_size_hint_min_get(RealHandle, out w, out h);
+                return h;
+            }
+            set
+            {
+                int w = MinimumWidth;
+                Interop.Evas.evas_object_size_hint_min_set(RealHandle, w, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the visible state of the given Evas object.
+        /// </summary>
+        public bool IsVisible
+        {
+            get
+            {
+                return Interop.Evas.evas_object_visible_get(Handle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the position and (rectangular) size of the given Evas object.
+        /// </summary>
+        public Rect Geometry
+        {
+            get
+            {
+                int x, y, w, h;
+                Interop.Evas.evas_object_geometry_get(Handle, out x, out y, out w, out h);
+                Rect rect = new Rect(x, y, w, h);
+                return rect;
+            }
+            set
+            {
+                Interop.Evas.evas_object_geometry_set(Handle, value.X, value.Y, value.Width, value.Height);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the general or main color of the given Evas object.
+        /// </summary>
+        public virtual Color Color
+        {
+            get
+            {
+                int r, g, b, a;
+                Interop.Evas.evas_object_color_get(RealHandle, out r, out g, out b, out a);
+                return Color.FromRgba(r, g, b, a);
+            }
+            set
+            {
+                Interop.Evas.SetPremultipliedColor(RealHandle, value.R, value.G, value.B, value.A);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the map enabled state.
+        /// </summary>
+        public bool IsMapEnabled
+        {
+            get
+            {
+                return Interop.Evas.evas_object_map_enable_get(Handle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_map_enable_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets current object transformation map.
+        /// </summary>
+        public EvasMap EvasMap
+        {
+            get
+            {
+                IntPtr evasMap = Interop.Evas.evas_object_map_get(Handle);
+                return new EvasMap(evasMap);
+            }
+            set
+            {
+                Interop.Evas.evas_object_map_set(Handle, value.Handle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether an object is to repeat events.
+        /// </summary>
+        public bool RepeatEvents
+        {
+            get
+            {
+                return Interop.Evas.evas_object_repeat_events_get(RealHandle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_repeat_events_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether events on a smart object's member should get propagated up to its parent.
+        /// </summary>
+        public bool PropagateEvents
+        {
+            get
+            {
+                return Interop.Evas.evas_object_propagate_events_get(RealHandle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_propagate_events_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether an object is set to pass (ignore) events.
+        /// </summary>
+        public bool PassEvents
+        {
+            get
+            {
+                return Interop.Evas.evas_object_pass_events_get(RealHandle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_pass_events_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets style for this object tooltip.
+        /// </summary>
+        public string TooltipStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_tooltip_style_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_tooltip_style_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the orientation of Tooltip.
+        /// </summary>
+        public TooltipOrientation TooltipOrientation
+        {
+            get
+            {
+                return (TooltipOrientation)Interop.Elementary.elm_object_tooltip_orient_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_tooltip_orient_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets size restriction state of an object's tooltip.
+        /// </summary>
+        public bool TooltipWindowMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_tooltip_window_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_tooltip_window_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the content to be shown in the tooltip object.
+        /// </summary>
+        public GetTooltipContentDelegate TooltipContentDelegate
+        {
+            get
+            {
+                return _tooltipContentDelegate;
+            }
+            set
+            {
+                _tooltipContentDelegate = value;
+                if (value != null)
+                {
+                    Interop.Elementary.elm_object_tooltip_content_cb_set(RealHandle, _tooltipContentCallback, IntPtr.Zero, null);
+                }
+                else
+                {
+                    Interop.Elementary.elm_object_tooltip_content_cb_set(RealHandle, null, IntPtr.Zero, null);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the movement freeze by 1
+        /// This gets the movement freeze count by one.
+        /// </summary>
+        public int TooltipMoveFreezeCount
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_tooltip_move_freeze_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether an Evas object is to freeze (discard) events.
+        /// </summary>
+        public bool AllEventsFrozen
+        {
+            get
+            {
+                return Interop.Evas.evas_object_freeze_events_get(RealHandle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_freeze_events_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the layer of its canvas that the given object will be part of.
+        /// </summary>
+        public virtual int Layer
+        {
+            get
+            {
+                return Interop.Evas.evas_object_layer_get(Handle);
+            }
+            set
+            {
+                Interop.Evas.evas_object_layer_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Clips one object to another.
+        /// </summary>
+        /// <param name="clip">The object to clip object by</param>
+        public void SetClip(EvasObject clip)
+        {
+            Interop.Evas.evas_object_clip_set(Handle, clip);
+        }
+
+        /// <summary>
+        /// Sets the hints for an object's alignment.
+        /// </summary>
+        /// <param name="x">The horizontal alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 </param>
+        /// <param name="y">The vertical alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 </param>
+        public void SetAlignment(double x, double y)
+        {
+            Interop.Evas.evas_object_size_hint_align_set(Handle, x, y);
+        }
+
+        /// <summary>
+        /// Sets the hints for an object's weight.
+        /// </summary>
+        /// <param name="x">The non-negative double value to use as horizontal weight hint</param>
+        /// <param name="y">The non-negative double value to use as vertical weight hint</param>
+        public void SetWeight(double x, double y)
+        {
+            Interop.Evas.evas_object_size_hint_weight_set(Handle, x, y);
+        }
+
+        /// <summary>
+        /// Sets the text for an object's tooltip.
+        /// </summary>
+        /// <param name="text">The text value to display inside the tooltip</param>
+        public void SetTooltipText(string text)
+        {
+            Interop.Elementary.elm_object_tooltip_text_set(RealHandle, text);
+        }
+
+        /// <summary>
+        /// Unsets an object's tooltip.
+        /// </summary>
+        public void UnsetTooltip()
+        {
+            Interop.Elementary.elm_object_tooltip_unset(RealHandle);
+        }
+
+        /// <summary>
+        /// This increments the tooltip movement freeze count by one.
+        /// If the count is more than 0, the tooltip position will be fixed.
+        /// </summary>
+        public void PushTooltipMoveFreeze()
+        {
+            Interop.Elementary.elm_object_tooltip_move_freeze_push(RealHandle);
+        }
+
+        /// <summary>
+        /// This decrements the tooltip freeze count by one.
+        /// </summary>
+        public void PopTooltipMoveFreeze()
+        {
+            Interop.Elementary.elm_object_tooltip_move_freeze_pop(RealHandle);
+        }
+
+        /// <summary>
+        /// Force hide tooltip of object.
+        /// </summary>
+        public void HideTooltip()
+        {
+            Interop.Elementary.elm_object_tooltip_hide(RealHandle);
+        }
+
+        /// <summary>
+        /// Force show tooltip of object.
+        /// </summary>
+        public void ShowTooltip()
+        {
+            Interop.Elementary.elm_object_tooltip_show(RealHandle);
+        }
+
+        /// <summary>
+        /// Makes the current object visible.
+        /// </summary>
+        public void Show()
+        {
+            Interop.Evas.evas_object_show(Handle);
+        }
+
+        /// <summary>
+        /// Makes the current object invisible.
+        /// </summary>
+        public void Hide()
+        {
+            Interop.Evas.evas_object_hide(Handle);
+        }
+
+        /// <summary>
+        /// Changes the size of the current object.
+        /// </summary>
+        /// <param name="w">The new width</param>
+        /// <param name="h">The new height</param>
+        public void Resize(int w, int h)
+        {
+            Interop.Evas.evas_object_resize(Handle, w, h);
+        }
+
+        /// <summary>
+        /// Moves the current object to the given location.
+        /// </summary>
+        /// <param name="x">The X position to move the object to.</param>
+        /// <param name="y">The Y position to move the object to.</param>
+        public void Move(int x, int y)
+        {
+            Interop.Evas.evas_object_move(Handle, x, y);
+        }
+
+        /// <summary>
+        /// Lowers obj to the bottom of its layer.
+        /// </summary>
+        public void Lower()
+        {
+            Interop.Evas.evas_object_lower(Handle);
+        }
+
+        /// <summary>
+        /// Define IntPtr operator
+        /// </summary>
+        /// <param name="obj">Parent object</param>
+        public static implicit operator IntPtr(EvasObject obj)
+        {
+            if (obj == null)
+                return IntPtr.Zero;
+            return obj.Handle;
+        }
+
+        /// <summary>
+        /// Requests keyname key events be directed to current obj.
+        /// </summary>
+        /// <param name="keyname">The key to request events for</param>
+        /// <param name="exclusive">Set TRUE to request that the obj is the only object receiving the keyname events,otherwise set FALSE</param>
+        /// <returns>If the call succeeded is true,otherwise is false</returns>
+        public bool KeyGrab(string keyname, bool exclusive)
+        {
+            return Interop.Evas.evas_object_key_grab(Handle, keyname, 0, 0, exclusive);
+        }
+
+        /// <summary>
+        /// Removes the grab on keyname key events.
+        /// </summary>
+        /// <param name="keyname">The key the grab is set for</param>
+        public void KeyUngrab(string keyname)
+        {
+            Interop.Evas.evas_object_key_ungrab(Handle, keyname, 0, 0);
+        }
+
+        /// <summary>
+        /// Mark smart object as changed.
+        /// </summary>
+        public void MarkChanged()
+        {
+            Interop.Evas.evas_object_smart_changed(RealHandle);
+        }
+
+        /// <summary>
+        /// Call the calculate smart function immediately.
+        /// This will force immediate calculations needed for renderization of this object.
+        /// </summary>
+        public void Calculate()
+        {
+            Interop.Evas.evas_object_smart_calculate(RealHandle);
+        }
+
+        /// <summary>
+        /// Sets the hints for an object's aspect ratio.
+        /// </summary>
+        /// <param name="aspect">The policy or type of aspect ratio to apply to object</param>
+        /// <param name="w">The integer to use as aspect width ratio term</param>
+        /// <param name="h">The integer to use as aspect height ratio term</param>
+        public void SetSizeHintAspect(AspectControl aspect, int w, int h)
+        {
+            Interop.Evas.evas_object_size_hint_aspect_set(Handle, (int)aspect, w, h);
+        }
+
+        /// <summary>
+        /// Gets the hints for an object's aspect ratio.
+        /// </summary>
+        /// <param name="aspect">The policy or type of aspect ratio to apply to object</param>
+        /// <param name="w">The integer to use as aspect width ratio term</param>
+        /// <param name="h">The integer to use as aspect height ratio term</param>
+        public void GetSizeHintAspect(out AspectControl aspect, out int w, out int h)
+        {
+            int aspectRatio;
+            Interop.Evas.evas_object_size_hint_aspect_get(Handle, out aspectRatio, out w, out h);
+            aspect = (AspectControl)aspectRatio;
+        }
+
+        /// <summary>
+        /// Stack immediately below anchor.
+        /// </summary>
+        /// <param name="anchor">The object below which to stack.</param>
+        public void StackBelow(EvasObject anchor)
+        {
+            Interop.Evas.evas_object_stack_below(Handle, anchor);
+        }
+
+        /// <summary>
+        /// Stack immediately above anchor.
+        /// </summary>
+        /// <param name="anchor">The object above which to stack.</param>
+        public void StackAbove(EvasObject anchor)
+        {
+            Interop.Evas.evas_object_stack_above(Handle, anchor);
+        }
+
+        /// <summary>
+        /// Raise to the top of its layer.
+        /// </summary>
+        public void RaiseTop()
+        {
+            Interop.Evas.evas_object_raise(Handle);
+        }
+
+        /// <summary>
+        /// Get the geometry of a line number.
+        /// </summary>
+        /// <param name="lineNumber">the line number.</param>
+        /// <param name="x">x coord of the line.</param>
+        /// <param name="y">y coord of the line.</param>
+        /// <param name="w">w coord of the line.</param>
+        /// <param name="h">h coord of the line.</param>
+        /// <returns></returns>
+        public bool GetTextBlockGeometryByLineNumber(int lineNumber, out int x, out int y, out int w, out int h)
+        {
+            return Interop.Evas.evas_object_textblock_line_number_geometry_get(RealHandle, lineNumber, out x, out y, out w, out h);
+        }
+
+        internal IntPtr GetData(string key)
+        {
+            return Interop.Evas.evas_object_data_get(RealHandle, key);
+        }
+
+        internal void SetData(string key, IntPtr data)
+        {
+            Interop.Evas.evas_object_data_set(RealHandle, key, data);
+        }
+
+        internal IntPtr DeleteData(string key)
+        {
+            return Interop.Evas.evas_object_data_del(RealHandle, key);
+        }
+
+        /// <summary>
+        /// The callback of Invalidate Event
+        /// </summary>
+        protected virtual void OnInvalidate()
+        {
+        }
+
+        /// <summary>
+        /// The callback of Instantiated Event
+        /// </summary>
+        protected virtual void OnInstantiated()
+        {
+        }
+
+        /// <summary>
+        /// The callback of Realized Event
+        /// </summary>
+        protected virtual void OnRealized()
+        {
+        }
+
+        /// <summary>
+        /// The callback of Unrealize Event
+        /// </summary>
+        protected virtual void OnUnrealize()
+        {
+        }
+
+        /// <summary>
+        /// Creates a widget handle.
+        /// </summary>
+        /// <param name="parent">Parent EvasObject</param>
+        /// <returns>Handle IntPtr</returns>
+        protected abstract IntPtr CreateHandle(EvasObject parent);
+
+        /// <summary>
+        /// For this object bind Parent object.Init handle and all kinds of EvasObjectEvent.
+        /// </summary>
+        /// <param name="parent">Parent object</param>
+        public void Realize(EvasObject parent)
+        {
+            if (!IsRealized)
+            {
+                Parent = parent;
+                Handle = CreateHandle(parent);
+                Debug.Assert(Handle != IntPtr.Zero);
+
+                (parent as Window)?.AddChild(this);
+
+                OnRealized();
+                _deleted = new EvasObjectEvent(this, EvasObjectCallbackType.Del);
+                _keydown = new EvasObjectEvent<EvasKeyEventArgs>(this, RealHandle, EvasObjectCallbackType.KeyDown, EvasKeyEventArgs.Create);
+                _keyup = new EvasObjectEvent<EvasKeyEventArgs>(this, RealHandle, EvasObjectCallbackType.KeyUp, EvasKeyEventArgs.Create);
+                _moved = new EvasObjectEvent(this, EvasObjectCallbackType.Move);
+                _resized = new EvasObjectEvent(this, EvasObjectCallbackType.Resize);
+
+                _deleted.On += (s, e) => MakeInvalidate();
+                _keydown.On += (s, e) => KeyDown?.Invoke(this, e);
+                _keyup.On += (s, e) => KeyUp?.Invoke(this, e);
+            }
+        }
+
+        /// <summary>
+        /// Removes current object relationship with others.
+        /// </summary>
+        public void Unrealize()
+        {
+            if (IsRealized)
+            {
+                if (_renderPostCallback != null)
+                {
+                    Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
+                    _renderPostCallback = null;
+                }
+
+                OnUnrealize();
+                IntPtr toBeDeleted = Handle;
+                Handle = IntPtr.Zero;
+
+                DisposeEvent();
+
+                (Parent as Window)?.RemoveChild(this);
+
+                Interop.Evas.evas_object_del(toBeDeleted);
+                Parent = null;
+            }
+        }
+
+        private void MakeInvalidate()
+        {
+            Deleted?.Invoke(this, EventArgs.Empty);
+            OnInvalidate();
+            Handle = IntPtr.Zero;
+
+            MakeInvalidateEvent();
+
+            (Parent as Window)?.RemoveChild(this);
+            Parent = null;
+            _deleted = null;
+        }
+
+        private void DisposeEvent()
+        {
+            foreach (var evt in _eventStore)
+            {
+                evt.Dispose();
+            }
+            _eventStore.Clear();
+        }
+
+        private void MakeInvalidateEvent()
+        {
+            foreach (var evt in _eventStore)
+            {
+                evt.MakeInvalidate();
+            }
+            _eventStore.Clear();
+        }
+
+        internal void AddToEventLifeTracker(IInvalidatable item)
+        {
+            _eventStore.Add(item);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/EvasObjectEvent.cs b/src/ElmSharp/ElmSharp/EvasObjectEvent.cs
new file mode 100644 (file)
index 0000000..6799be3
--- /dev/null
@@ -0,0 +1,446 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// IInvalidatable is a interface which can be overrided by its children class.
+    /// Inherits IDisposable
+    /// </summary>
+    public interface IInvalidatable : IDisposable
+    {
+        void MakeInvalidate();
+    }
+
+    /// <summary>
+    /// Enumeration for EvasObjectCallbackType
+    /// </summary>
+    public enum EvasObjectCallbackType
+    {
+        /// <summary>
+        /// Mouse In Event CallbackType.
+        /// </summary>
+        MouseIn,
+
+        /// <summary>
+        /// Mouse Out Event CallbackType
+        /// </summary>
+        MouseOut,
+
+        /// <summary>
+        /// Mouse Button Down Event CallbackType
+        /// </summary>
+        MouseDown,
+
+        /// <summary>
+        /// Mouse Button Up Event CallbackType
+        /// </summary>
+        MouseUp,
+
+        /// <summary>
+        /// Mouse Move Event CallbackType
+        /// </summary>
+        MouseMove,
+
+        /// <summary>
+        /// Mouse Wheel Event CallbackType
+        /// </summary>
+        MouseWheel,
+
+        /// <summary>
+        /// Multi-touch Down Event CallbackType
+        /// </summary>
+        MultiDown,
+
+        /// <summary>
+        /// Multi-touch Up Event CallbackType
+        /// </summary>
+        MultiUp,
+
+        /// <summary>
+        /// Multi-touch Move Event CallbackType
+        /// </summary>
+        MultiMove,
+
+        /// <summary>
+        /// Object Being Freed (Called after Del)
+        /// </summary>
+        Free,
+
+        /// <summary>
+        /// Key Press Event CallbackType
+        /// </summary>
+        KeyDown,
+
+        /// <summary>
+        /// Key Release Event CallbackType
+        /// </summary>
+        KeyUp,
+
+        /// <summary>
+        /// Focus In Event CallbackType
+        /// </summary>
+        FocusIn,
+
+        /// <summary>
+        /// Focus Out Event CallbackType
+        /// </summary>
+        FocusOut,
+
+        /// <summary>
+        /// Show Event CallbackType
+        /// </summary>
+        Show,
+
+        /// <summary>
+        /// Hide Event CallbackType
+        /// </summary>
+        Hide,
+
+        /// <summary>
+        /// Move Event CallbackType
+        /// </summary>
+        Move,
+
+        /// <summary>
+        /// Resize Event CallbackType
+        /// </summary>
+        Resize,
+
+        /// <summary>
+        /// Restack Event CallbackType
+        /// </summary>
+        Restack,
+
+        /// <summary>
+        /// Object Being Deleted (called before Free)
+        /// </summary>
+        Del,
+
+        /// <summary>
+        /// Hold Event CallbackType, Informational purpose event to indicate something
+        /// </summary>
+        Hold,
+
+        /// <summary>
+        /// Size hints changed Event CallbackType
+        /// </summary>
+        ChangedSizeHints,
+
+        /// <summary>
+        /// Image has been preloaded
+        /// </summary>
+        ImagePreloaded,
+
+        /// <summary>
+        /// Canvas got focus as a whole
+        /// </summary>
+        CanvasFocusIn,
+
+        /// <summary>
+        /// Canvas lost focus as a whole
+        /// </summary>
+        CanvasFocusOut,
+
+        /// <summary>
+        /// Called just before rendering is updated on the canvas target
+        /// </summary>
+        RenderFlushPre,
+
+        /// <summary>
+        /// Called just after rendering is updated on the canvas target
+        /// </summary>
+        RenderFlushPost,
+
+        /// <summary>
+        /// Canvas object got focus
+        /// </summary>
+        CanvasObjectFocusIn,
+
+        /// <summary>
+        /// Canvas object lost focus
+        /// </summary>
+        CanvasObjectFocusOut,
+
+        /// <summary>
+        /// Image data has been unloaded (by some mechanism in Evas that throw out original image data)
+        /// </summary>
+        ImageUnloaded,
+
+        /// <summary>
+        /// Called just before rendering starts on the canvas target
+        /// </summary>
+        RenderPre,
+
+        /// <summary>
+        /// Called just after rendering stops on the canvas target
+        /// </summary>
+        RenderPost,
+
+        /// <summary>
+        /// Image size is changed
+        /// </summary>
+        ImageResize,
+
+        /// <summary>
+        /// Devices added, removed or changed on canvas
+        /// </summary>
+        DeviceChanged,
+
+        /// <summary>
+        /// Axis is changed
+        /// </summary>
+        AxisUpdate,
+
+        /// <summary>
+        /// Canvas Viewport size is changed
+        /// </summary>
+        CanvasViewportResize
+    }
+
+    /// <summary>
+    /// Event class for EvasObject
+    /// </summary>
+    /// <typeparam name="TEventArgs">Kinds of EventArgs</typeparam>
+    public class EvasObjectEvent<TEventArgs> : IInvalidatable where TEventArgs : EventArgs
+    {
+        /// <summary>
+        /// SmartEventInfoParser delegate of EvasObjectEvent class
+        /// </summary>
+        /// <param name="data">data</param>
+        /// <param name="obj">obj</param>
+        /// <param name="info">info</param>
+        /// <returns> delegate handle</returns>
+        public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info);
+
+        private bool _disposed = false;
+        private EvasObject _sender;
+        private IntPtr _handle;
+        private readonly EvasObjectCallbackType _type;
+        private readonly SmartEventInfoParser _parser;
+        private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasObjectEvent.
+        /// </summary>
+        /// <param name="sender">EvasObject class belong to</param>
+        /// <param name="type">EvasObjectCallbackType</param>
+        /// <param name="parser">SmartEventInfoParser</param>
+        public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type, SmartEventInfoParser parser) : this(sender, sender.Handle, type, parser)
+        {
+        }
+
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type, SmartEventInfoParser parser)
+        {
+            _sender = sender;
+            _handle = handle;
+            _type = type;
+            _parser = parser;
+            sender.AddToEventLifeTracker(this);
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasObjectEvent.
+        /// </summary>
+        /// <param name="sender">EvasObject class belong with</param>
+        /// <param name="type">SmartEventInfoParser</param>
+        public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, type, null)
+        {
+        }
+
+        ~EvasObjectEvent()
+        {
+            Dispose(false);
+        }
+
+        private struct NativeCallback
+        {
+            public Interop.Evas.EventCallback callback;
+            public EventHandler<TEventArgs> eventHandler;
+        }
+
+        /// <summary>
+        /// On Event Handler of EvasObjectEvent
+        /// </summary>
+        public event EventHandler<TEventArgs> On
+        {
+            add
+            {
+                if (_handle == IntPtr.Zero)
+                {
+                    return;
+                }
+                EventHandler<TEventArgs> handler = value;
+                var cb = new Interop.Evas.EventCallback((data, evas, obj, info) =>
+                {
+                    TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(data, obj, info);
+                    handler(_sender, ea);
+                });
+                _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+                int i = _nativeCallbacks.Count - 1;
+                Interop.Evas.evas_object_event_callback_add(_handle, (Interop.Evas.ObjectCallbackType)_type, _nativeCallbacks[i].callback, IntPtr.Zero);
+            }
+
+            remove
+            {
+                if (_handle == IntPtr.Zero)
+                {
+                    return;
+                }
+                EventHandler<TEventArgs> handler = value;
+                var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+                foreach (var cb in callbacks)
+                {
+                    Interop.Evas.evas_object_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)_type, cb.callback);
+                }
+            }
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (disposing)
+                {
+                    // Place holder to dispose managed state (managed objects).
+                }
+                if (_handle != IntPtr.Zero)
+                {
+                    foreach (var cb in _nativeCallbacks)
+                    {
+                        Interop.Evas.evas_object_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)_type, cb.callback);
+                    }
+                }
+                _nativeCallbacks.Clear();
+                _disposed = true;
+            }
+        }
+
+        /// <summary>
+        /// Destroy Current Obj
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Make current instance invalidate
+        /// </summary>
+        public void MakeInvalidate()
+        {
+            _sender = null;
+            _handle = IntPtr.Zero;
+        }
+    }
+
+    /// <summary>
+    /// Event class for EvasObject
+    /// </summary>
+    public class EvasObjectEvent : IInvalidatable
+    {
+        private EvasObjectEvent<EventArgs> _evasObjectEvent;
+
+        private event EventHandler _handlers;
+
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the EvasObjectEvent.
+        /// </summary>
+        /// <param name="sender">EvasObject class belong to</param>
+        /// <param name="type">EvasObjectCallbackType</param>
+        public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, sender.Handle, type)
+        {
+        }
+
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type)
+        {
+            _evasObjectEvent = new EvasObjectEvent<EventArgs>(sender, handle, type, null);
+        }
+
+        ~EvasObjectEvent()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// On Event Handler of EvasObjectEvent
+        /// </summary>
+        public event EventHandler On
+        {
+            add
+            {
+                if (_handlers == null)
+                {
+                    _evasObjectEvent.On += SendEvent;
+                }
+                _handlers += value;
+            }
+
+            remove
+            {
+                _handlers -= value;
+                if (_handlers == null)
+                {
+                    _evasObjectEvent.On -= SendEvent;
+                }
+            }
+        }
+
+        private void SendEvent(object sender, EventArgs e)
+        {
+            _handlers?.Invoke(sender, e);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (disposing)
+                {
+                    _evasObjectEvent.Dispose();
+                }
+                _disposed = true;
+            }
+        }
+
+        /// <summary>
+        /// Destroy Current Obj
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Make current instance invalidate
+        /// </summary>
+        public void MakeInvalidate()
+        {
+            _evasObjectEvent.MakeInvalidate();
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/FlipSelector.cs b/src/ElmSharp/ElmSharp/FlipSelector.cs
new file mode 100755 (executable)
index 0000000..bffb713
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// A flip selector is a widget to show a set of text items,one at a time.with the same sheet switching style as the clock widget, when one changes the current displaying sheet.
+    /// </summary>
+    public class FlipSelector : Layout
+    {
+        SmartEvent _selected;
+        SmartEvent _overflowed;
+        SmartEvent _underflowed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the FlipSelector.
+        /// </summary>
+        /// <param name="parent">Parent EvasObject </param>
+        public FlipSelector(EvasObject parent) : base(parent)
+        {
+            _selected = new SmartEvent(this, Handle, "selected");
+            _overflowed = new SmartEvent(this, Handle, "overflowed");
+            _underflowed = new SmartEvent(this, Handle, "underflowed");
+
+            _selected.On += SelectedChanged;
+            _overflowed.On += OverflowedChanged;
+            _underflowed.On += UnderflowedChanged;
+        }
+
+        /// <summary>
+        /// Selected will be triggered when be Selected
+        /// </summary>
+        public event EventHandler Selected;
+        /// <summary>
+        /// Overflowed will be triggered when Overflowed
+        /// </summary>
+        public event EventHandler Overflowed;
+        /// <summary>
+        /// Underflowed will be triggered when be Underflowed
+        /// </summary>
+        public event EventHandler Underflowed;
+
+        /// <summary>
+        ///  Sets or gets the interval on time updates for an user mouse button hold on a flip selector widget.
+        /// </summary>
+        public double Interval
+        {
+            get
+            {
+                return Interop.Elementary.elm_flipselector_first_interval_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_flipselector_first_interval_set(Handle, value);
+            }
+        }
+
+
+        /// <summary>
+        /// Gets the currently selected item in a flip selector widget.
+        /// </summary>
+        public FlipSelectorItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_flipselector_selected_item_get(Handle);
+                return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the first item in the given flip selector widget's list of items.
+        /// </summary>
+        public FlipSelectorItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_flipselector_first_item_get(Handle);
+                return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the last item in the given flip selector widget's list of items.
+        /// </summary>
+        public FlipSelectorItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_flipselector_last_item_get(Handle);
+                return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+            }
+        }
+
+        /// <summary>
+        /// Appends a (text) item to a flip selector widget.
+        /// </summary>
+        /// <param name="text">text value</param>
+        /// <returns>
+        /// A handle to the item added or NULL, on errors
+        /// </returns>
+        /// <remarks>
+        /// The widget's list of labels to show will be appended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected.
+        /// </remarks>
+        public FlipSelectorItem Append(string text)
+        {
+            FlipSelectorItem item = new FlipSelectorItem(text);
+            item.Handle = Interop.Elementary.elm_flipselector_item_append(Handle, text, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepend a (text) item to a flip selector widget.
+        /// </summary>
+        /// <param name="text">Prepend text</param>
+        /// <returns>A handle to the item added or NULL, on errors</returns>
+        /// <remarks>
+        /// The widget's list of labels to show will be prepended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected.
+        /// </remarks>
+        public FlipSelectorItem Prepend(string text)
+        {
+            FlipSelectorItem item = new FlipSelectorItem(text);
+            item.Handle = Interop.Elementary.elm_flipselector_item_prepend(Handle, text, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// To remove the given item.
+        /// </summary>
+        /// <param name="item">FlipSelector's item</param>
+        public void Remove(FlipSelectorItem item)
+        {
+            if (item as FlipSelectorItem != null)
+                item.Delete();
+        }
+
+        /// <summary>
+        /// Programmatically select the next item of a flip selector widget.
+        /// </summary>
+        /// <remarks>
+        /// The selection will be animated. Also, if it reaches the beginning of its list of member items, it will continue with the last one backwards.
+        /// </remarks>
+        public void Next()
+        {
+            Interop.Elementary.elm_flipselector_flip_next(Handle);
+        }
+
+        /// <summary>
+        /// Programmatically select the previous item of a flip selector widget.
+        /// </summary>
+        public void Prev()
+        {
+            Interop.Elementary.elm_flipselector_flip_prev(Handle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_flipselector_add(parent.Handle);
+        }
+
+        void SelectedChanged(object sender, EventArgs e)
+        {
+            SelectedItem?.SendSelected();
+            Selected?.Invoke(this, EventArgs.Empty);
+        }
+
+        void OverflowedChanged(object sender, EventArgs e)
+        {
+            Overflowed?.Invoke(this, e);
+        }
+
+        void UnderflowedChanged(object sender, EventArgs e)
+        {
+            Underflowed?.Invoke(this, e);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/FlipSelectorItem.cs b/src/ElmSharp/ElmSharp/FlipSelectorItem.cs
new file mode 100755 (executable)
index 0000000..3210e3b
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Iterm class of FlipSelector
+    /// </summary>
+    public class FlipSelectorItem : ItemObject
+    {
+        /// <summary>
+        /// Sets or gets the Text of FlipSelectorItem
+        /// </summary>
+        public string Text { get; private set; }
+
+        /// <summary>
+        /// Selected will be triggered when Selected
+        /// </summary>
+        public event EventHandler Selected;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the FlipSelectorItem.
+        /// </summary>
+        /// <param name="text">FlipSelectorItem's text</param>
+        public FlipSelectorItem(string text) : base(IntPtr.Zero)
+        {
+            Text = text;
+        }
+
+        internal void SendSelected()
+        {
+            Selected?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/FloatingButton.cs b/src/ElmSharp/ElmSharp/FloatingButton.cs
new file mode 100755 (executable)
index 0000000..5252a1f
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The FloatingButton is a widget that to add floating area for buttons.
+    /// </summary>
+    public class FloatingButton : Layout
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the FloatingButton class.
+        /// </summary>
+        /// <param name="parent">Created on this parent container..</param>
+        public FloatingButton(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets floatingbutton mode.
+        /// </summary>
+        public FloatingButtonMode Mode
+        {
+            get
+            {
+                return (FloatingButtonMode)Interop.Eext.eext_floatingbutton_mode_get(Handle);
+            }
+            set
+            {
+                Interop.Eext.eext_floatingbutton_mode_set(Handle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets floatingbutton Position.
+        /// </summary>
+        public FloatingButtonPosition Position
+        {
+            get
+            {
+                return (FloatingButtonPosition)Interop.Eext.eext_floatingbutton_pos_get(Handle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets movability for a given floatingbutton widget.
+        /// </summary>
+        public bool MovementBlock
+        {
+            get
+            {
+                return Interop.Eext.eext_floatingbutton_movement_block_get(Handle);
+            }
+            set
+            {
+                Interop.Eext.eext_floatingbutton_movement_block_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get Opacity's value of the given FloatingButton.
+        /// </summary>
+        public override int Opacity
+        {
+            get
+            {
+                return Color.Default.A;
+            }
+
+            set
+            {
+                Console.WriteLine("FloatingButton instance doesn't support to set Opacity.");
+            }
+        }
+
+        /// <summary>
+        /// Set the floatingbutton position with animation or not.
+        /// </summary>
+        /// <param name="position">Button position</param>
+        /// <param name="animated">Animat flag</param>
+        public void SetPosition(FloatingButtonPosition position, bool animated)
+        {
+            if (animated)
+            {
+                Interop.Eext.eext_floatingbutton_pos_bring_in(Handle, (int)position);
+            }
+            else
+            {
+                Interop.Eext.eext_floatingbutton_pos_set(Handle, (int)position);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Eext.eext_floatingbutton_add(parent.Handle);
+        }
+    }
+
+    /// <summary>
+    /// Enumeration for FloatingButtonMode
+    /// </summary>
+    public enum FloatingButtonMode
+    {
+        /// <summary>
+        /// Allows all positions
+        /// </summary>
+        All,
+
+        /// <summary>
+        /// Allows LEFT and RIGHT positions only
+        /// </summary>
+        LeftRightOnly,
+    }
+
+    /// <summary>
+    /// Enumeration for FloatingButtonPosition
+    /// </summary>
+    public enum FloatingButtonPosition
+    {
+        /// <summary>
+        /// Hides in the left, but small handler will show only
+        /// </summary>
+        LeftOut,
+
+        /// <summary>
+        /// Shows all of buttons, but lies on the left
+        /// </summary>
+        Left,
+
+        /// <summary>
+        /// Shows all of buttons, but lies on the center
+        /// </summary>
+        Center,
+
+        /// <summary>
+        /// Shows all of buttons, but lies on the right
+        /// </summary>
+        Right,
+
+        /// <summary>
+        /// Hides in the right, but small handler will show only
+        /// </summary>
+        RightOut,
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenGrid.cs b/src/ElmSharp/ElmSharp/GenGrid.cs
new file mode 100644 (file)
index 0000000..2b1a6ee
--- /dev/null
@@ -0,0 +1,606 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// It contains Item which is <see cref="GenGridItem"/> type.
+    /// All events of GenGrid contain GenGridItemEventArgs as a parameter.
+    /// </summary>
+    public class GenGridItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets or sets GenGrid item.The return type is <see cref="GenGridItem"/>.
+        /// </summary>
+        public GenGridItem Item { get; set; }
+
+        internal static GenGridItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            GenGridItem item = ItemObject.GetItemByHandle(info) as GenGridItem;
+            return new GenGridItemEventArgs() { Item = item };
+        }
+    }
+
+    /// <summary>
+    /// It inherits <see cref="Layout"/>.
+    /// The GenGrid is a widget that aims to position objects in a grid layout while actually creating and rendering only the visible ones.
+    /// It has two direction in which a given GenGrid widget expands while placing its items, horizontal and vertical.
+    /// The GenGrid items are represented through <see cref="GenItemClass"/> definition field details.
+    /// </summary>
+    public class GenGrid : Layout
+    {
+        HashSet<GenGridItem> _children = new HashSet<GenGridItem>();
+
+        SmartEvent<GenGridItemEventArgs> _selected;
+        SmartEvent<GenGridItemEventArgs> _unselected;
+        SmartEvent<GenGridItemEventArgs> _activated;
+        SmartEvent<GenGridItemEventArgs> _pressed;
+        SmartEvent<GenGridItemEventArgs> _released;
+        SmartEvent<GenGridItemEventArgs> _doubleClicked;
+        SmartEvent<GenGridItemEventArgs> _realized;
+        SmartEvent<GenGridItemEventArgs> _unrealized;
+        SmartEvent<GenGridItemEventArgs> _longpressed;
+        SmartEvent _changed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the GenGrid class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by GenGrid as a child. It's <see cref="EvasObject"/> type.</param>
+        public GenGrid(EvasObject parent) : base(parent)
+        {
+            InitializeSmartEvent();
+        }
+
+        /// <summary>
+        /// ItemSelected is raised when a new gengrid item is selected.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemSelected;
+
+        /// <summary>
+        /// ItemUnselected is raised when the gengrid item is Unselected.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemUnselected;
+
+        /// <summary>
+        /// ItemPressed is raised when a new gengrid item is pressed.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemPressed;
+
+        /// <summary>
+        /// ItemReleased is raised when a new gengrid item is released.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemReleased;
+
+        /// <summary>
+        /// ItemActivated is raised when a new gengrid item is double clicked or pressed (enter|return|spacebar).
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemActivated;
+
+        /// <summary>
+        /// ItemDoubleClicked is raised when a new gengrid item is double clicked.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemDoubleClicked;
+
+        /// <summary>
+        /// ItemRealized is raised when a gengrid item is implementing through <see cref="GenItemClass"/>.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemRealized;
+
+        /// <summary>
+        /// ItemUnrealized is raised when the gengrid item is deleted.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemUnrealized;
+
+        /// <summary>
+        /// ItemLongPressed is raised when a gengrid item is pressed for a certain amount of time. By default it's 1 second.
+        /// </summary>
+        public event EventHandler<GenGridItemEventArgs> ItemLongPressed;
+
+        /// <summary>
+        ///  Changed is raised when an item is added, removed, resized or moved and when the gengrid is resized or gets "horizontal" property changes.
+        /// </summary>
+        public event EventHandler Changed;
+
+        /// <summary>
+        /// Gets or sets the item's grid alignment along x-axis within a given gengrid widget.
+        /// Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users.
+        /// By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the left along x-axis.
+        /// </summary>
+        public double ItemAlignmentX
+        {
+            get
+            {
+                double align;
+                Interop.Elementary.elm_gengrid_align_get(RealHandle, out align, IntPtr.Zero);
+                return align;
+            }
+            set
+            {
+                double aligny = ItemAlignmentY;
+                Interop.Elementary.elm_gengrid_align_set(RealHandle, value, aligny);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the item's grid alignment on y-axis within a given gengrid widget.
+        /// Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users.
+        /// By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the top along y-axis.
+        /// </summary>
+        public double ItemAlignmentY
+        {
+            get
+            {
+                double align;
+                Interop.Elementary.elm_gengrid_align_get(RealHandle, IntPtr.Zero, out align);
+                return align;
+            }
+            set
+            {
+                double alignx = ItemAlignmentX;
+                Interop.Elementary.elm_gengrid_align_set(RealHandle, alignx, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the manner in which the items grid is filled within a given gengrid widget.
+        /// It is filled if true, otherwise false.
+        /// </summary>
+        public bool FillItems
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_filled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_filled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether multi-selection is enabled or disabled for a given gengrid widget.
+        /// </summary>
+        /// <remarks>
+        /// Multi-selection is the ability to have more than one item selected, on a given gengrid, simultaneously.
+        /// When it is enabled, a sequence of clicks on different items makes them all selected, progressively.
+        /// A click on an already selected item unselects it. If interacting via the keyboard, multi-selection is enabled while holding the "Shift" key.
+        /// By default, multi-selection is disabled.
+        /// </remarks>
+        public bool MultipleSelection
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_multi_select_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_multi_select_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the width for the items of a given gengrid widget.
+        /// </summary>
+        /// <remarks>
+        /// A gengrid, after creation, still has no information on the size to give to each of its cells.
+        /// The default width and height just have one finger wide.
+        /// Use this property to force a custom width for your items, making them as big as you wish.
+        /// </remarks>
+        public int ItemWidth
+        {
+            get
+            {
+                int width;
+                Interop.Elementary.elm_gengrid_item_size_get(RealHandle, out width, IntPtr.Zero);
+                return width;
+            }
+            set
+            {
+                int height = ItemHeight;
+                Interop.Elementary.elm_gengrid_item_size_set(RealHandle, value, height);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the height for the items of a given gengrid widget.
+        /// </summary>
+        /// <remarks>
+        /// A gengrid, after creation, still has no information on the size to give to each of its cells.
+        /// The default width and height just have one finger wide.
+        /// Use this property to force a custom height for your items, making them as big as you wish.
+        /// </remarks>
+        public int ItemHeight
+        {
+            get
+            {
+                int height;
+                Interop.Elementary.elm_gengrid_item_size_get(RealHandle, IntPtr.Zero, out height);
+                return height;
+            }
+            set
+            {
+                int width = ItemWidth;
+                Interop.Elementary.elm_gengrid_item_size_set(RealHandle, width, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the gengrid select mode by <see cref="GenGridSelectionMode"/>.
+        /// </summary>
+        public GenItemSelectionMode SelectionMode
+        {
+            get
+            {
+                return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_select_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_select_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the direction for which a given gengrid widget expands while placing its items.
+        /// </summary>
+        /// <remarks>
+        /// If true, items are placed in columns from top to bottom and when the space for a column is filled, another one is started on the right, thus expanding the grid horizontally.
+        /// If false, items are placed in rows from left to right, and when the space for a row is filled, another one is started below, thus expanding the grid vertically.
+        /// </remarks>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether the gengrid items should be highlighted when an item is selected.
+        /// </summary>
+        public bool IsHighlight
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_highlight_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_highlight_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, out policy, IntPtr.Zero);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)value, (int)v);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of VerticalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, IntPtr.Zero, out policy);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)h, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the first item in a given gengrid widget.
+        /// </summary>
+        public GenGridItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_gengrid_first_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenGridItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the last item in a given gengrid widget.
+        /// </summary>
+        public GenGridItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_gengrid_last_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenGridItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the items count in a given gengrid widget.
+        /// </summary>
+        public uint ItemCount
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_items_count(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets the selected item in a given gengrid widget.
+        /// </summary>
+        public GenGridItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_gengrid_selected_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenGridItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether a given gengrid widget is or not able have items reordered.
+        /// </summary>
+        public bool ReorderMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_reorder_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_reorder_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Appends a new item to a given gengrid widget. This adds an item to the end of the gengrid.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+        /// <seealso cref="GenItemClass"/>
+        /// <seealso cref="GenGridItem"/>
+        public GenGridItem Append(GenItemClass itemClass, object data)
+        {
+            GenGridItem item = new GenGridItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_gengrid_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepends a new item to a given gengrid widget. This adds an item to the beginning of the gengrid.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+        /// <seealso cref="GenItemClass"/>
+        /// <seealso cref="GenGridItem"/>
+        public GenGridItem Prepend(GenItemClass itemClass, object data)
+        {
+            GenGridItem item = new GenGridItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_gengrid_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts an item before another in a gengrid widget. This inserts an item before another in the gengrid.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="before">The item before which to place this new one.</param>
+        /// <returns>Return a gengrid item that contains data and itemClass./></returns>
+        /// <seealso cref="GenItemClass"/>
+        /// <seealso cref="GenGridItem"/>
+        public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before)
+        {
+            GenGridItem item = new GenGridItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_before(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts an item before another in a gengrid widget. This inserts an item after another in the gengrid.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="after">The item after which to place this new one.</param>
+        /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+        /// <seealso cref="GenItemClass"/>
+        /// <seealso cref="GenGridItem"/>
+        public GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after)
+        {
+            GenGridItem item = new GenGridItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Insert an item in a gengrid widget using a user-defined sort function.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="func">User defined comparison function that defines the sort order based on gengrid item and its data.</param>
+        /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+        public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison<object> comparison)
+        {
+            GenGridItem item = new GenGridItem(data, itemClass);
+
+            Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
+            {
+                GenGridItem first = (ItemObject.GetItemByHandle(handle1) as GenGridItem) ?? item;
+                GenGridItem second = (ItemObject.GetItemByHandle(handle2) as GenGridItem) ?? item;
+                return comparison(first.Data, second.Data);
+            };
+
+            IntPtr handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Shows a given item to the visible area of a gengrid.
+        /// </summary>
+        /// <param name="item">The gengrid item to display.</param>
+        /// <param name="position">The position of the item in the viewport.</param>
+        /// <param name="animated">The type of how to show the item.</param>
+        /// <remarks>
+        /// If animated is true, the gengrid shows item by scrolling if it's not fully visible.
+        /// If animated is false, the gengrid shows item by jumping if it's not fully visible.
+        /// </remarks>
+        /// <seealso cref="ScrollToPosition"/>
+        public void ScrollTo(GenGridItem item, ScrollToPosition position, bool animated)
+        {
+            if (animated)
+            {
+                Interop.Elementary.elm_gengrid_item_bring_in(item.Handle, (int)position);
+            }
+            else
+            {
+                Interop.Elementary.elm_gengrid_item_show(item.Handle, (int)position);
+            }
+        }
+
+        /// <summary>
+        /// Updates the contents of all the realized items.
+        /// This updates all realized items by calling all the <see cref="GenItemClass"/> again to get the content, text, and states.
+        /// Use this when the original item data has changed and the changes are desired to reflect.
+        /// </summary>
+        /// <remarks>
+        /// <see cref="GenItem.Update()"/> to update just one item.
+        /// </remarks>
+        public void UpdateRealizedItems()
+        {
+            Interop.Elementary.elm_gengrid_realized_items_update(RealHandle);
+        }
+
+        /// <summary>
+        /// Removes all items from a given gengrid widget.
+        /// This removes(and deletes) all items in obj, making it empty.
+        /// </summary>
+        /// <remarks>
+        /// <see cref="ItemObject.Delete()"/> to delete just one item.
+        /// </remarks>
+        public void Clear()
+        {
+            Interop.Elementary.elm_gengrid_clear(RealHandle);
+        }
+
+        /// <summary>
+        /// Get the item that is at the x, y canvas coords.
+        /// </summary>
+        /// <param name="x">The input x coordinate</param>
+        /// <param name="y">The input y coordinate</param>
+        /// <param name="positionX">The position relative to the item returned here.
+        /// -1, 0 or 1, depending if the coordinate is on the left portion of that item(-1), on the middle section(0) or on the right part(1).
+        /// </param>
+        /// <param name="positionY">The position relative to the item returned here
+        /// -1, 0 or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0) or on the lower part (1).
+        /// </param>
+        /// <returns></returns>
+        public GenGridItem GetItemByPosition(int x, int y, out int portionX, out int portionY)
+        {
+            IntPtr handle = Interop.Elementary.elm_gengrid_at_xy_item_get(RealHandle, x, y, out portionX, out portionY);
+            return ItemObject.GetItemByHandle(handle) as GenGridItem;
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_gengrid_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        void InitializeSmartEvent()
+        {
+            _selected = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "selected", GenGridItemEventArgs.CreateFromSmartEvent);
+            _unselected = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "unselected", GenGridItemEventArgs.CreateFromSmartEvent);
+            _activated = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "activated", GenGridItemEventArgs.CreateFromSmartEvent);
+            _pressed = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "pressed", GenGridItemEventArgs.CreateFromSmartEvent);
+            _released = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "released", GenGridItemEventArgs.CreateFromSmartEvent);
+            _doubleClicked = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "clicked,double", GenGridItemEventArgs.CreateFromSmartEvent);
+            _realized = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "realized", GenGridItemEventArgs.CreateFromSmartEvent);
+            _unrealized = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "unrealized", GenGridItemEventArgs.CreateFromSmartEvent);
+            _longpressed = new SmartEvent<GenGridItemEventArgs>(this, this.RealHandle, "longpressed", GenGridItemEventArgs.CreateFromSmartEvent);
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+
+            _selected.On += (s, e) => { if (e.Item != null) ItemSelected?.Invoke(this, e); };
+            _unselected.On += (s, e) => { if (e.Item != null) ItemUnselected?.Invoke(this, e); };
+            _activated.On += (s, e) => { if (e.Item != null) ItemActivated?.Invoke(this, e); };
+            _pressed.On += (s, e) => { if (e.Item != null) ItemPressed?.Invoke(this, e); };
+            _released.On += (s, e) => { if (e.Item != null) ItemReleased?.Invoke(this, e); };
+            _doubleClicked.On += (s, e) => { if (e.Item != null) ItemDoubleClicked?.Invoke(this, e); };
+            _realized.On += (s, e) => { if (e.Item != null) ItemRealized?.Invoke(this, e); };
+            _unrealized.On += (s, e) => { if (e.Item != null) ItemUnrealized?.Invoke(this, e); };
+            _longpressed.On += (s, e) => { if (e.Item != null) ItemLongPressed?.Invoke(this, e); };
+            _changed.On += (s, e) => { Changed?.Invoke(this, e); };
+        }
+
+        void AddInternal(GenGridItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((GenGridItem)sender);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenGridItem.cs b/src/ElmSharp/ElmSharp/GenGridItem.cs
new file mode 100644 (file)
index 0000000..afdede0
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="GenItem"/>.
+    /// A instance to the gengrid item added.
+    /// It contains Update() method to update a gengrid item which is given.
+    /// </summary>
+    public class GenGridItem : GenItem
+    {
+        internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
+        {
+        }
+
+        /// <summary>
+        /// Gets or sets whether a given gengrid item is selected.
+        /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one.
+        /// </summary>
+        /// <remarks>
+        /// If true, it is selected.
+        /// If false, it is unselected.
+        /// </remarks>
+        public override bool IsSelected
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_item_selected_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_item_selected_set(Handle, value);
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override string Cursor
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_item_cursor_get(Handle);
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    Interop.Elementary.elm_gengrid_item_cursor_set(Handle, value);
+                }
+                else
+                {
+                    Interop.Elementary.elm_gengrid_item_cursor_unset(Handle);
+                }
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override string CursorStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_item_cursor_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_item_cursor_style_set(Handle, value);
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsUseEngineCursor
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_item_cursor_engine_only_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_item_cursor_engine_only_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the style of given gengrid item's tooltip.
+        /// </summary>
+        public override string TooltipStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_gengrid_item_tooltip_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_item_tooltip_style_set(Handle, value);
+            }
+        }
+
+        public override GenItemSelectionMode SelectionMode
+        {
+            get
+            {
+                return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_item_select_mode_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gengrid_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets gengrid item's row position, relative to the whole gengrid's grid area.
+        /// </summary>
+        public int Row
+        {
+            get
+            {
+                int row, column;
+                Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
+                return row;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets gengrid item's column position, relative to the whole gengrid's grid area.
+        /// </summary>
+        public int Column
+        {
+            get
+            {
+                int row, column;
+                Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
+                return column;
+            }
+        }
+
+        public override void SetTooltipText(string tooltip)
+        {
+            Interop.Elementary.elm_gengrid_item_tooltip_text_set(Handle, tooltip);
+        }
+
+        public override void UnsetTooltip()
+        {
+            Interop.Elementary.elm_gengrid_item_tooltip_unset(Handle);
+        }
+
+        /// <summary>
+        /// Updates the content of a given gengrid item.
+        /// This updates an item by calling all the genitem class functions again to get the content, text, and states.
+        /// Use this when the original item data has changed and you want the changes to reflect.
+        /// </summary>
+        /// <remarks>
+        /// <see cref="GenGrid.UpdateRealizedItems"/> to update the contents of all the realized items.
+        /// </remarks>
+        public override void Update()
+        {
+            Interop.Elementary.elm_gengrid_item_update(Handle);
+        }
+
+        protected override void UpdateTooltipDelegate()
+        {
+            Interop.Elementary.elm_gengrid_item_tooltip_content_cb_set(Handle,
+                TooltipContentDelegate != null ? _tooltipCb : null,
+                IntPtr.Zero,
+                null);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenItem.cs b/src/ElmSharp/ElmSharp/GenItem.cs
new file mode 100644 (file)
index 0000000..ac609b0
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    public enum GenItemSelectionMode
+    {
+        /// <summary>
+        /// Default select mode.
+        /// </summary>
+        Default,
+
+        /// <summary>
+        /// Always select mode.
+        /// </summary>
+        Always,
+
+        /// <summary>
+        /// No select mode.
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// No select mode with no finger size rule.
+        /// </summary>
+        DisplayOnly
+    }
+
+    /// <summary>
+    /// It inherits <see cref="ItemObject"/>.
+    /// A base class for <see cref="GenGridItem"/> and <see cref="GenListItem"/>.
+    /// It contains genitem class and data to display data.
+    /// </summary>
+    public abstract class GenItem : ItemObject
+    {
+        internal Interop.Elementary.Elm_Tooltip_Item_Content_Cb _tooltipCb;
+        GetTooltipContentDelegate _tooltipContentDelegate = null;
+
+        /// <summary>
+        /// The delegate returning the tooltip contents.
+        /// </summary>
+        public delegate EvasObject GetTooltipContentDelegate();
+
+        internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero)
+        {
+            Data = data;
+            ItemClass = itemClass;
+            _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); };
+        }
+
+        /// <summary>
+        /// Gets the item class that defines how to display data. It returns <see cref="GenItemClass"/> type.
+        /// </summary>
+        public GenItemClass ItemClass { get; protected set; }
+
+        /// <summary>
+        /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipContent"/> and <see cref="GenListItem.TooltipContent"/>.
+        /// </summary>
+        public GetTooltipContentDelegate TooltipContentDelegate
+        {
+            get
+            {
+                return _tooltipContentDelegate;
+            }
+            set
+            {
+                _tooltipContentDelegate = value;
+                UpdateTooltipDelegate();
+            }
+        }
+
+        public abstract GenItemSelectionMode SelectionMode { get; set; }
+
+        public abstract string Cursor { get; set; }
+        public abstract string CursorStyle { get; set; }
+
+        public abstract bool IsUseEngineCursor { get; set; }
+
+        /// <summary>
+        /// Gets item data that is added through calling <see cref="GenGrid.Append(GenItemClass, object)"/>, <see cref="GenGrid.Prepend(GenItemClass, object)"/> or <see cref="GenGrid.InsertBefore(GenItemClass, object, GenGridItem)"/> methods.
+        /// </summary>
+        public object Data { get; protected set; }
+
+        /// <summary>
+        /// It's a abstract property. It's implemented by <see cref="GenGridItem.IsSelected"/> and <see cref="GenListItem.IsSelected"/>.
+        /// </summary>
+        public abstract bool IsSelected { get; set; }
+
+        /// <summary>
+        /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipStyle"/> and <see cref="GenListItem.TooltipStyle"/>.
+        /// </summary>
+        public abstract string TooltipStyle { get; set; }
+
+        public abstract void SetTooltipText(string tooltip);
+        public abstract void UnsetTooltip();
+
+        /// <summary>
+        /// It's a abstract method. It's implemented by <see cref="GenGridItem.Update"/> and <see cref="GenListItem.Update"/>.
+        /// </summary>
+        public abstract void Update();
+
+        /// <summary>
+        /// The override method for delete item class and item data. It's called when the item is deleting.
+        /// </summary>
+        protected override void OnInvalidate()
+        {
+            ItemClass?.SendItemDeleted(Data);
+            Data = null;
+            ItemClass = null;
+        }
+
+        protected abstract void UpdateTooltipDelegate();
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenItemClass.cs b/src/ElmSharp/ElmSharp/GenItemClass.cs
new file mode 100644 (file)
index 0000000..17fe11a
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It represents the GenGrid or GenList item class definition field details.
+    /// It has some display styles, such as "default", "full" and "group_index".
+    /// </summary>
+    public class GenItemClass : IDisposable
+    {
+        static Dictionary<IntPtr, EvasObject> s_HandleToEvasObject = new Dictionary<IntPtr, EvasObject>();
+
+        /// <summary>
+        /// The delegate to define <see cref="GetTextHandler"/>.
+        /// </summary>
+        /// <param name="data">The item data.</param>
+        /// <param name="part">The part where the data should be shown.</param>
+        /// <returns>Return string that should be shown.</returns>
+        public delegate string GetTextDelegate(object data, string part);
+
+        /// <summary>
+        /// The delegate to define <see cref="GetContentHandler"/>.
+        /// </summary>
+        /// <param name="data">The item data.</param>
+        /// <param name="part">The part where the data should be shown.</param>
+        /// <returns>Return content that should be shown.</returns>
+        public delegate EvasObject GetContentDelegate(object data, string part);
+
+        /// <summary>
+        /// The delegate to define <see cref="DeleteHandler"/>.
+        /// </summary>
+        /// <param name="data">The item data.</param>
+        public delegate void DeleteDelegate(object data);
+
+        /// <summary>
+        /// The delegate to define <see cref="ReusableContentHandler"/>.
+        /// </summary>
+        /// <param name="data">The item data.</param>
+        /// <param name="part">The part where the data should be shown.</param>
+        /// <param name="old">The content has been added in gengrid.</param>
+        /// <returns>Return content that should be shown.</returns>
+        public delegate EvasObject GetReusableContentDelegate(object data, string part, EvasObject old);
+
+        ItemClass _itemClass;
+        IntPtr _unmanagedPtr = IntPtr.Zero;
+        string _style;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the GenItemClass.
+        /// </summary>
+        /// <param name="style">The item display style.</param>
+        public GenItemClass(string style)
+        {
+            _style = style;
+            IntPtr unmanaged = CreateItemClass();
+
+            _itemClass = Marshal.PtrToStructure<ItemClass>(unmanaged);
+            _itemClass.itemStyle = style;
+            _itemClass.textCallback = GetTextCallback;
+            _itemClass.contentCallback = GetContentCallback;
+            _itemClass.stateCallback = null;
+            _itemClass.delCallback = DelCallback;
+            _itemClass.reusableContentCallback = GetReusableContentCallback;
+
+            ReleaseItemClass(unmanaged);
+        }
+
+        ~GenItemClass()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets the item style.
+        /// </summary>
+        public string ItemStyle { get { return _style; } }
+
+        /// <summary>
+        /// Gets or sets the callback that defines how to display item text.
+        /// If get, return <see cref="GetTextDelegate"/>.
+        /// </summary>
+        public GetTextDelegate GetTextHandler { get; set; }
+
+        /// <summary>
+        /// Gets or sets the callback that defines how to display item content.
+        /// If get, return <see cref="GetContentDelegate"/>.
+        /// </summary>
+        public GetContentDelegate GetContentHandler { get; set; }
+
+        /// <summary>
+        /// Gets or sets the callback that defines how to delete item text and content.
+        /// If get, return <see cref="DeleteDelegate"/>.
+        /// </summary>
+        public DeleteDelegate DeleteHandler { get; set; }
+
+        /// <summary>
+        /// Gets or sets the callback that defines how to reuse item content.
+        /// If get, return <see cref="GetReusableContentDelegate"/>.
+        /// </summary>
+        public GetReusableContentDelegate ReusableContentHandler { get; set; }
+
+        internal IntPtr UnmanagedPtr
+        {
+            get
+            {
+                if (_unmanagedPtr == IntPtr.Zero)
+                {
+                    _unmanagedPtr = Marshal.AllocHGlobal(Marshal.SizeOf(_itemClass));
+                    Marshal.StructureToPtr(_itemClass, _unmanagedPtr, false);
+                }
+                return _unmanagedPtr;
+            }
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_unmanagedPtr != IntPtr.Zero)
+            {
+                Marshal.FreeHGlobal(_unmanagedPtr);
+                _unmanagedPtr = IntPtr.Zero;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal void SendItemDeleted(object data)
+        {
+            // data is user inserted value with GenItem
+            DeleteHandler?.Invoke(data);
+        }
+
+        protected virtual IntPtr CreateItemClass()
+        {
+            return Interop.Elementary.elm_genlist_item_class_new();
+        }
+
+        protected virtual void ReleaseItemClass(IntPtr unmanagedPtr)
+        {
+            Interop.Elementary.elm_genlist_item_class_free(unmanagedPtr);
+        }
+
+        string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part)
+        {
+            GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+            return GetTextHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
+        }
+
+        IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part)
+        {
+            GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+            EvasObject evasObject = GetContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
+            if (evasObject != null)
+            {
+                s_HandleToEvasObject[evasObject.Handle] = evasObject;
+                evasObject.Deleted += EvasObjectDeleted;
+            }
+            return evasObject;
+        }
+
+        void EvasObjectDeleted(object sender, EventArgs e)
+        {
+            IntPtr handle = (sender as EvasObject).Handle;
+            s_HandleToEvasObject.Remove(handle);
+        }
+
+        IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old)
+        {
+            IntPtr reusedHandle = IntPtr.Zero;
+            GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+            if (s_HandleToEvasObject.ContainsKey(old))
+            {
+                reusedHandle = ReusableContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part), s_HandleToEvasObject[old]);
+            }
+            return reusedHandle;
+        }
+
+        void DelCallback(IntPtr data, IntPtr obj)
+        {
+            // We can't use this callback
+            // because, when item was deleted
+            // First, ItemObject deleted callback was called
+            // and We need to clean up ItemObject related objects
+            // This callback was called after ItemObject deleted callback was completed.
+            // So, We can't get resource reletated with ItemObject
+        }
+    }
+
+    public class GenGridItemClass : GenItemClass
+    {
+        public GenGridItemClass(string style) : base(style)
+        {
+        }
+
+        protected override IntPtr CreateItemClass()
+        {
+            return Interop.Elementary.elm_gengrid_item_class_new();
+        }
+
+        protected override void ReleaseItemClass(IntPtr unmanagedPtr)
+        {
+            Interop.Elementary.elm_gengrid_item_class_free(unmanagedPtr);
+        }
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal class ItemClass
+    {
+        public delegate string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part);
+
+        public delegate IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part);
+
+        public delegate int GetStateCallback(IntPtr data, IntPtr obj, IntPtr part);
+
+        public delegate void DelCallback(IntPtr data, IntPtr obj);
+
+        public delegate int FilterCallback(IntPtr data, IntPtr obj, IntPtr key);
+
+        public delegate IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old);
+
+        public int version;
+        public uint refCount;
+        public int deleteMe;
+        public string itemStyle;
+        public readonly string decorateItemStyle;
+        public readonly string decorateAllItemStyle;
+        public GetTextCallback textCallback;
+        public GetContentCallback contentCallback;
+        public GetStateCallback stateCallback;
+        public DelCallback delCallback;
+        public FilterCallback filterCallback;
+        public GetReusableContentCallback reusableContentCallback;
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenList.cs b/src/ElmSharp/ElmSharp/GenList.cs
new file mode 100644 (file)
index 0000000..ecb20e4
--- /dev/null
@@ -0,0 +1,751 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for setting genlist item type.
+    /// </summary>
+    public enum GenListItemType
+    {
+        /// <summary>
+        /// if Normal is set then this item is normal item.
+        /// </summary>
+        Normal = 0,
+
+        /// <summary>
+        /// If tree is set then this item is displayed as an item that is able to expand and have child items.
+        /// </summary>
+        Tree = (1 << 0),
+
+        /// <summary>
+        /// if Group is set then this item is group index item that is displayed at the top until the next group comes.
+        /// </summary>
+        Group = (1 << 1),
+    }
+
+    /// <summary>
+    /// Enumeration for setting genlist's resizing behavior, transverse axis scrolling and items cropping.
+    /// </summary>
+    public enum GenListMode
+    {
+        /// <summary>
+        /// The genlist won't set any of its size hints to inform how a possible container should resize it.
+        /// Then, if it's not created as a "resize object", it might end with zeroed dimensions.
+        /// The genlist will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction.
+        /// </summary>
+        Compress = 0,
+
+        /// <summary>
+        /// This is the same as Compress, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction.
+        /// </summary>
+        Scroll,
+
+        /// <summary>
+        /// Sets a minimum size hint on the genlist object, so that containers may respect it (and resize itself to fit the child properly).
+        /// More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well.
+        /// This is naturally bound by the genlist object's maximum size hints, set externally.
+        /// </summary>
+        Limit,
+
+        /// <summary>
+        /// Besides setting a minimum size on the transverse axis, just like on Limit, the genlist will set a minimum size on th longitudinal axis, trying to reserve space to all its children to be visible at a time.
+        /// This is naturally bound by the genlist object's maximum size hints, set externally.
+        /// </summary>
+        Expand
+    }
+
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// It contains Item which is <see cref="GenListItem"/> type.
+    /// All events of GenList contain GenListItemEventArgs as a parameter.
+    /// </summary>
+    public class GenListItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets or sets GenList item. The return type is <see cref="GenListItem"/>.
+        /// </summary>
+        public GenListItem Item { get; set; }
+
+        internal static GenListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            GenListItem item = ItemObject.GetItemByHandle(info) as GenListItem;
+            return new GenListItemEventArgs() { Item = item };
+        }
+    }
+
+    /// <summary>
+    /// Enumeration that defines where to position the item in the genlist.
+    /// </summary>
+    public enum ScrollToPosition
+    {
+        /// <summary>
+        /// Scrolls to nowhere.
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// Scrolls to the nearest viewport.
+        /// </summary>
+        In = (1 << 0),
+
+        /// <summary>
+        /// Scrolls to the top of the viewport.
+        /// </summary>
+        Top = (1 << 1),
+
+        /// <summary>
+        /// Scrolls to the middle of the viewport.
+        /// </summary>
+        Middle = (1 << 2),
+
+        /// <summary>
+        /// Scrolls to the bottom of the viewport.
+        /// </summary>
+        Bottom = (1 << 3)
+    }
+
+    /// <summary>
+    /// It inherits <see cref="Layout"/>.
+    /// The GenList is a widget that aims to have more expansive list than the simple <see cref="List"/> in ElmSharp that could have more flexible items and allow many more entries while still being fast and low on memory usage.
+    /// At the same time it was also made to be able to do tree structures.
+    /// But the price to pay is more complexity when it comes to usage.
+    /// If all you want is a simple list with icons and a single text, use the <see cref="List"/> widget.
+    /// </summary>
+    public class GenList : Layout
+    {
+        HashSet<GenListItem> _children = new HashSet<GenListItem>();
+
+        SmartEvent<GenListItemEventArgs> _selected;
+        SmartEvent<GenListItemEventArgs> _unselected;
+        SmartEvent<GenListItemEventArgs> _activated;
+        SmartEvent<GenListItemEventArgs> _pressed;
+        SmartEvent<GenListItemEventArgs> _released;
+        SmartEvent<GenListItemEventArgs> _doubleClicked;
+        SmartEvent<GenListItemEventArgs> _expanded;
+        SmartEvent<GenListItemEventArgs> _realized;
+        SmartEvent<GenListItemEventArgs> _unrealized;
+        SmartEvent<GenListItemEventArgs> _longpressed;
+        SmartEvent<GenListItemEventArgs> _moved;
+        SmartEvent<GenListItemEventArgs> _movedAfter;
+        SmartEvent<GenListItemEventArgs> _movedBefore;
+        SmartEvent _scrollAnimationStarted;
+        SmartEvent _scrollAnimationStopped;
+        SmartEvent _changed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the GenList class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by GenList as a child. It's <see cref="EvasObject"/> type.</param>
+        public GenList(EvasObject parent) : base(parent)
+        {
+            ListMode = GenListMode.Compress;
+            InitializeSmartEvent();
+        }
+
+        /// <summary>
+        /// Gets or sets whether the homogeneous mode is enabled.
+        /// </summary>
+        /// <remarks>
+        /// If true, the genlist items have same height and width.
+        /// </remarks>
+        public bool Homogeneous
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_homogeneous_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_homogeneous_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the horizontal stretching mode. This mode used for sizing items horizontally.
+        /// The default value is <see cref="GenListMode.Scroll"/> which means that if items are too wide to fit, the scroller scrolls horizontally.
+        /// If set <see cref="GenListMode.Compress"/> which means that the item width is fixed (restricted to a minimum of) to the list width when calculating its size in order to allow the height to be calculated based on it.
+        /// If set <see cref="GenListMode.Limit"/> which means that items are expanded to the viewport width and limited to that size.
+        /// if set <see cref="GenListMode.Expand"/> which means that genlist try to reserve space to all its items to be visible at a time.
+        /// </summary>
+        /// <remarks>
+        /// Compress makes genlist resize slower as it recalculates every item height again whenever the list width changes.
+        /// The homogeneous mode is so that all items in the genlist are of the same width/height. With Compress, genlist items are initialized fast.
+        /// However, there are no sub-objects in the genlist which can be on the flying resizable (such as TEXTBLOCK).
+        /// If so, then some dynamic resizable objects in the genlist would not be diplayed properly.
+        /// </remarks>
+        public GenListMode ListMode
+        {
+            get
+            {
+                return (GenListMode)Interop.Elementary.elm_genlist_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the first item in the genlist.
+        /// </summary>
+        public GenListItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_genlist_first_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenListItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the last item in the genlist.
+        /// </summary>
+        public GenListItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_genlist_last_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenListItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the reorder mode.
+        /// After turning on the reorder mode, longpress on a normal item triggers reordering of the item.
+        /// You can move the item up and down. However, reordering does not work with group items.
+        /// </summary>
+        public bool ReorderMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_reorder_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_reorder_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or set the maximum number of items within an item block.
+        /// </summary>
+        public int BlockCount
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_block_count_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_block_count_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether the genlist items should be highlighted when an item is selected.
+        /// </summary>
+        public bool IsHighlight
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_highlight_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_highlight_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the timeout in seconds for the longpress event.
+        /// </summary>
+        public double LongPressTimeout
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_longpress_timeout_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_longpress_timeout_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether enable multi-selection in the genlist.
+        /// </summary>
+        public bool IsMultiSelection
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_multi_select_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_multi_select_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the selected item in a given genlist widget.
+        /// </summary>
+        public GenListItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_genlist_selected_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as GenListItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the genlist select mode by <see cref="GenItemSelectionMode"/>.
+        /// </summary>
+        public GenItemSelectionMode SelectionMode
+        {
+            get
+            {
+                return (GenItemSelectionMode)Interop.Elementary.elm_genlist_select_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_select_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// ItemSelected is raised when a new genlist item is selected.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemSelected;
+
+        /// <summary>
+        /// ItemUnselected is raised when the genlist item is Unselected.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemUnselected;
+
+        /// <summary>
+        /// ItemPressed is raised when a new genlist item is pressed.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemPressed;
+
+        /// <summary>
+        /// ItemReleased is raised when a new genlist item is released.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemReleased;
+
+        /// <summary>
+        /// ItemActivated is raised when a new genlist item is double clicked or pressed (enter|return|spacebar).
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemActivated;
+
+        /// <summary>
+        /// ItemDoubleClicked is raised when a new genlist item is double clicked.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemDoubleClicked;
+
+        /// <summary>
+        /// ItemExpanded is raised when a new genlist item is indicated to expand.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemExpanded;
+
+        /// <summary>
+        /// ItemRealized is raised when a new genlist item is created as a real object.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemRealized;
+
+        /// <summary>
+        /// ItemUnrealized is raised when a new genlist item is unrealized.
+        /// After calling unrealize, the item's content objects are deleted and the item object itself is deleted or is put into a floating cache.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemUnrealized;
+
+        /// <summary>
+        /// ItemLongPressed is raised when a genlist item is pressed for a certain amount of time. By default it's 1 second.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemLongPressed;
+
+        /// <summary>
+        /// ItemMoved is raised when a genlist item is moved in the reorder mode.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemMoved;
+
+        /// <summary>
+        /// ItemMovedAfter is raised when a genlist item is moved after another item in the reorder mode.
+        /// To get the relative previous item, use <see cref="GenListItem.Previous"/>.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemMovedAfter;
+
+        /// <summary>
+        /// ItemMovedBefore is raised when a genlist item is moved before another item in the reorder mode.
+        /// To get the relative next item, use <see cref="GenListItem.Next"/>.
+        /// </summary>
+        public event EventHandler<GenListItemEventArgs> ItemMovedBefore;
+
+        /// <summary>
+        /// Changed is raised when genlist is changed.
+        /// </summary>
+        public event EventHandler Changed
+        {
+            add { _changed.On += value; }
+            remove { _changed.On -= value; }
+        }
+
+        /// <summary>
+        /// ScrollAnimationStarted is raised when scrolling animation has started.
+        /// </summary>
+        public event EventHandler ScrollAnimationStarted
+        {
+            add { _scrollAnimationStarted.On += value; }
+            remove { _scrollAnimationStarted.On -= value; }
+        }
+
+        /// <summary>
+        /// ScrollAnimationStopped is raised when scrolling animation has stopped.
+        /// </summary>
+        public event EventHandler ScrollAnimationStopped
+        {
+            add { _scrollAnimationStopped.On += value; }
+            remove { _scrollAnimationStopped.On -= value; }
+        }
+
+        /// <summary>
+        /// Appends a new item to the end of a given genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        /// <seealso cref="GenItemClass"/>
+        /// <seealso cref="GenListItem"/>
+        public GenListItem Append(GenItemClass itemClass, object data)
+        {
+            return Append(itemClass, data, GenListItemType.Normal);
+        }
+
+        /// <summary>
+        /// Appends a new item with <see cref="GenListItemType"/> to the end of a given genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type)
+        {
+            return Append(itemClass, data, type, null);
+        }
+
+        /// <summary>
+        /// Appends a new item with <see cref="GenListItemType"/> to the end of a given genlist widget or the end of the children list if the parent is given.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
+        {
+            GenListItem item = new GenListItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_genlist_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepends a new item to the beginning of a given genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem Prepend(GenItemClass itemClass, object data)
+        {
+            return Prepend(itemClass, data, GenListItemType.Normal);
+        }
+
+        /// <summary>
+        /// Prepends a new item with <see cref="GenListItemType"/> to the beginning of a given genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type)
+        {
+            return Prepend(itemClass, data, type, null);
+        }
+
+        /// <summary>
+        /// Prepends a new item with <see cref="GenListItemType"/> to the beginning of a given genlist widget or the beginning of the children list if the parent is given.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
+        {
+            GenListItem item = new GenListItem(data, itemClass);
+            IntPtr handle = Interop.Elementary.elm_genlist_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts an item before another item in a genlist widget.
+        /// It is the same tree level or group as the item before which it is inserted.????
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="before">The item before which to place this new one.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before)
+        {
+            return InsertBefore(itemClass, data, before, GenListItemType.Normal);
+        }
+
+        /// <summary>
+        /// Inserts an item with <see cref="GenListItemType"/> before another item in a genlist widget.
+        /// It is the same tree level or group as the item before which it is inserted.????
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="before">The item before which to place this new one.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type)
+        {
+            return InsertBefore(itemClass, data, before, type, null);
+        }
+
+        /// <summary>
+        /// Inserts an item with <see cref="GenListItemType"/> before another item under a parent in a genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="before">The item before which to place this new one.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type, GenListItem parent)
+        {
+            GenListItem item = new GenListItem(data, itemClass);
+            // insert before the `before` list item
+            IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+                RealHandle, // genlist handle
+                itemClass.UnmanagedPtr, // item class
+                (IntPtr)item.Id, // data
+                parent, // parent
+                before, // before
+                (int)type, // item type
+                null, // select callback
+                (IntPtr)item.Id); // callback data
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts an item with <see cref="GenListItemType"/> after another item under a parent in a genlist widget.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="before">The item after which to place this new one.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+        public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent)
+        {
+            GenListItem item = new GenListItem(data, itemClass);
+            // insert before the `before` list item
+            IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+                RealHandle, // genlist handle
+                itemClass.UnmanagedPtr, // item class
+                (IntPtr)item.Id, // data
+                parent, // parent
+                after, // after
+                (int)type, // item type
+                null, // select callback
+                (IntPtr)item.Id); // callback data
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Insert an item in a genlist widget using a user-defined sort function.
+        /// </summary>
+        /// <param name="itemClass">The itemClass defines how to display the data.</param>
+        /// <param name="data">The item data.</param>
+        /// <param name="func">User defined comparison function that defines the sort order based on genlist item and its data.</param>
+        /// <param name="type">The genlist item type.</param>
+        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+        /// <returns>Return a genlist item that contains data and itemClass.</returns>
+        public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison<object> comparison, GenListItemType type, GenListItem parent)
+        {
+            GenListItem item = new GenListItem(data, itemClass);
+
+            Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
+            {
+                GenListItem first = (ItemObject.GetItemByHandle(handle1) as GenListItem) ?? item;
+                GenListItem second = (ItemObject.GetItemByHandle(handle2) as GenListItem) ?? item;
+                return comparison(first.Data, second.Data);
+            };
+
+            IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert(
+                RealHandle, // genlist handle
+                itemClass.UnmanagedPtr, // item clas
+                (IntPtr)item.Id, // data
+                parent, // parent
+                (int)type, // item type
+                compareCallback, // compare callback
+                null, //select callback
+                (IntPtr)item.Id); // callback data
+            item.Handle = handle;
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Shows the given item with position type in a genlist.
+        /// When animated is true, genlist will jump to the given item and display it (by animatedly scrolling), if it is not fully visible. This may use animation and may take some time.
+        /// When animated is false, genlist will jump to the given item and display it (by jumping to that position), if it is not fully visible.
+        /// </summary>
+        /// <param name="item">The item to display.</param>
+        /// <param name="position">The position to show the given item to <see cref="ScrollToPosition"/>.</param>
+        /// <param name="animated">The animated indicates how to display the item, by scrolling or by jumping.</param>
+        public void ScrollTo(GenListItem item, ScrollToPosition position, bool animated)
+        {
+            if (animated)
+            {
+                Interop.Elementary.elm_genlist_item_bring_in(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position);
+            }
+            else
+            {
+                Interop.Elementary.elm_genlist_item_show(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position);
+            }
+        }
+
+        /// <summary>
+        /// Updates the content of all the realized items.
+        /// This updates all the realized items by calling all the <see cref="GenItemClass"/> again to get the content, text and states.
+        /// Use this when the original item data has changed and the changes are desired to reflect.
+        /// To update just one item, use <see cref="GenListItem.Update"/>.
+        /// </summary>
+        /// <seealso cref="GenListItem.Update"/>
+        public void UpdateRealizedItems()
+        {
+            Interop.Elementary.elm_genlist_realized_items_update(RealHandle);
+        }
+
+        /// <summary>
+        /// Removes all items from a given genlist widget.
+        /// This removes (and deletes) all items in obj, making it empty.
+        /// To delete just one item, use <see cref="ItemObject.Delete"/>.
+        /// </summary>
+        /// <seealso cref="ItemObject.Delete"/>
+        public void Clear()
+        {
+            Interop.Elementary.elm_genlist_clear(RealHandle);
+        }
+
+        /// <summary>
+        /// Get the item that is at the x, y canvas coords.
+        /// </summary>
+        /// <param name="x">The input x coordinate</param>
+        /// <param name="y">The input y coordinate</param>
+        /// <param name="pos">The position relative to the item returned here
+        ///  -1, 0, or 1, depending on whether the coordinate is on the upper portion of that item (-1), in the middle section (0), or on the lower part (1).
+        /// </param>
+        /// <returns></returns>
+        public GenListItem GetItemByPosition(int x, int y, out int pos)
+        {
+            IntPtr handle = Interop.Elementary.elm_genlist_at_xy_item_get(RealHandle, x, y, out pos);
+            return ItemObject.GetItemByHandle(handle) as GenListItem;
+        }
+
+        /// <summary>
+        /// Gets the nth item in a given genlist widget, placed at position nth, in its internal items list.
+        /// </summary>
+        /// <param name="index">The number of the item to grab (0 being the first)</param>
+        /// <returns></returns>
+        public GenListItem GetItemByIndex(int index)
+        {
+            IntPtr handle = Interop.Elementary.elm_genlist_nth_item_get(RealHandle, index);
+            return ItemObject.GetItemByHandle(handle) as GenListItem;
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_genlist_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        void InitializeSmartEvent()
+        {
+            _selected = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "selected", GenListItemEventArgs.CreateFromSmartEvent);
+            _unselected = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "unselected", GenListItemEventArgs.CreateFromSmartEvent);
+            _activated = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "activated", GenListItemEventArgs.CreateFromSmartEvent);
+            _pressed = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "pressed", GenListItemEventArgs.CreateFromSmartEvent);
+            _released = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "released", GenListItemEventArgs.CreateFromSmartEvent);
+            _doubleClicked = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "clicked,double", GenListItemEventArgs.CreateFromSmartEvent);
+            _expanded = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "expanded", GenListItemEventArgs.CreateFromSmartEvent);
+            _realized = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "realized", GenListItemEventArgs.CreateFromSmartEvent);
+            _unrealized = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "unrealized", GenListItemEventArgs.CreateFromSmartEvent);
+            _longpressed = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "longpressed", GenListItemEventArgs.CreateFromSmartEvent);
+            _moved = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "moved", GenListItemEventArgs.CreateFromSmartEvent);
+            _movedAfter = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "moved,after", GenListItemEventArgs.CreateFromSmartEvent);
+            _movedBefore = new SmartEvent<GenListItemEventArgs>(this, this.RealHandle, "moved,before", GenListItemEventArgs.CreateFromSmartEvent);
+            _scrollAnimationStarted = new SmartEvent(this, this.RealHandle, "scroll,anim,start");
+            _scrollAnimationStopped = new SmartEvent(this, this.RealHandle, "scroll,anim,stop");
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+
+            _selected.On += (s, e) => { if (e.Item != null) ItemSelected?.Invoke(this, e); };
+            _unselected.On += (s, e) => { if (e.Item != null) ItemUnselected?.Invoke(this, e); };
+            _activated.On += (s, e) => { if (e.Item != null) ItemActivated?.Invoke(this, e); };
+            _pressed.On += (s, e) => { if (e.Item != null) ItemPressed?.Invoke(this, e); };
+            _released.On += (s, e) => { if (e.Item != null) ItemReleased?.Invoke(this, e); };
+            _doubleClicked.On += (s, e) => { if (e.Item != null) ItemDoubleClicked?.Invoke(this, e); };
+            _expanded.On += (s, e) => { if (e.Item != null) ItemExpanded?.Invoke(this, e); };
+            _realized.On += (s, e) => { if (e.Item != null) ItemRealized?.Invoke(this, e); };
+            _unrealized.On += (s, e) => { if (e.Item != null) ItemUnrealized?.Invoke(this, e); };
+            _longpressed.On += (s, e) => { if (e.Item != null) ItemLongPressed?.Invoke(this, e); };
+            _moved.On += (s, e) => { if (e.Item != null) ItemMoved?.Invoke(this, e); };
+            _movedAfter.On += (s, e) => { if (e.Item != null) ItemMovedAfter?.Invoke(this, e); };
+            _movedBefore.On += (s, e) => { if (e.Item != null) ItemMovedBefore?.Invoke(this, e); };
+        }
+
+        void AddInternal(GenListItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((GenListItem)sender);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/GenListItem.cs b/src/ElmSharp/ElmSharp/GenListItem.cs
new file mode 100644 (file)
index 0000000..d1f7a85
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The type of item's part type.
+    /// </summary>
+    [Flags]
+    public enum GenListItemFieldType
+    {
+        /// <summary>
+        /// All item's parts.
+        /// </summary>
+        All = 0,
+
+        /// <summary>
+        /// The text part type.
+        /// </summary>
+        Text = (1 << 0),
+
+        /// <summary>
+        /// The Content part type.
+        /// </summary>
+        Content = (1 << 1),
+
+        /// <summary>
+        /// The state of part.
+        /// </summary>
+        State = (1 << 2),
+
+        /// <summary>
+        /// No part type.
+        /// </summary>
+        None = (1 << 3)
+    };
+
+    /// <summary>
+    /// It inherits <see cref="GenItem"/>.
+    /// A instance to the genlist item added.
+    /// It contains Update() method to update a genlist item which is given.
+    /// </summary>
+    public class GenListItem : GenItem
+    {
+        internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass)
+        {
+        }
+
+        /// <summary>
+        /// Gets or sets whether a given genlist item is selected.
+        /// </summary>
+        public override bool IsSelected
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_selected_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_selected_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether a given genlist item is expanded.
+        /// </summary>
+        public bool IsExpanded
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_expanded_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_expanded_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Updates the content of an item.
+        /// This updates an item by calling all the <see cref="GenItemClass"/> again to get the content, text, and states.
+        /// Use this when the original item data has changed and the changes are desired to reflect.
+        /// To update already realized items, use <see cref="GenList.UpdateRealizedItems"/>.
+        /// </summary>
+        /// <seealso cref="GenList.UpdateRealizedItems"/>
+        public override void Update()
+        {
+            Interop.Elementary.elm_genlist_item_update(Handle);
+        }
+
+        /// <summary>
+        /// Updates the part of an item.
+        /// This updates an item's part by calling item's fetching functions again to get the contents, texts and states.
+        /// Use this when the original item data has changed and the changes are desired to be reflected.
+        /// To update an item's all property, use <see cref="GenList.UpdateRealizedItems"/>.
+        /// </summary>
+        /// <param name="part">The part could be "elm.text", "elm.swalllow.icon", "elm.swallow.end", "elm.swallow.content" and so on. It is also used for globbing to match '*', '?', and '.'. It can be used at updating multi fields.</param>
+        /// <param name="type">The type of item's part type.</param>
+        /// <seealso cref="GenList.UpdateRealizedItems"/>
+        public void UpdateField(string part, GenListItemFieldType type)
+        {
+            Interop.Elementary.elm_genlist_item_fields_update(Handle, part, (uint)type);
+        }
+
+        /// <summary>
+        /// Demote an item to the end of the list.
+        /// </summary>
+        /// <param name="item">The genlistitem object</param>
+        public void DemoteItem()
+        {
+            Interop.Elementary.elm_genlist_item_demote(Handle);
+        }
+
+        /// <summary>
+        /// Gets or sets the genlist item's select mode.
+        /// </summary>
+        public override GenItemSelectionMode SelectionMode
+        {
+            get
+            {
+                return (GenItemSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the next item in a genlist widget's internal list of items.
+        /// </summary>
+        /// <seealso cref="Previous"/>
+        public GenListItem Next
+        {
+            get
+            {
+                IntPtr next = Interop.Elementary.elm_genlist_item_next_get(Handle);
+                if (next == IntPtr.Zero)
+                    return null;
+                else
+                    return GetItemByHandle(next) as GenListItem;
+            }
+        }
+
+        /// <summary>
+        /// Get the previous item in a genlist widget's internal list of items.
+        /// </summary>
+        /// <seealso cref="Next"/>
+        public GenListItem Previous
+        {
+            get
+            {
+                IntPtr prev = Interop.Elementary.elm_genlist_item_prev_get(Handle);
+                if (prev == IntPtr.Zero)
+                    return null;
+                else
+                    return GetItemByHandle(prev) as GenListItem;
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override string Cursor
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_cursor_get(Handle);
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    Interop.Elementary.elm_genlist_item_cursor_set(Handle, value);
+                }
+                else
+                {
+                    Interop.Elementary.elm_genlist_item_cursor_unset(Handle);
+                }
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override string CursorStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_cursor_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_cursor_style_set(Handle, value);
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsUseEngineCursor
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_cursor_engine_only_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_cursor_engine_only_set(Handle, value);
+            }
+        }
+
+        public override void SetTooltipText(string tooltip)
+        {
+            Interop.Elementary.elm_genlist_item_tooltip_text_set(Handle, tooltip);
+        }
+
+        public override void UnsetTooltip()
+        {
+            Interop.Elementary.elm_genlist_item_tooltip_unset(Handle);
+        }
+
+        /// <summary>
+        /// Gets or sets the style of given genlist item's tooltip.
+        /// </summary>
+        public override string TooltipStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_tooltip_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_tooltip_style_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether disable size restrictions on an object's tooltip.
+        /// </summary>
+        public bool IsTooltipWindowMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_tooltip_window_mode_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_genlist_item_tooltip_window_mode_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the index of the item. It is only valid once displayed.
+        /// </summary>
+        public int Index
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_index_get(Handle);
+            }
+        }
+
+        /// <summary>
+        /// Gets the depth of expanded item.
+        /// </summary>
+        public int ExpandedItemDepth
+        {
+            get
+            {
+                return Interop.Elementary.elm_genlist_item_expanded_depth_get(Handle);
+            }
+        }
+
+        /// <summary>
+        /// Remove all sub-items (children) of the given item.
+        /// </summary>
+        /// <remark>
+        /// This removes all items that are children (and their descendants) of the given item it.
+        /// </remark>
+        public void ClearSubitems()
+        {
+            Interop.Elementary.elm_genlist_item_subitems_clear(Handle);
+        }
+
+        /// <summary>
+        /// Update the item class of an item.
+        /// This sets another class of the item, changing the way that it is displayed. After changing the item class, <see cref="Update"/> is called on the item.
+        /// </summary>
+        /// <param name="itemClass">The item class for the item.</param>
+        /// <param name="data">The data for the item.</param>
+        public void UpdateItemClass(GenItemClass itemClass, object data)
+        {
+            Data = data;
+            ItemClass = itemClass;
+            Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr);
+        }
+
+        protected override void UpdateTooltipDelegate()
+        {
+            Interop.Elementary.elm_genlist_item_tooltip_content_cb_set(Handle,
+                TooltipContentDelegate != null ? _tooltipCb : null,
+                IntPtr.Zero,
+                null);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/GestureLayer.cs b/src/ElmSharp/ElmSharp/GestureLayer.cs
new file mode 100644 (file)
index 0000000..c6bce6c
--- /dev/null
@@ -0,0 +1,835 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The GestureLayer is used to detect gestures.
+    /// Inherits Widget
+    /// </summary>
+    public class GestureLayer : Widget
+    {
+        private readonly Interop.Elementary.GestureEventCallback _gestureCallback;
+
+        // Important: don't remove items from _handlers list
+        // The list can grow up to (number of GestureType) * (number of GestureState)
+        // but all gestures share the callback and you don't want to desynchronize mapping
+        private readonly List<NativeCallback> _handlers = new List<NativeCallback>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of GestureLayer class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by GestureLayer as a child. It's <see cref="EvasObject"/> type.</param>
+        public GestureLayer(EvasObject parent) : base(parent)
+        {
+            _gestureCallback = new Interop.Elementary.GestureEventCallback(GestureCallbackHandler);
+        }
+
+        /// <summary>
+        /// Enumeration for supported gesture types.
+        /// </summary>
+        public enum GestureType
+        {
+            /// <summary>
+            /// N fingers single taps
+            /// </summary>
+            Tap = 1,
+
+            /// <summary>
+            /// N fingers single long-taps
+            /// </summary>
+            LongTap,
+
+            /// <summary>
+            /// N fingers double-single taps
+            /// </summary>
+            DoubleTap,
+
+            /// <summary>
+            /// N fingers triple-single taps
+            /// </summary>
+            TripleTap,
+
+            /// <summary>
+            /// Reports momentum in the direction of move
+            /// </summary>
+            Momentum,
+
+            /// <summary>
+            /// N fingers line gesture
+            /// </summary>
+            Line,
+
+            /// <summary>
+            /// N fingers flick gesture
+            /// </summary>
+            Flick,
+
+            /// <summary>
+            /// Zoom
+            /// </summary>
+            Zoom,
+
+            /// <summary>
+            /// Rotate
+            /// </summary>
+            Rotate,
+        }
+
+        /// <summary>
+        /// Enumeration for gesture states.
+        /// </summary>
+        public enum GestureState
+        {
+            /// <summary>
+            /// Gesture not started
+            /// </summary>
+            Undefined = -1,
+
+            /// <summary>
+            /// Gesture started
+            /// </summary>
+            Start,
+
+            /// <summary>
+            /// Gesture is ongoing
+            /// </summary>
+            Move,
+
+            /// <summary>
+            /// Gesture completed
+            /// </summary>
+            End,
+
+            /// <summary>
+            /// Ongoing gesture is aborted
+            /// </summary>
+            Abort,
+        }
+
+        #region Properties
+
+        /// <summary>
+        /// Sets or gets the repeat-events setting.
+        /// </summary>
+        public bool HoldEvents
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_hold_events_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_hold_events_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer continues enable of an object
+        /// </summary>
+        public bool Continues
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_continues_enable_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_continues_enable_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer finger-size for taps.
+        /// </summary>
+        public int TapFingerSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_tap_finger_size_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_tap_finger_size_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer long tap start timeout of an object
+        /// </summary>
+        public double LongTapTimeout
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_long_tap_start_timeout_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_long_tap_start_timeout_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer double tap timeout of an object
+        /// </summary>
+        public double DoubleTapTimeout
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_double_tap_timeout_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_double_tap_timeout_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer flick time limit (in ms) of an object
+        /// </summary>
+        public int FlickTimeLimit
+        {
+            get
+            {
+                return (int)Interop.Elementary.elm_gesture_layer_flick_time_limit_ms_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_flick_time_limit_ms_set(Handle, (UInt32)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer line min length of an object
+        /// </summary>
+        public int MinimumLineLength
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_line_min_length_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_line_min_length_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets  the gesture layer line angular tolerance of an object
+        /// </summary>
+        public double LineAngularTolerance
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_line_angular_tolerance_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_line_angular_tolerance_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer line distance tolerance of an object
+        /// </summary>
+        public int LineDistanceTolerance
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_line_distance_tolerance_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_line_distance_tolerance_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets step-value for rotate action.
+        /// </summary>
+        public double RotateStep
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_rotate_step_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_rotate_step_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer rotate angular tolerance of an object
+        /// </summary>
+        public double RotateAngularTolerance
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_rotate_angular_tolerance_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_rotate_angular_tolerance_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets control step value for zoom action.
+        /// </summary>
+        public double ZoomStep
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_zoom_step_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_zoom_step_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer zoom distance tolerance of an object
+        /// </summary>
+        public int ZoomDistanceTolerance
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_zoom_distance_tolerance_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_zoom_distance_tolerance_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer zoom finger factor of an object
+        /// </summary>
+        public double ZoomFingerFactor
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_zoom_finger_factor_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_zoom_finger_factor_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the gesture layer zoom wheel factor of an object
+        /// </summary>
+        public double ZoomWheelFactor
+        {
+            get
+            {
+                return Interop.Elementary.elm_gesture_layer_zoom_wheel_factor_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_gesture_layer_zoom_wheel_factor_set(Handle, value);
+            }
+        }
+
+        #endregion Properties
+
+        /// <summary>
+        /// Attach a gesture layer widget to an Evas object (setting the widget's target).
+        /// A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events.
+        /// </summary>
+        /// <param name="target">The object to attach.</param>
+        public void Attach(EvasObject target)
+        {
+            Interop.Elementary.elm_gesture_layer_attach(Handle, target.Handle);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback.
+        /// When all callbacks for the gesture are set to null, it means this gesture is disabled.
+        /// </summary>
+        /// <param name="type">The gesture you want to track state of.</param>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetGestureCallback(GestureType type, GestureState state, Action<object> action)
+        {
+            lock (_handlers)
+            {
+                bool found = false;
+                int i = 0;
+                // if this (type, state) already exists in _handlers, we will reuse it
+                foreach (var handler in _handlers)
+                {
+                    if (handler.Type == type && handler.State == state)
+                    {
+                        found = true;
+                        break;
+                    }
+                    i++;
+                }
+                if (found)
+                {
+                    // if we are changing null -> not-null, or not-null -> null, then inform the EFL
+                    if (_handlers[i].Action == null ^ action == null)
+                        Interop.Elementary.elm_gesture_layer_cb_set(Handle, type, state, action == null ? null : _gestureCallback, new IntPtr(i));
+                    // overwrite previous action
+                    _handlers[i].Action = action;
+                }
+                else
+                {
+                    if (action == null)
+                    {
+                        // ignore unsetting a handler for event which was not registered yet?
+                        return;
+                    }
+                    // (type, state) was not found, so we are adding a new entry and registering the callback
+                    _handlers.Add(new NativeCallback(type, state, action));
+                    // callback is always the same, the event is recognised by the index in _handler list (the index is passed as data)
+                    Interop.Elementary.elm_gesture_layer_cb_set(Handle, type, state, _gestureCallback, new IntPtr(i));
+                }
+            }
+        }
+
+        /// <summary>
+        /// clear the gesture state change callback.
+        /// </summary>
+        public void ClearCallbacks()
+        {
+            lock (_handlers)
+            {
+                int i = 0;
+                foreach (var handler in _handlers)
+                {
+                    if (handler.Action != null)
+                    {
+                        Interop.Elementary.elm_gesture_layer_cb_set(Handle, handler.Type, handler.State, null, new IntPtr(i));
+                        handler.Action = null;
+                    }
+                    i++;
+                }
+            }
+        }
+
+        #region Typed callback setting methods
+
+        // Following methods have been added for convenience, so the user will not have to convert Info structures himself
+        /// <summary>
+        /// Set the tap callback.
+        /// </summary>
+        /// <param name="type">The gesture you want to track state of.</param>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetTapCallback(GestureType type, GestureState state, Action<TapData> action)
+        {
+            SetCallback(type, state, action);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback with Momentum Gesture Type
+        /// </summary>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetMomentumCallback(GestureState state, Action<MomentumData> action)
+        {
+            SetCallback(GestureType.Momentum, state, action);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback with Line Gesture Type
+        /// </summary>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetLineCallback(GestureState state, Action<LineData> action)
+        {
+            SetCallback(GestureType.Line, state, action);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback with Flick Gesture Type
+        /// </summary>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetFlickCallback(GestureState state, Action<LineData> action)
+        {
+            SetCallback(GestureType.Flick, state, action);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback with Zoom Gesture Type
+        /// </summary>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetZoomCallback(GestureState state, Action<ZoomData> action)
+        {
+            SetCallback(GestureType.Zoom, state, action);
+        }
+
+        /// <summary>
+        /// Set the gesture state change callback with Rotate Gesture Type
+        /// </summary>
+        /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
+        /// <param name="action">The callback itself.</param>
+        public void SetRotateCallback(GestureState state, Action<RotateData> action)
+        {
+            SetCallback(GestureType.Rotate, state, action);
+        }
+
+        #endregion Typed callback setting methods
+
+        /// <summary>
+        /// Call this function to construct a new gesture-layer object.
+        /// </summary>
+        /// <param name="parent">The gesture layer's parent widget.</param>
+        /// <returns></returns>
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_gesture_layer_add(parent);
+        }
+
+        /// <summary>
+        /// clear the gesture state change callback.
+        /// </summary>
+        protected override void OnUnrealize()
+        {
+            ClearCallbacks();
+            base.OnUnrealize();
+        }
+
+        private void SetCallback<T>(GestureType type, GestureState state, Action<T> action)
+        {
+            if (action == null)
+                SetGestureCallback(type, state, null);
+            else
+                SetGestureCallback(type, state, new Action<object>((info) => action((T)info)));
+        }
+
+        private void GestureCallbackHandler(IntPtr data, IntPtr event_info)
+        {
+            // so EFL called our callback, lets use data to find the right Action to call
+            var handlerIndex = (int)data;
+            // thanks to the fact that we never remove item from _handlers, we don't need a lock here
+            if (handlerIndex < 0 || handlerIndex >= _handlers.Count)
+                return;
+            Action<object> action = _handlers[handlerIndex].Action;
+            if (action == null)
+                return;
+            // the interpretation of the event_info struct pointer depends on the GestureType
+            switch (_handlers[handlerIndex].Type)
+            {
+                case GestureType.Tap:
+                case GestureType.LongTap:
+                case GestureType.DoubleTap:
+                case GestureType.TripleTap:
+                    action(Marshal.PtrToStructure<TapData>(event_info));
+                    break;
+
+                case GestureType.Momentum:
+                    action(Marshal.PtrToStructure<MomentumData>(event_info));
+                    break;
+
+                case GestureType.Line:
+                case GestureType.Flick:
+                    action(Marshal.PtrToStructure<LineData>(event_info));
+                    break;
+
+                case GestureType.Zoom:
+                    action(Marshal.PtrToStructure<ZoomData>(event_info));
+                    break;
+
+                case GestureType.Rotate:
+                    action(Marshal.PtrToStructure<RotateData>(event_info));
+                    break;
+            }
+        }
+
+        #region Info structures
+
+        /// <summary>
+        /// The struct of TapData
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct TapData
+        {
+            /// <summary>
+            /// The x coordinate of the center point.
+            /// </summary>
+            public Int32 X;
+
+            /// <summary>
+            /// The y coordinate of the center point.
+            /// </summary>
+            public Int32 Y;
+
+#pragma warning disable 3003
+
+            /// <summary>
+            /// The number of fingers tapped.
+            /// </summary>
+            public UInt32 FingersCount;
+
+            /// <summary>
+            /// The timestamp.
+            /// </summary>
+            public UInt32 Timestamp;
+
+#pragma warning restore 3003
+        }
+
+        /// <summary>
+        /// The struct of MomentumData
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct MomentumData
+        {
+            /// <summary>
+            /// Final-swipe direction starting point on X.
+            /// </summary>
+            public Int32 X1;
+
+            /// <summary>
+            /// Final-swipe direction starting point on Y.
+            /// </summary>
+            public Int32 Y1;
+
+            /// <summary>
+            /// Final-swipe direction ending point on X.
+            /// </summary>
+            public Int32 X2;
+
+            /// <summary>
+            /// Final-swipe direction ending point on Y
+            /// </summary>
+            public Int32 Y2;
+
+#pragma warning disable 3003
+
+            /// <summary>
+            /// Timestamp of start of final x-swipe.
+            /// </summary>
+            public UInt32 HorizontalSwipeTimestamp;
+
+            /// <summary>
+            /// Timestamp of start of final y-swipe.
+            /// </summary>
+            public UInt32 VerticalSwipeTimestamp;
+
+            /// <summary>
+            /// Momentum on X.
+            /// </summary>
+            public Int32 HorizontalMomentum;
+
+            /// <summary>
+            /// Momentum on Y.
+            /// </summary>
+            public Int32 VerticalMomentum;
+
+            /// <summary>
+            /// Number of fingers.
+            /// </summary>
+            public UInt32 FingersCount;
+
+#pragma warning restore 3003
+        }
+
+        /// <summary>
+        /// The struct of LineData
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct LineData
+        {
+            /// <summary>
+            /// Final-swipe direction starting point on X.
+            /// </summary>
+            public Int32 X1;
+
+            /// <summary>
+            /// Final-swipe direction starting point on Y.
+            /// </summary>
+            public Int32 Y1;
+
+            /// <summary>
+            /// Final-swipe direction ending point on X.
+            /// </summary>
+            public Int32 X2;
+
+            /// <summary>
+            /// Final-swipe direction ending point on Y
+            /// </summary>
+            public Int32 Y2;
+
+#pragma warning disable 3003
+
+            /// <summary>
+            /// Timestamp of start of final x-swipe.
+            /// </summary>
+            public UInt32 HorizontalSwipeTimestamp;
+
+            /// <summary>
+            /// Timestamp of start of final y-swipe.
+            /// </summary>
+            public UInt32 VerticalSwipeTimestamp;
+
+            /// <summary>
+            /// Momentum on X.
+            /// </summary>
+            public Int32 HorizontalMomentum;
+
+            /// <summary>
+            /// Momentum on Y.
+            /// </summary>
+            public Int32 VerticalMomentum;
+
+            /// <summary>
+            /// Number of fingers.
+            /// </summary>
+            public UInt32 FingersCount;
+
+#pragma warning restore 3003
+
+            /// <summary>
+            /// Angle (direction) of lines.
+            /// </summary>
+            public double Angle;
+        }
+
+        /// <summary>
+        /// The struct of ZoomData
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct ZoomData
+        {
+            /// <summary>
+            /// The x coordinate of zoom center point reported to user.
+            /// </summary>
+            public Int32 X;
+
+            /// <summary>
+            /// The y coordinate of zoom center point reported to user.
+            /// </summary>
+            public Int32 Y;
+
+            /// <summary>
+            /// The radius (distance) between fingers reported to user.
+            /// </summary>
+            public Int32 Radius;
+
+            /// <summary>
+            /// The zoom value. 1.0 means no zoom.
+            /// </summary>
+            public double Zoom;
+
+            /// <summary>
+            /// Zoom momentum: zoom growth per second (NOT YET SUPPORTED).
+            /// </summary>
+            private double Momentum;
+        }
+
+        /// <summary>
+        /// The struct of RotateData
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct RotateData
+        {
+            /// <summary>
+            /// The x coordinate of rotation center point reported to user.
+            /// </summary>
+            public Int32 X;
+
+            /// <summary>
+            /// The y coordinate of rotation center point reported to user.
+            /// </summary>
+            public Int32 Y;
+
+            /// <summary>
+            /// The radius (distance) between fingers reported to user.
+            /// </summary>
+            public Int32 Radius;
+
+            /// <summary>
+            /// The start-angle.
+            /// </summary>
+            public double BaseAngle;
+
+            /// <summary>
+            /// The rotation value. 0.0 means no rotation.
+            /// </summary>
+            public double Angle;
+
+            /// <summary>
+            /// Rotation momentum: rotation done per second (NOT YET SUPPORTED).
+            /// </summary>
+            private double Momentum;
+        }
+
+        #endregion Info structures
+
+        /// <summary>
+        /// Config is a static class, it provides gestureLayer's timeout information.
+        /// </summary>
+        public static class Config
+        {
+            /// <summary>
+            /// Sets or gets the duration for occurring long tap event of gesture layer.
+            /// </summary>
+            public static double DefaultLongTapTimeout
+            {
+                get
+                {
+                    return Interop.Elementary.elm_config_glayer_long_tap_start_timeout_get();
+                }
+                set
+                {
+                    Interop.Elementary.elm_config_glayer_long_tap_start_timeout_set(value);
+                }
+            }
+
+            /// <summary>
+            /// Sets or gets the duration for occurring double tap event of gesture layer.
+            /// </summary>
+            public static double DefaultDoubleTapTimeout
+            {
+                get
+                {
+                    return Interop.Elementary.elm_config_glayer_double_tap_timeout_get();
+                }
+                set
+                {
+                    Interop.Elementary.elm_config_glayer_double_tap_timeout_set(value);
+                }
+            }
+        }
+
+        private class NativeCallback
+        {
+            public readonly GestureType Type;
+            public readonly GestureState State;
+            public Action<object> Action;
+
+            public NativeCallback(GestureType type, GestureState state, Action<object> action)
+            {
+                Type = type;
+                State = state;
+                Action = action;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Hoversel.cs b/src/ElmSharp/ElmSharp/Hoversel.cs
new file mode 100644 (file)
index 0000000..6adca62
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The HoverselItemEventArgs is an HoverselItem's EventArgs
+    /// </summary>
+    public class HoverselItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Hoversel's Item
+        /// </summary>
+        public HoverselItem Item { get; set; }
+
+        internal static HoverselItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            HoverselItem item = ItemObject.GetItemByHandle(info) as HoverselItem;
+            return new HoverselItemEventArgs() { Item = item };
+        }
+    }
+
+    /// <summary>
+    /// The hoversel is a button that pops up a list of items.
+    /// </summary>
+    public class Hoversel : Layout
+    {
+        SmartEvent _clicked;
+        SmartEvent _expanded;
+        SmartEvent _dismissed;
+        SmartEvent<HoverselItemEventArgs> _selected;
+        Interop.Evas.SmartCallback _onItemSelected;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Hoversel class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Hoversel as a child. It's <see cref="EvasObject"/> type.</param>
+        public Hoversel(EvasObject parent) : base(parent)
+        {
+            _clicked = new SmartEvent(this, "clicked");
+            _clicked.On += (sender, e) =>
+            {
+                Clicked?.Invoke(this, EventArgs.Empty);
+            };
+            _expanded = new SmartEvent(this, "expanded");
+            _expanded.On += (sender, e) =>
+            {
+                Expanded?.Invoke(this, EventArgs.Empty);
+            };
+            _dismissed = new SmartEvent(this, "dismissed");
+            _dismissed.On += (sender, e) =>
+            {
+                Dismissed?.Invoke(this, EventArgs.Empty);
+            };
+            _selected = new SmartEvent<HoverselItemEventArgs>(this, RealHandle, "selected", HoverselItemEventArgs.CreateFromSmartEvent);
+            _selected.On += (s, e) =>
+            {
+                if (e.Item != null) ItemSelected?.Invoke(this, e);
+            };
+            _onItemSelected = (data, obj, info) =>
+            {
+                HoverselItem item = ItemObject.GetItemById((int)data) as HoverselItem;
+                item?.SendItemSelected();
+            };
+        }
+
+        /// <summary>
+        /// Clicked will be triggered when Hoversel is clicked
+        /// </summary>
+        public event EventHandler Clicked;
+
+        /// <summary>
+        /// Expanded will be triggered when Hoversel is activated by clicking the hoversel or by a function
+        /// </summary>
+        public event EventHandler Expanded;
+
+        /// <summary>
+        /// Dismissed will be triggered when Hoversel Dismissed
+        /// </summary>
+        public event EventHandler Dismissed;
+
+        /// <summary>
+        /// ItemSelected will be triggered when Hoversel's Item Selected
+        /// </summary>
+        public event EventHandler<HoverselItemEventArgs> ItemSelected;
+
+        /// <summary>
+        /// Gets or sets the status to control whether the hoversel should expand horizontally.
+        /// </summary>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_hoversel_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_hoversel_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the hover parent.
+        /// </summary>
+        public IntPtr HoverParent
+        {
+            get
+            {
+                return Interop.Elementary.elm_hoversel_hover_parent_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_hoversel_hover_parent_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the flag of whether the hoversel is expanded.
+        /// </summary>
+        public bool IsExpanded
+        {
+            get
+            {
+                return Interop.Elementary.elm_hoversel_expanded_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the status of whether update icon and text of hoversel same to those of selected item automatically.
+        /// </summary>
+        public bool AutoUpdate
+        {
+            get
+            {
+                return Interop.Elementary.elm_hoversel_auto_update_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_hoversel_auto_update_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// This triggers the hoversel popup from code, the same as if the user had clicked the button.
+        /// </summary>
+        public void HoverBegin()
+        {
+            Interop.Elementary.elm_hoversel_hover_begin(RealHandle);
+        }
+
+        /// <summary>
+        /// This dismisses the hoversel popup as if the user had clicked outside the hover.
+        /// </summary>
+        public void HoverEnd()
+        {
+            Interop.Elementary.elm_hoversel_hover_end(RealHandle);
+        }
+
+        /// <summary>
+        /// This will remove all the children items from the hoversel.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_hoversel_clear(RealHandle);
+        }
+
+        /// <summary>
+        /// Add an item to the hoversel button.
+        /// This adds an item to the hoversel to show when it is clicked.
+        /// </summary>
+        /// <param name="label">Item's label</param>
+        /// <returns>A handle to the added item.</returns>
+        public HoverselItem AddItem(string label)
+        {
+            HoverselItem item = new HoverselItem();
+            item.Label = label;
+            item.Handle = Interop.Elementary.elm_hoversel_item_add(RealHandle, label, null, 0, _onItemSelected, (IntPtr)item.Id);
+            return item;
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+            RealHandle = Interop.Elementary.elm_hoversel_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/HoverselItem.cs b/src/ElmSharp/ElmSharp/HoverselItem.cs
new file mode 100755 (executable)
index 0000000..ebdaece
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The HoverselItem is the Item of Hoversel
+    /// </summary>
+    public class HoverselItem : ItemObject
+    {
+        internal HoverselItem() : base(IntPtr.Zero)
+        {
+        }
+
+        /// <summary>
+        /// HoverselItem's label
+        /// </summary>
+        public string Label { get; internal set; }
+
+        /// <summary>
+        /// ItemSelected will be triggered when HoverselItem Selected
+        /// </summary>
+        public event EventHandler ItemSelected;
+
+        internal void SendItemSelected()
+        {
+            ItemSelected?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/IAccessibleObject.cs b/src/ElmSharp/ElmSharp/IAccessibleObject.cs
new file mode 100755 (executable)
index 0000000..f1488ff
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// IAccessibleObject is a interface which defines properties and methods of accessible object.
+    /// </summary>
+    public interface IAccessibleObject
+    {
+        ReadingInfoType ReadingInfoType { get; set; }
+        AccessRole Role { get; set; }
+        bool CanHighlight { get; set; }
+        string TranslationDomain { get; set; }
+        string Name { get; set; }
+        string Description { get; set; }
+        AccessibleInfoProvider NameProvider { get; set; }
+        AccessibleInfoProvider DescriptionProvider { get; set; }
+        void AppendRelation(IAccessibleRelation relation);
+        void RemoveRelation(IAccessibleRelation relation);
+        void Highlight();
+        void Unhighlight();
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Icon.cs b/src/ElmSharp/ElmSharp/Icon.cs
new file mode 100755 (executable)
index 0000000..3ebff8f
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the icon lookup order. Should look for icons in the theme, FDO paths, or both.
+    /// </summary>
+    public enum IconLookupOrder
+    {
+        /// <summary>
+        /// Icon look up order: freedesktop, theme
+        /// </summary>
+        FreeDesktopFirst = 0,
+        /// <summary>
+        /// Icon look up order: theme, freedesktop
+        /// </summary>
+        ThemeFirst,
+        /// <summary>
+        /// Icon look up order: freedesktop
+        /// </summary>
+        FreeDesktopOnly,
+        /// <summary>
+        /// Icon look up order: theme
+        /// </summary>
+        ThemeOnly
+    }
+
+    /// <summary>
+    /// The Icon is a widget that displays standard icon images ("delete", "edit", "arrows", etc.)
+    /// or images coming from a custom file (PNG, JPG, EDJE, etc.), on icon context.
+    /// Inherits Image
+    /// </summary>
+    public class Icon : Image
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of Icon class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Icon as a child. It's <see cref="EvasObject"/> type.</param>
+        public Icon(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets the standard icon name of a given Icon widget.
+        /// </summary>
+        public string StandardIconName
+        {
+            get
+            {
+                return Interop.Elementary.elm_icon_standard_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_icon_standard_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the icon lookup order of a given Icon widget.
+        /// </summary>
+        public IconLookupOrder IconLookupOrder
+        {
+            get
+            {
+                return (IconLookupOrder)Interop.Elementary.elm_icon_order_lookup_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_icon_order_lookup_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the file that is used, but uses a generated thumbnail.
+        /// </summary>
+        /// <param name="file">The path to the file that is used as an icon image</param>
+        /// <param name="group">The group that the icon belongs to</param>
+        public void SetThumb(string file, string group)
+        {
+            Interop.Elementary.elm_icon_thumb_set(RealHandle, file, group);
+        }
+
+        /// <summary>
+        /// Adds a new icon object to the parent.
+        /// </summary>
+        /// <param name="parent">EvasObject</param>
+        /// <returns>The new object, otherwise NULL if it cannot be created</returns>
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+            RealHandle = Interop.Elementary.elm_icon_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Image.cs b/src/ElmSharp/ElmSharp/Image.cs
new file mode 100644 (file)
index 0000000..743cb42
--- /dev/null
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Image is a widget that allows one to load and display an image file on it,
+    /// be it from a disk file or from a memory region.
+    /// Inherits Widget
+    /// </summary>
+    public class Image : Widget
+    {
+        bool _canScaleUp = true;
+        bool _canScaleDown = true;
+        SmartEvent _clicked;
+        Color _color = Color.Default;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Image class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Image as a child. It's <see cref="EvasObject"/> type.</param>
+        public Image(EvasObject parent) : base(parent)
+        {
+            _clicked = new SmartEvent(this, "clicked");
+            _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Clicked will be triggered when the image is clicked.
+        /// </summary>
+        public event EventHandler Clicked;
+
+        /// <summary>
+        /// LoadingCompleted will be triggered when the image is loaded completely.
+        /// </summary>
+        public event EventHandler LoadingCompleted;
+
+        /// <summary>
+        /// Clicked will be triggered when the image is fail to load.
+        /// </summary>
+        public event EventHandler LoadingFailed;
+
+        /// <summary>
+        /// Gets the file that is used as an image.
+        /// </summary>
+        public string File
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_file_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the smooth effect for an image.
+        /// </summary>
+        public bool IsSmooth
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_smooth_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_smooth_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether scaling is disabled on the object.
+        /// </summary>
+        public bool IsScaling
+        {
+            get
+            {
+                return !Interop.Elementary.elm_image_no_scale_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_no_scale_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the object is down resizeable.
+        /// </summary>
+        public bool CanScaleDown
+        {
+            get
+            {
+                return _canScaleDown;
+            }
+            set
+            {
+                _canScaleDown = value;
+                Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the object is up resizeable.
+        /// </summary>
+        public bool CanScaleUp
+        {
+            get
+            {
+                return _canScaleUp;
+            }
+            set
+            {
+                _canScaleUp = value;
+                Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the image fills the entire object area, when keeping the aspect ratio.
+        /// </summary>
+        public bool CanFillOutside
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_fill_outside_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_fill_outside_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the prescale size for the image.
+        /// </summary>
+        public int PrescaleSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_prescale_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_prescale_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the original aspect ratio of the image should be kept on resize.
+        /// </summary>
+        public bool IsFixedAspect
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_aspect_fixed_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_aspect_fixed_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether an image object (which supports animation) is to animate itself.
+        /// </summary>
+        public bool IsAnimated
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_animated_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_animated_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether an image object supports animation.
+        /// </summary>
+        public bool IsAnimatedAvailable
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_animated_available_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether an image object is under animation.
+        /// </summary>
+        /// <remarks>
+        /// An image object, even if it supports animation, will be displayed by default without animation.
+        /// To actually start playing any image object's animation, <see cref="IsAnimated"/> should be TRUE before setting this property true.
+        /// </remarks>
+        public bool IsAnimationPlaying
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_animated_play_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_animated_play_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the image is 'editable'.
+        /// </summary>
+        public bool IsEditable
+        {
+            get
+            {
+                return Interop.Elementary.elm_image_editable_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_editable_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the current size of the image.
+        /// </summary>
+        public Size ObjectSize
+        {
+            get
+            {
+                Interop.Elementary.elm_image_object_size_get(RealHandle, out int w, out int h);
+                return new Size(w, h);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether alpha channel data is being used on the given image object.
+        /// </summary>
+        public bool IsOpaque
+        {
+            get
+            {
+                IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+                if (evasObj != IntPtr.Zero)
+                {
+                    return !Interop.Evas.evas_object_image_alpha_get(evasObj);
+                }
+                return false;
+            }
+            set
+            {
+                IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+                if (evasObj != IntPtr.Zero)
+                {
+                    Interop.Evas.evas_object_image_alpha_set(evasObj, !value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the image orientation.
+        /// </summary>
+        public ImageOrientation Orientation
+        {
+            get
+            {
+                return (ImageOrientation)Interop.Elementary.elm_image_orient_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_image_orient_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the image color
+        /// </summary>
+        public override Color Color
+        {
+            get
+            {
+                return _color;
+            }
+            set
+            {
+                IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+                if (evasObj != IntPtr.Zero)
+                {
+                    if (value.IsDefault)
+                    {
+                        // Currently, we assume the Image.Color property as a blending color (actually, multiply blending).
+                        // Thus we are using Color.White (255,255,255,255) as a default color to ensure original image color. (255/255 * original = original)
+                        Interop.Evas.evas_object_color_set(evasObj, 255, 255, 255, 255);
+                    }
+                    else
+                    {
+                        Interop.Evas.SetPremultipliedColor(evasObj, value.R, value.G, value.B, value.A);
+                    }
+                }
+                _color = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets the background color
+        /// </summary>
+        public override Color BackgroundColor
+        {
+            set
+            {
+                if (value.IsDefault)
+                {
+                    SetPartColor("bg", Color.Transparent);
+                }
+                else
+                {
+                    SetPartColor("bg", value);
+                }
+                _backgroundColor = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets the dimensions for an image object's border, a region which is not scaled together with its center ever.
+        /// </summary>
+        /// <param name="left">The border's left width</param>
+        /// <param name="right">The border's right width</param>
+        /// <param name="top">The border's top width</param>
+        /// <param name="bottom">The border's bottom width</param>
+        public void SetBorder(int left, int right, int top, int bottom)
+        {
+            IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+            Interop.Evas.evas_object_image_border_set(evasObj, left, right, top, bottom);
+        }
+
+        /// <summary>
+        /// Sets or gets if the center part of the given image object (not the border) should be drawn.
+        /// </summary>
+        /// <remarks>
+        /// When rendering, the image may be scaled to fit the size of the image object.
+        /// This function sets if the center part of the scaled image is to be drawn or left completely blank, or forced to be solid.
+        /// Very useful for frames and decorations.
+        /// </remarks>
+        public ImageBorderFillMode BorderCenterFillMode
+        {
+            get
+            {
+                IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+                return (ImageBorderFillMode)Interop.Evas.evas_object_image_border_center_fill_get(evasObj);
+            }
+            set
+            {
+                IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
+                Interop.Evas.evas_object_image_border_center_fill_set(evasObj, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the file that is used as the image's source.
+        /// </summary>
+        /// <param name="file">The path to the file that is used as an image source</param>
+        /// <returns>(true = success, false = error)</returns>
+        public bool Load(string file)
+        {
+            if (file == null)
+                throw new ArgumentNullException("file");
+
+            Interop.Elementary.elm_image_async_open_set(RealHandle, false);
+            Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
+            return Interop.Elementary.elm_image_file_set(RealHandle, file, null);
+        }
+
+        /// <summary>
+        /// Sets the uri that is used as the image's source.
+        /// </summary>
+        /// <param name="uri">The uri to the file that is used as an image source</param>
+        /// <returns>(true = success, false = error)</returns>
+        public bool Load(Uri uri)
+        {
+            if (uri == null)
+                throw new ArgumentNullException("uri");
+
+            return Load(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri);
+        }
+
+        /// <summary>
+        /// Sets a location in the memory to be used as an image object's source bitmap.
+        /// </summary>
+        /// <remarks>
+        /// This function is handy when the contents of an image file are mapped into the memory, for example.
+        /// The format string should be something like "png", "jpg", "tga", "tiff", "bmp" etc, when provided (null, on the contrary).
+        /// This improves the loader performance as it tries the "correct" loader first, before trying a range of other possible loaders until one succeeds.
+        /// </remarks>
+        /// <param name="img">The binary data that is used as an image source</param>
+        /// <param name="size">The size of the binary data blob img</param>
+        /// <returns>(true = success, false = error)</returns>
+        [Obsolete("This method will be removed. Use Load(Stream stream) instead.")]
+        public unsafe bool Load(byte* img, long size)
+        {
+            if (img == null)
+                throw new ArgumentNullException("img");
+
+            Interop.Elementary.elm_image_async_open_set(RealHandle, false);
+            Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
+            return Interop.Elementary.elm_image_memfile_set(RealHandle, img, size, IntPtr.Zero, IntPtr.Zero);
+        }
+
+        /// <summary>
+        /// Sets the stream that is used as the image's source.
+        /// </summary>
+        /// <param name="stream">The stream that is used as an image source</param>
+        /// <returns>(true = success, false = error)</returns>
+        public bool Load(Stream stream)
+        {
+            if (stream == null)
+                throw new ArgumentNullException("stream");
+
+            Interop.Elementary.elm_image_async_open_set(RealHandle, false);
+            Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
+            MemoryStream memstream = new MemoryStream();
+            stream.CopyTo(memstream);
+            unsafe
+            {
+                byte[] dataArr = memstream.ToArray();
+                fixed (byte* data = &dataArr[0])
+                {
+                    return Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets the file that is used as the image's source with async.
+        /// </summary>
+        /// <param name="file">The path to the file that is used as an image source</param>
+        /// <param name="cancellationToken">cancellation token</param>
+        /// <returns>(true = success, false = error)</returns>
+        public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
+        {
+            if (file == null)
+                throw new ArgumentNullException("file");
+
+            Interop.Elementary.elm_image_async_open_set(RealHandle, true);
+            Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);
+
+            var tcs = new TaskCompletionSource<bool>();
+
+            cancellationToken.Register(() =>
+            {
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetCanceled();
+                }
+            });
+
+            SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready");
+            loadReady.On += (s, e) =>
+            {
+                loadReady.Dispose();
+                LoadingCompleted?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(true);
+                }
+            };
+
+            SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error");
+            loadError.On += (s, e) =>
+            {
+                loadError.Dispose();
+                LoadingFailed?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(false);
+                }
+            };
+
+            bool ret = Interop.Elementary.elm_image_file_set(RealHandle, file, null);
+            if (!ret)
+            {
+                throw new InvalidOperationException("Failed to set file to Image");
+            }
+
+            return tcs.Task;
+        }
+
+        /// <summary>
+        /// Sets the uri that is used as the image's source with async.
+        /// </summary>
+        /// <param name="uri">The uri to the file that is used as an image source</param>
+        /// <param name="cancellationToken">cancellation token</param>
+        /// <returns>(true = success, false = error)</returns>
+        public Task<bool> LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken))
+        {
+            if (uri == null)
+                throw new ArgumentNullException("uri");
+
+            return LoadAsync(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri, cancellationToken);
+        }
+
+        /// <summary>
+        /// Sets the stream that is used as the image's source with async.
+        /// </summary>
+        /// <param name="stream">The stream that is used as an image source</param>
+        /// <param name="cancellationToken">cancellation token</param>
+        /// <returns>(true = success, false = error)</returns>
+        public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+        {
+            if (stream == null)
+                throw new ArgumentNullException("stream");
+
+            Interop.Elementary.elm_image_async_open_set(RealHandle, true);
+            Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);
+
+            var tcs = new TaskCompletionSource<bool>();
+
+            cancellationToken.Register(() =>
+            {
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetCanceled();
+                }
+            });
+
+            SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready");
+            loadReady.On += (s, e) =>
+            {
+                loadReady.Dispose();
+                LoadingCompleted?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(true);
+                }
+            };
+
+            SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error");
+            loadError.On += (s, e) =>
+            {
+                loadError.Dispose();
+                LoadingFailed?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(false);
+                }
+            };
+
+            MemoryStream memstream = new MemoryStream();
+            await stream.CopyToAsync(memstream);
+
+            unsafe
+            {
+                byte[] dataArr = memstream.ToArray();
+                fixed (byte* data = &dataArr[0])
+                {
+                    bool ret = Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
+                    if (!ret)
+                    {
+                        return false;
+                    }
+                }
+            }
+
+            return await tcs.Task;
+        }
+
+        /// <summary>
+        /// Sets the color of color class for a given widget.
+        /// </summary>
+        /// <param name="part">The name of color class.</param>
+        /// <param name="color">The struct of color</param>
+        public override void SetPartColor(string part, Color color)
+        {
+            Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255,
+                                                                              color.G * color.A / 255,
+                                                                              color.B * color.A / 255,
+                                                                              color.A);
+        }
+
+        /// <summary>
+        /// Gets the color of color class for a given widget.
+        /// </summary>
+        /// <param name="part">The name of color class.</param>
+        /// <returns>color object</returns>
+        public override Color GetPartColor(string part)
+        {
+            Interop.Elementary.elm_object_color_class_color_get(Handle, part, out int r, out int g, out int b, out int a);
+            return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+        }
+
+        /// <summary>
+        /// Sets the content at a part of a given container widget.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Image as a child. It's <see cref="EvasObject"/> type.</param>
+        /// <returns>The new object, otherwise null if it cannot be created</returns>
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+            RealHandle = Interop.Elementary.elm_image_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+
+    /// <summary>
+    /// Enumeration for the fill mode of image border
+    /// </summary>
+    public enum ImageBorderFillMode
+    {
+        /// <summary>
+        /// None mode of image border
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// Default mode of image border
+        /// </summary>
+        Default,
+
+        /// <summary>
+        /// Solid mode of image border
+        /// </summary>
+        Solid,
+    }
+
+    /// <summary>
+    /// Enumeration for the possible orientation options
+    /// </summary>
+    public enum ImageOrientation : int
+    {
+        /// <summary>
+        /// No orientation change
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// Rotate 90 degrees clockwise
+        /// </summary>
+        Rotate90,
+
+        /// <summary>
+        /// Rotate 180 degrees clockwise
+        /// </summary>
+        Rotate180,
+
+        /// <summary>
+        /// Rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise)
+        /// </summary>
+        Rotate270,
+
+        /// <summary>
+        /// Flip image horizontally
+        /// </summary>
+        FlipHorizontal,
+
+        /// <summary>
+        /// Flip image vertically
+        /// </summary>
+        FlipVertical,
+
+        /// <summary>
+        /// Flip the image along the y = (width - x) line (bottom-left to top-right)
+        /// </summary>
+        FlipTranspose,
+
+        /// <summary>
+        /// Flip the image along the y = x line (top-left to bottom-right)
+        /// </summary>
+        FlipTransverse
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Index.cs b/src/ElmSharp/ElmSharp/Index.cs
new file mode 100755 (executable)
index 0000000..f73ec7a
--- /dev/null
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// An index widget gives you an index for fast access to whichever group of other UI items one might have.
+    /// Inherits Layout
+    /// </summary>
+    public class Index : Layout
+    {
+        HashSet<IndexItem> _children = new HashSet<IndexItem>();
+        SmartEvent _delayedChanged;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Index class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Index as a child. It's <see cref="EvasObject"/> type.</param>
+        public Index(EvasObject parent) : base(parent)
+        {
+            _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
+            _delayedChanged.On += _delayedChanged_On;
+        }
+
+        /// <summary>
+        /// Changed will be triggered when the selected index item is changed.
+        /// </summary>
+        public event EventHandler Changed;
+
+        /// <summary>
+        /// Sets or gets the auto hiding feature is enabled or not for a given index widget.
+        /// </summary>
+        public bool AutoHide
+        {
+            get
+            {
+                return !Interop.Elementary.elm_index_autohide_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_autohide_disabled_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets a value whether horizontal mode is enabled or not.
+        /// </summary>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_index_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of indicator's disabled status.
+        /// </summary>
+        public bool IndicatorVisible
+        {
+            get
+            {
+                return !Interop.Elementary.elm_index_indicator_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_indicator_disabled_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the omit feature is enabled or not for a given index widget.
+        /// </summary>
+        public bool OmitEnabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_index_omit_enabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_omit_enabled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Set a delay change time for index object.
+        /// delay time is 0.2 sec by default.
+        /// </summary>
+        public double Delay
+        {
+            get
+            {
+                return Interop.Elementary.elm_index_delay_change_time_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_delay_change_time_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the items level for a given index widget.
+        /// </summary>
+        public int Level
+        {
+            get
+            {
+                return Interop.Elementary.elm_index_item_level_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_item_level_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Control standard_priority group of index.
+        /// Priority group will be shown as many items as it can, and other group will be shown one character only.
+        /// </summary>
+        public int Priority
+        {
+            get
+            {
+                return Interop.Elementary.elm_index_standard_priority_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_index_standard_priority_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the last selected item, for a given index widget.
+        /// </summary>
+        public IndexItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_index_selected_item_get(RealHandle, 0);
+                return ItemObject.GetItemByHandle(handle) as IndexItem;
+            }
+        }
+
+        /// <summary>
+        /// Append a new item on a given index widget.
+        /// </summary>
+        /// <param name="label">the label which the item should be indexed</param>
+        /// <returns>A object to the IndexItem added or null, on errors</returns>
+        public IndexItem Append(string label)
+        {
+            IndexItem item = new IndexItem(label);
+            item.Handle = Interop.Elementary.elm_index_item_append(RealHandle, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepend a new item on a given index widget.
+        /// </summary>
+        /// <param name="label">the label which the item should be indexed</param>
+        /// <returns>A handle to the item added or NULL, on errors</returns>
+        public IndexItem Prepend(string label)
+        {
+            IndexItem item = new IndexItem(label);
+            item.Handle = Interop.Elementary.elm_index_item_prepend(RealHandle, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Insert a new item into the index object before item before.
+        /// </summary>
+        /// <param name="label">the label which the item should be indexed</param>
+        /// <param name="before">The index item to insert after.</param>
+        /// <returns>A object to the IndexItem added or null, on errors</returns>
+        public IndexItem InsertBefore(string label, IndexItem before)
+        {
+            IndexItem item = new IndexItem(label);
+            item.Handle = Interop.Elementary.elm_index_item_insert_before(RealHandle, before, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Insert a new item into the index object after item after.
+        /// </summary>
+        /// <param name="label">the label which the item should be indexed</param>
+        /// <param name="after">The index item to insert after.</param>
+        /// <returns>A object to the IndexItem added or null, on errors</returns>
+        public IndexItem InsertAfter(string label, IndexItem after)
+        {
+            IndexItem item = new IndexItem(label);
+            item.Handle = Interop.Elementary.elm_index_item_insert_after(RealHandle, after, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Flush the changes made to the index items so they work correctly.
+        /// </summary>
+        /// <param name="level">The index level (one of 0 or 1) where changes were made</param>
+        public void Update(int level)
+        {
+            Interop.Elementary.elm_index_level_go(RealHandle, level);
+        }
+
+        /// <summary>
+        /// Removes all items from a given index widget.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_index_item_clear(RealHandle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_index_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        void _delayedChanged_On(object sender, EventArgs e)
+        {
+            SelectedItem?.SendSelected();
+            Changed?.Invoke(this, e);
+        }
+
+        void AddInternal(IndexItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((IndexItem)sender);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/IndexItem.cs b/src/ElmSharp/ElmSharp/IndexItem.cs
new file mode 100755 (executable)
index 0000000..67dcfd4
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+namespace ElmSharp
+{
+    /// <summary>
+    /// The IndexItem is used to manage index item
+    /// Inherits ItemObject
+    /// </summary>
+    public class IndexItem : ItemObject
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of IndexItem class.
+        /// </summary>
+        /// <param name="text">the text is set to the Text. It's 'string' type.</param>
+        public IndexItem(string text) : base(IntPtr.Zero)
+        {
+            Text = text;
+        }
+
+        /// <summary>
+        /// Selected will be triggered when the index item is selected
+        /// </summary>
+        public event EventHandler Selected;
+
+        /// <summary>
+        /// Gets the text
+        /// </summary>
+        public string Text { get; private set; }
+
+        /// <summary>
+        /// Sets the selected state of an item.
+        /// </summary>
+        /// <param name="selected">The selected state</param>
+        public void Select(bool selected)
+        {
+            Interop.Elementary.elm_index_item_selected_set(Handle, selected);
+        }
+        internal void SendSelected()
+        {
+            Selected?.Invoke(this, EventArgs.Empty);
+        }
+
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ItemObject.cs b/src/ElmSharp/ElmSharp/ItemObject.cs
new file mode 100644 (file)
index 0000000..f009396
--- /dev/null
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The ItemObject is used to manage item object
+    /// </summary>
+    public class ItemObject
+    {
+        private static Dictionary<int, ItemObject> s_IdToItemTable = new Dictionary<int, ItemObject>();
+        private static Dictionary<IntPtr, ItemObject> s_HandleToItemTable = new Dictionary<IntPtr, ItemObject>();
+        private static int s_globalId = 0;
+
+        readonly Dictionary<string, EvasObject> _partContents = new Dictionary<string, EvasObject>();
+        Interop.Evas.SmartCallback _deleteCallback;
+        IntPtr _handle = IntPtr.Zero;
+        Dictionary<SignalData, Interop.Elementary.Elm_Object_Item_Signal_Cb> _signalDatas = new Dictionary<SignalData, Interop.Elementary.Elm_Object_Item_Signal_Cb>();
+        EvasObject _trackObject = null;
+
+        /// <summary>
+        /// Creates and initializes a new instance of ItemObject class.
+        /// </summary>
+        /// <param name="handle">IntPtr</param>
+        protected ItemObject(IntPtr handle)
+        {
+            _deleteCallback = DeleteCallbackHandler;
+            Id = GetNextId();
+            s_IdToItemTable[Id] = this;
+            Handle = handle;
+        }
+
+        // C# Finalizer was called on GC thread
+        // So, We can't access to EFL object
+        // And When Finalizer was called, Field can be already released.
+        //~ItemObject()
+        //{
+        //    if (Handle != IntPtr.Zero)
+        //        Interop.Elementary.elm_object_item_del(Handle);
+        //}
+
+        /// <summary>
+        /// Gets the id of item object
+        /// </summary>
+        public int Id { get; private set; }
+
+        /// <summary>
+        /// Sets or gets whether the item object is enabled
+        /// </summary>
+        public bool IsEnabled
+        {
+            get { return !Interop.Elementary.elm_object_item_disabled_get(Handle); }
+            set { Interop.Elementary.elm_object_item_disabled_set(Handle, !value); }
+        }
+
+        /// <summary>
+        /// Gets track object of the item.
+        /// </summary>
+        public EvasObject TrackObject
+        {
+            get
+            {
+                if (_trackObject == null)
+                    _trackObject = new ItemEvasObject(Handle);
+                return _trackObject;
+            }
+        }
+
+        internal IntPtr Handle
+        {
+            get
+            {
+                return _handle;
+            }
+            set
+            {
+                if (_handle == value)
+                    return;
+
+                if (_handle != IntPtr.Zero)
+                {
+                    UnsetDeleteCallback();
+                }
+                _handle = value;
+                SetDeleteCallback();
+                s_HandleToItemTable[Handle] = this;
+            }
+        }
+
+        /// <summary>
+        /// Deleted will be triggered when the item object is deleted
+        /// </summary>
+        public event EventHandler Deleted;
+
+        /// <summary>
+        /// Delete the item object
+        /// </summary>
+        public void Delete()
+        {
+            Interop.Elementary.elm_object_item_del(Handle);
+            _handle = IntPtr.Zero;
+        }
+
+        /// <summary>
+        /// Set a content of an object item and delete old content
+        /// </summary>
+        /// <param name="part">The content part name (null for the default content)</param>
+        /// <param name="content">The content of the object item</param>
+        public void SetPartContent(string part, EvasObject content)
+        {
+            SetPartContent(part, content, false);
+        }
+
+        /// <summary>
+        /// Set a content of an object item
+        /// </summary>
+        /// <param name="part">The content part name (null for the default content)</param>
+        /// <param name="content">The content of the object item</param>
+        /// <param name="preserveOldContent">judge whether delete old content</param>
+        public void SetPartContent(string part, EvasObject content, bool preserveOldContent)
+        {
+            IntPtr oldContent = Interop.Elementary.elm_object_item_part_content_unset(Handle, part);
+            if (oldContent != IntPtr.Zero && !preserveOldContent)
+            {
+                Interop.Evas.evas_object_del(oldContent);
+            }
+            Interop.Elementary.elm_object_item_part_content_set(Handle, part, content);
+            _partContents[part ?? "__default__"] = content;
+        }
+
+        /// <summary>
+        /// Set a label of an object item
+        /// </summary>
+        /// <param name="part">The text part name (null for the default label)</param>
+        /// <param name="text">Text of the label</param>
+        public void SetPartText(string part, string text)
+        {
+            Interop.Elementary.elm_object_item_part_text_set(Handle, part, text);
+        }
+
+        /// <summary>
+        /// Gets a label of an object item
+        /// </summary>
+        /// <param name="part">The text part name (null for the default label)</param>
+        /// <returns></returns>
+        public string GetPartText(string part)
+        {
+            return Interop.Elementary.elm_object_item_part_text_get(Handle, part);
+        }
+
+        /// <summary>
+        /// Sets color of an object item
+        /// </summary>
+        /// <param name="part">The text part name (null for the default label)</param>
+        /// <param name="color">the color</param>
+        public void SetPartColor(string part, Color color)
+        {
+            Interop.Elementary.elm_object_item_color_class_color_set(Handle, part, color.R * color.A / 255,
+                                                                              color.G * color.A / 255,
+                                                                              color.B * color.A / 255,
+                                                                              color.A);
+        }
+
+        /// <summary>
+        /// Gets color of an object item
+        /// </summary>
+        /// <param name="part">The text part name (null for the default label)</param>
+        /// <returns>the color of object item</returns>
+        public Color GetPartColor(string part)
+        {
+            int r, g, b, a;
+            Interop.Elementary.elm_object_item_color_class_color_get(Handle, part, out r, out g, out b, out a);
+            return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+        }
+
+        /// <summary>
+        /// Deletes color of an object item
+        /// </summary>
+        /// <param name="part">The text part name</param>
+        public void DeletePartColor(string part)
+        {
+            Interop.Elementary.elm_object_item_color_class_del(Handle, part);
+        }
+
+        /// <summary>
+        /// Add a function for a signal emitted by object item edje.
+        /// </summary>
+        /// <param name="emission">The signal's name.</param>
+        /// <param name="source">The signal's source.</param>
+        /// <param name="func">The function to be executed when the signal is emitted.</param>
+        public void AddSignalHandler(string emission, string source, Func<string, string, bool> func)
+        {
+            if (emission != null && source != null && func != null)
+            {
+                var signalData = new SignalData(emission, source, func);
+                if (!_signalDatas.ContainsKey(signalData))
+                {
+                    var signalCallback = new Interop.Elementary.Elm_Object_Item_Signal_Cb((d, o, e, s) =>
+                    {
+                        return func(e, s);
+                    });
+                    Interop.Elementary.elm_object_item_signal_callback_add(Handle, emission, source, signalCallback, IntPtr.Zero);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Remove a signal-triggered function from a object item edje object.
+        /// </summary>
+        /// <param name="emission">The signal's name.</param>
+        /// <param name="source">The signal's source.</param>
+        /// <param name="func">The function to be executed when the signal is emitted.</param>
+        public void RemoveSignalHandler(string emission, string source, Func<string, string, bool> func)
+        {
+            if (emission != null && source != null && func != null)
+            {
+                var signalData = new SignalData(emission, source, func);
+
+                Interop.Elementary.Elm_Object_Item_Signal_Cb signalCallback = null;
+                _signalDatas.TryGetValue(signalData, out signalCallback);
+
+                if (signalCallback != null)
+                {
+                    Interop.Elementary.elm_object_item_signal_callback_del(Handle, emission, source, signalCallback);
+                    _signalDatas.Remove(signalData);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Send a signal to the edje object of the widget item.
+        /// </summary>
+        /// <param name="emission">The signal's name.</param>
+        /// <param name="source">The signal's source.</param>
+        public void EmitSignal(string emission, string source)
+        {
+            Interop.Elementary.elm_object_item_signal_emit(Handle, emission, source);
+        }
+
+        /// <summary>
+        /// Gets the handle of object item
+        /// </summary>
+        /// <param name="obj">ItemObject</param>
+        public static implicit operator IntPtr(ItemObject obj)
+        {
+            if (obj == null)
+                return IntPtr.Zero;
+            return obj.Handle;
+        }
+
+        /// <summary>
+        /// OnInvalidate of object item
+        /// </summary>
+        protected virtual void OnInvalidate() { }
+
+        internal static ItemObject GetItemById(int id)
+        {
+            ItemObject value;
+            s_IdToItemTable.TryGetValue(id, out value);
+            return value;
+        }
+
+        internal static ItemObject GetItemByHandle(IntPtr handle)
+        {
+            ItemObject value;
+            s_HandleToItemTable.TryGetValue(handle, out value);
+            return value;
+        }
+
+        void DeleteCallbackHandler(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            Deleted?.Invoke(this, EventArgs.Empty);
+            OnInvalidate();
+            if (s_IdToItemTable.ContainsKey(Id))
+            {
+                s_IdToItemTable.Remove(Id);
+            }
+            if (s_HandleToItemTable.ContainsKey(_handle))
+            {
+                s_HandleToItemTable.Remove(_handle);
+            }
+            _partContents.Clear();
+            _handle = IntPtr.Zero;
+        }
+
+        void UnsetDeleteCallback()
+        {
+            Interop.Elementary.elm_object_item_del_cb_set(Handle, null);
+        }
+
+        void SetDeleteCallback()
+        {
+            if (Handle != IntPtr.Zero)
+                Interop.Elementary.elm_object_item_del_cb_set(Handle, _deleteCallback);
+        }
+
+        static int GetNextId()
+        {
+            return s_globalId++;
+        }
+
+        class SignalData
+        {
+            public string Emission { get; set; }
+            public string Source { get; set; }
+            public Func<string, string, bool> Func { get; set; }
+
+            public SignalData(string emission, string source, Func<string, string, bool> func)
+            {
+                Emission = emission;
+                Source = source;
+                Func = func;
+            }
+
+            public override bool Equals(object obj)
+            {
+                SignalData s = obj as SignalData;
+                if (s == null)
+                {
+                    return false;
+                }
+                return (Emission == s.Emission) && (Source == s.Source) && (Func == s.Func);
+            }
+
+            public override int GetHashCode()
+            {
+                int hashCode = Emission.GetHashCode();
+                hashCode ^= Source.GetHashCode();
+                hashCode ^= Func.GetHashCode();
+                return hashCode;
+            }
+        }
+
+        class ItemEvasObject : EvasObject
+        {
+            IntPtr _parent = IntPtr.Zero;
+
+            public ItemEvasObject(IntPtr parent) : base()
+            {
+                _parent = parent;
+                Realize(null);
+            }
+
+            protected override IntPtr CreateHandle(EvasObject parent)
+            {
+                return Interop.Elementary.elm_object_item_track(_parent);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/ItemObjectExtension.cs b/src/ElmSharp/ElmSharp/ItemObjectExtension.cs
new file mode 100755 (executable)
index 0000000..ef8b609
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The ItemObjectExtension is used to manage item object extension
+    /// </summary>
+    public static class ItemObjectExtension
+    {
+        /// <summary>
+        /// Grab high light of item object
+        /// </summary>
+        /// <param name="obj">the item object which is grabbed high light</param>
+        public static void GrabHighlight(this ItemObject obj)
+        {
+            Interop.Elementary.elm_atspi_component_highlight_grab(obj.Handle);
+        }
+
+        /// <summary>
+        /// Clear high light of item object
+        /// </summary>
+        /// <param name="obj">the item object which is cleared high light</param>
+        public static void ClearHighlight(this ItemObject obj)
+        {
+            Interop.Elementary.elm_atspi_component_highlight_clear(obj.Handle);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Label.cs b/src/ElmSharp/ElmSharp/Label.cs
new file mode 100755 (executable)
index 0000000..12aae07
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+namespace ElmSharp
+{
+    /// <summary>
+    /// Label is a widget to display text, with simple html-like markup.
+    /// Inherits Layout
+    /// </summary>
+    public class Label : Layout
+    {
+        SmartEvent _slideCompleted;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Label class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Label as a child. It's <see cref="EvasObject"/> type.</param>
+        public Label(EvasObject parent) : base(parent)
+        {
+            _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end");
+            _slideCompleted.On += (s, e) =>
+            {
+                SlideCompleted?.Invoke(this, EventArgs.Empty);
+            };
+        }
+
+        /// <summary>
+        /// SlideCompleted will be triggered when the slide is completed.
+        /// </summary>
+        public event EventHandler SlideCompleted;
+
+        /// <summary>
+        /// Sets or gets wrap width of the label.
+        /// </summary>
+        public int LineWrapWidth
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_wrap_width_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_wrap_width_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the wrapping behavior of the label.
+        /// </summary>
+        public WrapType LineWrapType
+        {
+            get
+            {
+                return (WrapType)Interop.Elementary.elm_label_line_wrap_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_line_wrap_set(RealHandle, (int)value);
+                if (value != WrapType.None)
+                {
+                    Interop.Evas.evas_object_size_hint_min_get(RealHandle, IntPtr.Zero, out int h);
+                    Interop.Evas.evas_object_size_hint_min_set(RealHandle, 0, h);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the slide mode of the label widget.
+        /// </summary>
+        public LabelSlideMode SlideMode
+        {
+            get
+            {
+                return (LabelSlideMode)Interop.Elementary.elm_label_slide_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_slide_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the slide duration of the label.
+        /// </summary>
+        public double SlideDuration
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_slide_duration_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_slide_duration_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the slide Speed of the label.
+        /// </summary>
+        /// <remarks>
+        /// The speed of the slide animation in px per seconds.
+        /// If you set the duration of the slide using elm_label_slide_duration_set() you cannot get the correct speed using this function until the label is actually rendered and resized.
+        /// </remarks>
+        /// <seealso cref="SlideDuration"/>
+        public double SlideSpeed
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_slide_speed_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_slide_speed_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the ellipsis behavior of the label.
+        /// </summary>
+        public bool IsEllipsis
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_ellipsis_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_label_ellipsis_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the style of the label text.
+        /// </summary>
+        /// <remarks>
+        /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Avalilable since Tizen_4.0.
+        /// </remarks>
+        /// 
+        public string TextStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_label_text_style_user_peek(RealHandle);
+            }
+            set
+            {
+                if (string.IsNullOrEmpty(value))
+                {
+                    Interop.Elementary.elm_label_text_style_user_pop(RealHandle);
+                }
+                else
+                {
+                    Interop.Elementary.elm_label_text_style_user_push(RealHandle, value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Start slide effect.
+        /// </summary>
+        public void PlaySlide()
+        {
+            Interop.Elementary.elm_label_slide_go(RealHandle);
+        }
+
+        /// <summary>
+        /// Sets the content at a part of a given container widget.
+        /// </summary>
+        /// <param name="parent">EvasObject</param>
+        /// <returns>The new object, otherwise null if it cannot be created</returns>
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {            
+            return Interop.Elementary.elm_label_add(parent.Handle);
+        }
+    }
+
+    /// <summary>
+    /// Enumeration for slide mode of a label widget
+    /// </summary>
+    public enum LabelSlideMode
+    {
+        /// <summary>
+        /// no slide effect
+        /// </summary>
+        None = 0,
+        /// <summary>
+        /// slide only if the label area is bigger than the text width length
+        /// </summary>
+        Auto,
+        /// <summary>
+        /// slide always
+        /// </summary>
+        Always
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Layout.cs b/src/ElmSharp/ElmSharp/Layout.cs
new file mode 100644 (file)
index 0000000..9a45bbe
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// This is a container widget that takes a standard Edje design file and wraps it very thinly in a widget.
+    /// Inherits Widget
+    /// </summary>
+    public class Layout : Container
+    {
+        SmartEvent _languageChanged;
+        SmartEvent _themeChanged;
+
+        IntPtr _edjeHandle;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Layout class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
+        public Layout(EvasObject parent) : base(parent)
+        {
+            _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
+            _languageChanged.On += (s, e) =>
+            {
+                LanguageChanged?.Invoke(this, EventArgs.Empty);
+            };
+
+            _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
+            _themeChanged.On += (s, e) =>
+            {
+                ThemeChanged?.Invoke(this, EventArgs.Empty);
+            };
+        }
+
+        /// <summary>
+        /// LanguageChanged will be triggered when the program's language is changed.
+        /// </summary>
+        public event EventHandler LanguageChanged;
+
+        /// <summary>
+        /// ThemeChanged will be triggered when the theme is changed.
+        /// </summary>
+        public event EventHandler ThemeChanged;
+
+        /// <summary>
+        /// Gets the edje layout.
+        /// </summary>
+        public EdjeObject EdjeObject
+        {
+            get
+            {
+                if (_edjeHandle == IntPtr.Zero)
+                    _edjeHandle = Interop.Elementary.elm_layout_edje_get(RealHandle);
+                return new EdjeObject(_edjeHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets accessibility state of texblock(text) parts in the layout object.
+        /// </summary>
+        public bool TextBlockAccessibility
+        {
+            get
+            {
+                return Interop.Elementary.elm_layout_edje_object_can_access_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_layout_edje_object_can_access_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Freezes the Elementary layout object.
+        /// This function puts all changes on hold.
+        /// Successive freezes will nest, requiring an equal number of thaws.
+        /// </summary>
+        /// <returns>The frozen state or 0 if the object is not frozen or on error.</returns>
+        public int Freeze()
+        {
+            return Interop.Elementary.elm_layout_freeze(RealHandle);
+        }
+
+        /// <summary>
+        /// Thaws the Elementary object.
+        /// If sucessives freezes were done, an equal number of thaws will be required.
+        /// </summary>
+        /// <returns>The frozen state or 0 if the object is not frozen or on error.</returns>
+        public int Thaw()
+        {
+            return Interop.Elementary.elm_layout_thaw(RealHandle);
+        }
+
+        /// <summary>
+        /// Eval sizing.
+        /// Manually forces a sizing re-evaluation.
+        /// This is useful when the minimum size required by the edje theme of this layout has changed.
+        /// The change on the minimum size required by the edje theme is not immediately reported to the elementary layout, so one needs to call this function in order to tell the widget (layout) that it needs to reevaluate its own size.
+        /// The minimum size of the theme is calculated based on minimum size of parts, the size of elements inside containers like box and table, etc.
+        /// All of this can change due to state changes, and that's when this function should be called.
+        /// </summary>
+        public void Resizing()
+        {
+            Interop.Elementary.elm_layout_sizing_eval(RealHandle);
+        }
+
+        /// <summary>
+        /// Request sizing reevaluation, restricted to current width and/or height.
+        /// Useful mostly when there are TEXTBLOCK parts defining the height of the object and nothing else restricting it to a minimum width.Calling this function will restrict the minimum size in the Edje calculation to whatever size it the layout has at the moment.
+        /// </summary>
+        /// <param name="width">Restrict minimum size ot the current width.</param>
+        /// <param name="height">Restrict minimum size ot the current height.</param>
+        public void Resizing(bool width, bool height)
+        {
+            Interop.Elementary.elm_layout_sizing_restricted_eval(RealHandle, width, height);
+        }
+
+        /// <summary>
+        /// Get the edje data from the given layout.
+        /// This function fetches data specified inside the edje theme of this layout.
+        /// This function return NULL if data is not found.
+        /// </summary>
+        /// <param name="key">The data key</param>
+        /// <returns>The data</returns>
+        public string GetEdjeData(string key)
+        {
+            return Interop.Elementary.elm_layout_data_get(RealHandle, key);
+        }
+
+        /// <summary>
+        /// Gets the text set in the given part.
+        /// </summary>
+        /// <param name="part">The TEXT part to retrieve the text off.</param>
+        /// <returns></returns>
+        public override string GetPartText(string part)
+        {
+            return Interop.Elementary.elm_layout_text_get(RealHandle, part);
+        }
+
+        /// <summary>
+        /// Sets the text set in the given part.
+        /// </summary>
+        /// <param name="part">The TEXT part to retrieve the text off.</param>
+        /// <param name="text">The text to set.</param>
+        /// <returns></returns>
+        public override bool SetPartText(string part, string text)
+        {
+            return Interop.Elementary.elm_layout_text_set(RealHandle, part, text);
+        }
+
+        /// <summary>
+        /// Append child to layout box part.
+        /// Once the object is appended, it will become child of the layout.
+        /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+        /// </summary>
+        /// <param name="part">The part</param>
+        /// <param name="child">The Object to append</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxAppend(string part, EvasObject child)
+        {
+            AddChild(child);
+            return Interop.Elementary.elm_layout_box_append(RealHandle, part, child.Handle);
+        }
+
+        /// <summary>
+        /// Prepend child to layout box part.
+        /// Once the object is prepended, it will become child of the layout.
+        /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+        /// </summary>
+        /// <param name="part">The part</param>
+        /// <param name="child">The Object to prepend</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxPrepend(string part, EvasObject child)
+        {
+            AddChild(child);
+            return Interop.Elementary.elm_layout_box_prepend(RealHandle, part, child.Handle);
+        }
+
+        /// <summary>
+        /// Remove a child of the given part box.
+        /// The object will be removed from the box part and its lifetime will not be handled by the layout anymore.
+        /// </summary>
+        /// <param name="part">The part</param>
+        /// <param name="child">The Object to remove</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxRemove(string part, EvasObject child)
+        {
+            RemoveChild(child);
+            return Interop.Elementary.elm_layout_box_remove(RealHandle, part, child.Handle) != null;
+        }
+
+        /// <summary>
+        /// Remove all children of the given part box.
+        /// The objects will be removed from the box part and their lifetime will not be handled by the layout anymore.
+        /// </summary>
+        /// <param name="part">The part</param>
+        /// <param name="clear">If true, then all objects will be deleted as well, otherwise they will just be removed and will be dangling on the canvas.</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxRemoveAll(string part, bool clear)
+        {
+            ClearChildren();
+            return Interop.Elementary.elm_layout_box_remove_all(RealHandle, part, clear);
+        }
+
+        /// <summary>
+        /// Insert child to layout box part at a given position.
+        /// Once the object is inserted, it will become child of the layout.
+        /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+        /// </summary>
+        /// <param name="part">The part</param>
+        /// <param name="child">The child object to insert into box.</param>
+        /// <param name="position">The numeric position >=0 to insert the child.</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxInsertAt(string part, EvasObject child, uint position)
+        {
+            AddChild(child);
+            return Interop.Elementary.elm_layout_box_insert_at(RealHandle, part, child.Handle, position);
+        }
+
+        /// <summary>
+        /// Insert child to layout box part before a reference object.
+        /// Once the object is inserted, it will become child of the layout.
+        /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+        /// </summary>
+        /// <param name="part"></param>
+        /// <param name="child">The child object to insert into box.</param>
+        /// <param name="reference">Another reference object to insert before in box.</param>
+        /// <returns>Sucess is true</returns>
+        public bool BoxInsertBefore(string part, EvasObject child, EvasObject reference)
+        {
+            AddChild(child);
+            return Interop.Elementary.elm_layout_box_insert_before(RealHandle, part, child.Handle, reference.Handle);
+        }
+
+        /// <summary>
+        /// Sets the layout content.
+        /// </summary>
+        /// <param name="part">The swallow part name in the edje file</param>
+        /// <param name="content">The child that will be added in this layout object.</param>
+        /// <returns>TRUE on success, FALSE otherwise</returns>
+        public override bool SetPartContent(string part, EvasObject content)
+        {
+            return SetPartContent(part, content, false);
+        }
+
+        /// <summary>
+        /// Sets the layout content.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="content">The content</param>
+        /// <param name="preserveOldContent">true, preserve old content will be unset. false, preserve old content will not be unset.</param>
+        /// <returns>TRUE on success, FALSE otherwise</returns>
+        public override bool SetPartContent(string part, EvasObject content, bool preserveOldContent)
+        {
+            if (preserveOldContent)
+            {
+                Interop.Elementary.elm_layout_content_unset(RealHandle, part);
+            }
+            UpdatePartContents(content, part);
+            return Interop.Elementary.elm_layout_content_set(RealHandle, part, content);
+        }
+
+        /// <summary>
+        /// Sets the edje group from the elementary theme that is used as a layout.
+        /// </summary>
+        /// <param name="klass">The class of the group</param>
+        /// <param name="group">The group</param>
+        /// <param name="style">The style to use</param>
+        public void SetTheme(string klass, string group, string style)
+        {
+            Interop.Elementary.elm_layout_theme_set(RealHandle, klass, group, style);
+        }
+
+        /// <summary>
+        /// Sets the file that is used as a layout.
+        /// </summary>
+        /// <param name="file">The path to the file (edj) that is used as a layout</param>
+        /// <param name="group">The group that the layout belongs to in the edje file</param>
+        public void SetFile(string file, string group)
+        {
+            Interop.Elementary.elm_layout_file_set(RealHandle, file, group);
+        }
+
+        /// <summary>
+        /// Sets the back ground color of layout
+        /// </summary>
+        public override Color BackgroundColor
+        {
+            set
+            {
+                if (value.IsDefault)
+                {
+                    string part = ClassName.ToLower().Replace("elm_", "") + "/" + "bg";
+                    EdjeObject.DeleteColorClass(part);
+                }
+                else
+                {
+                    SetPartColor("bg", value);
+                }
+                _backgroundColor = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets the vertical text alignment of layout's text part
+        /// </summary>
+        /// <remarks>
+        /// API, elm_layout_text_valign_set, is an internal API only in Tizen. Avalilable since Tizen_4.0.
+        /// </remarks>
+        public virtual void SetVerticalTextAlignment(string part, double valign)
+        {
+            Interop.Elementary.elm_layout_text_valign_set(RealHandle, part, valign);
+        }
+
+        /// <summary>
+        /// Gets the vertical text alignment of layout's text part
+        /// </summary>
+        /// <remarks>
+        /// API, elm_layout_text_valign_get, is internal API only in Tizen. Avalilable since Tizen_4.0.
+        /// </remarks>
+        public virtual double GetVerticalTextAlignment(string part)
+        {
+            return Interop.Elementary.elm_layout_text_valign_get(RealHandle, part);
+        }
+
+        /// <summary>
+        /// Sets the content at a part of a given container widget.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
+        /// <returns>The new object, otherwise null if it cannot be created</returns>
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_layout_add(parent.Handle);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/List.cs b/src/ElmSharp/ElmSharp/List.cs
new file mode 100755 (executable)
index 0000000..9a14f93
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for setting list's resizing behavior, transverse axis scrolling and items cropping.
+    /// </summary>
+    public enum ListMode
+    {
+        /// <summary>
+        /// The list won't set any of its size hints to inform how a possible container should resize it.
+        /// Then, if it's not created as a "resize object", it might end with zeroed dimensions.
+        /// The list will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction.
+        /// </summary>
+        Compress = 0,
+        /// <summary>
+        /// This is the same as Compress, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction.
+        /// </summary>
+        Scroll,
+        /// <summary>
+        /// Sets a minimum size hint on the genlist object, so that containers may respect it (and resize itself to fit the child properly).
+        /// More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well.
+        /// This is naturally bound by the list object's maximum size hints, set externally.
+        /// </summary>
+        Limit,
+        /// <summary>
+        /// Besides setting a minimum size on the transverse axis, just like on Limit, the list will set a minimum size on th longitudinal axis, trying to reserve space to all its children to be visible at a time.
+        /// This is naturally bound by the list object's maximum size hints, set externally.
+        /// </summary>
+        Expand
+    }
+
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// It contains Item which is <see cref="ListItem"/> type.
+    /// All events of List contain ListItemEventArgs as a parameter.
+    /// </summary>
+    public class ListItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets or sets List item. The return type is <see cref="ListItem"/>.
+        /// </summary>
+        public ListItem Item { get; set; }
+
+        internal static ListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            ListItem item = ItemObject.GetItemByHandle(info) as ListItem;
+            return new ListItemEventArgs() { Item = item };
+        }
+    }
+
+    /// <summary>
+    /// It inherits <see cref="Layout"/>.
+    /// The List is a widget that aims to display simple list item which has 2 icons and 1 text, and can be selected.
+    /// For more robust lists, <see cref="GenList"/> should probably be used.
+    /// </summary>
+    /// <seealso cref="GenList"/>
+    /// <seealso cref="GenGrid"/>
+    public class List : Layout
+    {
+        HashSet<ListItem> _children = new HashSet<ListItem>();
+        SmartEvent<ListItemEventArgs> _selected;
+        SmartEvent<ListItemEventArgs> _unselected;
+        SmartEvent<ListItemEventArgs> _doubleClicked;
+        SmartEvent<ListItemEventArgs> _longpressed;
+        SmartEvent<ListItemEventArgs> _activated;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the List class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by List as a child. It's <see cref="EvasObject"/> type.</param>
+        public List(EvasObject parent) : base(parent)
+        {
+            _selected = new SmartEvent<ListItemEventArgs>(this, this.RealHandle, "selected", ListItemEventArgs.CreateFromSmartEvent);
+            _unselected = new SmartEvent<ListItemEventArgs>(this, this.RealHandle, "unselected", ListItemEventArgs.CreateFromSmartEvent);
+            _doubleClicked = new SmartEvent<ListItemEventArgs>(this, this.RealHandle, "clicked,double", ListItemEventArgs.CreateFromSmartEvent);
+            _longpressed = new SmartEvent<ListItemEventArgs>(this, this.RealHandle, "longpressed", ListItemEventArgs.CreateFromSmartEvent);
+            _activated = new SmartEvent<ListItemEventArgs>(this, this.RealHandle, "activated", ListItemEventArgs.CreateFromSmartEvent);
+            _selected.On += (s, e) => { ItemSelected?.Invoke(this, e); };
+            _unselected.On += (s, e) => { ItemUnselected?.Invoke(this, e); };
+            _doubleClicked.On += (s, e) => { ItemDoubleClicked?.Invoke(this, e); };
+            _longpressed.On += (s, e) => { ItemLongPressed?.Invoke(this, e); };
+            _activated.On += (s, e) => { ItemActivated?.Invoke(this, e); };
+        }
+
+        /// <summary>
+        /// Gets or sets which mode to use for the list.
+        /// </summary>
+        public ListMode Mode
+        {
+            get
+            {
+                return (ListMode)Interop.Elementary.elm_list_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_list_mode_set(RealHandle, (Interop.Elementary.Elm_List_Mode)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the selected item.
+        /// </summary>
+        public ListItem SelectedItem
+        {
+            get
+            {
+                IntPtr item = Interop.Elementary.elm_list_selected_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(item) as ListItem;
+            }
+        }
+
+        /// <summary>
+        /// ItemSelected is raised when a new list item is selected.
+        /// </summary>
+        public event EventHandler<ListItemEventArgs> ItemSelected;
+
+        /// <summary>
+        /// ItemUnselected is raised when the list item is Unselected.
+        /// </summary>
+        public event EventHandler<ListItemEventArgs> ItemUnselected;
+
+        /// <summary>
+        /// ItemDoubleClicked is raised when a new list item is double clicked.
+        /// </summary>
+        public event EventHandler<ListItemEventArgs> ItemDoubleClicked;
+
+        /// <summary>
+        /// ItemLongPressed is raised when a list item is pressed for a certain amount of time. By default it's 1 second.
+        /// </summary>
+        public event EventHandler<ListItemEventArgs> ItemLongPressed;
+
+        /// <summary>
+        /// ItemActivated is raised when a new list item is double clicked or pressed (enter|return|spacebar).
+        /// </summary>
+        public event EventHandler<ListItemEventArgs> ItemActivated;
+
+        /// <summary>
+        /// Starts the list.
+        /// Call before running <see cref="EvasObject.Show"/> on the list object.
+        /// If not called, it won't display the list properly.
+        /// </summary>
+        public void Update()
+        {
+            Interop.Elementary.elm_list_go(RealHandle);
+        }
+
+        /// <summary>
+        /// Appends a new item with a text to the end of a given list widget.
+        /// </summary>
+        /// <param name="label">The text for the item.</param>
+        /// <returns>Return a new added list item that contains a text.</returns>
+        /// <seealso cref="ListItem"/>
+        public ListItem Append(string label)
+        {
+            return Append(label, null, null);
+        }
+
+        /// <summary>
+        /// Appends a new item with a text and 2 icons to the end of a given list widget.
+        /// </summary>
+        /// <param name="label">The text for the item.</param>
+        /// <param name="leftIcon">The left icon for the item.</param>
+        /// <param name="rightIcon">The right icon for the item.</param>
+        /// <returns>Return a new added list item that contains a text and 2 icons.</returns>
+        /// <seealso cref="ListItem"/>
+        public ListItem Append(string label, EvasObject leftIcon, EvasObject rightIcon)
+        {
+            ListItem item = new ListItem(label, leftIcon, rightIcon);
+            item.Handle = Interop.Elementary.elm_list_item_append(RealHandle, label, leftIcon, rightIcon, null, (IntPtr)item.Id);
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepends a new item with a text to the beginning of a given list widget.
+        /// </summary>
+        /// <param name="label">The text for the item.</param>
+        /// <returns>Return a new added list item that contains a text.</returns>
+        public ListItem Prepend(string label)
+        {
+            return Prepend(label, null, null);
+        }
+
+        /// <summary>
+        /// Prepends a new item with a text and 2 icons to the beginning of a given list widget.
+        /// </summary>
+        /// <param name="label">The text for the item.</param>
+        /// <param name="leftIcon">The left icon for the item.</param>
+        /// <param name="rigthIcon">The right icon for the item.</param>
+        /// <returns>Return a new added list item that contains a text and 2 icons.</returns>
+        public ListItem Prepend(string label, EvasObject leftIcon, EvasObject rigthIcon)
+        {
+            ListItem item = new ListItem(label, leftIcon, rigthIcon);
+            item.Handle = Interop.Elementary.elm_list_item_prepend(RealHandle, label, leftIcon, rigthIcon, null, (IntPtr)item.Id);
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Removes all items from a given list widget.
+        /// To delete just one item, use <see cref="ItemObject.Delete"/>.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_list_clear(RealHandle);
+            foreach (var item in _children)
+            {
+                item.Deleted -= Item_Deleted;
+            }
+            _children.Clear();
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_list_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        void AddInternal(ListItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((ListItem)sender);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ListItem.cs b/src/ElmSharp/ElmSharp/ListItem.cs
new file mode 100644 (file)
index 0000000..09354b1
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="ItemObject"/>.
+    /// A instance to the list item added.
+    /// It contains Text, LeftIcon and RightIcon properties to show a list item which is given.
+    /// </summary>
+    public class ListItem : ItemObject
+    {
+        internal ListItem(string text, EvasObject leftIcon, EvasObject rightIcon) : base(IntPtr.Zero)
+        {
+            Text = text;
+            LeftIcon = leftIcon;
+            RightIcon = rightIcon;
+        }
+
+        /// <summary>
+        /// Gets the text for the list item.
+        /// </summary>
+        public string Text { get; internal set; }
+
+        /// <summary>
+        /// Gets the left icon for the list item.
+        /// </summary>
+        public EvasObject LeftIcon { get; internal set; }
+
+        /// <summary>
+        /// Gets the right icon for the list item.
+        /// </summary>
+        public EvasObject RightIcon { get; internal set; }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/MultiButtonEntry.cs b/src/ElmSharp/ElmSharp/MultiButtonEntry.cs
new file mode 100755 (executable)
index 0000000..21d9a54
--- /dev/null
@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="Layout"/>.
+    /// The MultiButtonEntry is a widget letting an user enter text and each chunk of text managed as a set of buttons.
+    /// Each text button is inserted by pressing the "return" key. If there is no space in the current row, a new button is added to the next row.
+    /// When a text button is pressed, it will become focused. Backspace removes the focus. When the multi-button entry loses focus, items longer than one line are shrunk to one line.
+    /// The typical use case of multi-button entry is composing emails/messages to a group of addresses, each of which is an item that can be clicked for further actions.
+    /// </summary>
+    public class MultiButtonEntry : Layout
+    {
+        HashSet<MultiButtonEntryItem> _children = new HashSet<MultiButtonEntryItem>();
+        List<Func<string, bool>> _filters = new List<Func<string, bool>>();
+        Func<int, string> _formatFunc = null;
+        Entry _entry = null;
+
+        Interop.Elementary.MultiButtonEntryItemFilterCallback _filterCallback;
+        Interop.Elementary.MultiButtonEntryFormatCallback _formatCallback;
+
+        SmartEvent _clicked;
+        SmartEvent _expanded;
+        SmartEvent _contracted;
+        SmartEvent _expandedStateChanged;
+        SmartEvent<MultiButtonEntryItemEventArgs> _itemSelected;
+        SmartEvent<MultiButtonEntryItemEventArgs> _itemClicked;
+        SmartEvent<MultiButtonEntryItemEventArgs> _itemLongPressed;
+        SmartEvent<MultiButtonEntryItemEventArgs> _itemAdded;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the MultiButtonEntry class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by MultiButtonEntry as a child. It's <see cref="EvasObject"/> type.</param>
+        public MultiButtonEntry(EvasObject parent) : base(parent)
+        {
+            _clicked = new SmartEvent(this, "clicked");
+            _expanded = new SmartEvent(this, "expanded");
+            _contracted = new SmartEvent(this, "contracted");
+            _expandedStateChanged = new SmartEvent(this, "expand,state,changed");
+
+            _itemSelected = new SmartEvent<MultiButtonEntryItemEventArgs>(this, "item,selected", MultiButtonEntryItemEventArgs.CreateFromSmartEvent);
+            _itemClicked = new SmartEvent<MultiButtonEntryItemEventArgs>(this, "item,clicked", MultiButtonEntryItemEventArgs.CreateFromSmartEvent);
+            _itemLongPressed = new SmartEvent<MultiButtonEntryItemEventArgs>(this, "item,longpressed", MultiButtonEntryItemEventArgs.CreateFromSmartEvent);
+            _itemAdded = new SmartEvent<MultiButtonEntryItemEventArgs>(this, "item,added", MultiButtonEntryItemEventArgs.CreateAndAddFromSmartEvent);
+
+            _filterCallback = new Interop.Elementary.MultiButtonEntryItemFilterCallback(FilterCallbackHandler);
+            _formatCallback = new Interop.Elementary.MultiButtonEntryFormatCallback(FormatCallbackHandler);
+
+            _clicked.On += (sender, e) => Clicked?.Invoke(this, EventArgs.Empty);
+            _expanded.On += (sender, e) => Expanded?.Invoke(this, EventArgs.Empty);
+            _contracted.On += (sender, e) => Contracted?.Invoke(this, EventArgs.Empty);
+            _expandedStateChanged.On += (sender, e) => ExpandedStateChanged?.Invoke(this, EventArgs.Empty);
+
+            _itemSelected.On += (sender, e) => { ItemSelected?.Invoke(this, e); };
+            _itemClicked.On += (sender, e) => { ItemClicked?.Invoke(this, e); };
+            _itemLongPressed.On += (sender, e) => { ItemLongPressed?.Invoke(this, e); };
+            _itemAdded.On += OnItemAdded;
+        }
+
+        /// <summary>
+        /// Clicked is raised when a MultiButtonEntry is clicked.
+        /// </summary>
+        public event EventHandler Clicked;
+
+        /// <summary>
+        /// Expanded is raised when a MultiButtonEntry is expanded.
+        /// </summary>
+        public event EventHandler Expanded;
+
+        /// <summary>
+        /// Contracted is raised when a MultiButtonEntry is contracted.
+        /// </summary>
+        public event EventHandler Contracted;
+
+        /// <summary>
+        /// ExpandedStateChanged is raised when shrink mode state of MultiButtonEntry is changed.
+        /// </summary>
+        public event EventHandler ExpandedStateChanged;
+
+        /// <summary>
+        /// ItemSelected is raised when an item is selected by api, user interaction, and etc.
+        /// This is also raised when a user press back space while cursor is on the first field of entry.
+        /// </summary>
+        public event EventHandler<MultiButtonEntryItemEventArgs> ItemSelected;
+
+        /// <summary>
+        /// ItemClicked is raised when an item is clicked by user interaction.
+        /// </summary>
+        public event EventHandler<MultiButtonEntryItemEventArgs> ItemClicked;
+
+        /// <summary>
+        /// ItemLongPressed is raised when MultiButtonEntry item is pressed for a long time.
+        /// </summary>
+        public event EventHandler<MultiButtonEntryItemEventArgs> ItemLongPressed;
+
+        /// <summary>
+        /// ItemAdded is raised when a new MultiButtonEntry item is added.
+        /// </summary>
+        public event EventHandler<MultiButtonEntryItemEventArgs> ItemAdded;
+
+        /// <summary>
+        /// ItemDeleted is raised when a MultiButtonEntry item is deleted.
+        /// </summary>
+        public event EventHandler<MultiButtonEntryItemEventArgs> ItemDeleted;
+
+        /// <summary>
+        /// Gets the selected item in the multibuttonentry.
+        /// </summary>
+        public MultiButtonEntryItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_multibuttonentry_selected_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether the multibuttonentry is editable or not.
+        /// </summary>
+        public bool IsEditable
+        {
+            get
+            {
+                return Interop.Elementary.elm_multibuttonentry_editable_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_multibuttonentry_editable_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the multibuttonentry to expanded state.
+        /// If true, expanded state.
+        /// If false, single line state.
+        /// </summary>
+        public bool IsExpanded
+        {
+            get
+            {
+                return Interop.Elementary.elm_multibuttonentry_expanded_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_multibuttonentry_expanded_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the first item in the multibuttonentry.
+        /// </summary>
+        public MultiButtonEntryItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_multibuttonentry_first_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the last item in the multibuttonentry.
+        /// </summary>
+        public MultiButtonEntryItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_multibuttonentry_last_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the entry object int the multibuttonentry.
+        /// </summary>
+        public Entry Entry
+        {
+            get
+            {
+                if (_entry == null)
+                {
+                    _entry = new EntryInner(this);
+                }
+
+                return _entry;
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_multibuttonentry_add(parent.Handle);
+        }
+
+        /// <summary>
+        /// Append a new item to the multibuttonentry.
+        /// </summary>
+        /// <param name="label">The label of new item.</param>
+        /// <returns>A MultiButtonEntryItem to the item added.</returns>
+        public MultiButtonEntryItem Append(string label)
+        {
+            var handle = Interop.Elementary.elm_multibuttonentry_item_append(RealHandle, label, null, IntPtr.Zero);
+            MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            return item;
+        }
+
+        /// <summary>
+        /// Prepend a new item to the multibuttonentry.
+        /// </summary>
+        /// <param name="label">The label of new item.</param>
+        /// <returns>A MultiButtonEntryItem to the item added.</returns>
+        public MultiButtonEntryItem Prepend(string label)
+        {
+            var handle = Interop.Elementary.elm_multibuttonentry_item_prepend(RealHandle, label, null, IntPtr.Zero);
+            MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            return item;
+        }
+
+        /// <summary>
+        /// Add a new item to the multibuttonentry before the indicated object reference.
+        /// </summary>
+        /// <param name="before">The item before which to add it.</param>
+        /// <param name="label">The label of new item.</param>
+        /// <returns>A MultiButtonEntryItem to the item added.</returns>
+        public MultiButtonEntryItem InsertBefore(MultiButtonEntryItem before, string label)
+        {
+            var handle = Interop.Elementary.elm_multibuttonentry_item_insert_before(RealHandle, before.Handle, label, null, IntPtr.Zero);
+            MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            return item;
+        }
+
+        /// <summary>
+        /// Add a new item to the multibuttonentry after the indicated object.
+        /// </summary>
+        /// <param name="after">The item after which to add it.</param>
+        /// <param name="label">The label of new item.</param>
+        /// <returns>A MultiButtonEntryItem to the item added.</returns>
+        public MultiButtonEntryItem InsertAfter(MultiButtonEntryItem after, string label)
+        {
+            var handle = Interop.Elementary.elm_multibuttonentry_item_insert_after(RealHandle, after.Handle, label, null, IntPtr.Zero);
+            MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem;
+            return item;
+        }
+
+        /// <summary>
+        /// Remove all items in the multibuttonentry.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_multibuttonentry_clear(RealHandle);
+            foreach (var item in _children)
+            {
+                item.Deleted -= Item_Deleted;
+            }
+            _children.Clear();
+        }
+
+        /// <summary>
+        /// Append an item filter function for text inserted in the Multibuttonentry.
+        /// </summary>
+        /// <param name="func">The function to use as item filter.</param>
+        public void AppendFilter(Func<string, bool> func)
+        {
+            _filters.Add(func);
+            if (_filters.Count == 1)
+            {
+                Interop.Elementary.elm_multibuttonentry_item_filter_append(RealHandle, _filterCallback, IntPtr.Zero);
+            }
+        }
+
+        /// <summary>
+        /// Prepend a filter function for text inserted in the Multibuttonentry.
+        /// </summary>
+        /// <param name="func">The function to use as text filter.</param>
+        public void PrependFilter(Func<string, bool> func)
+        {
+            _filters.Insert(0, func);
+            if (_filters.Count == 1)
+            {
+                Interop.Elementary.elm_multibuttonentry_item_filter_prepend(RealHandle, _filterCallback, IntPtr.Zero);
+            }
+        }
+
+        /// <summary>
+        /// Remove a filter from the list.
+        /// </summary>
+        /// <param name="func">The filter function to remove.</param>
+        public void RemoveFilter(Func<string, bool> func)
+        {
+            _filters.Remove(func);
+            if (_filters.Count == 0)
+            {
+                Interop.Elementary.elm_multibuttonentry_item_filter_remove(RealHandle, _filterCallback, IntPtr.Zero);
+            }
+        }
+
+        /// <summary>
+        /// Set a function to format the string that will be used to display the hidden items counter.
+        /// If func is NULL, the default format will be used, which is "+ 'the hidden items counter'".
+        /// </summary>
+        /// <param name="func">The function to return string to show</param>
+        public void SetFormatCallback(Func<int, string> func)
+        {
+            if (func == null)
+            {
+                Interop.Elementary.elm_multibuttonentry_format_function_set(RealHandle, null, IntPtr.Zero);
+            }
+            else
+            {
+                _formatFunc = func;
+                Interop.Elementary.elm_multibuttonentry_format_function_set(RealHandle, _formatCallback, IntPtr.Zero);
+            }
+        }
+
+        string FormatCallbackHandler(int count, IntPtr data)
+        {
+            return _formatFunc(count);
+        }
+
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            var removed = sender as MultiButtonEntryItem;
+            _children.Remove(removed);
+
+            // "item,deleted" event will be called after removing the item from ItemObject has been done.
+            // ItemObject will no longer have the item instance that is deleted after this.
+            // So, ItemDelete event with the removed item should be triggered here.
+            ItemDeleted?.Invoke(this, new MultiButtonEntryItemEventArgs() { Item = removed });
+        }
+
+        void OnItemAdded(object sender, MultiButtonEntryItemEventArgs e)
+        {
+            _children.Add(e.Item);
+            e.Item.Deleted += Item_Deleted;
+            ItemAdded?.Invoke(this, e);
+        }
+
+        bool FilterCallbackHandler(IntPtr obj, string label, IntPtr itemData, IntPtr data)
+        {
+            foreach (var func in _filters)
+            {
+                if (!func(label))
+                    return false;
+            }
+            return true;
+        }
+
+        internal class EntryInner : Entry
+        {
+            internal EntryInner(EvasObject parent) : base(parent)
+            {
+            }
+
+            protected override IntPtr CreateHandle(EvasObject parent)
+            {
+                return Interop.Elementary.elm_multibuttonentry_entry_get(parent.Handle);
+            }
+        }
+    }
+
+    /// <summary>
+    /// It inherits System.EventArgs.
+    /// The MultiButtonEntryItemEventArgs is a argument for all events of MultiButtonEntry.
+    /// It contains Item which is <see cref="MultiButtonEntryItem"/> type.
+    /// </summary>
+    public class MultiButtonEntryItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets or sets MultiButtonEntryItem item. The return type is <see cref="MultiButtonEntryItem"/>.
+        /// </summary>
+        public MultiButtonEntryItem Item { get; set; }
+
+        internal static MultiButtonEntryItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            MultiButtonEntryItem item = ItemObject.GetItemByHandle(info) as MultiButtonEntryItem;
+            return new MultiButtonEntryItemEventArgs() { Item = item };
+        }
+
+        internal static MultiButtonEntryItemEventArgs CreateAndAddFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            // Item can be added throught calling Append method and user input.
+            // And since "item.added" event will be called before xx_append() method returns,
+            // ItemObject does NOT have an item that contains handle matched to "info" at this time.
+            // So, item should be created and added internally here.
+            MultiButtonEntryItem item = new MultiButtonEntryItem(info);
+            return new MultiButtonEntryItemEventArgs() { Item = item };
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs b/src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs
new file mode 100755 (executable)
index 0000000..583e1ee
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="ItemObject"/>.
+    /// MutltiButtonEntryItem is a item which is added to MultiButtonEntry.
+    /// It contains Next and Prev properties to get next and previous item.
+    /// </summary>
+    public class MultiButtonEntryItem : ItemObject
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the MultiButtonEntryItem class.
+        /// </summary>
+        /// <param name="text">The text of MultiButtonEntryItem's Label name.</param>
+        public MultiButtonEntryItem(string text) : base(IntPtr.Zero)
+        {
+            Label = text;
+        }
+
+        internal MultiButtonEntryItem(IntPtr handle) : base(handle)
+        {
+            Label = Interop.Elementary.elm_object_item_part_text_get(handle, null);
+        }
+
+        /// <summary>
+        /// Gets the label of this item.
+        /// </summary>
+        public string Label { get; private set; }
+
+        /// <summary>
+        /// Gets or sets the selected state of an item.
+        /// </summary>
+        public bool IsSelected
+        {
+            get
+            {
+                return Interop.Elementary.elm_multibuttonentry_item_selected_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_multibuttonentry_item_selected_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the next item in the multibuttonentry.
+        /// </summary>
+        public MultiButtonEntryItem Next
+        {
+            get
+            {
+                var next = Interop.Elementary.elm_multibuttonentry_item_next_get(Handle);
+                return ItemObject.GetItemByHandle(next) as MultiButtonEntryItem;
+            }
+        }
+
+        /// <summary>
+        /// Get the previous item in the multibuttonentry.
+        /// </summary>
+        public MultiButtonEntryItem Prev
+        {
+            get
+            {
+                var prev = Interop.Elementary.elm_multibuttonentry_item_prev_get(Handle);
+                return ItemObject.GetItemByHandle(prev) as MultiButtonEntryItem;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/NaviItem.cs b/src/ElmSharp/ElmSharp/NaviItem.cs
new file mode 100755 (executable)
index 0000000..f7da156
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The NaviItem is a widget to contain the contents to show in Naviframe.
+    /// Inherits ItemObject
+    /// </summary>
+    public class NaviItem : ItemObject
+    {
+        EvasObject _content;
+        bool _isPopped;
+        Color _barBackgroundColor = Color.Default;
+        Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped;
+
+        NaviItem(IntPtr handle, EvasObject content) : base(handle)
+        {
+            _isPopped = false;
+            _content = content;
+            _popped = (d, i) =>
+            {
+                _isPopped = true;
+                Popped?.Invoke(this, EventArgs.Empty);
+                return true;
+            };
+            Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero);
+        }
+
+        /// <summary>
+        /// Popped will be triggered when NaviItem is removed.
+        /// </summary>
+        public event EventHandler Popped;
+
+        /// <summary>
+        /// Gets the content object. The name of content part is "elm.swallow.content".
+        /// </summary>
+        public EvasObject Content
+        {
+            get { return _content; }
+        }
+
+        /// <summary>
+        /// Sets or gets a value whether title area is enabled or not.
+        /// </summary>
+        public bool TitleBarVisible
+        {
+            get
+            {
+                return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false);
+            }
+        }
+
+        /// <summary>
+        ///  Sets or gets the title bar background color
+        /// </summary>
+        public Color TitleBarBackgroundColor
+        {
+            get
+            {
+                return _barBackgroundColor;
+            }
+            set
+            {
+                if (value.IsDefault)
+                {
+                    Interop.Elementary.elm_object_item_color_class_del(Handle, "bg_title");
+                }
+                else
+                {
+                    SetPartColor("bg_title", value);
+                    _barBackgroundColor = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets an item style.
+        /// </summary>
+        public string Style
+        {
+            get
+            {
+                return Interop.Elementary.elm_naviframe_item_style_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_naviframe_item_style_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Invalidate the EventArgs if _isPopped is false.
+        /// The method should be overridden in children class.
+        /// </summary>
+        protected override void OnInvalidate()
+        {
+            if (!_isPopped)
+                Popped?.Invoke(this, EventArgs.Empty);
+        }
+
+        internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content)
+        {
+            return new NaviItem(handle, content);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Naviframe.cs b/src/ElmSharp/ElmSharp/Naviframe.cs
new file mode 100755 (executable)
index 0000000..8d31756
--- /dev/null
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The NaviframeEventArgs is a event args class for navi frame.
+    /// Inherits EventArgs
+    /// </summary>
+    public class NaviframeEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Sets or gets the content object. The name of content part is "elm.swallow.content".
+        /// </summary>
+        public EvasObject Content { get; set; }
+    }
+    /// <summary>
+    /// Naviframe is a widget to stands for navigation frame. It's a views manager for applications.
+    /// Inherits Widget
+    /// </summary>
+    public class Naviframe : Widget
+    {
+        SmartEvent _transitionFinished;
+        readonly List<NaviItem> _itemStack = new List<NaviItem>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of Naviframe class.
+        /// </summary>
+        /// <param name="parent">The parent is a given container which will be attached by Naviframe as a child. It's <see cref="EvasObject"/> type.</param>
+        public Naviframe(EvasObject parent) : base(parent)
+        {
+            _transitionFinished = new SmartEvent(this, this.RealHandle, "transition,finished");
+            _transitionFinished.On += (s, e) => AnimationFinished?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Popped will be triggered when NaviItem is removed.
+        /// </summary>
+        /// <remarks>
+        /// It is always called when NaviItem was removed.
+        /// (even if removed by NaviItem.Delete())
+        /// This event will be invoked in progress of Pop/Delete operation.
+        /// After called Popped event, Pop/Delete method will be returned
+        /// </remarks>
+        public event EventHandler<NaviframeEventArgs> Popped;
+
+        /// <summary>
+        /// AnimationFinished will be triggered when animation is finished.
+        /// </summary>
+        public event EventHandler AnimationFinished;
+
+        /// <summary>
+        /// Gets the list of navi item
+        /// </summary>
+        public IReadOnlyList<NaviItem> NavigationStack
+        {
+            get { return _itemStack; }
+        }
+
+        /// <summary>
+        /// Sets or gets the the preserve content objects when items are popped.
+        /// </summary>
+        public bool PreserveContentOnPop
+        {
+            get
+            {
+                return Interop.Elementary.elm_naviframe_content_preserve_on_pop_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_naviframe_content_preserve_on_pop_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the default back button is enabled
+        /// </summary>
+        public bool DefaultBackButtonEnabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Push a new item to the top of the naviframe stack and show it.
+        /// The title and style are null.
+        /// </summary>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem Push(EvasObject content)
+        {
+            return Push(content, null);
+        }
+
+        /// <summary>
+        /// Push a new item to the top of the naviframe stack and show it.
+        /// The style are null.
+        /// </summary>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <returns></returns>
+        public NaviItem Push(EvasObject content, string title)
+        {
+            return Push(content, title, null);
+        }
+
+        /// <summary>
+        /// Push a new item to the top of the naviframe stack and show it.
+        /// </summary>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <param name="style">The current item style name. null would be default.</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem Push(EvasObject content, string title, string style)
+        {
+            IntPtr item = Interop.Elementary.elm_naviframe_item_push(RealHandle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, style);
+            NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+            _itemStack.Add(naviItem);
+            naviItem.Popped += ItemPoppedHandler;
+            return naviItem;
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe before item.
+        /// The title is "" and the style is null.
+        /// </summary>
+        /// <param name="before">The item which the new item is inserted before.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertBefore(NaviItem before, EvasObject content)
+        {
+            return InsertBefore(before, content, "");
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe before item.
+        /// The style is null.
+        /// </summary>
+        /// <param name="before">The item which the new item is inserted before.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertBefore(NaviItem before, EvasObject content, string title)
+        {
+            return InsertBefore(before, content, title, null);
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe before item.
+        /// </summary>
+        /// <param name="before">The item which the new item is inserted before.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <param name="style">The current item style name. null would be default.</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertBefore(NaviItem before, EvasObject content, string title, string style)
+        {
+            IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(RealHandle, before, title, IntPtr.Zero, IntPtr.Zero, content, null);
+            NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+            int idx = _itemStack.IndexOf(before);
+            _itemStack.Insert(idx, naviItem);
+            naviItem.Popped += ItemPoppedHandler;
+            return naviItem;
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe after item.
+        /// The title is "" and the style is null.
+        /// </summary>
+        /// <param name="after">The item which the new item is inserted after.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertAfter(NaviItem after, EvasObject content)
+        {
+            return InsertAfter(after, content, "");
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe after item.
+        /// The style is null.
+        /// </summary>
+        /// <param name="after">The item which the new item is inserted after.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertAfter(NaviItem after, EvasObject content, string title)
+        {
+            return InsertAfter(after, content, title, null);
+        }
+
+        /// <summary>
+        /// Insert a new item into the naviframe after item.
+        /// </summary>
+        /// <param name="after">The item which the new item is inserted after.</param>
+        /// <param name="content">The main content object. The name of content part is "elm.swallow.content".</param>
+        /// <param name="title">The current item title. null would be default.</param>
+        /// <param name="style">The current item style name. null would be default.</param>
+        /// <returns>The created item or null upon failure.</returns>
+        public NaviItem InsertAfter(NaviItem after, EvasObject content, string title, string style)
+        {
+            IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(RealHandle, after, title, IntPtr.Zero, IntPtr.Zero, content, null);
+            NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+            int idx = _itemStack.IndexOf(after);
+            _itemStack.Insert(idx + 1, naviItem);
+            naviItem.Popped += ItemPoppedHandler;
+            return naviItem;
+        }
+
+        /// <summary>
+        /// Pop an item that is on top of the stack.
+        /// </summary>
+        public void Pop()
+        {
+            Interop.Elementary.elm_naviframe_item_pop(RealHandle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_naviframe_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+
+        void ItemPoppedHandler(object sender, EventArgs e)
+        {
+            NaviItem item = sender as NaviItem;
+            if (item == null)
+                return;
+            _itemStack.Remove(item);
+            Popped?.Invoke(this, new NaviframeEventArgs() { Content = item.Content });
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Panel.cs b/src/ElmSharp/ElmSharp/Panel.cs
new file mode 100755 (executable)
index 0000000..f644d27
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for paneldirection type.
+    /// </summary>
+    public enum PanelDirection
+    {
+        /// <summary>
+        /// Top to bottom
+        /// </summary>
+        Top = 0,
+        /// <summary>
+        /// Bottom to top
+        /// </summary>
+        Bottom,
+        /// <summary>
+        /// Left to right
+        /// </summary>
+        Left,
+        /// <summary>
+        /// Right to left
+        /// </summary>
+        Right,
+    }
+
+    /// <summary>
+    /// The Panel is a container that can contain subobjects.
+    /// </summary>
+    public class Panel : Layout
+    {
+        SmartEvent _toggled;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Panel class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Panel will be attached as a child.</param>
+        public Panel(EvasObject parent) : base(parent)
+        {
+            _toggled = new SmartEvent(this, this.RealHandle, "toggled");
+            _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Sets or gets the hidden status of a given Panel widget.
+        /// </summary>
+        public bool IsOpen
+        {
+            get
+            {
+                return !Interop.Elementary.elm_panel_hidden_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panel_hidden_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the direction of a given Panel widget.
+        /// </summary>
+        public PanelDirection Direction
+        {
+            get
+            {
+                return (PanelDirection)Interop.Elementary.elm_panel_orient_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panel_orient_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Toggled will be triggered when toggles Panel.
+        /// </summary>
+        public event EventHandler Toggled;
+
+        /// <summary>
+        /// Enable or disable scrolling in the Panel.
+        /// </summary>
+        /// <param name="enable">
+        /// Bool value can be false or true.
+        /// </param>
+        public void SetScrollable(bool enable)
+        {
+            Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable);
+        }
+
+        /// <summary>
+        /// Sets the scroll size of Panel.
+        /// </summary>
+        /// <param name="ratio">
+        /// The size of scroll area.
+        /// </param>
+        public void SetScrollableArea(double ratio)
+        {
+            Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio);
+        }
+
+        /// <summary>
+        /// Toggles the hidden state of the Panel.
+        /// </summary>
+        public void Toggle()
+        {
+            Interop.Elementary.elm_panel_toggle(RealHandle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_panel_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Panes.cs b/src/ElmSharp/ElmSharp/Panes.cs
new file mode 100755 (executable)
index 0000000..d99b5b6
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Panes is a widget that adds a draggable bar between two contents.
+    /// When dragged this bar resizes contents' size.
+    /// </summary>
+    public class Panes : Layout
+    {
+        SmartEvent _press;
+        SmartEvent _unpressed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Panes class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Panes will be attached as a child.</param>
+        public Panes(EvasObject parent) : base(parent)
+        {
+            _press = new SmartEvent(this, this.RealHandle, "press");
+            _unpressed = new SmartEvent(this, this.RealHandle, "unpress");
+
+            _press.On += (s, e) => Pressed?.Invoke(this, e);
+            _unpressed.On += (s, e) => Unpressed?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Pressed will be triggered when panes have been pressed (button isn't released yet).
+        /// </summary>
+        public event EventHandler Pressed;
+
+        /// <summary>
+        /// Unpressed will be triggered when panes are released after being pressed.
+        /// </summary>
+        public event EventHandler Unpressed;
+
+        /// <summary>
+        /// Sets or gets resize mode of a given Panes widget.
+        /// True means the left and right panes resize homogeneously.
+        /// </summary>
+        public bool IsFixed
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_fixed_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_fixed_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or Gets the size proportion of the Panes widget's left side.
+        /// </summary>
+        /// <remarks>
+        /// By default it's homogeneous, i.e., both sides have the same size.If something different is required,
+        /// it can be set with this function. For example, if the left content should be displayed over 75% of the panes size,
+        /// size should be passed as 0.75. This way, the right content is resized to 25% of the panes size.
+        /// If displayed vertically, left content is displayed at the top, and right content at the bottom.
+        /// This proportion changes when the user drags the panes bar.
+        ///
+        /// The value is float type and between 0.0 and 1.0 representing the size proportion of the left side.
+        /// </remarks>
+        public double Proportion
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_content_left_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_content_left_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the orientation of a given Panes widget.
+        /// </summary>
+        /// <remarks>
+        /// Uses this function to change how your panes are to be disposed: vertically or horizontally.
+        /// By default it's displayed horizontally.
+        /// </remarks>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the absolute minimum size of panes widget's left side.
+        /// If displayed vertically, left content is displayed at top.
+        /// value representing minimum size of left side in pixels.
+        /// </summary>
+        public int LeftMinimumSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_content_left_min_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_content_left_min_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the relative minimum size of panes widget's left side.
+        /// proportion of minimum size of left side.
+        /// If displayed vertically, left content is displayed at top.
+        /// value between 0.0 and 1.0 representing size proportion of minimum size of left side.
+        /// </summary>
+        public double LeftMinimumRelativeSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_content_left_min_relative_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_content_left_min_relative_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the absolute minimum size of panes widget's right side.
+        /// If displayed vertically, right content is displayed at top.
+        /// value representing minimum size of right side in pixels.
+        /// </summary>
+        public int RightMinimumSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_content_right_min_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_content_right_min_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the relative minimum size of panes widget's right side.
+        /// proportion of minimum size of right side.
+        /// If displayed vertically, right content is displayed at top.
+        /// value between 0.0 and 1.0 representing size proportion of minimum size of right side.
+        /// </summary>
+        public double RightMinimumRelativeSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_panes_content_right_min_relative_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_panes_content_right_min_relative_size_set(RealHandle, value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_panes_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Point.cs b/src/ElmSharp/ElmSharp/Point.cs
new file mode 100755 (executable)
index 0000000..3fe04cd
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Point is a struct that defines a 2-D point as a pair of generic type.
+    /// </summary>
+    public struct Point : IEquatable<Point>
+    {
+        /// <summary>
+        /// Location along the horizontal axis.
+        /// </summary>
+        public int X;
+
+        /// <summary>
+        /// Location along the vertical axis.
+        /// </summary>
+        public int Y;
+
+        public override string ToString()
+        {
+            return string.Format("{{X={0} Y={1}}}", X, Y);
+        }
+
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                return X.GetHashCode() ^ (Y.GetHashCode() * 397);
+            }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is Point))
+                return false;
+
+            return Equals((Point)obj);
+        }
+
+        public bool Equals(Point other)
+        {
+            return X.Equals(other.X) && Y.Equals(other.Y);
+        }
+
+        /// <summary>
+        /// Whether the two <see cref="T:Tizen.UI.Point" />s are equal.
+        /// </summary>
+        /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
+        /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s have equal values.</returns>
+        public static bool operator ==(Point p1, Point p2)
+        {
+            return p1.Equals(p2);
+        }
+
+        /// <summary>
+        /// Whether two <see cref="T:Tizen.UI.Point" />s are not equal.
+        /// </summary>
+        /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
+        /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s do not have equal values.</returns>
+        public static bool operator !=(Point p1, Point p2)
+        {
+            return !p1.Equals(p2);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Point3D.cs b/src/ElmSharp/ElmSharp/Point3D.cs
new file mode 100755 (executable)
index 0000000..ebb8afb
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Point3D is a Struct that defining a 3-D point.
+    /// </summary>
+    public struct Point3D : IEquatable<Point3D>
+    {
+        /// <summary>
+        /// The X coordinate of a 3D point.
+        /// </summary>
+        public int X;
+
+        /// <summary>
+        /// The Y coordinate of a 3D point.
+        /// </summary>
+        public int Y;
+
+        /// <summary>
+        /// The Z coordinate of a 3D point.
+        /// </summary>
+        public int Z;
+
+        public override string ToString()
+        {
+            return string.Format("{{X={0} Y={1} Z={2}}}", X, Y, Z);
+        }
+
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                int hashCode = X.GetHashCode();
+                hashCode = (hashCode * 397) ^ Y.GetHashCode();
+                hashCode = (hashCode * 397) ^ Z.GetHashCode();
+                return hashCode;
+            }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is Point3D))
+                return false;
+
+            return Equals((Point3D)obj);
+        }
+
+        public bool Equals(Point3D other)
+        {
+            return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
+        }
+
+        /// <summary>
+        /// Whether the two <see cref="T:Tizen.UI.Point3D" />s are equal.
+        /// </summary>
+        /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
+        /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s have equal values.</returns>
+        public static bool operator ==(Point3D p1, Point3D p2)
+        {
+            return p1.Equals(p2);
+        }
+
+        /// <summary>
+        /// Whether two <see cref="T:Tizen.UI.Point3D" />s are not equal.
+        /// </summary>
+        /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
+        /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s do not have equal values.</returns>
+        public static bool operator !=(Point3D p1, Point3D p2)
+        {
+            return !p1.Equals(p2);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Polygon.cs b/src/ElmSharp/ElmSharp/Polygon.cs
new file mode 100755 (executable)
index 0000000..5db398d
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Polygon is a widget that used to draw a polygon (filled).
+    /// </summary>
+    public class Polygon : EvasObject
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the Polygon class.
+        /// <param name="parent">The EvasObject to which the new Polygon will be attached as a child.</param>
+        /// </summary>
+        public Polygon(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Adds a new vertex to the Polygon.
+        /// <param name="x">The X coordinate of the new vertex.</param>
+        /// <param name="y">The Y coordinate of the new vertex.</param>
+        /// </summary>
+        public void AddPoint(int x, int y)
+        {
+            Interop.Evas.evas_object_polygon_point_add(Handle, x, y);
+        }
+
+        /// <summary>
+        /// Adds a new vertex to the Polygon.
+        /// <param name="p">The coordinates of the new vertex.</param>
+        /// </summary>
+        public void AddPoint(Point p)
+        {
+            AddPoint(p.X, p.Y);
+        }
+
+        /// <summary>
+        /// Removes all the vertices of the Polygon, making it empty.
+        /// </summary>
+        public void ClearPoints()
+        {
+            Interop.Evas.evas_object_polygon_points_clear(Handle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle);
+            return Interop.Evas.evas_object_polygon_add(evas);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Popup.cs b/src/ElmSharp/ElmSharp/Popup.cs
new file mode 100755 (executable)
index 0000000..26f736d
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the popup orientation type.
+    /// </summary>
+    public enum PopupOrientation
+    {
+        /// <summary>
+        /// Appears in the top of parent, default.
+        /// </summary>
+        Top,
+        /// <summary>
+        /// Appears in the center of parent.
+        /// </summary>
+        Center,
+        /// <summary>
+        /// Appears in the bottom of parent.
+        /// </summary>
+        Bottom,
+        /// <summary>
+        /// Appears in the left of parent.
+        /// </summary>
+        Left,
+        /// <summary>
+        /// Appears in the right of parent.
+        /// </summary>
+        Right,
+        /// <summary>
+        /// Appears in the top left of parent.
+        /// </summary>
+        TopLeft,
+        /// <summary>
+        /// Appears in the top right of parent.
+        /// </summary>
+        TopRight,
+        /// <summary>
+        /// Appears in the bottom left of parent.
+        /// </summary>
+        BottomLeft,
+        /// <summary>
+        /// Appears in the bottom right of parent.
+        /// </summary>
+        BottomRight
+    }
+
+    /// <summary>
+    /// The Popup is a widget that is an enhancement of Notify.
+    /// In addition to content area, there are two optional sections, namely title area and action area.
+    /// </summary>
+    public class Popup : Layout
+    {
+        HashSet<PopupItem> _children = new HashSet<PopupItem>();
+        SmartEvent _dismissed;
+        SmartEvent _blockClicked;
+        SmartEvent _timeout;
+        SmartEvent _showFinished;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Popup class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Popup will be attached as a child.</param>
+        public Popup(EvasObject parent) : base(parent)
+        {
+            _dismissed = new SmartEvent(this, "dismissed");
+            _dismissed.On += (sender, e) =>
+            {
+                Dismissed?.Invoke(this, EventArgs.Empty);
+            };
+
+            _blockClicked = new SmartEvent(this, "block,clicked");
+            _blockClicked.On += (sender, e) =>
+            {
+                OutsideClicked?.Invoke(this, EventArgs.Empty);
+            };
+
+            _timeout = new SmartEvent(this, "timeout");
+            _timeout.On += (sender, e) =>
+            {
+                TimedOut?.Invoke(this, EventArgs.Empty);
+            };
+
+            _showFinished = new SmartEvent(this, "show,finished");
+            _showFinished.On += (sender, e) =>
+            {
+                ShowAnimationFinished?.Invoke(this, EventArgs.Empty);
+            };
+        }
+
+        /// <summary>
+        /// Dismissed will be triggered when Popup have been dismissed.
+        /// </summary>
+        public event EventHandler Dismissed;
+
+        /// <summary>
+        /// OutsideClicked will be triggered when users taps on the outside of Popup.
+        /// </summary>
+        public event EventHandler OutsideClicked;
+
+        /// <summary>
+        /// OutsideClicked will be triggered when Popup is closed as a result of timeout.
+        /// </summary>
+        public event EventHandler TimedOut;
+
+        /// <summary>
+        /// OutsideClicked will be triggered when the Popup transition is finished in showing.
+        /// </summary>
+        public event EventHandler ShowAnimationFinished;
+
+        /// <summary>
+        /// Sets or gets the position in which Popup will appear in its parent.
+        /// </summary>
+        public PopupOrientation Orientation
+        {
+            get
+            {
+                return (PopupOrientation)Interop.Elementary.elm_popup_orient_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_popup_orient_set(Handle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the wrapping type of content text packed in content area of Popup widget.
+        /// </summary>
+        public WrapType ContentTextWrapType
+        {
+            get
+            {
+                return (WrapType)Interop.Elementary.elm_popup_content_text_wrap_type_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_popup_content_text_wrap_type_set(Handle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the timeout value set to the Popup(in seconds).
+        /// </summary>
+        /// <remarks>
+        /// Since calling Show() on a popup restarts the timer controlling when it is hidden,
+        /// setting this before the popup is shown will in effect mean starting the timer when the popup is shown.
+        /// TimedOut is called afterwards which can be handled if needed.
+        /// Set a value <= 0.0 to disable a running timer.If the value > 0.0 and the popup is previously visible,
+        /// the timer will be started with this value, canceling any running timer.
+        /// </remarks>
+        public double Timeout
+        {
+            get
+            {
+                return Interop.Elementary.elm_popup_timeout_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_popup_timeout_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether events should be passed to event blocked area by a click outside.
+        /// </summary>
+        /// <remarks>
+        /// The visible region of popup is surrounded by a translucent region called Blocked Event area.
+        /// </remarks>
+        public bool AllowEvents
+        {
+            get
+            {
+                return Interop.Elementary.elm_popup_allow_events_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_popup_allow_events_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the AlignmentX in which the popup will appear in its parent.
+        /// </summary>
+        public override double AlignmentX
+        {
+            get
+            {
+                return Interop.Elementary.GetPopupAlignX(Handle);
+            }
+            set
+            {
+                Interop.Elementary.SetPopupAlignX(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the AlignmentY in which the popup will appear in its parent.
+        /// </summary>
+        public override double AlignmentY
+        {
+            get
+            {
+                return Interop.Elementary.GetPopupAlignY(Handle);
+            }
+            set
+            {
+                Interop.Elementary.SetPopupAlignY(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the Opacity value of the Popup.
+        /// </summary>
+        public override int Opacity
+        {
+            get
+            {
+                return Color.Default.A;
+            }
+
+            set
+            {
+                Console.WriteLine("Popup instance doesn't support to set Opacity.");
+            }
+        }
+
+        /// <summary>
+        /// Adds label to a Popup widget.
+        /// </summary>
+        /// <param name="label"></param>
+        /// <returns>The new PopupItem which contains label .</returns>
+        public PopupItem Append(string label)
+        {
+            return Append(label, null);
+        }
+
+        /// <summary>
+        /// Adds Label and icon to a Popup widget.
+        /// </summary>
+        /// <param name="label">The Label which will be added into a new PopupItem. </param>
+        /// <param name="icon">The icon which will be added into a new PopupItem. </param>
+        /// <returns>The new PopupItem which contains label and icon.</returns>
+        public PopupItem Append(string label, EvasObject icon)
+        {
+            PopupItem item = new PopupItem(label, icon);
+            item.Handle = Interop.Elementary.elm_popup_item_append(Handle, label, icon, null, (IntPtr)item.Id);
+            AddInternal(item);
+            return item;
+        }
+
+        /// <summary>
+        /// Uses this function to dismiss the popup in hide effect.
+        /// when the Popup is dismissed, the "dismissed" signal will be emitted.
+        /// </summary>
+        public void Dismiss()
+        {
+            Interop.Elementary.elm_popup_dismiss(Handle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_popup_add(parent.Handle);
+        }
+        void AddInternal(PopupItem item)
+        {
+            _children.Add(item);
+            item.Deleted += Item_Deleted;
+        }
+        void Item_Deleted(object sender, EventArgs e)
+        {
+            _children.Remove((PopupItem)sender);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/PopupItem.cs b/src/ElmSharp/ElmSharp/PopupItem.cs
new file mode 100755 (executable)
index 0000000..1251c55
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The PopupItem is a class that including icon and text.
+    /// </summary>
+    public class PopupItem : ItemObject
+    {
+        internal PopupItem(string text, EvasObject icon) : base(IntPtr.Zero)
+        {
+            Text = text;
+            Icon = icon;
+        }
+
+        /// <summary>
+        /// Gets the text label of popupitem.Return value is string.
+        /// </summary>
+        public string Text { get; internal set; }
+
+        /// <summary>
+        /// Gets the icon EvasObject of popupitem.
+        /// </summary>
+        public EvasObject Icon { get; internal set; }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ProgressBar.cs b/src/ElmSharp/ElmSharp/ProgressBar.cs
new file mode 100755 (executable)
index 0000000..28f6302
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The ProgressBar is a widget for visually representing the progress status of a given job/task.
+    /// </summary>
+    public class ProgressBar : Layout
+    {
+        SmartEvent _changed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the ProgressBar class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new ProgressBar will be attached as a child.</param>
+        public ProgressBar(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (s, e) =>
+            {
+                ValueChanged?.Invoke(this, EventArgs.Empty);
+            };
+        }
+
+        /// <summary>
+        /// ValueChanged will be triggered when value of ProgressBar change.
+        /// </summary>
+        public event EventHandler ValueChanged;
+
+        /// <summary>
+        /// Sets or gets the value wheather a given ProgressBar widget is at the "pulsing mode".
+        /// </summary>
+        /// <remarks>
+        /// By default, progress bars display values from low to high value boundaries.
+        /// There are, though, contexts in which the progress of a given task is unknown.
+        /// For such cases, one can set a progress bar widget to a "pulsing state",
+        /// to give the user an idea that some computation is being held,
+        /// but without exact progress values. In the default theme,
+        /// it animates its bar with the contents filling in constantly and back to non-filled, in a loop.
+        /// </remarks>
+        public bool IsPulseMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_pulse_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_pulse_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of ProgressBar.
+        /// </summary>
+        /// <remarks>
+        /// Use this property to set the progress bar levels.
+        /// If you pass a value out of the specified range(0.0~1.0),
+        /// it is interpreted as the closest of the boundary values in the range.
+        /// </remarks>
+        public double Value
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_value_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the span value of ProgressBar.
+        /// </summary>
+        public int SpanSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_span_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_span_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value wheather a given ProgressBar widget is horizontal.
+        /// </summary>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value whether a given progress bar widget's displaying values are inverted.
+        /// </summary>
+        public bool IsInverted
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_inverted_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_inverted_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets format string for a given progress bar widget's units label.
+        /// </summary>
+        /// <remarks>
+        /// If NULL is passed on format, it makes obj units area to be hidden completely.
+        /// If not, it sets the format string for the units label's text.
+        /// The units label is provided with a floating point value, so the units text displays at most one floating point value.
+        /// Note that the units label is optional. Use a format string such as "%1.2f meters" for example.
+        /// The default format string for a progress bar is an integer percentage, as in "%.0f %%".
+        /// </remarks>
+        public string UnitFormat
+        {
+            get
+            {
+                return Interop.Elementary.elm_progressbar_unit_format_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_progressbar_unit_format_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Starts a given progress bar "pulsing" animation, if its under that mode.
+        /// </summary>
+        public void PlayPulse()
+        {
+            Interop.Elementary.elm_progressbar_pulse(RealHandle, true);
+        }
+
+        [Obsolete("use StopPulse instead")]
+        public void StopPluse()
+        {
+            Interop.Elementary.elm_progressbar_pulse(RealHandle, false);
+        }
+
+        /// <summary>
+        /// Stops a given progress bar "pulsing" animation, if its under that mode.
+        /// </summary>
+        public void StopPulse()
+        {
+            Interop.Elementary.elm_progressbar_pulse(RealHandle, false);
+        }
+
+        /// <summary>
+        /// Gets the part value of the given part of the Progressbar.
+        /// </summary>
+        /// <param name="part">Part of the Progressbar.</param>
+        /// <returns>Returns value range is from 0.0 to 1.0.</returns>
+        public double GetPartValue(string part)
+        {
+            return Interop.Elementary.elm_progressbar_part_value_get(RealHandle, part);
+        }
+
+        /// <summary>
+        /// Sets or gets the general or main color of the given Progressbar.
+        /// </summary>
+        public override Color Color
+        {
+            get
+            {
+                return GetPartColor("bar");
+            }
+            set
+            {
+                SetPartColor("bar", value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the part value of the give part of the Progressbar.
+        /// </summary>
+        /// <param name="part">Part of the Progressbar.</param>
+        /// <param name="value">Value range is from 0.0 to 1.0.</param>
+        public void SetPartValue(string part, double value)
+        {
+            Interop.Elementary.elm_progressbar_part_value_set(RealHandle, part, value);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_progressbar_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Radio.cs b/src/ElmSharp/ElmSharp/Radio.cs
new file mode 100755 (executable)
index 0000000..9a5f2d5
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them.
+    /// </summary>
+    public class Radio : Layout
+    {
+        SmartEvent _changed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Radio class.
+        /// </summary>
+        /// <param name="parent">The EvasObject to which the new Radio will be attached as a child.</param>
+        public Radio(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// ValueChanged will be triggered when value of Radio change.
+        /// </summary>
+        public event EventHandler ValueChanged;
+
+        /// <summary>
+        /// Sets or gets a unique value to each Radio button.
+        /// </summary>
+        public int StateValue
+        {
+            get
+            {
+                return Interop.Elementary.elm_radio_state_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_radio_state_value_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of the radio group.
+        /// </summary>
+        public int GroupValue
+        {
+            get
+            {
+                return Interop.Elementary.elm_radio_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_radio_value_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Adds this radio to a group of other radio objects.
+        /// </summary>
+        /// <param name="group">Group which add radio in.</param>
+        public void SetGroup(Radio group)
+        {
+            if (group == null)
+            {
+                throw new ArgumentNullException("group");
+            }
+            Interop.Elementary.elm_radio_group_add(RealHandle, group.RealHandle);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_radio_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/ReadingInfoType.cs b/src/ElmSharp/ElmSharp/ReadingInfoType.cs
new file mode 100755 (executable)
index 0000000..35df932
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Accessible
+{
+    /// <summary>
+    /// Enumeration for ReadingInfoType.
+    /// </summary>
+    [Flags]
+    public enum ReadingInfoType
+    {
+        /// <summary>
+        /// None
+        /// </summary>
+        None = 0,
+        /// <summary>
+        /// Name for reading info type
+        /// </summary>
+        Name = 0x1,
+        /// <summary>
+        /// Role for reading info type
+        /// </summary>
+        Role = 0x2,
+        /// <summary>
+        /// Description for reading info type
+        /// </summary>
+        Description = 0x4,
+        /// <summary>
+        /// State for reading info type
+        /// </summary>
+        State = 0x8
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Rect.cs b/src/ElmSharp/ElmSharp/Rect.cs
new file mode 100644 (file)
index 0000000..2f7a544
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Rect is a struct that represent rectangluar space.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct Rect : IEquatable<Rect>
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the Rect class.
+        /// </summary>
+        /// <param name="x">X axis value.</param>
+        /// <param name="y">Y axis value.</param>
+        /// <param name="w">Width value.</param>
+        /// <param name="h">Height value.</param>
+        public Rect(int x, int y, int w, int h)
+        {
+            X = x;
+            Y = y;
+            Width = w;
+            Height = h;
+        }
+        /// <summary>
+        /// Gets or sets the position of this Rectangle on the X axis.
+        /// </summary>
+        public int X { get; set; }
+
+        /// <summary>
+        /// Gets or sets the position of this Rectangle on the Y axis.
+        /// </summary>
+        public int Y { get; set; }
+
+        /// <summary>
+        /// Gets or sets the width of this Rectangle.
+        /// </summary>
+        public int Width { get; set; }
+
+        /// <summary>
+        /// Gets or sets the height of this Rectangle.
+        /// </summary>
+        public int Height { get; set; }
+
+        /// <summary>
+        /// Gets the position of this Rectangle on the X axis.
+        /// </summary>
+        public int Left { get { return X; } }
+
+        /// <summary>
+        /// Gets the extent along the X axis.
+        /// </summary>
+        public int Right { get { return X + Width; } }
+
+        /// <summary>
+        /// Gets the position of this Rectangle on the Y axis.
+        /// </summary>
+        public int Top { get { return Y; } }
+
+        /// <summary>
+        /// Gets the extent along the Y axis.
+        /// </summary>
+        public int Bottom { get { return Y + Height; } }
+
+        /// <summary>
+        /// Gets the Point defined by Rectangle.Left and Rectangle.Top.
+        /// </summary>
+        public Point Location { get { return new Point { X = X, Y = Y }; } }
+
+        /// <summary>
+        /// Gets the extent of the Rectangle along its X and Y axis.
+        /// </summary>
+        public Size Size { get { return new Size { Width = Width, Height = Height }; } }
+
+        public override string ToString()
+        {
+            return string.Format("{{X={0} Y={1} Width={2} Height={3}}}", X, Y, Width, Height);
+        }
+
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                int hashCode = X.GetHashCode();
+                hashCode = (hashCode * 397) ^ Y.GetHashCode();
+                hashCode = (hashCode * 397) ^ Width.GetHashCode();
+                hashCode = (hashCode * 397) ^ Height.GetHashCode();
+                return hashCode;
+            }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is Rect))
+                return false;
+
+            return Equals((Rect)obj);
+        }
+
+        public bool Equals(Rect other)
+        {
+            return X.Equals(other.X) && Y.Equals(other.Y) && Width.Equals(other.Width) && Height.Equals(other.Height);
+        }
+
+        /// <summary>
+        /// Whether the two <see cref="T:Tizen.UI.Rectangle" />s are equal.
+        /// </summary>
+        /// <param name="r1">A <see cref="T:Tizen.UI.Rectangle" /> on the left hand side.</param>
+        /// <param name="r2">A <see cref="T:Tizen.UI.Rectangle" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Rectangle" />s have equal values.</returns>
+        public static bool operator ==(Rect r1, Rect r2)
+        {
+            return r1.Equals(r2);
+        }
+
+        /// <summary>
+        /// Whether two <see cref="T:Tizen.UI.Rectangle" />s are not equal.
+        /// </summary>
+        /// <param name="r1">A <see cref="T:Tizen.UI.Rectangle" /> on the left hand side.</param>
+        /// <param name="r2">A <see cref="T:Tizen.UI.Rectangle" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Rectangle" />s do not have equal values.</returns>
+        public static bool operator !=(Rect r1, Rect r2)
+        {
+            return !r1.Equals(r2);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Rectangle.cs b/src/ElmSharp/ElmSharp/Rectangle.cs
new file mode 100755 (executable)
index 0000000..b0e69f8
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Rectangle is a class that used to draw a solid colored rectangle.
+    /// </summary>
+    public class Rectangle : EvasObject
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of the Rectangle class.
+        /// </summary>
+        /// <param name="parent">The <see cref="EvasObject"/> to which the new Slider will be attached as a child.</param>
+        public Rectangle(EvasObject parent) : base(parent)
+        {
+            Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle);
+            return Interop.Evas.evas_object_rectangle_add(evas);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Scroller.cs b/src/ElmSharp/ElmSharp/Scroller.cs
new file mode 100755 (executable)
index 0000000..2ceb38c
--- /dev/null
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for visible type of scrollbar.
+    /// </summary>
+    public enum ScrollBarVisiblePolicy
+    {
+        /// <summary>
+        /// Show scrollbars as needed
+        /// </summary>
+        Auto = 0,
+
+        /// <summary>
+        /// Always show scrollbars
+        /// </summary>
+        Visible,
+
+        /// <summary>
+        /// Never show scrollbars
+        /// </summary>
+        Invisible
+    }
+
+    /// <summary>
+    /// Enumeration for visible type of scrollbar.
+    /// </summary>
+    public enum ScrollBlock
+    {
+        /// <summary>
+        /// Scrolling movement is allowed in both direction.(X axis and Y axis)
+        /// </summary>
+        None = 1,
+
+        /// <summary>
+        /// Scrolling movement is not allowed in Y axis direction.
+        /// </summary>
+        Vertical = 2,
+
+        /// <summary>
+        /// Scrolling movement is not allowed in X axis direction.
+        /// </summary>
+        Horizontal = 4
+    }
+
+    /// <summary>
+    /// Type that controls how the content is scrolled.
+    /// </summary>
+    public enum ScrollSingleDirection
+    {
+        /// <summary>
+        /// Scroll every direction.
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// Scroll single direction if the direction is certain.
+        /// </summary>
+        Soft,
+
+        /// <summary>
+        /// Scroll only single direction.
+        /// </summary>
+        Hard,
+    }
+
+    /// <summary>
+    /// The Scroller is a container that holds and clips a single object and allows you to scroll across it.
+    /// </summary>
+    public class Scroller : Layout
+    {
+        SmartEvent _scroll;
+        SmartEvent _dragStart;
+        SmartEvent _dragStop;
+        SmartEvent _scrollpage;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Scroller class.
+        /// </summary>
+        /// <param name="parent">The <see cref="EvasObject"/> to which the new Scroller will be attached as a child.</param>
+        public Scroller(EvasObject parent) : base(parent)
+        {
+            _scroll = new SmartEvent(this, this.RealHandle, "scroll");
+            _dragStart = new SmartEvent(this, this.RealHandle, "scroll,drag,start");
+            _dragStop = new SmartEvent(this, this.RealHandle, "scroll,drag,stop");
+            _scrollpage = new SmartEvent(this, this.RealHandle, "scroll,page,changed");
+        }
+
+        /// <summary>
+        /// Scrolled will be triggered when the content has been scrolled.
+        /// </summary>
+        public event EventHandler Scrolled
+        {
+            add
+            {
+                _scroll.On += value;
+            }
+            remove
+            {
+                _scroll.On -= value;
+            }
+        }
+
+        /// <summary>
+        /// DragStart will be triggered when dragging the contents around has started.
+        /// </summary>
+        public event EventHandler DragStart
+        {
+            add
+            {
+                _dragStart.On += value;
+            }
+            remove
+            {
+                _dragStart.On -= value;
+            }
+        }
+
+        /// <summary>
+        /// DragStop will be triggered when dragging the contents around has stopped.
+        /// </summary>
+        public event EventHandler DragStop
+        {
+            add
+            {
+                _dragStop.On += value;
+            }
+            remove
+            {
+                _dragStop.On -= value;
+            }
+        }
+
+        /// <summary>
+        /// PageScrolled will be triggered when the visible page has changed.
+        /// </summary>
+        public event EventHandler PageScrolled
+        {
+            add
+            {
+                _scrollpage.On += value;
+            }
+            remove
+            {
+                _scrollpage.On -= value;
+            }
+        }
+
+        /// <summary>
+        /// Gets the current region in the content object that is visible through the Scroller.
+        /// </summary>
+        public Rect CurrentRegion
+        {
+            get
+            {
+                int x, y, w, h;
+                Interop.Elementary.elm_scroller_region_get(RealHandle, out x, out y, out w, out h);
+                return new Rect(x, y, w, h);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public virtual ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, out policy, IntPtr.Zero);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)value, (int)v);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of VerticalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public virtual ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, IntPtr.Zero, out policy);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)h, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of ScrollBlock.
+        /// </summary>
+        /// <remarks>
+        /// This function will block scrolling movement  in a given direction.One can disable movements in the X axis, the Y axis or both.
+        /// The default value is ScrollBlock.None, where movements are allowed in both directions.
+        /// </remarks>
+        public ScrollBlock ScrollBlock
+        {
+            get
+            {
+                return (ScrollBlock)Interop.Elementary.elm_scroller_movement_block_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_scroller_movement_block_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets scroll current page number.
+        /// </summary>
+        /// <remarks>
+        /// Current page means the page which meets the top of the viewport.
+        /// If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport.
+        /// The page number starts from 0. 0 is the first page.
+        /// </remarks>
+        public int VerticalPageIndex
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_current_page_get(RealHandle, out h, out v);
+                return v;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets scroll current page number.
+        /// </summary>
+        /// <remarks>
+        /// Current page means the page which meets the left of the viewport.
+        /// If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport.
+        /// The page number starts from 0. 0 is the first page.
+        /// </remarks>
+        public int HorizontalPageIndex
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_current_page_get(RealHandle, out h, out v);
+                return h;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum limit of the movable page at vertical direction.
+        /// </summary>
+        public int VerticalPageScrollLimit
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_page_scroll_limit_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                int h = HorizontalPageScrollLimit;
+                Interop.Elementary.elm_scroller_page_scroll_limit_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum limit of the movable page at horizontal direction.
+        /// </summary>
+        public int HorizontalPageScrollLimit
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_page_scroll_limit_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                int v = VerticalPageScrollLimit;
+                Interop.Elementary.elm_scroller_page_scroll_limit_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the vertical bounce behaviour.
+        /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
+        /// This is a visual way to indicate the end has been reached.
+        /// This is enabled by default for both axis.
+        /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
+        /// </summary>
+        public bool VerticalBounce
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                bool h = HorizontalBounce;
+                Interop.Elementary.elm_scroller_bounce_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the horizontal bounce behaviour.
+        /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
+        /// This is a visual way to indicate the end has been reached.
+        /// This is enabled by default for both axis.
+        /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
+        /// </summary>
+        public bool HorizontalBounce
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                bool v = VerticalBounce;
+                Interop.Elementary.elm_scroller_bounce_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Gets the width of the content object of the scroller.
+        /// </summary>
+        public int ChildWidth
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_scroller_child_size_get(RealHandle, out w, out h);
+                return w;
+            }
+        }
+
+        /// <summary>
+        /// Gets the height of the content object of the scroller.
+        /// </summary>
+        public int ChildHeight
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_scroller_child_size_get(RealHandle, out w, out h);
+                return h;
+            }
+        }
+
+        /// <summary>
+        /// Set scrolling gravity values for a scroller.
+        /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
+        /// The scroller will adjust the view to glue itself as follows.
+        /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content
+        /// Default values for x and y are 0.0
+        /// </summary>
+        public double HorizontalGravity
+        {
+            get
+            {
+                double v, h;
+                Interop.Elementary.elm_scroller_gravity_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                double v = VerticalGravity;
+                Interop.Elementary.elm_scroller_gravity_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Set scrolling gravity values for a scroller.
+        /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
+        /// The scroller will adjust the view to glue itself as follows.
+        /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content
+        /// Default values for x and y are 0.0
+        /// </summary>
+        public double VerticalGravity
+        {
+            get
+            {
+                double v, h;
+                Interop.Elementary.elm_scroller_gravity_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                double h = HorizontalGravity;
+                Interop.Elementary.elm_scroller_gravity_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Get scroll last page number.
+        /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
+        /// </summary>
+        public int LastVerticalPageNumber
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_last_page_get(RealHandle, out h, out v);
+                return v;
+            }
+        }
+
+        /// <summary>
+        /// Get scroll last page number.
+        /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
+        /// </summary>
+        public int LastHorizontalPageNumber
+        {
+            get
+            {
+                int v, h;
+                Interop.Elementary.elm_scroller_last_page_get(RealHandle, out h, out v);
+                return h;
+            }
+        }
+
+        /// <summary>
+        /// Set an infinite loop_ for a scroller.
+        /// This function sets the infinite loop vertically.
+        /// If the content is set, it will be shown repeatedly.
+        /// </summary>
+        public bool VerticalLoop
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_loop_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                bool h = HorizontalLoop;
+                Interop.Elementary.elm_scroller_loop_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Set an infinite loop_ for a scroller.
+        /// This function sets the infinite loop horizontally.
+        /// If the content is set, it will be shown repeatedly.
+        /// </summary>
+        public bool HorizontalLoop
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_loop_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                bool v = VerticalLoop;
+                Interop.Elementary.elm_scroller_loop_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
+        /// </summary>
+        public double VerticalRelativePageSize
+        {
+            get
+            {
+                double v, h;
+                Interop.Elementary.elm_scroller_page_relative_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                double h = HorizontalRelativePageSize;
+                Interop.Elementary.elm_scroller_page_relative_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
+        /// </summary>
+        public double HorizontalRelativePageSize
+        {
+            get
+            {
+                double v, h;
+                Interop.Elementary.elm_scroller_page_relative_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                double v = VerticalRelativePageSize;
+                Interop.Elementary.elm_scroller_page_relative_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Gets or Sets the page snapping behavior of a scroller.
+        /// </summary>
+        /// <remarks>
+        /// When scrolling, if a scroller is paged (see VerticalRelativePageSize),
+        /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
+        /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
+        /// This function will set if it that is enabled or not, for each axis.
+        /// </remarks>
+        public bool VerticalSnap
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_page_snap_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                bool h = HorizontalSnap;
+                Interop.Elementary.elm_scroller_page_snap_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or Sets the page snapping behavior of a scroller.
+        /// </summary>
+        /// <remarks>
+        /// When scrolling, if a scroller is paged (see HorizontalRelativePageSize),
+        /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
+        /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
+        /// This function will set if it that is enabled or not, for each axis.
+        /// </remarks>
+        public bool HorizontalSnap
+        {
+            get
+            {
+                bool v, h;
+                Interop.Elementary.elm_scroller_page_snap_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                bool v = VerticalSnap;
+                Interop.Elementary.elm_scroller_page_snap_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
+        /// </summary>
+        public int PageHeight
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_scroller_page_size_get(RealHandle, out w, out h);
+                return h;
+            }
+            set
+            {
+                int w = PageWidth;
+                Interop.Elementary.elm_scroller_page_size_set(RealHandle, w, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
+        /// </summary>
+        public int PageWidth
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_scroller_page_size_get(RealHandle, out w, out h);
+                return w;
+            }
+            set
+            {
+                int h = PageHeight;
+                Interop.Elementary.elm_scroller_page_size_set(RealHandle, value, h);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the event propagation for a scroller.
+        /// This enables or disables event propagation from the scroller content to the scroller and its parent.
+        /// By default event propagation is enabled.
+        /// </summary>
+        public bool ContentPropagateEvents
+        {
+            get
+            {
+                return Interop.Elementary.elm_scroller_propagate_events_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_scroller_propagate_events_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the step size to move scroller by key event.
+        /// </summary>
+        public int HorizontalStepSize
+        {
+            get
+            {
+                int h, v;
+                Interop.Elementary.elm_scroller_step_size_get(RealHandle, out h, out v);
+                return h;
+            }
+            set
+            {
+                int v = VerticalStepSize;
+                Interop.Elementary.elm_scroller_step_size_set(RealHandle, value, v);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the step size to move scroller by key event.
+        /// </summary>
+        public int VerticalStepSize
+        {
+            get
+            {
+                int h, v;
+                Interop.Elementary.elm_scroller_step_size_get(RealHandle, out h, out v);
+                return v;
+            }
+            set
+            {
+                int h = HorizontalStepSize;
+                Interop.Elementary.elm_scroller_step_size_set(RealHandle, h, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets a value whether mouse wheel is enabled or not over the scroller.
+        /// </summary>
+        public bool WheelDisabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_scroller_wheel_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_scroller_wheel_disabled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the type of single direction scroll.
+        /// </summary>
+        public ScrollSingleDirection SingleDirection
+        {
+            get
+            {
+                return (ScrollSingleDirection)Interop.Elementary.elm_scroller_single_direction_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_scroller_single_direction_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the scroller minimum size limited to the minimum size of the content.
+        /// By default the scroller will be as small as its design allows, irrespective of its content.
+        /// This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
+        /// </summary>
+        /// <param name="horizontal">Enable limiting minimum size horizontally</param>
+        /// <param name="vertical">Enable limiting minimum size vertically</param>
+        public void MinimumLimit(bool horizontal, bool vertical)
+        {
+            Interop.Elementary.elm_scroller_content_min_limit(RealHandle, horizontal, vertical);
+        }
+
+        /// <summary>
+        /// Sets the page size to an absolute fixed value, with 0 turning it off for that axis.
+        /// </summary>
+        /// <param name="width">The horizontal page size.</param>
+        /// <param name="height">The vertical page size.</param>
+        public void SetPageSize(int width, int height)
+        {
+            Interop.Elementary.elm_scroller_page_size_set(RealHandle, width, height);
+        }
+
+        /// <summary>
+        /// Sets the scroll page size relative to the viewport size.
+        /// </summary>
+        /// <remarks>
+        /// The scroller is capable of limiting scrolling by the user to "pages".
+        /// That is to jump by and only show a "whole page" at a time as if the continuous area of the scroller
+        /// content is split into page sized pieces. This sets the size of a page relative to the viewport of the scroller.
+        /// 1.0 is "1 viewport" which is the size (horizontally or vertically). 0.0 turns it off in that axis.
+        /// This is mutually exclusive with the page size (see elm_scroller_page_size_set() for more information).
+        /// Likewise 0.5 is "half a viewport". Usable values are normally between 0.0 and 1.0 including 1.0.
+        /// If you only want 1 axis to be page "limited", use 0.0 for the other axis.
+        /// </remarks>
+        /// <param name="width">The horizontal page relative size.</param>
+        /// <param name="height">The vertical page relative size.</param>
+        public void SetPageSize(double width, double height)
+        {
+            Interop.Elementary.elm_scroller_page_relative_set(RealHandle, width, height);
+        }
+
+        /// <summary>
+        /// Shows a specific virtual region within the scroller content object by the page number.
+        /// (0, 0) of the indicated page is located at the top-left corner of the viewport.
+        /// </summary>
+        /// <param name="horizontalPageIndex">The horizontal page number.</param>
+        /// <param name="verticalPageIndex">The vertical page number.</param>
+        /// <param name="animated">True means slider with animation.</param>
+        public void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated)
+        {
+            if (animated)
+            {
+                Interop.Elementary.elm_scroller_page_bring_in(RealHandle, horizontalPageIndex, verticalPageIndex);
+            }
+            else
+            {
+                Interop.Elementary.elm_scroller_page_show(RealHandle, horizontalPageIndex, verticalPageIndex);
+            }
+        }
+
+        /// <summary>
+        /// Shows a specific virtual region within the scroller content object.
+        /// </summary>
+        /// <remarks>
+        /// This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0)
+        /// starting at the top-left of the virtual content object) is shown within the scroller.
+        /// If set "animated" to true, it will allows the scroller to "smoothly slide" to this location
+        /// (if configuration in general calls for transitions).
+        /// It may not jump immediately to the new location and may take a while and show other content along the way.
+        /// </remarks>
+        /// <param name="region">Rect struct of region.</param>
+        /// <param name="animated">True means allows the scroller to "smoothly slide" to this location.</param>
+        public void ScrollTo(Rect region, bool animated)
+        {
+            if (animated)
+            {
+                Interop.Elementary.elm_scroller_region_bring_in(RealHandle, region.X, region.Y, region.Width, region.Height);
+            }
+            else
+            {
+                Interop.Elementary.elm_scroller_region_show(RealHandle, region.X, region.Y, region.Width, region.Height);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_scroller_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Size.cs b/src/ElmSharp/ElmSharp/Size.cs
new file mode 100755 (executable)
index 0000000..c2af5e2
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Size is a struct that defining height and width as a pair of generic type.
+    /// </summary>
+    public struct Size : IEquatable<Size>
+    {
+        /// <summary>
+        /// Magnitude along the horizontal axis, in platform-defined units.
+        /// </summary>
+        public int Width;
+
+        /// <summary>
+        /// Magnitude along the vertical axis, in platform-specific units.
+        /// </summary>
+        public int Height;
+
+        /// <summary>
+        /// Initializes a new instance of the Size structure from the specified dimensions.
+        /// </summary>
+        /// <param name="width">The width to set</param>
+        /// <param name="height">The height to set</param>
+        public Size(int width, int height)
+        {
+            Width = width;
+            Height = height;
+        }
+
+        /// <summary>
+        /// A human-readable representation of the <see cref="T:Tizen.UI.Size" />.
+        /// </summary>
+        /// <returns>The string is formatted as "{{Width={0} Height={1}}}".</returns>
+        public override string ToString()
+        {
+            return string.Format("{{Width={0} Height={1}}}", Width, Height);
+        }
+
+        public override int GetHashCode()
+        {
+            unchecked
+            {
+                return Width.GetHashCode() ^ (Height.GetHashCode() * 397);
+            }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is Size))
+                return false;
+
+            return Equals((Size)obj);
+        }
+
+        public bool Equals(Size other)
+        {
+            return Width.Equals(other.Width) && Height.Equals(other.Height);
+        }
+
+        /// <summary>
+        /// Whether the two <see cref="T:Tizen.UI.Size" />s are equal.
+        /// </summary>
+        /// <param name="s1">A <see cref="T:Tizen.UI.Size" /> on the left hand side.</param>
+        /// <param name="s2">A <see cref="T:Tizen.UI.Size" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Size" />s have equal values.</returns>
+        public static bool operator ==(Size s1, Size s2)
+        {
+            return s1.Equals(s2);
+        }
+
+        /// <summary>
+        /// Whether two <see cref="T:Tizen.UI.Size" />s are not equal.
+        /// </summary>
+        /// <param name="s1">A <see cref="T:Tizen.UI.Size" /> on the left hand side.</param>
+        /// <param name="s2">A <see cref="T:Tizen.UI.Size" /> on the right hand side.</param>
+        /// <returns>True if the two <see cref="T:Tizen.UI.Size" />s do not have equal values.</returns>
+        public static bool operator !=(Size s1, Size s2)
+        {
+            return !s1.Equals(s2);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Slider.cs b/src/ElmSharp/ElmSharp/Slider.cs
new file mode 100755 (executable)
index 0000000..41fb507
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the Slider's indicator visiblity mode.
+    /// </summary>
+    public enum SliderIndicatorVisibleMode
+    {
+        /// <summary>
+        /// Show indicator on mouse down or change in slider value.
+        /// </summary>
+        Default,
+
+        /// <summary>
+        /// Always show the indicator.
+        /// </summary>
+        Always,
+
+        /// <summary>
+        /// Show the indicator on focus.
+        /// </summary>
+        OnFocus,
+
+        /// <summary>
+        /// Never show the indicator.
+        /// </summary>
+        None,
+    }
+
+    /// <summary>
+    /// The Slider is a widget that adds a draggable slider widget for selecting the value of something within a range.
+    /// </summary>
+    public class Slider : Layout
+    {
+        double _minimum = 0.0;
+        double _maximum = 1.0;
+
+        SmartEvent _changed;
+        SmartEvent _delayedChanged;
+        SmartEvent _dragStarted;
+        SmartEvent _dragStopped;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Slider class.
+        /// </summary>
+        /// <param name="parent">The <see cref="EvasObject"/> to which the new Slider will be attached as a child.</param>
+        public Slider(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+            _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
+            _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+
+            _dragStarted = new SmartEvent(this, this.RealHandle, "slider,drag,start");
+            _dragStarted.On += (s, e) => DragStarted?.Invoke(this, EventArgs.Empty);
+
+            _dragStopped = new SmartEvent(this, this.RealHandle, "slider,drag,stop");
+            _dragStopped.On += (s, e) => DragStopped?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// ValueChanged will be triggered when the Slider value is changed by the user.
+        /// </summary>
+        public event EventHandler ValueChanged;
+
+        /// <summary>
+        /// DelayedValueChanged will be triggered when a short time after the value is changed by the user.
+        /// This will be called only when the user stops dragging for a very short period or when they release their finger/mouse,
+        /// so it avoids possibly expensive reactions to the value change.
+        /// </summary>
+        public event EventHandler DelayedValueChanged;
+
+        /// <summary>
+        /// DragStarted will be triggered when dragging the Slider indicator around has started.
+        /// </summary>
+        public event EventHandler DragStarted;
+
+        /// <summary>
+        /// DragStopped will be triggered when dragging the Slider indicator around has stopped.
+        /// </summary>
+        public event EventHandler DragStopped;
+
+        /// <summary>
+        /// Sets or gets the (exact) length of the bar region of a given Slider widget.
+        /// </summary>
+        /// <remarks>
+        /// This sets the minimum width (when in the horizontal mode) or height (when in the vertical mode)
+        /// of the actual bar area of the slider obj. This in turn affects the object's minimum size.
+        /// Use this when you're not setting other size hints expanding on the given direction
+        /// (like weight and alignment hints), and you would like it to have a specific size.
+        /// </remarks>
+        public int SpanSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_span_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_span_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the format string for the indicator label.
+        /// </summary>
+        /// <remarks>
+        /// The slider may display its value somewhere other than the unit label,
+        /// for example, above the slider knob that is dragged around. This function sets the format string
+        /// used for this.If NULL, the indicator label won't be visible. If not, it sets the format string
+        /// for the label text. For the label text floating point value is provided, so the label text can
+        /// display up to 1 floating point value. Note that this is optional.Use a format string
+        /// such as "%1.2f meters" for example, and it displays values like: "3.14 meters" for a value
+        /// equal to 3.14159.By default, the indicator label is disabled.
+        /// </remarks>
+        public string IndicatorFormat
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_indicator_format_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_indicator_format_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the orientation of a given slider widget.
+        /// </summary>
+        /// <remarks>
+        /// The orientation may be vertically or horizontally.By default, it's displayed horizontally.
+        /// </remarks>
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum values for the slider.
+        /// </summary>
+        /// <remarks>
+        /// This defines the allowed minimum values to be selected by the user.
+        /// If the actual value is less than min, it is updated to min.
+        /// Actual value can be obtained with Value.By default, min is equal to 0.0.
+        /// </remarks>
+        public double Minimum
+        {
+            get
+            {
+                return _minimum;
+            }
+            set
+            {
+                _minimum = value;
+                Interop.Elementary.elm_slider_min_max_set(RealHandle, _minimum, _maximum);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum values for the slider.
+        /// </summary>
+        /// <remarks>
+        /// This defines the allowed maximum values to be selected by the user.
+        /// If the actual value is bigger then max, it is updated to max.
+        /// Actual value can be obtained with Value.By default, min is equal to 0.0, and max is equal to 1.0.
+        /// Maximum must be greater than minimum, otherwise the behavior is undefined.
+        /// </remarks>
+        public double Maximum
+        {
+            get
+            {
+                return _maximum;
+            }
+            set
+            {
+                _maximum = value;
+                Interop.Elementary.elm_slider_min_max_set(RealHandle, _minimum, _maximum);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the value displayed by the slider.
+        /// </summary>
+        /// <remarks>
+        /// Value will be presented on the unit label following format specified with UnitFormat and
+        /// on indicator with IndicatorFormat.The value must to be between Minimum and Maximum values.
+        /// </remarks>
+        public double Value
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_value_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the step by which the slider indicator moves.
+        /// </summary>
+        /// <remarks>
+        /// This value is used when the draggable object is moved automatically i.e.,
+        /// in case of a key event when up/down/left/right key is pressed or in case accessibility
+        /// is set and the flick event is used to inc/dec slider values.
+        /// By default, the step value is equal to 0.05.
+        /// </remarks>
+        public double Step
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_step_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_step_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets whether a given slider widget's displaying values are inverted.
+        /// </summary>
+        /// <remarks>
+        /// A slider may be inverted, in which case it gets its values inverted,
+        /// with high values being on the left or top and low values on the right or bottom,
+        /// as opposed to normally have the low values on the former and high values on the latter,
+        /// respectively, for the horizontal and vertical modes.
+        /// </remarks>
+        public bool IsInverted
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_inverted_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_inverted_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether to enlarge the slider indicator (augmented knob).
+        /// </summary>
+        /// <remarks>
+        /// By default, the indicator is bigger when dragged by the user.
+        /// It won't display values set with IndicatorFormat if you disable the indicator.
+        /// </remarks>
+        public bool IsIndicatorVisible
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_indicator_show_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_indicator_show_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the visible mode of slider indicator.
+        /// </summary>
+        public SliderIndicatorVisibleMode IndicatorVisibleMode
+        {
+            get
+            {
+                return (SliderIndicatorVisibleMode)Interop.Elementary.elm_slider_indicator_visible_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_indicator_visible_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether to Show the indicator of slider on focus.
+        /// </summary>
+        public bool IsIndicatorFocusable
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_indicator_show_on_focus_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_indicator_show_on_focus_set(RealHandle, value);
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_slider_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/SmartEvent.cs b/src/ElmSharp/ElmSharp/SmartEvent.cs
new file mode 100755 (executable)
index 0000000..6edbb7a
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// It inherits <see cref="IInvalidatable"/>.
+    /// The event with TEventArgs for <see cref="EvasObject"/>.
+    /// EvasObject can elect SmartEvent occurring inside of them to be reported back to their users via delegates.
+    /// This way, you can extend EvasObject's own <see cref="EvasObjectEvent"/>.
+    /// They are defined by an event string, which identifies them uniquely.
+    /// </summary>
+    /// <typeparam name="TEventArgs">The parameter for the event.</typeparam>
+    public class SmartEvent<TEventArgs> : IInvalidatable where TEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The delegate for creating smart event item args.
+        /// </summary>
+        /// <param name="data">The item data.</param>
+        /// <param name="obj">The sender obj.</param>
+        /// <param name="info">The item sender obj.</param>
+        /// <returns>Return smart event item args.</returns>
+        public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info);
+
+        private EvasObject _sender;
+        private readonly string _eventName;
+        private IntPtr _handle;
+        private readonly SmartEventInfoParser _parser;
+        private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the SmartEvent class.
+        /// </summary>
+        /// <param name="sender">The source of the event.</param>
+        /// <param name="eventName">The event name.</param>
+        /// <param name="parser">The event parameter.</param>
+        public SmartEvent(EvasObject sender, string eventName, SmartEventInfoParser parser) : this(sender, sender.Handle, eventName, parser)
+        {
+        }
+
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        public SmartEvent(EvasObject sender, IntPtr handle, string eventName, SmartEventInfoParser parser)
+        {
+            _sender = sender;
+            _eventName = eventName;
+            _handle = handle;
+            _parser = parser;
+            sender.AddToEventLifeTracker(this);
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the SmartEvent class.
+        /// </summary>
+        /// <param name="sender">The source of the event.</param>
+        /// <param name="eventName">The event name.</param>
+        public SmartEvent(EvasObject sender, string eventName) : this(sender, eventName, null)
+        {
+        }
+
+        ~SmartEvent()
+        {
+            Dispose(false);
+        }
+
+        private struct NativeCallback
+        {
+            public Interop.Evas.SmartCallback callback;
+            public EventHandler<TEventArgs> eventHandler;
+        }
+
+        /// <summary>
+        /// Adds or removes delegate for event.
+        /// </summary>
+        public event EventHandler<TEventArgs> On
+        {
+            add
+            {
+                if (_handle == IntPtr.Zero)
+                {
+                    return;
+                }
+                EventHandler<TEventArgs> handler = value;
+                var cb = new Interop.Evas.SmartCallback((d, o, e) =>
+                {
+                    TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(d, o, e);
+                    handler(_sender, ea);
+                });
+                _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+                int i = _nativeCallbacks.Count - 1;
+                Interop.Evas.evas_object_smart_callback_add(_handle, _eventName, _nativeCallbacks[i].callback, IntPtr.Zero);
+            }
+
+            remove
+            {
+                if (_handle == IntPtr.Zero)
+                {
+                    return;
+                }
+                EventHandler<TEventArgs> handler = value;
+                var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+                foreach (var cb in callbacks)
+                {
+                    Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+                }
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Make current instance invalidate.
+        /// </summary>
+        public void MakeInvalidate()
+        {
+            _sender = null;
+            _handle = IntPtr.Zero;
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                // Place holder to dispose managed state (managed objects).
+            }
+            if (_handle != IntPtr.Zero)
+            {
+                foreach (var cb in _nativeCallbacks)
+                {
+                    Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+                }
+            }
+            _nativeCallbacks.Clear();
+        }
+    }
+
+    /// <summary>
+    /// It inherits <see cref="IInvalidatable"/>.
+    /// EvasObject can elect SmartEvent occurring inside of them to be reported back to their users via delegates.
+    /// This way, you can extend EvasObject's own <see cref="EvasObjectEvent"/>.
+    /// They are defined by an event string, which identifies them uniquely.
+    /// </summary>
+    /// <typeparam name="TEventArgs">The parameter for the event.</typeparam>
+    public class SmartEvent : IInvalidatable
+    {
+        private SmartEvent<EventArgs> _smartEvent;
+        private event EventHandler _handlers;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the SmartEvent class.
+        /// </summary>
+        /// <param name="sender">The source of the event.</param>
+        /// <param name="eventName">The event name.</param>
+        public SmartEvent(EvasObject sender, string eventName) : this(sender, sender.RealHandle, eventName)
+        {
+        }
+
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        public SmartEvent(EvasObject sender, IntPtr handle, string eventName)
+        {
+            _smartEvent = new SmartEvent<EventArgs>(sender, handle, eventName, null);
+        }
+
+        ~SmartEvent()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Adds or removes delegate for event.
+        /// </summary>
+        public event EventHandler On
+        {
+            add
+            {
+                if (_handlers == null)
+                {
+                    _smartEvent.On += SendEvent;
+                }
+                _handlers += value;
+            }
+
+            remove
+            {
+                _handlers -= value;
+                if (_handlers == null)
+                {
+                    _smartEvent.On -= SendEvent;
+                }
+            }
+        }
+
+        private void SendEvent(object sender, EventArgs e)
+        {
+            _handlers?.Invoke(sender, e);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Make current instance invalidate.
+        /// </summary>
+        public void MakeInvalidate()
+        {
+            _smartEvent.MakeInvalidate();
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                // Place holder to dispose managed state (managed objects).
+                _smartEvent.Dispose();
+            }
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Spinner.cs b/src/ElmSharp/ElmSharp/Spinner.cs
new file mode 100755 (executable)
index 0000000..e6a12e6
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Spinner is a widget that increase or decrease numeric values using arrow buttons, or edit values directly.
+    /// Inherits <see cref="Layout"/>.
+    /// </summary>
+    public class Spinner : Layout
+    {
+        double _minimum = 0.0;
+        double _maximum = 100.0;
+
+        SmartEvent _changed;
+        SmartEvent _delayedChanged;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Spinner class.
+        /// </summary>
+        /// <param name="parent">The parent of new Spinner instance</param>
+        public Spinner(EvasObject parent) : base(parent)
+        {
+            _changed = new SmartEvent(this, this.RealHandle, "changed");
+            _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+            _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
+            _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// ValueChanged will be triggered whenever the spinner value is changed.
+        /// </summary>
+        public event EventHandler ValueChanged;
+
+        /// <summary>
+        ///  DelayedValueChanged will be triggered after a short time when the value is changed.
+        /// </summary>
+        public event EventHandler DelayedValueChanged;
+
+        /// <summary>
+        /// Sets or gets the label format of the spinner.
+        /// </summary>
+        public string LabelFormat
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_label_format_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_label_format_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the minimum value for the spinner.
+        /// </summary>
+        public double Minimum
+        {
+            get
+            {
+                return _minimum;
+            }
+            set
+            {
+                _minimum = value;
+                Interop.Elementary.elm_spinner_min_max_set(RealHandle, _minimum, _maximum);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the maximum value for the spinner.
+        /// </summary>
+        public double Maximum
+        {
+            get
+            {
+                return _maximum;
+            }
+            set
+            {
+                _maximum = value;
+                Interop.Elementary.elm_spinner_min_max_set(RealHandle, _minimum, _maximum);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the step that used to increment or decrement the spinner value.
+        /// </summary>
+        public double Step
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_step_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_step_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value displayed by the spinner.
+        /// </summary>
+        public double Value
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_value_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_value_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the interval on time updates for an user mouse button hold on spinner widgets' arrows.
+        /// </summary>
+        public double Interval
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_interval_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_interval_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the base for rounding.
+        /// </summary>
+        public double RoundBase
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_base_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_base_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the round value for rounding.
+        /// </summary>
+        public int RoundValue
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_round_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_round_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the wrap of a given spinner widget.
+        /// </summary>
+        /// <remarks>
+        /// If wrap is disabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the maximum value.
+        /// If wrap is enabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the minimum value.
+        /// By default it's disabled.
+        /// </remarks>
+        public bool IsWrapEnabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_wrap_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_wrap_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the spinner can be directly edited by the user or not.
+        /// </summary>
+        /// <remarks>By default it is enabled</remarks>
+        public bool IsEditable
+        {
+            get
+            {
+                return Interop.Elementary.elm_spinner_editable_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_spinner_editable_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Set a special string to display in the place of the numerical value.
+        /// </summary>
+        /// <param name="value">The numerical value to be replaced</param>
+        /// <param name="label">The label to be used</param>
+        public void AddSpecialValue(double value, string label)
+        {
+            Interop.Elementary.elm_spinner_special_value_add(RealHandle, value, label);
+        }
+
+        /// <summary>
+        /// Remove a previously added special value, After this, the spinner will display the value itself instead of a label.
+        /// </summary>
+        /// <param name="value">The replaced numerical value</param>
+        public void RemoveSpecialValue(double value)
+        {
+            Interop.Elementary.elm_spinner_special_value_del(RealHandle, value);
+        }
+
+        /// <summary>
+        /// Get the special string display in the place of the numerical value.
+        /// </summary>
+        /// <param name="value">The replaced numerical value.</param>
+        /// <returns>The value of the spinner which replaced numerical value with special string</returns>
+        public string GetSpecialValue(double value)
+        {
+            return Interop.Elementary.elm_spinner_special_value_get(RealHandle, value);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_spinner_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Table.cs b/src/ElmSharp/ElmSharp/Table.cs
new file mode 100755 (executable)
index 0000000..707a34b
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The Table is a container widget to arrange other widgets in a table where items can span multiple columns or rows .
+    /// Inherits <see cref="Container"/>.
+    /// </summary>
+    public class Table : Container
+    {
+        int _paddingX = 0;
+        int _paddingY = 0;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Table class.
+        /// </summary>
+        /// <param name="parent">
+        /// A <see cref="EvasObject"/> to which the new Table instance will be attached.
+        /// </param>
+        public Table(EvasObject parent) : base(parent)
+        {
+        }
+
+        /// <summary>
+        /// Sets or gets whether the layout of this table is homogeneous.
+        /// </summary>
+        /// <remarks>True for homogeneous, False for no homogeneous</remarks>
+        public bool Homogeneous
+        {
+            get
+            {
+                return Interop.Elementary.elm_table_homogeneous_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_table_homogeneous_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the horizontal padding between the cells.
+        /// </summary>
+        public int PaddingX
+        {
+            get
+            {
+                return _paddingX;
+            }
+            set
+            {
+                _paddingX = value;
+                Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the vertical padding between the cells.
+        /// </summary>
+        public int PaddingY
+        {
+            get
+            {
+                return _paddingY;
+            }
+            set
+            {
+                _paddingY = value;
+                Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY);
+            }
+        }
+        /// <summary>
+        /// Adds a subobject on the table with the coordinates passed.
+        /// </summary>
+        /// <param name="obj">The subobject to be added to the table</param>
+        /// <param name="col">The column number</param>
+        /// <param name="row">The row number</param>
+        /// <param name="colspan">The column span</param>
+        /// <param name="rowspan">The row span</param>
+        public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan)
+        {
+            if (obj == null)
+                throw new ArgumentNullException("obj");
+            Interop.Elementary.elm_table_pack(RealHandle, obj, col, row, colspan, rowspan);
+            AddChild(obj);
+        }
+
+        /// <summary>
+        /// Removes the child from the table.
+        /// </summary>
+        /// <param name="obj">The subobject</param>
+        public void Unpack(EvasObject obj)
+        {
+            if (obj == null)
+                throw new ArgumentNullException("obj");
+            Interop.Elementary.elm_table_unpack(RealHandle, obj);
+            RemoveChild(obj);
+        }
+
+        /// <summary>
+        /// Removes all child objects from a table object.
+        /// </summary>
+        public void Clear()
+        {
+            Interop.Elementary.elm_table_clear(RealHandle, false);
+            ClearChildren();
+        }
+
+        /// <summary>
+        /// Sets the color for particular part of the table.
+        /// </summary>
+        /// <param name="part">The name of part class</param>
+        /// <param name="color">The color</param>
+        public override void SetPartColor(string part, Color color)
+        {
+            Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255,
+                                                                              color.G * color.A / 255,
+                                                                              color.B * color.A / 255,
+                                                                              color.A);
+        }
+
+        /// <summary>
+        /// Gets the color of particular part of the table.
+        /// </summary>
+        /// <param name="part">The name of part class, it could be 'bg', 'elm.swllow.content'</param>
+        /// <returns>The color of the particular part</returns>
+        public override Color GetPartColor(string part)
+        {
+            int r, g, b, a;
+            Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a);
+            return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+            RealHandle = Interop.Elementary.elm_table_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Toolbar.cs b/src/ElmSharp/ElmSharp/Toolbar.cs
new file mode 100644 (file)
index 0000000..0370594
--- /dev/null
@@ -0,0 +1,463 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the selection mode of Toolbar.
+    /// </summary>
+    public enum ToolbarSelectionMode
+    {
+        /// <summary>
+        /// Default select mode.
+        /// </summary>
+        Default = 0,
+
+        /// <summary>
+        /// Always select mode.
+        /// </summary>
+        Always,
+
+        /// <summary>
+        /// No select mode.
+        /// </summary>
+        None,
+
+        /// <summary>
+        /// No select mode with no finger size rule.
+        /// </summary>
+        DisplayOnly,
+    }
+
+    /// <summary>
+    /// Enumeration that sets the toolbar items display behavior, it can be scrollable, can show a menu with exceeding items, or simply hide them.
+    /// </summary>
+    public enum ToolbarShrinkMode
+    {
+        /// <summary>
+        /// Sets minimum toolbar size to fit all the items.
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// Hides exceeding items.
+        /// </summary>
+        Hide,
+
+        /// <summary>
+        /// Allows accessing exceeding items through a scroller.
+        /// </summary>
+        Scroll,
+
+        /// <summary>
+        /// Inserts a button to pop up a menu with exceeding items.
+        /// </summary>
+        Menu,
+
+        /// <summary>
+        /// Expands all items according to the size of the toolbar.
+        /// </summary>
+        Expand
+    }
+
+    /// <summary>
+    /// Enumeration for the icon lookup order of Toolbar.
+    /// </summary>
+    public enum ToolbarIconLookupOrder
+    {
+        /// <summary>
+        /// Icon look up order: freedesktop, theme.
+        /// </summary>
+        FreedesktopTheme,
+
+        /// <summary>
+        /// Icon look up order: theme, freedesktop.
+        /// </summary>
+        ThemeFreedesktop,
+
+        /// <summary>
+        /// Icon look up order: freedesktop.
+        /// </summary>
+        Freedesktop,
+
+        /// <summary>
+        /// Icon look up order: theme.
+        /// </summary>
+        Theme,
+    }
+
+    /// <summary>
+    /// Event arguments for events of <see cref="ToolbarItem"/>.
+    /// </summary>
+    /// <remarks>
+    /// Inherits EventArgs.
+    /// </remarks>
+    public class ToolbarItemEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the ToolbarItem.
+        /// </summary>
+        public ToolbarItem Item { get; private set; }
+
+        internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+        {
+            ToolbarItem item = ItemObject.GetItemByHandle(info) as ToolbarItem;
+            return new ToolbarItemEventArgs() { Item = item };
+        }
+    }
+
+    /// <summary>
+    /// The Toolbar is a widget that displays a list of items inside a box.
+    /// </summary>
+    public class Toolbar : Widget
+    {
+        SmartEvent<ToolbarItemEventArgs> _clicked;
+        SmartEvent<ToolbarItemEventArgs> _selected;
+        SmartEvent<ToolbarItemEventArgs> _longpressed;
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Toolbar class.
+        /// </summary>
+        /// <param name="parent">
+        /// A EvasObject to which the new Table instance will be attached.
+        /// </param>
+        public Toolbar(EvasObject parent) : base(parent)
+        {
+            _selected = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent);
+            _selected.On += (s, e) =>
+            {
+                if (e.Item != null)
+                {
+                    Selected?.Invoke(this, e);
+                    e.Item.SendSelected();
+                }
+            };
+            _longpressed = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "longpressed", ToolbarItemEventArgs.CreateFromSmartEvent);
+            _longpressed.On += (s, e) =>
+            {
+                e.Item?.SendLongPressed();
+            };
+            _clicked = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "clicked", ToolbarItemEventArgs.CreateFromSmartEvent);
+            _clicked.On += (s, e) =>
+            {
+                e.Item?.SendClicked();
+            };
+        }
+
+        /// <summary>
+        /// Selected will be triggered when toolbar have been selected.
+        /// </summary>
+        public event EventHandler<ToolbarItemEventArgs> Selected;
+
+        /// <summary>
+        /// Sets or gets whether the layout of this toolbar is homogeneous.
+        /// </summary>
+        /// <remarks>True for homogeneous, False for no homogeneous</remarks>
+        public bool Homogeneous
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_homogeneous_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_homogeneous_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the slection mode of a given Toolbar widget.
+        /// </summary>
+        public ToolbarSelectionMode SelectionMode
+        {
+            get
+            {
+                return (ToolbarSelectionMode)Interop.Elementary.elm_toolbar_select_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_select_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the shrink mode of a given Toolbar widget.
+        /// </summary>
+        public ToolbarShrinkMode ShrinkMode
+        {
+            get
+            {
+                return (ToolbarShrinkMode)Interop.Elementary.elm_toolbar_shrink_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_shrink_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsHorizontal
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_horizontal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_horizontal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the icon lookup order, for toolbar items' icons.
+        /// The default lookup order is ToolbarIocnLookupOrder.ThemeFreedesktop.
+        /// Icons added before calling this function will not be affected.
+        /// </summary>
+        public ToolbarIconLookupOrder IconLookupOrder
+        {
+            get
+            {
+                return (ToolbarIconLookupOrder)Interop.Elementary.elm_toolbar_icon_order_lookup_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_icon_order_lookup_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the icon size of a given toolbar widget.
+        /// Default value is 32 pixels, to be used by toolbar items.
+        /// </summary>
+        public int IconSize
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_icon_size_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_icon_size_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets the number of items in a toolbar widget.
+        /// </summary>
+        public int ItemsCount
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_items_count(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the alignment of the items.
+        /// </summary>
+        /// <remarks>The toolbar items alignment, a float between 0.0 and 1.0</remarks>
+        public double ItemAlignment
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_align_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_align_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the item's transverse expansion of a given toolbar widget.
+        /// </summary>
+        /// <remarks>
+        /// The transverse expansion of the item, true for on and false for off.
+        /// By default it's false.
+        /// </remarks>
+        public bool TransverseExpansion
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_transverse_expanded_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_transverse_expanded_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Appends ToolbarItem which just contains label to the toolbar.
+        /// </summary>
+        /// <param name="label">The label of the item</param>
+        /// <returns>The new ToolbarItem which appended to the toolbar</returns>
+        /// <seealso cref="Append(string, string)"/>
+        /// <seealso cref="Prepend(string)"/>
+        public ToolbarItem Append(string label)
+        {
+            return Append(label, null);
+        }
+
+        /// <summary>
+        /// Appends ToolbarItem which contains label and icon to the toolbar.
+        /// </summary>
+        /// <param name="label">The label of the item</param>
+        /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+        /// <returns>The new ToolbarItem which appended to the toolbar</returns>
+        /// <seealso cref="Append(string)"/>
+        /// <seealso cref="Prepend(string)"/>
+        /// <seealso cref="Prepend(string, string)"/>
+        public ToolbarItem Append(string label, string icon)
+        {
+            ToolbarItem item = new ToolbarItem(label, icon);
+            item.Handle = Interop.Elementary.elm_toolbar_item_append(RealHandle, icon, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Prepends ToolbarItem which just contains label to the toolbar.
+        /// </summary>
+        /// <param name="label">The label of the item</param>
+        /// <returns>The new ToolbarItem which prepended to the toolbar</returns>
+        /// <seealso cref="Append(string)"/>
+        /// <seealso cref="Append(string, string)"/>
+        /// <seealso cref="Prepend(string, string)"/>
+        public ToolbarItem Prepend(string label)
+        {
+            return Prepend(label, null);
+        }
+
+        /// <summary>
+        /// Prepends ToolbarItem which contains label and icon to the toolbar.
+        /// </summary>
+        /// <param name="label">The label of the item</param>
+        /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+        /// <returns>The new <see cref="ToolbarItem"/> which prepended to the toolbar</returns>
+        /// <seealso cref="Append(string)"/>
+        /// <seealso cref="Append(string, string)"/>
+        /// <seealso cref="Prepend(string)"/>
+        public ToolbarItem Prepend(string label, string icon)
+        {
+            ToolbarItem item = new ToolbarItem(label, icon);
+            item.Handle = Interop.Elementary.elm_toolbar_item_prepend(RealHandle, icon, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts a new item which just contains label into the toolbar object before item <paramref name="before"/>.
+        /// </summary>
+        /// <param name="before">The toolbar item to insert before</param>
+        /// <param name="label">The label of the item</param>
+        /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
+        /// <seealso cref="InsertBefore(ToolbarItem, string, string)"/>
+        public ToolbarItem InsertBefore(ToolbarItem before, string label)
+        {
+            return InsertBefore(before, label, string.Empty);
+        }
+
+        /// <summary>
+        /// Inserts a new item which contains label and icon into the toolbar object before item <paramref name="before"/>.
+        /// </summary>
+        /// <param name="before">The toolbar item to insert before</param>
+        /// <param name="label">The label of the item</param>
+        /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+        /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
+        /// <seealso cref="InsertBefore(ToolbarItem, string)"/>
+        public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon)
+        {
+            ToolbarItem item = new ToolbarItem(label, icon);
+            item.Handle = Interop.Elementary.elm_toolbar_item_insert_before(RealHandle, before, icon, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Inserts a new item which contains label and icon into the toolbar object after item <paramref name="after"/>.
+        /// </summary>
+        /// <param name="after">The toolbar item to insert after</param>
+        /// <param name="label">The label of the item</param>
+        /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+        /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
+        /// <seealso cref="InsertAfter(ToolbarItem, string)"/>
+        public ToolbarItem InsertAfter(ToolbarItem after, string label, string icon)
+        {
+            ToolbarItem item = new ToolbarItem(label, icon);
+            item.Handle = Interop.Elementary.elm_toolbar_item_insert_after(RealHandle, after, icon, label, null, (IntPtr)item.Id);
+            return item;
+        }
+
+        /// <summary>
+        /// Find the item with that label in the toolbar.
+        /// </summary>
+        /// <param name="label">The label of the item</param>
+        /// <returns>The <see cref="ToolbarItem"/> into the toolbar</returns>
+        public ToolbarItem FindItemByLabel(string label)
+        {
+            IntPtr handle = Interop.Elementary.elm_toolbar_item_find_by_label(RealHandle, label);
+            return ItemObject.GetItemByHandle(handle) as ToolbarItem;
+        }
+
+        /// <summary>
+        /// Gets the selected ToolbarItemItem of the toolbar.
+        /// </summary>
+        public ToolbarItem SelectedItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_toolbar_selected_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as ToolbarItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the first ToolbarItemItem of the toolbar.
+        /// </summary>
+        public ToolbarItem FirstItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_toolbar_first_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as ToolbarItem;
+            }
+        }
+
+        /// <summary>
+        /// Gets the last ToolbarItemItem of the toolbar.
+        /// </summary>
+        public ToolbarItem LastItem
+        {
+            get
+            {
+                IntPtr handle = Interop.Elementary.elm_toolbar_last_item_get(RealHandle);
+                return ItemObject.GetItemByHandle(handle) as ToolbarItem;
+            }
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
+            Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
+
+            RealHandle = Interop.Elementary.elm_toolbar_add(handle);
+            Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
+
+            return handle;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/ToolbarItem.cs b/src/ElmSharp/ElmSharp/ToolbarItem.cs
new file mode 100755 (executable)
index 0000000..072baab
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The ToolbarItem is a item of Toolbar.
+    /// </summary>
+    public class ToolbarItem : ItemObject
+    {
+        string _icon;
+        string _text;
+        internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
+        {
+            _text = text;
+            _icon = icon;
+        }
+
+        /// <summary>
+        /// Sets or gets the icon path of the item.
+        /// </summary>
+        public string Icon
+        {
+            get
+            {
+                return _icon;
+            }
+            set
+            {
+                _icon = value;
+                Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the text string of the item.
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return _text;
+            }
+            set
+            {
+                _text = value;
+                SetPartText(null, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the enable of the item.
+        /// </summary>
+        [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")]
+        public bool Enabled
+        {
+            get
+            {
+                return IsEnabled;
+            }
+            set
+            {
+                IsEnabled = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether displaying the item as a separator.
+        /// </summary>
+        /// <remarks>Items aren't set as a separator by default. If set as a separator it displays a separator theme, so it won't display icons or labels.</remarks>
+        public bool IsSeparator
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether the item is selected.
+        /// </summary>
+        public bool IsSelected
+        {
+            get
+            {
+                return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Selected will be triggered when the item is selected.
+        /// </summary>
+        public event EventHandler Selected;
+
+        /// <summary>
+        /// LongPressed will be triggered when the item is pressed long time.
+        /// </summary>
+        public event EventHandler LongPressed;
+
+        /// <summary>
+        /// Clicked will be triggered when the item is clicked.
+        /// </summary>
+        public event EventHandler Clicked;
+
+        internal void SendSelected()
+        {
+            Selected?.Invoke(this, EventArgs.Empty);
+        }
+        internal void SendLongPressed()
+        {
+            LongPressed?.Invoke(this, EventArgs.Empty);
+        }
+        internal void SendClicked()
+        {
+            Clicked?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/Transit.cs b/src/ElmSharp/ElmSharp/Transit.cs
new file mode 100755 (executable)
index 0000000..8ee276a
--- /dev/null
@@ -0,0 +1,386 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using static Interop.Elementary;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Transit is designed to apply various animated transition effects, such like translation, rotation, etc.
+    /// For using these effects, create an Transit and add the desired transition effects.
+    /// </summary>
+    /// <remarks>Transit is not reusable. If the effect ends, the transit is destroyed automatically.</remarks>
+    public class Transit : IDisposable
+    {
+        IntPtr _handle = IntPtr.Zero;
+        bool _isDisposed = false;
+        ObservableCollection<EvasObject> _objects = new ObservableCollection<EvasObject>();
+        ObservableCollection<Transit> _chains = new ObservableCollection<Transit>();
+        HashSet<object> _checker = new HashSet<object>();
+        Elm_Transit_Del_Cb DeletedCallback;
+        Elm_Transit_Effect_End_Cb EffectEndCallback;
+        Elm_Transit_Effect_Transition_Cb EffectTransitionCallback;
+
+        /// <summary>
+        /// A callback called when the transit is deleted.
+        /// </summary>
+        public event EventHandler Deleted;
+
+        /// <summary>
+        /// Creates and initializes a new instance of Transit class.
+        /// </summary>
+        public Transit()
+        {
+            _handle = Interop.Elementary.elm_transit_add();
+            DeletedCallback = (ptr1, ptr2) => {
+                Deleted?.Invoke(this, EventArgs.Empty);
+                Dispose(true);
+            };
+            Interop.Elementary.elm_transit_del_cb_set(_handle, DeletedCallback, IntPtr.Zero);
+            ((INotifyCollectionChanged)_objects).CollectionChanged += OnObjectCollectionChanged;
+            ((INotifyCollectionChanged)_chains).CollectionChanged += OnChaninCollectionChanged;
+        }
+
+        ~Transit()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets or sets the transit animation time
+        /// </summary>
+        public double Duration
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_duration_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_duration_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets a value whether the objects states will be keep or not.
+        /// If it is not kept, the objects states will be reset when transition ends.
+        /// </summary>
+        public bool ObjectStateKeep
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_objects_final_state_keep_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_objects_final_state_keep_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the transit animation acceleration type.
+        /// </summary>
+        public TweenMode TweenMode
+        {
+            get
+            {
+                return (TweenMode)Interop.Elementary.elm_transit_tween_mode_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_tween_mode_set(_handle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the transit repeat count.
+        /// If the repeat is a negative number, it will repeat infinite times.
+        /// </summary>
+        public int Repeat
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_repeat_times_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_repeat_times_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets if the auto reverse is on.
+        /// </summary>
+        public bool AutoReverse
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_auto_reverse_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_auto_reverse_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the event enabled when transit is operating.
+        /// </summary>
+        public bool EventEnabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_event_enabled_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_event_enabled_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the smooth scaling for transit map rendering
+        /// This gets smooth scaling for transit map rendering.
+        /// </summary>
+        public bool Smooth
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_smooth_get(_handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_smooth_set(_handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the time progression of the animation (a double value between 0.0 and 1.0).
+        /// The value returned is a fraction(current time / total time).
+        /// It represents the progression position relative to the total.
+        /// </summary>
+        public double Progress
+        {
+            get
+            {
+                return Interop.Elementary.elm_transit_progress_value_get(_handle);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the transit animation tween mode acceleration factor.
+        /// </summary>
+        /// <returns>A factor value from 0.0 to 1.0.</returns>
+        public double BeginAccelerationFactor
+        {
+            get
+            {
+                double begin = 1.0, end = 0.0;
+                Interop.Elementary.elm_transit_tween_mode_factor_get(_handle, out begin, out end);
+                return begin;
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_tween_mode_factor_set(_handle, value, EndAccelerationFactor);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the transit animation tween mode acceleration factor.
+        /// </summary>
+        /// <returns>A factor value from 0.0 to 1.0.</returns>
+        public double EndAccelerationFactor
+        {
+            get
+            {
+                double begin = 1.0, end = 0.0;
+                Interop.Elementary.elm_transit_tween_mode_factor_get(_handle, out begin, out end);
+                return end;
+            }
+            set
+            {
+                Interop.Elementary.elm_transit_tween_mode_factor_set(_handle, BeginAccelerationFactor, value);
+            }
+        }
+
+        /// <summary>
+        /// Starts the transition in given seconds.
+        /// Once this API is called, the transit begins to measure the time.
+        /// </summary>
+        /// <param name="interval">The interval value in seconds</param>
+        public void Go(double interval = 0)
+        {
+            Interop.Elementary.elm_transit_go_in(_handle, interval);
+        }
+
+        /// <summary>
+        /// Pause the transition.
+        /// </summary>
+        public void Pause()
+        {
+            if (Interop.Elementary.elm_transit_paused_get(_handle) == false)
+                Interop.Elementary.elm_transit_paused_set(_handle, true);
+        }
+
+        /// <summary>
+        /// Resume the transition.
+        /// </summary>
+        public void Resume()
+        {
+            if (Interop.Elementary.elm_transit_paused_get(_handle) == true)
+                Interop.Elementary.elm_transit_paused_set(_handle, false);
+        }
+
+        /// <summary>
+        /// Get the current chained transit list.
+        /// </summary>
+        /// <remarks>Cannot add the duplicate transit.</remarks>
+        public IList<Transit> Chains
+        {
+            get { return _chains; }
+        }
+
+        /// <summary>
+        /// Get the objects list of the transit.
+        /// </summary>
+        /// <remarks>Cannot add the duplicate object.</remarks>
+        public IList<EvasObject> Objects
+        {
+            get { return _objects; }
+        }
+
+        /// <summary>
+        /// Add the effect.
+        /// </summary>
+        /// <param name="effect">EffectBase object.</param>
+        public void AddEffect(EffectBase effect)
+        {
+            IntPtr _effect = effect.CreateEffect(_handle);
+            EffectEndCallback = (effectPtr, transitPtr) => { effect.SendEffectEnd(); };
+            EffectTransitionCallback = (effectPtr, transitPtr, progress) => { };
+            Interop.Elementary.elm_transit_effect_add(_handle, EffectTransitionCallback, _effect, EffectEndCallback);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected virtual void Dispose(bool isDisposing)
+        {
+            if (_isDisposed)
+                return;
+
+            if (isDisposing)
+            {
+                ((INotifyCollectionChanged)_chains).CollectionChanged -= OnChaninCollectionChanged;
+                _chains.Clear();
+                ((INotifyCollectionChanged)_objects).CollectionChanged -= OnObjectCollectionChanged;
+                _objects.Clear();
+                _checker.Clear();
+            }
+
+            _isDisposed = true;
+        }
+
+        void OnObjectCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+        {
+            if (e.Action == NotifyCollectionChangedAction.Add)
+            {
+                foreach (EvasObject item in e.NewItems)
+                    AddObject(item);
+            }
+            else if (e.Action == NotifyCollectionChangedAction.Remove)
+            {
+                foreach (EvasObject item in e.OldItems)
+                    RemoveObject(item);
+            }
+        }
+
+        void OnChaninCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+        {
+            if (e.Action == NotifyCollectionChangedAction.Add)
+            {
+                foreach (Transit item in e.NewItems)
+                    AddChainedTransit(item);
+            }
+            else if (e.Action == NotifyCollectionChangedAction.Remove)
+            {
+                foreach (Transit item in e.OldItems)
+                    DeleteChainedTransit(item);
+            }
+        }
+
+        /// <summary>
+        /// Add new object to apply the effects.
+        /// After the first addition of an object to transit, if its object list become empty again, the transit will be killed.
+        /// If the obj belongs to another transit, the obj will be removed from it and it will only belong to the other transit.
+        /// </summary>
+        /// <remarks>It is not allowed to add a new object after transit begins.</remarks>
+        /// <param name="obj">Object to be animated.</param>
+        void AddObject(EvasObject obj)
+        {
+            if (_checker.Contains(obj))
+                throw new Exception("Cannot add the duplicate object.");
+
+            _checker.Add(obj);
+            Interop.Elementary.elm_transit_object_add(_handle, obj);
+        }
+
+        /// <summary>
+        /// Removes an added object from the transit.
+        /// </summary>
+        /// <param name="obj">Object to be removed from transit.</param>
+        void RemoveObject(EvasObject obj)
+        {
+            if (_checker.Contains(obj))
+                _checker.Remove(obj);
+
+            Interop.Elementary.elm_transit_object_remove(_handle, obj);
+        }
+
+        /// <summary>
+        /// Makes the chain relationship between two transits.
+        /// </summary>
+        /// <param name="transit">The chain transit object. This transit will be operated after transit is done.</param>
+        void AddChainedTransit(Transit transit)
+        {
+            if (_checker.Contains(transit))
+                throw new Exception("Cannot add the duplicate transit.");
+
+            _checker.Add(transit);
+            Interop.Elementary.elm_transit_chain_transit_add(_handle, transit._handle);
+        }
+
+        /// <summary>
+        /// Cut off the chain relationship between two transits.
+        /// </summary>
+        /// <param name="transit">The chain transit object.</param>
+        void DeleteChainedTransit(Transit transit)
+        {
+            if (_checker.Contains(transit))
+                _checker.Remove(transit);
+
+            Interop.Elementary.elm_transit_chain_transit_del(_handle, transit._handle);
+        }
+    }
+}
diff --git a/src/ElmSharp/ElmSharp/TransitEffect.cs b/src/ElmSharp/ElmSharp/TransitEffect.cs
new file mode 100755 (executable)
index 0000000..fd29499
--- /dev/null
@@ -0,0 +1,461 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// The axis along which flip effect should be applied.
+    /// </summary>
+    public enum FlipAxis
+    {
+        /// <summary>
+        /// Flip on X axis
+        /// </summary>
+        X,
+
+        /// <summary>
+        /// Flip on Y axis
+        /// </summary>
+        Y,
+    }
+
+    /// <summary>
+    /// The direction in which the wipe effect should occur.
+    /// </summary>
+    public enum WipeDirection
+    {
+        /// <summary>
+        /// Wipe to the left
+        /// </summary>
+        Left,
+
+        /// <summary>
+        /// Wipe to the right
+        /// </summary>
+        Right,
+
+        /// <summary>
+        /// Wipe to the up
+        /// </summary>
+        Up,
+
+        /// <summary>
+        /// Wipe to the down
+        /// </summary>
+        Down,
+    }
+
+    /// <summary>
+    /// Whether the wipe effect should show or hide the object.
+    /// </summary>
+    public enum WipeType
+    {
+        /// <summary>
+        /// Hide the object during the animation
+        /// </summary>
+        Hide,
+
+        /// <summary>
+        /// Show the object during the animation
+        /// </summary>
+        Show,
+    }
+
+    /// <summary>
+    /// The type of acceleration used in the transition.
+    /// </summary>
+    public enum TweenMode
+    {
+        /// <summary>
+        /// Constant speed
+        /// </summary>
+        Linear,
+
+        /// <summary>
+        /// Starts slow, increase speed over time, then decrease again and stop slowly, v1 being a power factor
+        /// </summary>
+        Sinusoidal,
+
+        /// <summary>
+        /// Starts fast and decrease speed over time, v1 being a power factor
+        /// </summary>
+        Decelerate,
+
+        /// <summary>
+        /// Starts slow and increase speed over time, v1 being a power factor
+        /// </summary>
+        Accelerate,
+
+        /// <summary>
+        /// Start at gradient v1, interpolated via power of v2 curve
+        /// </summary>
+        DivisorInterpolate,
+
+        /// <summary>
+        /// Start at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with decay factor of v1
+        /// </summary>
+        Bounce,
+
+        /// <summary>
+        /// Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1
+        /// </summary>
+        Spring,
+
+        /// <summary>
+        /// Follow the cubic-bezier curve calculated with the control points (x1, y1), (x2, y2)
+        /// </summary>
+        BezierCurve,
+    }
+
+    /// <summary>
+    /// Blend effect class.
+    /// </summary>
+    public class BlendEffect : EffectBase
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of BlendEffect class.
+        /// </summary>
+        public BlendEffect()
+        {
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_blend_add(transit);
+        }
+    }
+
+    /// <summary>
+    /// Color effect class.
+    /// </summary>
+    public class ColorEffect : EffectBase
+    {
+        Color _begin;
+        Color _end;
+
+        /// <summary>
+        /// Creates and initializes a new instance of ColorEffect class.
+        /// </summary>
+        /// <param name="beginColor">The begin color of the effect</param>
+        /// <param name="endColor">The end color of the effect</param>
+        public ColorEffect(Color beginColor, Color endColor)
+        {
+            _begin = beginColor;
+            _end = endColor;
+        }
+
+        /// <summary>
+        /// The begin color of the effect
+        /// </summary>
+        public Color BeginColor
+        {
+            get { return _begin; }
+        }
+
+        /// <summary>
+        /// The end color of the effect
+        /// </summary>
+        public Color EndColor
+        {
+            get { return _end; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_color_add(transit, _begin.R, _begin.G, _begin.B, _begin.A, _end.R, _end.G, _end.B, _end.A);
+        }
+    }
+
+    /// <summary>
+    /// Fade effect class.
+    /// </summary>
+    public class FadeEffect : EffectBase
+    {
+        /// <summary>
+        /// Creates and initializes a new instance of FadeEffect class.
+        /// </summary>
+        public FadeEffect()
+        {
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_fade_add(transit);
+        }
+    }
+
+    /// <summary>
+    /// Flip effect class.
+    /// </summary>
+    public class FlipEffect : EffectBase
+    {
+        FlipAxis _axis;
+        bool _clockWise;
+        bool _resizable;
+
+        /// <summary>
+        /// Creates and initializes a new instance of FlipEffect class.
+        /// </summary>
+        /// <param name="axis">Flipping Axis(X or Y).</param>
+        /// <param name="clockWise">Flipping Direction. True is clock-wise.</param>
+        /// <param name="resizable">Resizable effect with FlipEffect</param>
+        public FlipEffect(FlipAxis axis, bool clockWise, bool resizable = false)
+        {
+            _axis = axis;
+            _clockWise = clockWise;
+            _resizable = resizable;
+        }
+
+        /// <summary>
+        /// Flipping Axis(X or Y).
+        /// </summary>
+        public FlipAxis Axis
+        {
+            get { return _axis; }
+        }
+
+        /// <summary>
+        /// Flipping Direction. True is clock-wise.
+        /// </summary>
+        public bool ClockWise
+        {
+            get { return _clockWise; }
+        }
+
+        /// <summary>
+        /// Resizable FlipEffect.
+        /// </summary>
+        public bool Resizable
+        {
+            get { return _resizable; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            if (_resizable)
+                return Interop.Elementary.elm_transit_effect_resizable_flip_add(transit, (int)_axis, _clockWise);
+            return Interop.Elementary.elm_transit_effect_flip_add(transit, (int)_axis, _clockWise);
+        }
+    }
+
+    /// <summary>
+    /// Resizing effect class.
+    /// </summary>
+    public class ResizingEffect : EffectBase
+    {
+        Size _begin;
+        Size _end;
+
+        /// <summary>
+        /// Creates and initializes a new instance of FlipEffect class.
+        /// </summary>
+        /// <param name="beginSize">The begin Size of the effect</param>
+        /// <param name="endSize">The end Size of the effect</param>
+        public ResizingEffect(Size beginSize, Size endSize)
+        {
+            _begin = beginSize;
+            _end = endSize;
+        }
+
+        /// <summary>
+        /// The begin Size of the effect
+        /// </summary>
+        public Size BeginSize
+        {
+            get { return _begin; }
+        }
+
+        /// <summary>
+        /// The end Size of the effect
+        /// </summary>
+        public Size EndSize
+        {
+            get { return _end; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_resizing_add(transit, _begin.Width, _begin.Height, _end.Width, _end.Height);
+        }
+    }
+
+    /// <summary>
+    /// Rotation effect class.
+    /// </summary>
+    public class RotationEffect : EffectBase
+    {
+        float _begin;
+        float _end;
+
+        /// <summary>
+        /// Creates and initializes a new instance of RotationEffect class.
+        /// </summary>
+        /// <param name="beginDegree">The begin degree of the effect</param>
+        /// <param name="endDegree">The end degree of the effect</param>
+        public RotationEffect(float beginDegree, float endDegree)
+        {
+            _begin = beginDegree;
+            _end = endDegree;
+        }
+
+        /// <summary>
+        /// The begin degree of the effect
+        /// </summary>
+        public float BeginDegree
+        {
+            get { return _begin; }
+        }
+
+        /// <summary>
+        /// The end degree of the effect
+        /// </summary>
+        public float EndDegree
+        {
+            get { return _end; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_rotation_add(transit, _begin, _end);
+        }
+    }
+
+    /// <summary>
+    /// Translation effect class.
+    /// </summary>
+    public class TranslationEffect : EffectBase
+    {
+        Point _begin;
+        Point _end;
+
+        /// <summary>
+        /// Creates and initializes a new instance of FlipEffect class.
+        /// </summary>
+        /// <param name="beginPoint">The begin Point of the effect</param>
+        /// <param name="endPoint">The end Point of the effect</param>
+        public TranslationEffect(Point beginPoint, Point endPoint)
+        {
+            _begin = beginPoint;
+            _end = endPoint;
+        }
+
+        /// <summary>
+        /// The begin Point of the effect
+        /// </summary>
+        public Point BeginPoint
+        {
+            get { return _begin; }
+        }
+
+        /// <summary>
+        /// The end Point of the effect
+        /// </summary>
+        public Point EndPoint
+        {
+            get { return _end; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_translation_add(transit, _begin.X, _begin.Y, _end.X, _end.Y);
+        }
+    }
+
+    /// <summary>
+    /// Wipe effect class.
+    /// </summary>
+    public class WipeEffect : EffectBase
+    {
+        WipeType _type;
+        WipeDirection _direction;
+
+        /// <summary>
+        /// Creates and initializes a new instance of WipeEffect class.
+        /// </summary>
+        /// <param name="type">Wipe type. Hide or show.</param>
+        /// <param name="direction">Wipe Direction.</param>
+        public WipeEffect(WipeType type, WipeDirection direction)
+        {
+            _type = type;
+            _direction = direction;
+        }
+
+        /// <summary>
+        /// Wipe type. Hide or show.
+        /// </summary>
+        public WipeType Type
+        {
+            get { return _type; }
+        }
+
+        /// <summary>
+        /// Wipe Direction.
+        /// </summary>
+        public WipeDirection Direction
+        {
+            get { return _direction; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_wipe_add(transit, (int)_type, (int)_direction);
+        }
+    }
+
+    /// <summary>
+    /// Zoom effect class.
+    /// </summary>
+    public class ZoomEffect : EffectBase
+    {
+        float _begin;
+        float _end;
+
+        /// <summary>
+        /// Creates and initializes a new instance of ZoomEffect class.
+        /// </summary>
+        /// <param name="beginRate">The begin rate of the effect</param>
+        /// <param name="endRate">The end rate of the effect</param>
+        public ZoomEffect(float beginRate, float endRate)
+        {
+            _begin = beginRate;
+            _end = endRate;
+        }
+
+        /// <summary>
+        /// The begin rate of the effect
+        /// </summary>
+        public float BeginRate
+        {
+            get { return _begin; }
+        }
+
+        /// <summary>
+        /// The end rate of the effect
+        /// </summary>
+        public float EndRate
+        {
+            get { return _end; }
+        }
+
+        internal override IntPtr CreateEffect(IntPtr transit)
+        {
+            return Interop.Elementary.elm_transit_effect_zoom_add(transit, _begin, _end);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Utility.cs b/src/ElmSharp/ElmSharp/Utility.cs
new file mode 100644 (file)
index 0000000..baff802
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp
+{
+    public static class Utility
+    {
+        /// <summary>
+        /// Appends a font path to the list of font paths used by the application.
+        /// </summary>
+        /// <param name="path">The new font path.</param>
+        public static void AppendGlobalFontPath(string path)
+        {
+            Interop.Evas.evas_font_path_global_append(path);
+        }
+
+        /// <summary>
+        /// Prepends a font path to the list of font paths used by the application.
+        /// </summary>
+        /// <param name="path">The new font path.</param>
+        public static void PrependEvasGlobalFontPath(string path)
+        {
+            Interop.Evas.evas_font_path_global_prepend(path);
+        }
+
+        /// <summary>
+        /// Removes all font paths loaded into memory by evas_font_path_app_* APIs for the application.
+        /// </summary>
+        public static void ClearEvasGlobalFontPath()
+        {
+            Interop.Evas.evas_font_path_global_clear();
+        }
+
+        /// <summary>
+        /// Sets Edje color class.
+        /// </summary>
+        /// <param name="colorClass">Color class</param>
+        /// <param name="red">Object Red value</param>
+        /// <param name="green">Object Red value</param>
+        /// <param name="blue">Object Red value</param>
+        /// <param name="alpha">Object Red value</param>
+        /// <param name="outlineRed">Outline Red value</param>
+        /// <param name="outlineGreen">Outline Green value</param>
+        /// <param name="outlineBlue">Outline Blue value</param>
+        /// <param name="outlineAlpha">Outline Alpha value</param>
+        /// <param name="shadowRed">Shadow Red value</param>
+        /// <param name="shadowGreen">Shadow Green value</param>
+        /// <param name="shadowBlue">Shadow Bluevalue</param>
+        /// <param name="shadowAlpha">Shadow Alpha value</param>
+        /// <returns></returns>
+        public static bool SetEdjeColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha,
+            int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha)
+        {
+            return Interop.Elementary.edje_color_class_set(colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, shadowRed, shadowGreen, shadowBlue, shadowAlpha);
+        }
+
+        /// <summary>
+        /// Gets Edje color class.
+        /// </summary>
+        /// <param name="colorClass">Color class</param>
+        /// <param name="red">Object Red value</param>
+        /// <param name="green">Object Red value</param>
+        /// <param name="blue">Object Red value</param>
+        /// <param name="alpha">Object Red value</param>
+        /// <param name="outlineRed">Outline Red value</param>
+        /// <param name="outlineGreen">Outline Green value</param>
+        /// <param name="outlineBlue">Outline Blue value</param>
+        /// <param name="outlineAlpha">Outline Alpha value</param>
+        /// <param name="shadowRed">Shadow Red value</param>
+        /// <param name="shadowGreen">Shadow Green value</param>
+        /// <param name="shadowBlue">Shadow Bluevalue</param>
+        /// <param name="shadowAlpha">Shadow Alpha value</param>
+        /// <returns></returns>
+        public static bool GetEdjeColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue,
+            out int outlineAlpha, out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha)
+        {
+            return Interop.Elementary.edje_color_class_get(colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha,
+                out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha);
+        }
+
+        /// <summary>
+        /// Processes all queued up edje messages.
+        /// This function triggers the processing of messages addressed to any (alive) edje objects.
+        /// </summary>
+        public static void ProcessEdjeMessageSignal()
+        {
+            Interop.Elementary.edje_message_signal_process();
+        }
+
+        /// <summary>
+        /// Sets the Edje text class.
+        /// </summary>
+        /// <param name="textClass">The text class name</param>
+        /// <param name="font">The font name</param>
+        /// <param name="size">The font size</param>
+        /// <returns>True, on success or false, on error</returns>
+        public static bool SetEdjeTextClass(string textClass, string font, int size)
+        {
+            return Interop.Elementary.edje_text_class_set(textClass, font, size);
+        }
+
+        /// <summary>
+        /// Gets the Edje text class.
+        /// </summary>
+        /// <param name="textClass">The text class name</param>
+        /// <param name="font">The font name</param>
+        /// <param name="size">The font size</param>
+        /// <returns>True, on success or false, on error</returns>
+        public static bool GetEdjeTextClass(string textClass, out string font, out int size)
+        {
+            return Interop.Elementary.edje_text_class_get(textClass, out font, out size);
+        }
+
+        /// <summary>
+        /// Delete the text class.
+        /// </summary>
+        /// <param name="textClass"></param>
+        public static void DeleteEdjeTextClass(string textClass)
+        {
+            Interop.Elementary.edje_text_class_del(textClass);
+        }
+
+        /// <summary>
+        /// Pre-multiplies a rgb triplet by an alpha factor.
+        /// </summary>
+        /// <param name="alpha">The alpha factor</param>
+        /// <param name="red">The Red component of the color</param>
+        /// <param name="green">The Green component of the color</param>
+        /// <param name="blue">The Blue component of the color</param>
+        public static void PremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
+        {
+            Interop.Evas.evas_color_argb_premul(alpha, ref red, ref green, ref blue);
+        }
+
+        /// <summary>
+        /// Undoes pre-multiplies a rgb triplet by an alpha factor.
+        /// </summary>
+        /// <param name="alpha">The alpha factor</param>
+        /// <param name="red">The Red component of the color</param>
+        /// <param name="green">The Green component of the color</param>
+        /// <param name="blue">The Blue component of the color</param>
+        public static void UnPremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
+        {
+            Interop.Evas.evas_color_argb_unpremul(alpha, ref red, ref green, ref blue);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Widget.cs b/src/ElmSharp/ElmSharp/Widget.cs
new file mode 100755 (executable)
index 0000000..f1df744
--- /dev/null
@@ -0,0 +1,442 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp.Accessible;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the focus direction.
+    /// </summary>
+    public enum FocusDirection
+    {
+        /// <summary>
+        /// Previous direction
+        /// </summary>
+        Previous,
+
+        /// <summary>
+        /// Next direction
+        /// </summary>
+        Next,
+
+        /// <summary>
+        /// Up direction
+        /// </summary>
+        Up,
+
+        /// <summary>
+        /// Down direction
+        /// </summary>
+        Down,
+
+        /// <summary>
+        /// Right direction
+        /// </summary>
+        Right,
+
+        /// <summary>
+        /// Left direction
+        /// </summary>
+        Left
+    }
+
+    /// <summary>
+    /// The Widget is abstract class, it is the parent of other widgets.
+    /// Inherits from <see cref="EvasObject"/>.
+    /// </summary>
+    public abstract class Widget : AccessibleObject
+    {
+        Dictionary<string, EvasObject> _partContents = new Dictionary<string, EvasObject>();
+
+        SmartEvent _focused;
+        SmartEvent _unfocused;
+
+        internal Color _backgroundColor = Color.Default;
+        internal int _opacity = Color.Default.A;
+
+        protected Widget()
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Widget class.
+        /// </summary>
+        /// <param name="parent">The parent of new Widget instance</param>
+        protected Widget(EvasObject parent) : base(parent)
+        {
+            _focused = new SmartEvent(this, "focused");
+            _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
+
+            _unfocused = new SmartEvent(this, "unfocused");
+            _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Update the part contents
+        /// </summary>
+        /// <param name="content">The content which put to the part</param>
+        /// <param name="part">The updated part</param>
+        protected void UpdatePartContents(EvasObject content, string part = "__default__")
+        {
+            _partContents[part] = content;
+        }
+
+        /// <summary>
+        /// Focused will be triggered when the widget is focused.
+        /// </summary>
+        public event EventHandler Focused;
+
+        /// <summary>
+        /// Unfocused will be triggered when the widget is unfocused.
+        /// </summary>
+        public event EventHandler Unfocused;
+
+        /// <summary>
+        /// Sets or gets the state of the widget, which might be enabled or disabled.
+        /// </summary>
+        public bool IsEnabled
+        {
+            get
+            {
+                return !Interop.Elementary.elm_object_disabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_disabled_set(RealHandle, !value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the style of the widget.
+        /// </summary>
+        public string Style
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_style_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_style_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether this widget is focused.
+        /// </summary>
+        public bool IsFocused
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_focus_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether a widget is focusable or not.
+        /// </summary>
+        /// <remarks>Widgets which are meant to be interacted with by input events are created able to be focused, by default</remarks>
+        public bool IsFocusAllowed
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_focus_allow_get(RealHandle);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the text of the widget.
+        /// </summary>
+        /// <remarks>It could be override by special child class</remarks>
+        public virtual string Text
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_part_text_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_part_text_set(RealHandle, IntPtr.Zero, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the background color of the widget.
+        /// </summary>
+        /// <remarks>It could be override by special child class</remarks>
+        public virtual Color BackgroundColor
+        {
+            get
+            {
+                if (!_backgroundColor.IsDefault)
+                {
+                    _backgroundColor = GetPartColor("bg");
+                }
+                return _backgroundColor;
+            }
+            set
+            {
+                if (value.IsDefault)
+                {
+                    Console.WriteLine("Widget instance doesn't support to set BackgroundColor to Color.Default.");
+                }
+                else
+                {
+                    SetPartColor("bg", value);
+                    _backgroundColor = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the opacity of the widget.
+        /// </summary>
+        /// <remarks>It could be override by special child class</remarks>
+        public virtual int Opacity
+        {
+            get
+            {
+                if (_opacity != Color.Default.A)
+                {
+                    _opacity = GetPartOpacity("opacity");
+                }
+                return _opacity;
+            }
+            set
+            {
+                SetPartOpacity("opacity", value);
+                _opacity = value;
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether a widget and its children are focusable or not.
+        /// </summary>
+        public bool AllowTreeFocus
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_tree_focus_allow_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_tree_focus_allow_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the widget's mirrored mode.
+        /// </summary>
+        public bool IsMirroredMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_mirrored_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_mirrored_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the widget's mirrored mode setting.
+        /// When widget set automatic mode(true), it follows the system mirrored mode.
+        /// </summary>
+        public bool IsAutoMirroredMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_object_mirrored_automatic_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_object_mirrored_automatic_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets the widget to be focused or not.
+        /// </summary>
+        /// <param name="isFocus">Weather be focused</param>
+        public void SetFocus(bool isFocus)
+        {
+            Interop.Elementary.elm_object_focus_set(RealHandle, isFocus);
+        }
+
+        /// <summary>
+        /// Sets the ability for a widget to be focused.
+        /// </summary>
+        /// <param name="isAllowFocus">True if the object can be focused, false if not(and on errors)</param>
+        public void AllowFocus(bool isAllowFocus)
+        {
+            Interop.Elementary.elm_object_focus_allow_set(RealHandle, isAllowFocus);
+        }
+
+        /// <summary>
+        /// Gives focus to next widget in widget tree.
+        /// </summary>
+        /// <param name="direction">Direction to move the focus</param>
+        public void FocusNext(FocusDirection direction)
+        {
+            Interop.Elementary.elm_object_focus_next(RealHandle, (int)direction);
+        }
+
+        /// <summary>
+        /// Set next widget with specific focus direction.
+        /// </summary>
+        /// <param name="next">Focus next widget</param>
+        /// <param name="direction">Focus direction</param>
+        public void SetNextFocusObject(EvasObject next, FocusDirection direction)
+        {
+            Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next.RealHandle, (int)direction);
+        }
+
+        /// <summary>
+        /// Sets content to particular part of the widget, and the preserve old content will not be unset.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="content">The content</param>
+        /// <seealso cref="SetPartContent(string, EvasObject, bool)"/>
+        public virtual bool SetPartContent(string part, EvasObject content)
+        {
+            return SetPartContent(part, content, false);
+        }
+
+        /// <summary>
+        /// Sets content to particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="content">The content</param>
+        /// <param name="preserveOldContent">true, preserve old content will be unset. false, preserve old content will not be unset.</param>
+        /// <seealso cref="SetPartContent(string, EvasObject)"/>
+        public virtual bool SetPartContent(string part, EvasObject content, bool preserveOldContent)
+        {
+            if (preserveOldContent)
+            {
+                Interop.Elementary.elm_object_part_content_unset(RealHandle, part);
+            }
+            Interop.Elementary.elm_object_part_content_set(RealHandle, part, content);
+            UpdatePartContents(content, part);
+            return true;
+        }
+
+        /// <summary>
+        /// Sets content to the widget, and the preserve old content will not be unset.
+        /// </summary>
+        /// <param name="content">The content</param>
+        /// <seealso cref="SetContent(EvasObject, bool)"/>
+        public void SetContent(EvasObject content)
+        {
+            SetContent(content, false);
+        }
+
+        /// <summary>
+        /// Sets content the widget.
+        /// </summary>
+        /// <param name="content">The content</param>
+        /// <param name="preserveOldContent">true, preserve old content will be unset. false, preserve old content will not be unset.</param>
+        /// <seealso cref="SetContent(EvasObject)"/>
+        public void SetContent(EvasObject content, bool preserveOldContent)
+        {
+            if (preserveOldContent)
+            {
+                Interop.Elementary.elm_object_content_unset(RealHandle);
+            }
+
+            Interop.Elementary.elm_object_content_set(RealHandle, content);
+            UpdatePartContents(content);
+        }
+
+        /// <summary>
+        /// Sets text to particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="text">The text</param>
+        public virtual bool SetPartText(string part, string text)
+        {
+            Interop.Elementary.elm_object_part_text_set(RealHandle, part, text);
+            return true;
+        }
+
+        /// <summary>
+        /// Gets text of a particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <returns>Text of the particular part of the widget</returns>
+        public virtual string GetPartText(string part)
+        {
+            return Interop.Elementary.elm_object_part_text_get(RealHandle, part);
+        }
+
+        /// <summary>
+        /// Sets color of a particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="color">The color be set to widget</param>
+        /// <remarks>This method is a virtual method, it could be override by special child class</remarks>
+        public virtual void SetPartColor(string part, Color color)
+        {
+            Interop.Elementary.elm_object_color_class_color_set(RealHandle, part, color.R * color.A / 255,
+                                                                              color.G * color.A / 255,
+                                                                              color.B * color.A / 255,
+                                                                              color.A);
+        }
+
+        /// <summary>
+        /// Gets color of the particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <returns>The color of the particular part</returns>
+        /// <remarks>This method is a virtual method, it could be override by special child class</remarks>
+        public virtual Color GetPartColor(string part)
+        {
+            int r, g, b, a;
+            Interop.Elementary.elm_object_color_class_color_get(RealHandle, part, out r, out g, out b, out a);
+            return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+        }
+
+        /// <summary>
+        /// Sets opacity of the particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <param name="opacity">The opacity of the particular part</param>
+        public void SetPartOpacity(string part, int opacity)
+        {
+            Interop.Elementary.elm_object_color_class_color_set(Handle, part, 255, 255, 255, opacity);
+        }
+
+        /// <summary>
+        /// Gets opacity of the particular part of the widget.
+        /// </summary>
+        /// <param name="part">The name of particular part</param>
+        /// <returns>Opacity value of the particular part</returns>
+        public int GetPartOpacity(string part)
+        {
+            int r, g, b, a;
+            Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a);
+            return a;
+        }
+
+        internal IntPtr GetPartContent(string part)
+        {
+            return Interop.Elementary.elm_object_part_content_get(RealHandle, part);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs
new file mode 100644 (file)
index 0000000..71d18f5
--- /dev/null
@@ -0,0 +1,1058 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the display rotation of window.
+    /// </summary>
+    [Flags]
+    public enum DisplayRotation
+    {
+        /// <summary>
+        /// Rotation value of window is 0 degree
+        /// </summary>
+        Degree_0 = 1,
+
+        /// <summary>
+        /// Rotation value of window is 90 degree
+        /// </summary>
+        Degree_90 = 2,
+
+        /// <summary>
+        /// Rotation value of window is 180 degree
+        /// </summary>
+        Degree_180 = 4,
+
+        /// <summary>
+        /// Rotation value of window is 270 degree
+        /// </summary>
+        Degree_270 = 8
+    };
+
+    /// <summary>
+    /// Enumeration for the indicator opacity
+    /// </summary>
+    public enum StatusBarMode
+    {
+        /// <summary>
+        /// Opacifies the status bar
+        /// </summary>
+        Opaque = 1,
+
+        /// <summary>
+        /// Be translucent the status bar
+        /// </summary>
+        /// <remarks>
+        /// Not supported.
+        /// </remarks>
+        Translucent = 2,
+
+        /// <summary>
+        /// Transparentizes the status bar
+        /// </summary>
+        Transparent = 3,
+    }
+
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum KeyGrabMode
+    {
+        Shared = 256,
+        Topmost = 512,
+        Exclusive = 1024,
+        OverrideExclusive = 2048,
+    }
+
+    /// <summary>
+    /// Enumeration for the indicator mode.
+    /// </summary>
+    public enum IndicatorMode
+    {
+        /// <summary>
+        /// Unknown indicator state.
+        /// </summary>
+        Unknown = 0,
+
+        /// <summary>
+        /// Hides the indicator.
+        /// </summary>
+        Hide,
+
+        /// <summary>
+        /// Shows the indicator.
+        /// </summary>
+        Show,
+    };
+
+    /// <summary>
+    /// Enumeration for the keyboard mode
+    /// </summary>
+    public enum KeyboardMode
+    {
+        /// <summary>
+        /// Unknown keyboard state
+        /// </summary>
+        Unknown,
+
+        /// <summary>
+        /// Request to deactivate the keyboard
+        /// </summary>
+        Off,
+
+        /// <summary>
+        /// Enable keyboard with default layout
+        /// </summary>
+        On,
+
+        /// <summary>
+        /// Alpha (a-z) keyboard layout
+        /// </summary>
+        Alpha,
+
+        /// <summary>
+        /// Numeric keyboard layout
+        /// </summary>
+        Numeric,
+
+        /// <summary>
+        /// PIN keyboard layout
+        /// </summary>
+        Pin,
+
+        /// <summary>
+        /// Phone keyboard layout
+        /// </summary>
+        PhoneNumber,
+
+        /// <summary>
+        /// Hexadecimal numeric keyboard layout
+        /// </summary>
+        Hex,
+
+        /// <summary>
+        /// Full (QWERTY) keyboard layout
+        /// </summary>
+        QWERTY,
+
+        /// <summary>
+        /// Password keyboard layout
+        /// </summary>
+        Password,
+
+        /// <summary>
+        /// IP keyboard layout
+        /// </summary>
+        IP,
+
+        /// <summary>
+        /// Host keyboard layout
+        /// </summary>
+        Host,
+
+        /// <summary>
+        /// File keyboard layout
+        /// </summary>
+        File,
+
+        /// <summary>
+        /// URL keyboard layout
+        /// </summary>
+        URL,
+
+        /// <summary>
+        /// Keypad layout
+        /// </summary>
+        Keypad,
+
+        /// <summary>
+        /// J2ME keyboard layout
+        /// </summary>
+        J2ME,
+    };
+
+    /// <summary>
+    /// Enumeration for the window type
+    /// </summary>
+    public enum WindowType
+    {
+        /// <summary>
+        /// Unknown
+        /// </summary>
+        Unknown,
+
+        /// <summary>
+        /// A normal window. Indicates a normal, top-level window. Almost every window will be created with this type.
+        /// </summary>
+        Basic,
+
+        /// <summary>
+        /// Used for simple dialog windows.
+        /// </summary>
+        Dialog,
+
+        /// <summary>
+        /// For special desktop windows, like a background window holding desktop icons.
+        /// </summary>
+        Desktop,
+
+        /// <summary>
+        /// The window is used as a dock or panel. Usually would be kept on top of any other window by the Window Manager.
+        /// </summary>
+        Dock,
+
+        /// <summary>
+        /// The window is used to hold a floating toolbar, or similar.
+        /// </summary>
+        Toolbar,
+
+        /// <summary>
+        /// Similar to Toolbar.
+        /// </summary>
+        Menu,
+
+        /// <summary>
+        /// A persistent utility window, like a toolbox or palette.
+        /// </summary>
+        Utility,
+
+        /// <summary>
+        /// Splash window for a starting up application.
+        /// </summary>
+        Splash,
+
+        /// <summary>
+        /// The window is a dropdown menu, as when an entry in a menubar is clicked.
+        /// </summary>
+        DropdownMenu,
+
+        /// <summary>
+        /// Like DropdownMenu, but for the menu triggered by right-clicking an object.
+        /// </summary>
+        PopupMenu,
+
+        /// <summary>
+        /// The window is a tooltip. A short piece of explanatory text that typically appear after the mouse cursor hovers over an object for a while.
+        /// </summary>
+        Tooltip,
+
+        /// <summary>
+        /// A notification window, like a warning about battery life or a new E-Mail received.
+        /// </summary>
+        Notification,
+
+        /// <summary>
+        /// A window holding the contents of a combo box.
+        /// </summary>
+        Combo,
+
+        /// <summary>
+        /// Used to indicate the window is a representation of an object being dragged across different windows, or even applications.
+        /// </summary>
+        DragAndDrop,
+
+        /// <summary>
+        /// The window is rendered onto an image buffer. No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer.
+        /// This allows to have children window inside a parent one just like any other object would be, and do other things like applying Evas_Map effects to it.
+        /// </summary>
+        InlinedImage,
+
+        /// <summary>
+        /// The window is rendered onto an image buffer and can be shown other process's plug image object.
+        /// No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer and can be shown other process's plug image object.
+        /// </summary>
+        SocketImage,
+
+        /// <summary>
+        /// This window was created using a pre-existing canvas. The window widget can be deleted, but the canvas must be managed externally.
+        /// </summary>
+        Fake,
+    };
+
+    /// <summary>
+    /// The Window is container that contain the graphical user interface of a program.
+    /// </summary>
+    public class Window : Widget
+    {
+        SmartEvent _deleteRequest;
+        SmartEvent _rotationChanged;
+        HashSet<EvasObject> _referenceHolder = new HashSet<EvasObject>();
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Window class.
+        /// </summary>
+        /// <param name="name">Window name.</param>
+        public Window(string name) : this(null, name)
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Window class.
+        /// </summary>
+        /// <param name="parent">
+        /// Parent widget which this widow created on.
+        /// </param>
+        /// <param name="name">
+        /// Window name.
+        /// </param>
+        /// <remarks>
+        /// Window constructor.show window indicator,set callback
+        /// When closing the window in any way outside the program control,
+        /// and set callback when window rotation changed.
+        /// </remarks>
+        public Window(Window parent, string name) : this(parent, name, WindowType.Basic)
+        {
+        }
+
+        /// <summary>
+        /// Creates and initializes a new instance of the Window class.
+        /// </summary>
+        /// <param name="parent">
+        /// Parent widget which this widow created on.
+        /// </param>
+        /// <param name="name">
+        /// Window name.
+        /// </param>
+        /// <param name="type">
+        /// Window type
+        /// </param>
+        /// <remarks>
+        /// Window constructor.show window indicator,set callback
+        /// When closing the window in any way outside the program control,
+        /// and set callback when window rotation changed.
+        /// </remarks>
+        public Window(Window parent, string name, WindowType type)
+        {
+            Name = name;
+            Type = type;
+            Realize(parent);
+            IndicatorMode = IndicatorMode.Show;
+
+            _deleteRequest = new SmartEvent(this, "delete,request");
+            _rotationChanged = new SmartEvent(this, "wm,rotation,changed");
+            _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
+            _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
+        }
+
+        protected Window()
+        {
+        }
+
+        /// <summary>
+        /// CloseRequested will be triggered when Window close.
+        /// </summary>
+        public event EventHandler CloseRequested;
+
+        /// <summary>
+        /// RotationChanged will be triggered when Window do rotation.
+        /// </summary>
+        public event EventHandler RotationChanged;
+
+        /// <summary>
+        /// Sets or gets Window name.
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// Gets the Window type.
+        /// </summary>
+        public WindowType Type { get; } = WindowType.Basic;
+
+        /// <summary>
+        /// Gets Window size with Size value(w,h)
+        /// </summary>
+        public Size ScreenSize
+        {
+            get
+            {
+                int x, y, w, h;
+                Interop.Elementary.elm_win_screen_size_get(Handle, out x, out y, out w, out h);
+                return new Size(w, h);
+            }
+        }
+
+        /// <summary>
+        /// Gets the screen dpi for the screen that a Window is on.
+        /// </summary>
+        public Point ScreenDpi
+        {
+            get
+            {
+                Point point = default(Point);
+                Interop.Elementary.elm_win_screen_dpi_get(Handle, out point.X, out point.Y);
+                return point;
+            }
+        }
+
+        /// <summary>
+        /// Gets the rotation of the Window.The rotation of the window in degrees (0-360).
+        /// </summary>
+        public int Rotation
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_rotation_get(Handle);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether window manager supports window rotation or not.
+        /// </summary>
+        public bool IsRotationSupported
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_wm_rotation_supported_get(Handle);
+            }
+        }
+
+        [Obsolete("Sorry, it's error typo of AvailableRotations, please use AvailableRotations")]
+        public DisplayRotation AavailableRotations { get; set; }
+
+        /// <summary>
+        /// Sets or gets available rotation degree.
+        /// </summary>
+        public DisplayRotation AvailableRotations
+        {
+            get
+            {
+                int[] rotations;
+                Interop.Elementary.elm_win_wm_rotation_available_rotations_get(Handle, out rotations);
+                if (rotations == null)
+                {
+                    return 0;
+                }
+                return ConvertToDisplayRotation(rotations);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_wm_rotation_available_rotations_set(Handle, ConvertDegreeArray(value));
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets whether auto deletion function is enable.
+        /// </summary>
+        /// <remarks>
+        /// If you enable auto deletion, the window is automatically destroyed after the signal is emitted.
+        /// If auto deletion is disabled, the window is not destroyed and the program has to handle it.
+        /// </remarks>
+        public bool AutoDeletion
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_autodel_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_autodel_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the alpha channel state of a window.
+        /// </summary>
+        /// <remarks>
+        /// True if the window alpha channel is enabled, false otherwise.
+        /// If alpha is true, the alpha channel of the canvas will be enabled possibly making parts of the window completely or partially transparent.
+        /// </remarks>
+        public bool Alpha
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_alpha_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_alpha_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the role of the window.
+        /// </summary>
+        /// <remarks>
+        /// The Role will be invalid if a new role is set or if the window is destroyed.
+        /// </remarks>
+        public string Role
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_role_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_role_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the mode of status bar.
+        /// </summary>
+        public StatusBarMode StatusBarMode
+        {
+            get
+            {
+                return (StatusBarMode)Interop.Elementary.elm_win_indicator_opacity_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_indicator_opacity_set(Handle, (int)value);
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool Iconified
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_iconified_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_iconified_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the window's indicator mode.
+        /// </summary>
+        /// <value>The indicator mode.</value>
+        public IndicatorMode IndicatorMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_indicator_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_indicator_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the aspect ratio of a window.
+        /// </summary>
+        public double Aspect
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_aspect_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_aspect_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Window's autohide state.
+        /// </summary>
+        public bool AutoHide
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_autohide_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_autohide_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the borderless state of a window.
+        /// This function requests the Window Manager to not draw any decoration around the window.
+        /// </summary>
+        public bool Borderless
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_borderless_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_borderless_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the demand attention state of a window.
+        /// </summary>
+        public bool DemandAttention
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_demand_attention_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_demand_attention_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the floating mode of a window.
+        /// </summary>
+        public bool FloatingMode
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_floating_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_floating_mode_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the animate status for the focus highlight for this window.
+        /// This function will enable or disable the animation of focus highlight only for the given window, regardless of the global setting for it.
+        /// </summary>
+        public bool FocusHighlightAnimation
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_focus_highlight_animate_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_focus_highlight_animate_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the enabled status for the focus highlight in a window.
+        /// This function will enable or disable the focus highlight only for the given window, regardless of the global setting for it.
+        /// </summary>
+        public bool FocusHighlightEnabled
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_focus_highlight_enabled_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_focus_highlight_enabled_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the style for the focus highlight on this window.
+        /// Sets the style to use for theming the highlight of focused objects on the given window.If style is NULL, the default will be used.
+        /// </summary>
+        public string FocusHighlightStyle
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_focus_highlight_style_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_focus_highlight_style_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the keyboard mode of the window.
+        /// </summary>
+        public KeyboardMode KeyboardMode
+        {
+            get
+            {
+                return (KeyboardMode)Interop.Elementary.elm_win_keyboard_mode_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_keyboard_mode_set(RealHandle, (int)value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the layer of the window.
+        /// What this means exactly will depend on the underlying engine used.
+        /// In the case of X11 backed engines, the value in layer has the following meanings
+        /// less than 3 means that the window will be placed below all others,
+        /// more than 5 means that the window will be placed above all others,
+        /// and anything else means that the window will be placed in the default layer.
+        /// </summary>
+        public override int Layer
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_layer_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_layer_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the maximized state of a window.
+        /// </summary>
+        public bool Maximized
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_maximized_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_maximized_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the modal state of a window.
+        /// </summary>
+        public bool Modal
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_modal_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_modal_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the noblank property of a window.
+        /// This is a way to request the display on which the windowis shown does not blank, screensave or otherwise hide or obscure the window.It is intended for uses such as media playback on a television where a user may not want to be interrupted by an idle screen.
+        /// The noblank property may have no effect if the window is iconified/minimized or hidden.
+        /// </summary>
+        public bool NoBlank
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_noblank_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_noblank_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the profile of a window.
+        /// </summary>
+        public string Profile
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_profile_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_profile_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Get the constraints on the maximum width and height of a window relative to the width and height of its screen.
+        /// When this function returns true, obj will never resize larger than the screen.
+        /// </summary>
+        public bool ScreenConstrain
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_screen_constrain_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_screen_constrain_set(RealHandle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the base size of a window.
+        /// </summary>
+        public Size BaseSize
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_win_size_base_get(RealHandle, out w, out h);
+                return new Size(w, h);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_size_base_set(RealHandle, value.Width, value.Height);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the step size of a window.
+        /// </summary>
+        public Size StepSize
+        {
+            get
+            {
+                int w, h;
+                Interop.Elementary.elm_win_size_step_get(RealHandle, out w, out h);
+                return new Size(w, h);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_size_step_set(RealHandle, value.Width, value.Height);
+            }
+        }
+
+        /// <summary>
+        /// Get the screen position X of a window.
+        /// </summary>
+        public int ScreenPositionX
+        {
+            get
+            {
+                int x, y;
+                Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y);
+                return x;
+            }
+        }
+
+        /// <summary>
+        /// Get the screen position Y of a window.
+        /// </summary>
+        public int ScreenPositionY
+        {
+            get
+            {
+                int x, y;
+                Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y);
+                return y;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the title of the window.
+        /// </summary>
+        public string Title
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_title_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_title_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the urgent state of a window.
+        /// </summary>
+        public bool Urgent
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_urgent_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_urgent_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the withdrawn state of a window.
+        /// </summary>
+        public bool Withdrawn
+        {
+            get
+            {
+                return Interop.Elementary.elm_win_urgent_get(Handle);
+            }
+            set
+            {
+                Interop.Elementary.elm_win_urgent_set(Handle, value);
+            }
+        }
+
+        /// <summary>
+        /// Create a socket to provide the service for Plug widget.
+        /// </summary>
+        /// <param name="serviceName">A service name</param>
+        /// <param name="serviceNumber">A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name.</param>
+        /// <param name="systemWide">A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user id that created the service.</param>
+        /// <returns></returns>
+        public bool CreateServiceSocket(string name, int number, bool systemWide)
+        {
+            return Interop.Elementary.elm_win_socket_listen(RealHandle, name, number, systemWide);
+        }
+
+        /// <summary>
+        /// Set the rotation of the window.
+        /// </summary>
+        /// <param name="degree">The rotation of the window, in degrees (0-360), counter-clockwise.</param>
+        /// <param name="resize">Resizes the window's contents so that they fit inside the current window geometry.</param>
+        public void SetRotation(int degree, bool resize)
+        {
+            if (resize)
+                Interop.Elementary.elm_win_rotation_with_resize_set(RealHandle, degree);
+            else
+                Interop.Elementary.elm_win_rotation_set(RealHandle, degree);
+        }
+
+        /// <summary>
+        /// Set the window to be skipped by focus.
+        /// This sets the window to be skipped by normal input.
+        /// This means a window manager will be asked to not focus this window as well as omit it from things like the taskbar, pager etc.
+        /// Call this and enable it on a window BEFORE you show it for the first time, otherwise it may have no effect.
+        /// Use this for windows that have only output information or might only be interacted with by the mouse or fingers, and never for typing input.
+        /// Be careful that this may have side-effects like making the window non-accessible in some cases unless the window is specially handled. Use this with care.
+        /// </summary>
+        public void FocusSkip(bool skip)
+        {
+            Interop.Elementary.elm_win_prop_focus_skip_set(Handle, skip);
+        }
+
+        /// <summary>
+        /// Pull up the window object.
+        /// Places the window pointed by obj at the top of the stack, so that it's not covered by any other window.
+        /// </summary>
+        public void PullUp()
+        {
+            Interop.Elementary.elm_win_raise(Handle);
+        }
+
+        /// <summary>
+        /// Bring down the window object.
+        /// Places the window pointed by obj at the bottom of the stack, so that no other window is covered by it.
+        /// </summary>
+        public void BringDown()
+        {
+            Interop.Elementary.elm_win_lower(Handle);
+        }
+
+        /// <summary>
+        /// This function sends a request to the Windows Manager to activate the Window.
+        /// If honored by the WM, the window receives the keyboard focus.
+        /// </summary>
+        /// <remarks>
+        /// This is just a request that a Window Manager may ignore, so calling this function does not ensure
+        /// in any way that the window is going to be the active one after it.
+        /// </remarks>
+        public void Active()
+        {
+            Interop.Elementary.elm_win_activate(Handle);
+        }
+
+        /// <summary>
+        /// Delete subobj as a resize object of window obj.
+        /// This function removes the object subobj from the resize objects of the window obj.
+        /// It will not delete the object itself, which will be left unmanaged and should be deleted by the developer, manually handled or set as child of some other container.
+        /// </summary>
+        /// <param name="obj">Resize object.</param>
+        public void DeleteResizeObject(EvasObject obj)
+        {
+            Interop.Elementary.elm_win_resize_object_del(Handle, obj);
+        }
+
+        /// <summary>
+        /// Adds obj as a resize object of the Window.
+        /// </summary>
+        /// <remarks>
+        /// Setting an object as a resize object of the window means that the obj child's size and
+        /// position is controlled by the window directly. That is, the obj is resized to match the window size
+        /// and should never be moved or resized manually by the developer.In addition,
+        /// resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user.
+        /// </remarks>
+        /// <param name="obj">
+        /// Resize object.
+        /// </param>
+        public void AddResizeObject(EvasObject obj)
+        {
+            Interop.Elementary.elm_win_resize_object_add(Handle, obj);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void WinKeyGrab(string keyname, KeyGrabMode mode)
+        {
+            Interop.Elementary.elm_win_keygrab_set(RealHandle, keyname, 0, 0, 0, mode);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void WinKeyUngrab(string keyname)
+        {
+            Interop.Elementary.elm_win_keygrab_unset(RealHandle, keyname, 0, 0);
+        }
+
+        /// <summary>
+        /// Set the keygrab of the window.
+        /// </summary>
+        /// <param name="keyname">keyname string to set keygrab</param>
+        public void KeyGrabEx(string keyname)
+        {
+            Interop.Elementary.eext_win_keygrab_set(RealHandle, keyname);
+        }
+
+        /// <summary>
+        /// Unset the keygrab of the window.
+        /// </summary>
+        /// <param name="keyname">keyname string to unset keygrab</param>
+        public void KeyUngrabEx(string keyname)
+        {
+            Interop.Elementary.eext_win_keygrab_unset(RealHandle, keyname);
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            Interop.Elementary.elm_config_accel_preference_set("3d");
+            return Interop.Elementary.elm_win_add(parent != null ? parent.Handle : IntPtr.Zero, Name, (int)Type);
+        }
+
+        internal void AddChild(EvasObject obj)
+        {
+            _referenceHolder.Add(obj);
+        }
+
+        internal void RemoveChild(EvasObject obj)
+        {
+            _referenceHolder.Remove(obj);
+        }
+
+        static int[] ConvertDegreeArray(DisplayRotation value)
+        {
+            List<int> rotations = new List<int>();
+            if (value.HasFlag(DisplayRotation.Degree_0))
+                rotations.Add(0);
+            if (value.HasFlag(DisplayRotation.Degree_90))
+                rotations.Add(90);
+            if (value.HasFlag(DisplayRotation.Degree_180))
+                rotations.Add(180);
+            if (value.HasFlag(DisplayRotation.Degree_270))
+                rotations.Add(270);
+            return rotations.ToArray();
+        }
+
+        static DisplayRotation ConvertToDisplayRotation(int[] values)
+        {
+            int orientation = 0;
+            foreach (int v in values)
+            {
+                orientation |= (1 << (v / 90));
+            }
+            return (DisplayRotation)orientation;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/ElmSharp/WrapType.cs b/src/ElmSharp/ElmSharp/WrapType.cs
new file mode 100755 (executable)
index 0000000..5725790
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+    /// <summary>
+    /// Enumeration for the wrap type.
+    /// </summary>
+    public enum WrapType
+    {
+        /// <summary>
+        /// No wrap.
+        /// </summary>
+        None = 0,
+        /// <summary>
+        /// Char wrap - wrap between characters.
+        /// </summary>
+        Char,
+        /// <summary>
+        /// Word wrap - wrap within the allowed wrapping points
+        /// (as defined in the unicode standard).
+        /// </summary>
+        Word,
+        /// <summary>
+        /// Mixed wrap - Word wrap, if that fails, char wrap.
+        /// </summary>
+        Mixed
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Ecore.cs b/src/ElmSharp/Interop/Interop.Ecore.cs
new file mode 100644 (file)
index 0000000..99b9ee1
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Ecore
+    {
+        internal delegate void EcoreCallback(IntPtr data);
+        internal delegate bool EcoreTaskCallback(IntPtr data);
+        internal delegate void EcoreEventCallback(IntPtr data, int type, IntPtr evt);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern int ecore_init();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern int ecore_shutdown();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern void ecore_main_loop_begin();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern void ecore_main_loop_quit();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern bool ecore_main_loop_glib_integrate();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_idler_add(EcoreTaskCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern void ecore_main_loop_thread_safe_call_async(EcoreTaskCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_main_loop_thread_safe_call_sync(EcoreTaskCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_idler_del(IntPtr idler);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_timer_add(double interval, EcoreTaskCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_timer_del(IntPtr timer);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_animator_add(EcoreTaskCallback func, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_animator_del(IntPtr animator);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern double ecore_time_get();
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_event_handler_add(int type, EcoreEventCallback func, IntPtr data);
+
+        [DllImport(Libraries.Ecore)]
+        internal static extern IntPtr ecore_event_handler_del(IntPtr handler);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Eext.Event.cs b/src/ElmSharp/Interop/Interop.Eext.Event.cs
new file mode 100644 (file)
index 0000000..02420dc
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        public enum EextCallbackType
+        {
+            EEXT_CALLBACK_BACK, // H/W Back Key Event
+            EEXT_CALLBACK_MORE,  // H/W More Key Event
+        }
+        internal delegate void EextEventCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_object_event_callback_add(IntPtr obj, EextCallbackType type, EextEventCallback callback, IntPtr data);
+
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_object_event_callback_del(IntPtr obj, EextCallbackType type, EextEventCallback callback);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs b/src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs
new file mode 100755 (executable)
index 0000000..7ecef6a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eext
+    {
+        [DllImport(Libraries.Eext)]
+        internal static extern IntPtr eext_floatingbutton_add(IntPtr parent);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern int eext_floatingbutton_mode_get(IntPtr floatingButton);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_floatingbutton_mode_set(IntPtr floatingButton, int mode);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern int eext_floatingbutton_pos_get(IntPtr floatingButton);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_floatingbutton_pos_set(IntPtr floatingButton, int position);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_floatingbutton_movement_block_get(IntPtr floatingButton);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern void eext_floatingbutton_movement_block_set(IntPtr floatingButton, bool block);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_floatingbutton_pos_bring_in(IntPtr floatingButton, int posposition);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Eina.cs b/src/ElmSharp/Interop/Interop.Eina.cs
new file mode 100644 (file)
index 0000000..1051b52
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eina
+    {
+        [DllImport(Libraries.Eina)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool eina_main_loop_is();
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs b/src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs
new file mode 100644 (file)
index 0000000..fc3bc6b
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal enum Elm_Atspi_Relation_Type
+        {
+            ELM_ATSPI_RELATION_NULL,
+            ELM_ATSPI_RELATION_LABEL_FOR,
+            ELM_ATSPI_RELATION_LABELLED_BY,
+            ELM_ATSPI_RELATION_CONTROLLER_FOR,
+            ELM_ATSPI_RELATION_CONTROLLED_BY,
+            ELM_ATSPI_RELATION_MEMBER_OF,
+            ELM_ATSPI_RELATION_TOOLTIP_FOR,
+            ELM_ATSPI_RELATION_NODE_CHILD_OF,
+            ELM_ATSPI_RELATION_NODE_PARENT_OF,
+            ELM_ATSPI_RELATION_EXTENDED,
+            ELM_ATSPI_RELATION_FLOWS_TO,
+            ELM_ATSPI_RELATION_FLOWS_FROM,
+            ELM_ATSPI_RELATION_SUBWINDOW_OF,
+            ELM_ATSPI_RELATION_EMBEDS,
+            ELM_ATSPI_RELATION_EMBEDDED_BY,
+            ELM_ATSPI_RELATION_POPUP_FOR,
+            ELM_ATSPI_RELATION_PARENT_WINDOW_OF,
+            ELM_ATSPI_RELATION_DESCRIPTION_FOR,
+            ELM_ATSPI_RELATION_DESCRIBED_BY,
+            ELM_ATSPI_RELATION_LAST_DEFINED,
+        }
+
+        internal enum Elm_Atspi_Role
+        {
+            ELM_ATSPI_ROLE_INVALID,
+            ELM_ATSPI_ROLE_ACCELERATOR_LABEL,
+            ELM_ATSPI_ROLE_ALERT,
+            ELM_ATSPI_ROLE_ANIMATION,
+            ELM_ATSPI_ROLE_ARROW,
+            ELM_ATSPI_ROLE_CALENDAR,
+            ELM_ATSPI_ROLE_CANVAS,
+            ELM_ATSPI_ROLE_CHECK_BOX,
+            ELM_ATSPI_ROLE_CHECK_MENU_ITEM,
+            ELM_ATSPI_ROLE_COLOR_CHOOSER,
+            ELM_ATSPI_ROLE_COLUMN_HEADER,
+            ELM_ATSPI_ROLE_COMBO_BOX,
+            ELM_ATSPI_ROLE_DATE_EDITOR,
+            ELM_ATSPI_ROLE_DESKTOP_ICON,
+            ELM_ATSPI_ROLE_DESKTOP_FRAME,
+            ELM_ATSPI_ROLE_DIAL,
+            ELM_ATSPI_ROLE_DIALOG,
+            ELM_ATSPI_ROLE_DIRECTORY_PANE,
+            ELM_ATSPI_ROLE_DRAWING_AREA,
+            ELM_ATSPI_ROLE_FILE_CHOOSER,
+            ELM_ATSPI_ROLE_FILLER,
+            ELM_ATSPI_ROLE_FOCUS_TRAVERSABLE,
+            ELM_ATSPI_ROLE_FONT_CHOOSER,
+            ELM_ATSPI_ROLE_FRAME,
+            ELM_ATSPI_ROLE_GLASS_PANE,
+            ELM_ATSPI_ROLE_HTML_CONTAINER,
+            ELM_ATSPI_ROLE_ICON,
+            ELM_ATSPI_ROLE_IMAGE,
+            ELM_ATSPI_ROLE_INTERNAL_FRAME,
+            ELM_ATSPI_ROLE_LABEL,
+            ELM_ATSPI_ROLE_LAYERED_PANE,
+            ELM_ATSPI_ROLE_LIST,
+            ELM_ATSPI_ROLE_LIST_ITEM,
+            ELM_ATSPI_ROLE_MENU,
+            ELM_ATSPI_ROLE_MENU_BAR,
+            ELM_ATSPI_ROLE_MENU_ITEM,
+            ELM_ATSPI_ROLE_OPTION_PANE,
+            ELM_ATSPI_ROLE_PAGE_TAB,
+            ELM_ATSPI_ROLE_PAGE_TAB_LIST,
+            ELM_ATSPI_ROLE_PANEL,
+            ELM_ATSPI_ROLE_PASSWORD_TEXT,
+            ELM_ATSPI_ROLE_POPUP_MENU,
+            ELM_ATSPI_ROLE_PROGRESS_BAR,
+            ELM_ATSPI_ROLE_PUSH_BUTTON,
+            ELM_ATSPI_ROLE_RADIO_BUTTON,
+            ELM_ATSPI_ROLE_RADIO_MENU_ITEM,
+            ELM_ATSPI_ROLE_ROOT_PANE,
+            ELM_ATSPI_ROLE_ROW_HEADER,
+            ELM_ATSPI_ROLE_SCROLL_BAR,
+            ELM_ATSPI_ROLE_SCROLL_PANE,
+            ELM_ATSPI_ROLE_SEPARATOR,
+            ELM_ATSPI_ROLE_SLIDER,
+            ELM_ATSPI_ROLE_SPIN_BUTTON,
+            ELM_ATSPI_ROLE_SPLIT_PANE,
+            ELM_ATSPI_ROLE_STATUS_BAR,
+            ELM_ATSPI_ROLE_TABLE,
+            ELM_ATSPI_ROLE_TABLE_CELL,
+            ELM_ATSPI_ROLE_TABLE_COLUMN_HEADER,
+            ELM_ATSPI_ROLE_TABLE_ROW_HEADER,
+            ELM_ATSPI_ROLE_TEAROFF_MENU_ITEM,
+            ELM_ATSPI_ROLE_TERMINAL,
+            ELM_ATSPI_ROLE_TEXT,
+            ELM_ATSPI_ROLE_TOGGLE_BUTTON,
+            ELM_ATSPI_ROLE_TOOL_BAR,
+            ELM_ATSPI_ROLE_TOOL_TIP,
+            ELM_ATSPI_ROLE_TREE,
+            ELM_ATSPI_ROLE_TREE_TABLE,
+            ELM_ATSPI_ROLE_UNKNOWN,
+            ELM_ATSPI_ROLE_VIEWPORT,
+            ELM_ATSPI_ROLE_WINDOW,
+            ELM_ATSPI_ROLE_EXTENDED,
+            ELM_ATSPI_ROLE_HEADER,
+            ELM_ATSPI_ROLE_FOOTER,
+            ELM_ATSPI_ROLE_PARAGRAPH,
+            ELM_ATSPI_ROLE_RULER,
+            ELM_ATSPI_ROLE_APPLICATION,
+            ELM_ATSPI_ROLE_AUTOCOMPLETE,
+            ELM_ATSPI_ROLE_EDITBAR,
+            ELM_ATSPI_ROLE_EMBEDDED,
+            ELM_ATSPI_ROLE_ENTRY,
+            ELM_ATSPI_ROLE_CHART,
+            ELM_ATSPI_ROLE_CAPTION,
+            ELM_ATSPI_ROLE_DOCUMENT_FRAME,
+            ELM_ATSPI_ROLE_HEADING,
+            ELM_ATSPI_ROLE_PAGE,
+            ELM_ATSPI_ROLE_SECTION,
+            ELM_ATSPI_ROLE_REDUNDANT_OBJECT,
+            ELM_ATSPI_ROLE_FORM,
+            ELM_ATSPI_ROLE_LINK,
+            ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW,
+            ELM_ATSPI_ROLE_TABLE_ROW,
+            ELM_ATSPI_ROLE_TREE_ITEM,
+            ELM_ATSPI_ROLE_DOCUMENT_SPREADSHEET,
+            ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION,
+            ELM_ATSPI_ROLE_DOCUMENT_TEXT,
+            ELM_ATSPI_ROLE_DOCUMENT_WEB,
+            ELM_ATSPI_ROLE_DOCUMENT_EMAIL,
+            ELM_ATSPI_ROLE_COMMENT,
+            ELM_ATSPI_ROLE_LIST_BOX,
+            ELM_ATSPI_ROLE_GROUPING,
+            ELM_ATSPI_ROLE_IMAGE_MAP,
+            ELM_ATSPI_ROLE_NOTIFICATION,
+            ELM_ATSPI_ROLE_INFO_BAR
+        }
+
+        [Flags]
+        internal enum Elm_Accessible_Reading_Info_Type
+        {
+            ELM_ACCESSIBLE_READING_INFO_TYPE_NAME = 0x1,
+            ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE = 0x2,
+            ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION = 0x4,
+            ELM_ACCESSIBLE_READING_INFO_TYPE_STATE = 0x8
+        }
+
+        internal delegate void Elm_Atspi_Say_Signal_Cb(IntPtr data, string say_signal);
+        internal delegate string Elm_Atspi_Reading_Info_Cb(IntPtr data, IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, int type, IntPtr relationObj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, int type, IntPtr relationObj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_translation_domain_get")]
+        internal static extern IntPtr _elm_atspi_accessible_translation_domain_get(IntPtr obj);
+
+        internal static string elm_atspi_accessible_translation_domain_get(IntPtr obj)
+        {
+            var str = _elm_atspi_accessible_translation_domain_get(obj);
+            return Marshal.PtrToStringAnsi(str);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_translation_domain_set(IntPtr obj, string domain);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_name_set(IntPtr obj, string name);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_name_get")]
+        internal static extern IntPtr _elm_atspi_accessible_name_get(IntPtr obj);
+
+        internal static string elm_atspi_accessible_name_get(IntPtr obj)
+        {
+            var str = _elm_atspi_accessible_name_get(obj);
+            return Marshal.PtrToStringAnsi(str);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_name_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb name_cb, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Atspi_Role elm_atspi_accessible_role_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_role_set(IntPtr obj, Elm_Atspi_Role role);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_description_set(IntPtr obj, string description);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_description_get")]
+        internal static extern IntPtr _elm_atspi_accessible_description_get(IntPtr obj);
+        internal static string elm_atspi_accessible_description_get(IntPtr obj)
+        {
+            var str = _elm_atspi_accessible_description_get(obj);
+            return Marshal.PtrToStringAnsi(str);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_description_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb description_cb, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_reading_info_type_set(IntPtr obj, Elm_Accessible_Reading_Info_Type reading_info);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_atspi_accessible_reading_info_type_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_accessible_can_highlight_set(IntPtr obj, bool can_highlight);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_atspi_accessible_can_highlight_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_atspi_component_highlight_grab(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_atspi_component_highlight_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_atspi_bridge_utils_say(string text, bool discardable, Elm_Atspi_Say_Signal_Cb func, IntPtr data);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Bg.cs b/src/ElmSharp/Interop/Interop.Elementary.Bg.cs
new file mode 100644 (file)
index 0000000..2f6f732
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        public enum BackgroundOptions
+        {
+            Center, Scale, Stretch, Tile
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_bg_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_bg_color_set(IntPtr obj, int r, int g, int b);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_bg_color_get(IntPtr obj, out int r, out int g, out int b);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_bg_file_set(IntPtr obj, string file, IntPtr group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_bg_file_get(IntPtr obj, out IntPtr file, IntPtr group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_bg_option_set(IntPtr obj, BackgroundOptions option);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_bg_load_size_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern BackgroundOptions elm_bg_option_get(IntPtr obj);
+
+        internal static string BackgroundFileGet(IntPtr obj)
+        {
+            IntPtr file = IntPtr.Zero;
+            elm_bg_file_get(obj, out file, IntPtr.Zero);
+            return Marshal.PtrToStringAnsi(file);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Box.cs b/src/ElmSharp/Interop/Interop.Elementary.Box.cs
new file mode 100644 (file)
index 0000000..cb104a6
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        public delegate void BoxLayoutCallback(IntPtr obj, IntPtr priv, IntPtr userData);
+
+        public delegate void BoxDataFreeCallback(IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_box_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_box_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_pack_start(IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_pack_end(IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_pack_before(IntPtr obj, IntPtr subobj, IntPtr before);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_pack_after(IntPtr obj, IntPtr subobj, IntPtr after);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_unpack(IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_unpack_all(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_align_set(IntPtr obj, double horizontal, double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, out double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_align_get(IntPtr obj, IntPtr horizontal, out double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, IntPtr vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_box_children_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_padding_set(IntPtr obj, int horizontal, int vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_padding_get(IntPtr obj, out int horizontal, out int vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, BoxDataFreeCallback dataFreeCb);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, IntPtr dataFreeCb);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_box_homogeneous_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_homogeneous_set(IntPtr obj, bool ishomogeneous);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_box_recalculate(IntPtr obj);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Button.cs b/src/ElmSharp/Interop/Interop.Elementary.Button.cs
new file mode 100644 (file)
index 0000000..5d5279f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_button_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_button_autorepeat_initial_timeout_set(IntPtr obj, double t);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_button_autorepeat_initial_timeout_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_button_autorepeat_gap_timeout_set(IntPtr obj, double t);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_button_autorepeat_gap_timeout_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_button_autorepeat_set(IntPtr obj, bool on);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_button_autorepeat_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_radio_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_radio_group_add(IntPtr obj, IntPtr group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_radio_state_value_set(IntPtr obj, int value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_radio_state_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_radio_value_set(IntPtr obj, int value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_radio_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_radio_selected_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_check_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_check_state_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_check_state_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_check_state_pointer_set(IntPtr obj, bool value);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs b/src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs
new file mode 100644 (file)
index 0000000..6885035
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal enum Elm_Calendar_Mark_Repeat_Type
+        {
+            ELM_CALENDAR_UNIQUE = 0, /* Default value. Marks will be displayed only on event day. */
+            ELM_CALENDAR_DAILY, /* Marks will be displayed every day after event day (inclusive). */
+            ELM_CALENDAR_WEEKLY, /* Marks will be displayed every week after event day (inclusive) */
+            ELM_CALENDAR_MONTHLY, /* Marks will be displayed every month day that coincides to event day. */
+            ELM_CALENDAR_ANNUALLY, /* Marks will be displayed every year that coincides to event day (and month). */
+            LM_CALENDAR_LAST_DAY_OF_MONTH /* Marks will be displayed every last day of month after event day (inclusive). */
+        };
+
+        internal enum Elm_Calendar_Select_Mode
+        {
+            ELM_CALENDAR_SELECT_MODE_DEFAULT = 0, /* Default value. a day is always selected. */
+            ELM_CALENDAR_SELECT_MODE_ALWAYS, /* a day is always selected. */
+            ELM_CALENDAR_SELECT_MODE_NONE, /* None of the days can be selected. */
+            ELM_CALENDAR_SELECT_MODE_ONDEMAND /* User may have selected a day or not. */
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_calendar_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_calendar_weekdays_names_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_weekdays_names_set(IntPtr obj, string[] weekdays);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_min_max_year_set(IntPtr obj, int min, int max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_min_max_year_get(IntPtr obj, out int min, out int max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_selected_time_set(IntPtr obj, ref Libc.SystemTime selectedtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_selected_time_get(IntPtr obj, ref Libc.SystemTime selectedtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_first_day_of_week_set(IntPtr obj, int day);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_calendar_first_day_of_week_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_selectable_set(IntPtr obj, int SelectedField);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_calendar_selectable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_calendar_displayed_time_get(IntPtr obj, out Libc.SystemTime displayedtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_interval_set(IntPtr obj, double interval);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_calendar_interval_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_select_mode_set(IntPtr obj, Elm_Calendar_Select_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_calendar_select_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_calendar_mark_add(IntPtr obj, string type, ref Libc.SystemTime date, Elm_Calendar_Mark_Repeat_Type repeatType);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_mark_del(IntPtr markItem);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_marks_draw(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_marks_clear(IntPtr obj);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate string Elm_Calendar_Format_Cb(Libc.SystemTime date);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_calendar_format_function_set(IntPtr obj, Elm_Calendar_Format_Cb format_function);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs b/src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs
new file mode 100755 (executable)
index 0000000..231fc9d
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+
+        internal enum Elm_Colorselector_Mode
+        {
+            ELM_COLORSELECTOR_PALETTE = 0, /* Only color palette is displayed. */
+            ELM_COLORSELECTOR_COMPONENTS, /* Only color selector is displayed. */
+            ELM_COLORSELECTOR_BOTH, /* Both Palette and selector is displayed, default.*/
+            ELM_COLORSELECTOR_PICKER, /* Only color picker is displayed. */
+            ELM_COLORSELECTOR_ALL /* All possible color selector is displayed. */
+        };
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_colorselector_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_palette_name_set(IntPtr obj, string name);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_colorselector_palette_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_colorselector_palette_name_get(IntPtr obj);
+        internal static string elm_colorselector_palette_name_get(IntPtr obj)
+        {
+            var text = _elm_colorselector_palette_name_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_mode_set(IntPtr obj, Elm_Colorselector_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Colorselector_Mode elm_colorselector_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_colorselector_palette_color_add(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_palette_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_colorselector_palette_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_palette_item_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_colorselector_palette_item_selected_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_colorselector_palette_item_selected_set(IntPtr obj, bool selected);
+
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs b/src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs
new file mode 100644 (file)
index 0000000..e2db4ba
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_ctxpopup_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_ctxpopup_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_ctxpopup_auto_hide_disabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_auto_hide_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_ctxpopup_hover_parent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_hover_parent_set(IntPtr obj, IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_ctxpopup_direction_available_get(IntPtr obj, int direction);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_direction_priority_set(IntPtr obj, int first, int second, int third, int fourth);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_direction_priority_get(IntPtr obj, out int first, out int second, out int third, out int fourth);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_ctxpopup_direction_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_dismiss(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_ctxpopup_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_ctxpopup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs b/src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs
new file mode 100644 (file)
index 0000000..e65b9ef
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_datetime_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_set(IntPtr obj, ref Libc.SystemTime newtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_get(IntPtr obj, ref Libc.SystemTime currtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_format_set(IntPtr obj, string format);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr _elm_datetime_format_get(IntPtr obj);
+
+        internal static string elm_datetime_format_get(IntPtr obj)
+        {
+            var format = _elm_datetime_format_get(obj);
+            return Marshal.PtrToStringAnsi(format);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_max_set(IntPtr obj, ref Libc.SystemTime maxtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_max_get(IntPtr obj, ref Libc.SystemTime maxtime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_min_set(IntPtr obj, ref Libc.SystemTime mintime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_value_min_get(IntPtr obj, ref Libc.SystemTime mintime);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_datetime_field_limit_set(IntPtr obj, int type, int min, int max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_datetime_field_limit_get(IntPtr obj, int type, out int min, out int max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_datetime_field_visible_set(IntPtr obj, int type, bool visible);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_datetime_field_visible_get(IntPtr obj, int type);
+
+        internal enum DateTimeFieldType
+        {
+            Year,
+            Month,
+            Date,
+            Hour,
+            Minute,
+            AmPm
+        }
+    }
+}
+
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Entry.cs b/src/ElmSharp/Interop/Interop.Elementary.Entry.cs
new file mode 100644 (file)
index 0000000..b858d5a
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        /// <summary>
+        /// Types of "Enter" keys available for different keyboards layout
+        /// </summary>
+        public enum ReturnKeyType
+        {
+            Default,
+            Done,
+            Go,
+            Join,
+            Login,
+            Next,
+            Search,
+            Send,
+            Signin
+        }
+
+        public enum InputPanelLayout
+        {
+            Normal,
+            Number,
+            Email,
+            Url,
+            PhoneNumber,
+            Ip,
+            Month,
+            NumberOnly,
+            Invalid,
+            Hex,
+            Terminal,
+            Password,
+            DateTime,
+            Emoticon
+        }
+
+        internal enum WrapType
+        {
+            None,
+            Char,
+            Word,
+            Mixed,
+        }
+
+        internal enum AutocapitalType
+        {
+            None,
+            Word,
+            Sentence,
+            AllCharacter,
+        }
+
+        internal enum InputHints
+        {
+            None,
+            AutoComplete,
+            SensitiveData,
+        }
+
+        internal enum InputPanelLanguage
+        {
+            Automatic,
+            Alphabet,
+        }
+
+        internal enum CopyAndPasteMode
+        {
+            Markup,
+            NoImage,
+            PlainText
+        }
+
+        internal enum TextFormat
+        {
+            PlainUtf8,
+            MarkupUtf8
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_entry_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_editable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_editable_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_single_line_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_single_line_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_entry_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_entry_entry_get(IntPtr obj);
+
+        internal static string elm_entry_entry_get(IntPtr obj)
+        {
+            var text = _elm_entry_entry_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_entry_set(IntPtr obj, string value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_entry_append(IntPtr obj, string value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_entry_insert(IntPtr obj, string value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_file_get(IntPtr obj, out string file, out TextFormat format);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_file_set(IntPtr obj, string file, TextFormat format);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_file_save(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_password_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_password_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_is_empty(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_next(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_prev(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_up(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_down(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_begin_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_end_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern string elm_entry_cursor_content_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_line_begin_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_line_end_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_entry_cursor_pos_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_pos_set(IntPtr obj, int pos);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_geometry_get(IntPtr obj, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_is_format_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_cursor_is_visible_format_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_selection_begin(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cursor_selection_end(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern string elm_entry_markup_to_utf8(IntPtr text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern string elm_entry_markup_to_utf8(string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_show(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_enabled_set(IntPtr obj, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_input_panel_enabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_return_key_type_set(IntPtr obj, ReturnKeyType keyType);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_layout_set(IntPtr obj, InputPanelLayout layout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern InputPanelLayout elm_entry_input_panel_layout_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_select_all(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_select_none(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_text_style_user_pop(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_text_style_user_push(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_entry_text_style_user_peek(IntPtr obj);
+
+        internal static string elm_entry_text_style_user_peek(IntPtr obj)
+        {
+            var text = _elm_entry_text_style_user_peek(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_scrollable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_scrollable_set(IntPtr obj, bool scroll);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_hide(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_imdata_set(IntPtr obj, IntPtr data, int len);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_entry_input_panel_layout_variation_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_layout_variation_set(IntPtr obj, int variation);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern WrapType elm_entry_line_wrap_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_line_wrap_set(IntPtr obj, WrapType wrap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern AutocapitalType elm_entry_autocapital_type_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_autocapital_type_set(IntPtr obj, AutocapitalType autoCapitalType);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_autosave_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_autosave_set(IntPtr obj, bool autosave);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern CopyAndPasteMode elm_entry_cnp_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_cnp_mode_set(IntPtr obj, CopyAndPasteMode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_calc_force(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_entry_imf_context_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern InputHints elm_entry_input_hint_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_hint_set(IntPtr obj, InputHints hints);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern InputPanelLanguage elm_entry_input_panel_language_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_language_set(IntPtr obj, InputPanelLanguage lang);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_input_panel_return_key_disabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_return_key_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_return_key_autoenabled_set(IntPtr obj, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_input_panel_show_on_demand_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_input_panel_show_on_demand_set(IntPtr obj, bool onDemand);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_markup_filter_append(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_markup_filter_prepend(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_markup_filter_remove(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_entry_prediction_allow_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_prediction_allow_set(IntPtr obj, bool prediction);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_select_allow_set(IntPtr obj, bool allow);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern string elm_entry_utf8_to_markup(string str);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Elm_Entry_Filter_Cb(IntPtr data, IntPtr obj, ref IntPtr text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_entry_anchor_hover_parent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_anchor_hover_parent_set(IntPtr obj, IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_anchor_hover_end(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_anchor_hover_style_get")]
+        internal static extern IntPtr _elm_entry_anchor_hover_style_get(IntPtr obj);
+
+        internal static string elm_entry_anchor_hover_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_entry_anchor_hover_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_anchor_hover_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_icon_visible_set(IntPtr obj, bool setting);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate IntPtr Elm_Entry_Item_Provider_Cb(IntPtr data, IntPtr entry, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_item_provider_append(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_item_provider_prepend(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_item_provider_remove(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_selection_copy(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_selection_cut(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_selection_paste(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_selection_handler_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_selection_get")]
+        internal static extern IntPtr _elm_entry_selection_get(IntPtr obj);
+
+        internal static string elm_entry_selection_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_entry_selection_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_entry_select_region_set(IntPtr obj, int start, int end);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs b/src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs
new file mode 100644 (file)
index 0000000..9768571
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_flipselector_first_interval_get(IntPtr flipSelector);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_flipselector_first_interval_set(IntPtr flipSelector, double interval);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_item_append(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_item_prepend(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_flipselector_flip_next(IntPtr flipSelector);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_flipselector_flip_prev(IntPtr flipSelector);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_selected_item_get(IntPtr flipSelector);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_first_item_get(IntPtr flipSelector);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_flipselector_last_item_get(IntPtr flipSelector);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs b/src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs
new file mode 100644 (file)
index 0000000..b9acd01
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_align_set(IntPtr obj, double align_x, double align_y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, out double align_y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_align_get(IntPtr obj, IntPtr align_x, out double align_y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, IntPtr align_y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_multi_select_set(IntPtr obj, bool multi);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_multi_select_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_append(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr before, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr after, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_class_new();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_size_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_size_get(IntPtr obj, IntPtr w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, IntPtr h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_filled_set(IntPtr obj, bool fill);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_filled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gengrid_item_index_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_selected_set(IntPtr obj, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_item_selected_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern uint elm_gengrid_items_count(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_highlight_mode_set(IntPtr obj, bool highlight);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_highlight_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_show(IntPtr obj, int type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_bring_in(IntPtr obj, int type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_select_mode_set(IntPtr it, Elm_Object_Select_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(IntPtr it);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_select_mode_set(IntPtr it, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gengrid_select_mode_get(IntPtr it);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_realized_items_update(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_update(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_at_xy_item_get(IntPtr obj, int x, int y, out int xposret, out int yposret);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_first_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_class_free(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_last_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_cursor_get")]
+        internal static extern IntPtr _elm_gengrid_item_cursor_get(IntPtr obj);
+
+        internal static string elm_gengrid_item_cursor_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_gengrid_item_cursor_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_cursor_set(IntPtr obj, string cursor);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_cursor_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_cursor_style_get")]
+        internal static extern IntPtr _elm_gengrid_item_cursor_style_get(IntPtr obj);
+
+        internal static string elm_gengrid_item_cursor_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_gengrid_item_cursor_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_cursor_style_set(IntPtr obj, string cursor);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_item_cursor_engine_only_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_cursor_engine_only_set(IntPtr obj, bool engine);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_tooltip_text_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_tooltip_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_tooltip_style_get")]
+        internal static extern IntPtr _elm_gengrid_item_tooltip_style_get(IntPtr obj);
+
+        internal static string elm_gengrid_item_tooltip_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_gengrid_item_tooltip_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_tooltip_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gengrid_reorder_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_reorder_mode_set(IntPtr obj, bool mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_pos_get(IntPtr obj, out int row, out int column);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gengrid_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gengrid_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs
new file mode 100644 (file)
index 0000000..bfb326f
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal enum Elm_Genlist_Item_Scrollto_Type
+        {
+            ELM_GENLIST_ITEM_SCROLLTO_NONE = 0,
+
+            // Scrolls to nowhere
+            ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0),
+
+            // Scrolls to the nearest viewport
+            ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1),
+
+            // Scrolls to the top of the viewport
+            ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2),
+
+            // Scrolls to the middle of the viewport
+            ELM_GENLIST_ITEM_SCROLLTO_BOTTOM = (1 << 3)
+
+            // Scrolls to the bottom of the viewport
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Evas_Smart_Cb(IntPtr data, IntPtr obj, IntPtr eventInfo);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_mode_set(IntPtr obj, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_select_mode_set(IntPtr obj, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_select_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_append(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr before, int type, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_class_new();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_class_free(IntPtr itemClass);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_block_count_set(IntPtr obj, int count);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_block_count_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_homogeneous_set(IntPtr obj, bool homogeneous);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_homogeneous_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_item_index_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_item_type_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_parent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_realized_items_update(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_update(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_show(IntPtr item, Elm_Genlist_Item_Scrollto_Type type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_bring_in(IntPtr item, Elm_Genlist_Item_Scrollto_Type type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_items_count(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_first_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_last_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_next_get(IntPtr item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_prev_get(IntPtr item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_item_selected_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_selected_set(IntPtr obj, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_select_mode_set(IntPtr obj, Elm_Object_Select_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Object_Select_Mode elm_genlist_item_select_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_item_class_update(IntPtr obj, IntPtr itc);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_fields_update(IntPtr item, string part, uint type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_reorder_mode_set(IntPtr obj, bool mode);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_genlist_reorder_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern void elm_genlist_item_expanded_set(IntPtr obj, bool isExpanded);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_genlist_item_expanded_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_highlight_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_highlight_mode_set(IntPtr obj, bool highlight);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_at_xy_item_get(IntPtr obj, int x, int y, out int posret);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr after, int type, Evas.SmartCallback func, IntPtr func_data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_item_class_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_genlist_longpress_timeout_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_longpress_timeout_set(IntPtr obj, double timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_multi_select_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_multi_select_set(IntPtr obj, bool multi);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_nth_item_get(IntPtr obj, int nth);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_cursor_get")]
+        internal static extern IntPtr _elm_genlist_item_cursor_get(IntPtr obj);
+
+        internal static string elm_genlist_item_cursor_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_genlist_item_cursor_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_cursor_set(IntPtr obj, string cursor);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_cursor_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_item_cursor_engine_only_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_cursor_engine_only_set(IntPtr obj, bool engineOnly);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_cursor_style_get")]
+        internal static extern IntPtr _elm_genlist_item_cursor_style_get(IntPtr obj);
+
+        internal static string elm_genlist_item_cursor_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_genlist_item_cursor_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_cursor_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_demote(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_genlist_item_expanded_depth_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_subitems_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_tooltip_text_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_tooltip_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_tooltip_style_get")]
+        internal static extern IntPtr _elm_genlist_item_tooltip_style_get(IntPtr obj);
+
+        internal static string elm_genlist_item_tooltip_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_genlist_item_tooltip_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_tooltip_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_item_tooltip_window_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_genlist_item_tooltip_window_mode_set(IntPtr obj, bool disable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_genlist_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_genlist_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs b/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs
new file mode 100644 (file)
index 0000000..369eba1
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        public delegate void GestureEventCallback(IntPtr data, IntPtr event_info);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_gesture_layer_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gesture_layer_attach(IntPtr obj, IntPtr target);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_zoom_step_set(IntPtr obj, double step);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_zoom_step_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_tap_finger_size_set(IntPtr obj, int sz);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gesture_layer_tap_finger_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_hold_events_set(IntPtr obj, bool hold_events);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gesture_layer_hold_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_rotate_step_set(IntPtr obj, double step);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_rotate_step_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_cb_set(IntPtr obj, ElmSharp.GestureLayer.GestureType idx, ElmSharp.GestureLayer.GestureState cb_type, GestureEventCallback cb, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_line_min_length_set(IntPtr obj, int line_min_length);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gesture_layer_line_min_length_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_zoom_distance_tolerance_set(IntPtr obj, int zoom_distance_tolerance);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gesture_layer_zoom_distance_tolerance_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_line_distance_tolerance_set(IntPtr obj, int line_distance_tolerance);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_gesture_layer_line_distance_tolerance_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_line_angular_tolerance_set(IntPtr obj, double line_angular_tolerance);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_line_angular_tolerance_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_zoom_wheel_factor_set(IntPtr obj, double zoom_wheel_factor);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_zoom_wheel_factor_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_zoom_finger_factor_set (IntPtr obj, double zoom_finger_factor);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_zoom_finger_factor_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_rotate_angular_tolerance_set (IntPtr obj, double rotate_angular_tolerance);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_rotate_angular_tolerance_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_flick_time_limit_ms_set (IntPtr obj, UInt32 flick_time_limit_ms);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern UInt32 elm_gesture_layer_flick_time_limit_ms_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_long_tap_start_timeout_set(IntPtr obj, double long_tap_start_timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_long_tap_start_timeout_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_continues_enable_set(IntPtr obj, bool continues_enable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_gesture_layer_continues_enable_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_gesture_layer_double_tap_timeout_set (IntPtr obj, double double_tap_timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_gesture_layer_double_tap_timeout_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_config_glayer_long_tap_start_timeout_get ();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_glayer_long_tap_start_timeout_set(double long_tap_timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_config_glayer_double_tap_timeout_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_glayer_double_tap_timeout_set(double double_tap_timeout);
+    }
+}
+
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs b/src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs
new file mode 100755 (executable)
index 0000000..ca8cefe
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_hoversel_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_hoversel_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_hover_parent_set(IntPtr obj, IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_hoversel_hover_parent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_hoversel_expanded_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_auto_update_set(IntPtr obj, bool auto_update);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_hoversel_auto_update_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_hover_begin(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_hover_end(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_hoversel_item_add(IntPtr obj, string label, string icon_file, int icon_type, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_item_icon_set(IntPtr obj, string icon_file, string icon_group, int icon_type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_hoversel_item_icon_get(IntPtr obj, out string icon_file, out string icon_group, int icon_type);
+    }
+}
+
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Image.cs b/src/ElmSharp/Interop/Interop.Elementary.Image.cs
new file mode 100644 (file)
index 0000000..c49ff92
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_image_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_async_open_set(IntPtr obj, bool async);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_image_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_image_object_size_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_preload_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_file_set(IntPtr obj, string file, string group);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_image_file_get")]
+        internal static extern void _elm_image_file_get(IntPtr obj, out IntPtr file, out IntPtr group);
+        internal static string elm_image_file_get(IntPtr obj)
+        {
+            IntPtr file;
+            IntPtr group;
+            _elm_image_file_get(obj, out file, out group);
+            return Marshal.PtrToStringAnsi(file);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static unsafe extern bool elm_image_memfile_set(IntPtr obj, byte* img, long size, IntPtr format, IntPtr key);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_smooth_set(IntPtr obj, bool smooth);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_smooth_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_resizable_set(IntPtr obj, bool up, bool down);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_resizable_get(IntPtr obj, out bool up, out bool down);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_no_scale_set(IntPtr obj, bool no_scale);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_no_scale_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_aspect_fixed_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_aspect_fixed_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_fill_outside_set(IntPtr obj, bool fill_outside);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_fill_outside_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_animated_available_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_animated_set(IntPtr obj, bool anim);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_animated_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_animated_play_set(IntPtr obj, bool play);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_animated_play_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_prescale_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_image_prescale_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_editable_set(IntPtr obj, bool set);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_image_editable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_image_orient_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_orient_set(IntPtr obj, int orient);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_icon_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_icon_standard_set(IntPtr obj, string name);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_icon_standard_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_icon_standard_get(IntPtr obj);
+        internal static string elm_icon_standard_get(IntPtr obj)
+        {
+            var text = _elm_icon_standard_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_icon_thumb_set(IntPtr obj, string file, string group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_icon_order_lookup_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_icon_order_lookup_set(IntPtr obj, int order);
+    }
+}
+
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Index.cs b/src/ElmSharp/Interop/Interop.Elementary.Index.cs
new file mode 100644 (file)
index 0000000..f2ecacd
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal delegate void EventCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+        internal delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_index_autohide_disabled_get(IntPtr index);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_autohide_disabled_set(IntPtr index, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_index_horizontal_get(IntPtr index);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_horizontal_set(IntPtr index, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_append(IntPtr index, string text, EventCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_prepend(IntPtr index, string text, EventCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_selected_item_get(IntPtr index, int level);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_item_selected_set(IntPtr item, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_level_go(IntPtr index, int level);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_index_indicator_disabled_get(IntPtr index);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_indicator_disabled_set(IntPtr index, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_index_omit_enabled_get(IntPtr index);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_omit_enabled_set(IntPtr index, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_insert_before(IntPtr obj, IntPtr before, string letter, EventCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_sorted_insert(IntPtr obj, string letter, Evas_Smart_Cb func, IntPtr data, Eina_Compare_Cb cmpFunc, Eina_Compare_Cb cmpDataFunc);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_delay_change_time_set(IntPtr obj, double time);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_index_delay_change_time_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_item_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_find(IntPtr obj, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_index_item_insert_after(IntPtr obj, IntPtr after, string letter, SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_index_item_level_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_item_level_set(IntPtr obj, int level);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_index_standard_priority_set(IntPtr obj, int priority);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_index_standard_priority_get(IntPtr obj);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Item.cs b/src/ElmSharp/Interop/Interop.Elementary.Item.cs
new file mode 100644 (file)
index 0000000..0d516ec
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
+
+        internal static string elm_object_item_part_text_get(IntPtr obj, string part)
+        {
+            var text = _elm_object_item_part_text_get(obj, part);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_data_get(IntPtr it);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_del(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_item_disabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_part_content_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_access_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_access_unregister(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_track(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_untrack(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_widget_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_signal_emit(IntPtr obj, string emission, string source);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_item_signal_callback_add(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_item_signal_callback_del(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate IntPtr Elm_Tooltip_Item_Content_Cb(IntPtr data, IntPtr obj, IntPtr tooltip, IntPtr item);
+
+        internal enum Elm_Object_Select_Mode
+        {
+            ELM_OBJECT_SELECT_MODE_DEFAULT,
+            ELM_OBJECT_SELECT_MODE_ALWAYS,
+            ELM_OBJECT_SELECT_MODE_NONE,
+            ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Label.cs b/src/ElmSharp/Interop/Interop.Elementary.Label.cs
new file mode 100755 (executable)
index 0000000..bf5c2d5
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_label_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_slide_mode_set(IntPtr obj, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_label_slide_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_slide_duration_set(IntPtr obj, double duration);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_label_slide_duration_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_slide_speed_set(IntPtr obj, double speed);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_label_slide_speed_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_slide_go(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_line_wrap_set(IntPtr obj, int wrap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_label_line_wrap_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_wrap_width_set(IntPtr obj, int w);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_label_wrap_width_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_ellipsis_set(IntPtr obj, bool ellipsis);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_label_ellipsis_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_label_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_label_text_style_user_peek(IntPtr obj);
+        internal static string elm_label_text_style_user_peek(IntPtr obj)
+        {
+            var text = _elm_label_text_style_user_peek(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_text_style_user_push(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_label_text_style_user_pop(IntPtr obj);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.List.cs b/src/ElmSharp/Interop/Interop.Elementary.List.cs
new file mode 100644 (file)
index 0000000..40f4059
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        public enum Elm_List_Mode
+        {
+            ELM_LIST_COMPRESS = 0,
+            ELM_LIST_SCROLL,
+            ELM_LIST_LIMIT,
+            ELM_LIST_EXPAND,
+            ELM_LIST_LAST
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_list_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_list_item_append(IntPtr obj, string label, IntPtr lefticon, IntPtr righticon, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_list_item_prepend(IntPtr obj, string label, IntPtr icon, IntPtr end, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_list_go(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_list_mode_set(IntPtr obj, Elm_List_Mode listMode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_List_Mode elm_list_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_list_item_selected_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_list_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_list_clear(IntPtr obj);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs b/src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs
new file mode 100644 (file)
index 0000000..0fa7ca5
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        public delegate bool MultiButtonEntryItemFilterCallback(IntPtr obj, string label, IntPtr itemData, IntPtr data);
+
+        public delegate string MultiButtonEntryFormatCallback(int count, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_entry_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_multibuttonentry_expanded_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_expanded_set(IntPtr obj, bool expanded);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_multibuttonentry_editable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_editable_set(IntPtr obj, bool editable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_prepend(IntPtr obj, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_append(IntPtr obj, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_insert_before(IntPtr obj, IntPtr before, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_insert_after(IntPtr obj, IntPtr after, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_first_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_last_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_item_selected_set(IntPtr obj, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_multibuttonentry_item_selected_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_clear(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_prev_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_multibuttonentry_item_next_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_format_function_set(IntPtr obj, MultiButtonEntryFormatCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_item_filter_append(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_item_filter_prepend(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_multibuttonentry_item_filter_remove(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs b/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs
new file mode 100644 (file)
index 0000000..732ecee
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_item_pop_cb_set(IntPtr it, Elm_Naviframe_Item_Pop_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_event_enabled_set(IntPtr obj, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_prev_btn_auto_pushed_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_naviframe_prev_btn_auto_pushed_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_item_title_enabled_set(IntPtr item, bool enable, bool transition);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_naviframe_item_title_enabled_get(IntPtr item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_item_push(IntPtr obj, string title, IntPtr prev, IntPtr next, IntPtr content, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_item_pop(IntPtr obj);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool Elm_Naviframe_Item_Pop_Cb(IntPtr data, IntPtr item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_content_preserve_on_pop_set(IntPtr obj, bool preserve);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_naviframe_content_preserve_on_pop_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_item_insert_before(IntPtr naviframe, IntPtr before, string title, IntPtr prev, IntPtr next, IntPtr content, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_item_insert_after(IntPtr naviframe, IntPtr after, string title, IntPtr prev, IntPtr next, IntPtr content, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_top_item_get(IntPtr naviframe);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_naviframe_bottom_item_get(IntPtr naviframe);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_item_pop_to(IntPtr item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_naviframe_item_style_set(IntPtr item, string style);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_naviframe_item_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_naviframe_item_style_get(IntPtr item);
+
+        internal static string elm_naviframe_item_style_get(IntPtr item)
+        {
+            var text = _elm_naviframe_item_style_get(item);
+            return Marshal.PtrToStringAnsi(text);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Panel.cs b/src/ElmSharp/Interop/Interop.Elementary.Panel.cs
new file mode 100644 (file)
index 0000000..c25f4fd
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_panel_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panel_toggle(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panel_hidden_set(IntPtr obj, bool hidden);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_panel_hidden_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panel_scrollable_set(IntPtr obj, bool scrollable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panel_scrollable_content_size_set(IntPtr obj, double ratio);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panel_orient_set(IntPtr obj, int orient);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_panel_orient_get(IntPtr obj);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Panes.cs b/src/ElmSharp/Interop/Interop.Elementary.Panes.cs
new file mode 100644 (file)
index 0000000..d3aa6e8
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_panes_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_left_size_set(IntPtr obj, double size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_panes_content_left_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_panes_content_left_min_relative_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_left_min_relative_size_set(IntPtr obj, double size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_panes_content_left_min_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_left_min_size_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_right_size_set(IntPtr obj, double size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_panes_content_right_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_panes_content_right_min_relative_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_right_min_relative_size_set(IntPtr obj, double size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_panes_content_right_min_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_content_right_min_size_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_panes_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_panes_fixed_set(IntPtr obj, bool fix);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_panes_fixed_get(IntPtr obj);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Popup.cs b/src/ElmSharp/Interop/Interop.Elementary.Popup.cs
new file mode 100644 (file)
index 0000000..aeae832
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_popup_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_popup_timeout_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_timeout_set(IntPtr obj, double timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_popup_timeout_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_popup_orient_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_orient_set(IntPtr obj, int orient);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_popup_orient_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_allow_events_set(IntPtr obj, bool allow);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_popup_allow_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_popup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_dismiss(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_align_set(IntPtr obj, double horizontal, double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, out double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_align_get(IntPtr obj, IntPtr horizontal, out double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, IntPtr vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_popup_content_text_wrap_type_set(IntPtr obj, int type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_popup_content_text_wrap_type_get(IntPtr obj);
+
+        internal static double GetPopupAlignX(IntPtr obj)
+        {
+            double x;
+            elm_popup_align_get(obj, out x, IntPtr.Zero);
+            return x;
+        }
+
+        internal static double GetPopupAlignY(IntPtr obj)
+        {
+            double y;
+            elm_popup_align_get(obj, IntPtr.Zero, out y);
+            return y;
+        }
+
+        internal static void SetPopupAlignX(IntPtr obj, double x)
+        {
+            double y = GetPopupAlignY(obj);
+            elm_popup_align_set(obj, x, y);
+        }
+
+        internal static void SetPopupAlignY(IntPtr obj, double y)
+        {
+            double x = GetPopupAlignX(obj);
+            elm_popup_align_set(obj, x, y);
+        }
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs b/src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs
new file mode 100644 (file)
index 0000000..259b53f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_progressbar_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_progressbar_pulse_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_pulse_set(IntPtr obj, bool pulse);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_progressbar_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_inverted_set(IntPtr obj, bool inverted);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_progressbar_inverted_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_value_set(IntPtr obj, double val);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_progressbar_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_span_size_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_progressbar_span_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_pulse(IntPtr obj, bool state);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_part_value_set(IntPtr obj, string part, double val);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_progressbar_part_value_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_progressbar_unit_format_set(IntPtr obj, string format);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr _elm_progressbar_unit_format_get(IntPtr obj);
+
+        internal static string elm_progressbar_unit_format_get(IntPtr obj)
+        {
+            var format = _elm_progressbar_unit_format_get(obj);
+            return Marshal.PtrToStringAnsi(format);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs b/src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs
new file mode 100644 (file)
index 0000000..671aa5c
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_interface_scrollable_content_size_get (out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_interface_scrollable_page_bring_in (int pagenumber_h, int pagenumber_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_scroller_add (IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_bounce_get(IntPtr obj, out bool h_bounce, out bool v_bounce);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_bounce_set(IntPtr obj, bool h_bounce, bool v_bounce);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_child_size_get (IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_content_min_limit (IntPtr obj, bool w, bool h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_current_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_gravity_get(IntPtr obj, out double x, out double y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_gravity_set (IntPtr obj, double x, double y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_last_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_loop_get(IntPtr obj, out bool loop_h, out bool loop_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_loop_set (IntPtr obj, bool loop_h, bool loop_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_scroller_movement_block_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_movement_block_set(IntPtr obj, int block);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_bring_in (IntPtr obj, int h_pagenumber, int v_pagenumber);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_relative_get (IntPtr obj, out double h_pagerel, out double v_pagerel);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_relative_set (IntPtr obj, double h_pagerel, double v_pagerel);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_show (IntPtr obj, int h_pagenumber, int v_pagenumber);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_size_get (IntPtr obj, out int h_pagesize, out int v_pagesize);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_size_set (IntPtr obj, int h_pagesize, int v_pagesize);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_snap_get (IntPtr obj, out bool page_h_snap, out bool page_v_snap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_snap_set (IntPtr obj, bool page_h_snap, bool page_v_snap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, out int policy_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, IntPtr policy_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_policy_get(IntPtr obj, IntPtr policy_h, out int policy_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_policy_set(IntPtr obj, int policy_h, int policy_v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_region_bring_in (IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_region_get (IntPtr obj, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_region_show (IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_scroller_single_direction_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_single_direction_set(IntPtr obj, int singleDirection);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_step_size_get (IntPtr obj, out int x, out int y);
+
+        [DllImportAttribute(Libraries.Elementary)]
+        internal static extern void elm_scroller_step_size_set (IntPtr obj, int x, int y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_scroller_wheel_disabled_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_wheel_disabled_set (IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_scroller_propagate_events_get (IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_propagate_events_set (IntPtr obj, bool propagation);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_scroll_limit_get (IntPtr obj, out int page_limit_h_, out int page_limit_v_);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_scroller_page_scroll_limit_set (IntPtr obj, int page_limit_h_, int page_limit_v_);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_scroll_lock_y_set(IntPtr obj, bool enable);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Slider.cs b/src/ElmSharp/Interop/Interop.Elementary.Slider.cs
new file mode 100755 (executable)
index 0000000..6f30f31
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal enum Elm_Slider_Indicator_Visible_Mode
+        {
+            ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT, /* show indicator on mouse down or change in slider value */
+            ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /* Always show the indicator. */
+            ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /* Show the indicator on focus */
+            ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /* Never show the indicator */
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_slider_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_indicator_show_set(IntPtr obj, bool show);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_slider_indicator_show_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_indicator_show_on_focus_set(IntPtr obj, bool focus);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_slider_indicator_show_on_focus_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_indicator_format_set(IntPtr obj, string indicator);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_indicator_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_slider_indicator_format_get(IntPtr obj);
+
+        internal static string elm_slider_indicator_format_get(IntPtr obj)
+        {
+            var text = _elm_slider_indicator_format_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_unit_format_set(IntPtr obj, string units);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_unit_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_slider_unit_format_get(IntPtr obj);
+
+        internal static string elm_slider_unit_format_get(IntPtr obj)
+        {
+            var text = _elm_slider_unit_format_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_inverted_set(IntPtr obj, bool inverted);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_slider_inverted_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_horizontal_set(IntPtr obj, bool value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_slider_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_min_max_set(IntPtr obj, double min, double max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, out double max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, IntPtr max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_min_max_get(IntPtr obj, IntPtr min, out double max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_value_set(IntPtr obj, double val);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_slider_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_span_size_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_slider_span_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_step_set(IntPtr obj, double step);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_slider_step_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_slider_indicator_visible_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_slider_indicator_visible_mode_set(IntPtr obj, int mode);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Spinner.cs b/src/ElmSharp/Interop/Interop.Elementary.Spinner.cs
new file mode 100644 (file)
index 0000000..338b4cc
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_spinner_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_min_max_set(IntPtr obj, double min, double max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_min_max_get(IntPtr obj, out double min, IntPtr max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_min_max_get(IntPtr obj, IntPtr min, out double max);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_step_set(IntPtr obj, double step);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_spinner_step_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_wrap_set(IntPtr obj, bool wrap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_spinner_wrap_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_interval_set(IntPtr obj, double interval);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_spinner_interval_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_round_set(IntPtr obj, int rnd);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_spinner_round_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_editable_set(IntPtr obj, bool editable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_spinner_editable_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_base_set(IntPtr obj, double value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_spinner_base_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_value_set(IntPtr obj, double val);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_spinner_value_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_label_format_set(IntPtr obj, string fmt);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_label_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_spinner_label_format_get(IntPtr obj);
+        internal static string elm_spinner_label_format_get(IntPtr obj)
+        {
+            var text = _elm_spinner_label_format_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_special_value_add(IntPtr obj, double value, string label);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_spinner_special_value_del(IntPtr obj, double value);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_special_value_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_spinner_special_value_get(IntPtr obj, double value);
+        internal static string elm_spinner_special_value_get(IntPtr obj, double value)
+        {
+            var text = _elm_spinner_special_value_get(obj, value);
+            return Marshal.PtrToStringAnsi(text);
+        }
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Table.cs b/src/ElmSharp/Interop/Interop.Elementary.Table.cs
new file mode 100644 (file)
index 0000000..d793a75
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_table_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_homogeneous_set(IntPtr obj, bool homogeneous);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_table_homogeneous_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_padding_set(IntPtr obj, int horizontal, int vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_padding_get(IntPtr obj, out int horizontal, out int vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_clear (IntPtr obj, bool clear);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_unpack (IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_pack(IntPtr obj, IntPtr subobj, int column, int row, int colspan, int rowspan);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_pack_set(IntPtr subobj, int col, int row, int colspan, int rowspan);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_table_pack_get(IntPtr subobj, out int col, out int row, out int colspan, out int rowspan);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs b/src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs
new file mode 100644 (file)
index 0000000..d753827
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_add(IntPtr parent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_shrink_mode_set(IntPtr obj, int shrink_mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_toolbar_shrink_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_item_append(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_item_prepend(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_item_insert_before(IntPtr obj, IntPtr before, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_transverse_expanded_set(IntPtr obj, bool transverse_expanded);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_toolbar_transverse_expanded_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_select_mode_set(IntPtr obj, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_toolbar_select_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_toolbar_align_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_align_set(IntPtr obj, double align);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_homogeneous_set(IntPtr obj, bool homogeneous);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_toolbar_homogeneous_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_toolbar_horizontal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_horizontal_set(IntPtr obj, bool horizontal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_toolbar_icon_order_lookup_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_icon_order_lookup_set(IntPtr obj, int order);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_toolbar_icon_size_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_icon_size_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_item_icon_set(IntPtr obj, string icon);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_toolbar_item_icon_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_toolbar_item_icon_get(IntPtr obj);
+        internal static string elm_toolbar_item_icon_get(IntPtr obj)
+        {
+            var text = _elm_toolbar_item_icon_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_first_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_last_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_item_selected_set(IntPtr obj, bool selected);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_toolbar_item_selected_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_selected_item_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_toolbar_item_separator_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_toolbar_item_separator_set(IntPtr obj, bool separator);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_item_find_by_label(IntPtr obj, string label);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_item_insert_after(IntPtr obj, IntPtr after, string icon, string label, Evas_Smart_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_toolbar_items_count(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_menu_parent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_menu_parent_set(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_toolbar_more_item_get(IntPtr obj);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Elementary.Win.cs b/src/ElmSharp/Interop/Interop.Elementary.Win.cs
new file mode 100644 (file)
index 0000000..f0d2412
--- /dev/null
@@ -0,0 +1,444 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp;
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_add(IntPtr parent, string name, int type);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_util_standard_add(string name, string title);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_activate(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_title_set(IntPtr obj, string title);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _elm_win_title_get(IntPtr obj);
+
+        internal static string elm_win_title_get(IntPtr obj)
+        {
+            var text = _elm_win_title_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_screen_size_get(IntPtr obj, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_resize_object_del(IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_resize_object_add(IntPtr obj, IntPtr subobj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_raise(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_lower(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_alpha_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_alpha_set(IntPtr obj, bool alpha);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_role_get")]
+        internal static extern IntPtr _elm_win_role_get(IntPtr obj);
+
+        internal static string elm_win_role_get(IntPtr obj)
+        {
+            var text = _elm_win_role_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_role_set(IntPtr obj, string role);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_focus_highlight_style_get")]
+        internal static extern IntPtr _elm_win_focus_highlight_style_get(IntPtr obj);
+
+        internal static string elm_win_focus_highlight_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_win_focus_highlight_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_focus_highlight_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_borderless_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_borderless_set(IntPtr obj, bool borderless);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_focus_highlight_enabled_set(IntPtr obj, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_focus_highlight_enabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_autodel_set(IntPtr obj, bool autodel);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_autodel_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_override_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_override_set(IntPtr obj, bool isOverride);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_indicator_opacity_set(IntPtr obj, int opacity);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_indicator_opacity_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_indicator_mode_set(IntPtr obj, IndicatorMode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IndicatorMode elm_win_indicator_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_demand_attention_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_demand_attention_set(IntPtr obj, bool demandAttention);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_conformant_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_conformant_set(IntPtr obj, bool conformant);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_fullscreen_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_fullscreen_set(IntPtr obj, bool fullscreen);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_rotation_set(IntPtr obj, int rotation);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_rotation_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_rotation_with_resize_set(IntPtr obj, int rotation);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_prop_focus_skip_set(IntPtr obj, bool skip);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_wm_rotation_supported_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_focus_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_set")]
+        internal static extern void _elm_win_wm_rotation_available_rotations_set(IntPtr obj, IntPtr rotations, uint count);
+
+        internal static void elm_win_wm_rotation_available_rotations_set(IntPtr obj, int[] rotations)
+        {
+            IntPtr pRotations = Marshal.AllocHGlobal(Marshal.SizeOf<int>() * rotations.Length);
+            Marshal.Copy(rotations, 0, pRotations, rotations.Length);
+            _elm_win_wm_rotation_available_rotations_set(obj, pRotations, (uint)rotations.Length);
+            Marshal.FreeHGlobal(pRotations);
+        }
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_get")]
+        internal static extern bool _elm_win_wm_rotation_available_rotations_get(IntPtr obj, out IntPtr rotations, out int count);
+
+        internal static bool elm_win_wm_rotation_available_rotations_get(IntPtr obj, out int[] rotations)
+        {
+            IntPtr rotationArrPtr;
+            int count;
+            if (_elm_win_wm_rotation_available_rotations_get(obj, out rotationArrPtr, out count))
+            {
+                rotations = new int[count];
+                Marshal.Copy(rotationArrPtr, rotations, 0, count);
+                Libc.Free(rotationArrPtr);
+                return true;
+            }
+            rotations = null;
+            return false;
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_layer_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_layer_set(IntPtr obj, int layer);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_sticky_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_sticky_set(IntPtr obj, bool sticky);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_screen_dpi_get(IntPtr obj, out int xdpi, out int ydpi);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_iconified_set(IntPtr obj, bool iconified);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_win_iconified_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_floating_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_floating_mode_set(IntPtr obj, bool floating);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_win_keygrab_set(IntPtr obj, string key, ulong  modifiers, ulong notModifiers, int proirity, KeyGrabMode grabMode);
+
+        [DllImport(Libraries.Elementary)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool elm_win_keygrab_unset(IntPtr obj, string key, ulong modifiers, ulong notModifiers);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_win_keygrab_set(IntPtr obj, string key);
+
+        [DllImport(Libraries.Eext)]
+        internal static extern bool eext_win_keygrab_unset(IntPtr obj, string key);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_keyboard_win_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_keyboard_win_set(IntPtr obj, bool isKeyboard);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_keyboard_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_keyboard_mode_set(IntPtr obj, int mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_inwin_activate(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_inwin_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_inwin_content_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_inwin_content_set(IntPtr obj, IntPtr content);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_inwin_content_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_win_aspect_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_aspect_set(IntPtr obj, double aspect);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_autohide_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_autohide_set(IntPtr obj, bool autohide);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_center(IntPtr obj, bool h, bool v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_focus_highlight_animate_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_focus_highlight_animate_set(IntPtr obj, bool animate);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_icon_name_get")]
+        internal static extern IntPtr _elm_win_icon_name_get(IntPtr obj);
+
+        internal static string elm_win_icon_name_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_win_icon_name_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_icon_name_set(IntPtr obj, string iconName);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_icon_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_icon_object_set(IntPtr obj, IntPtr icon);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_inlined_image_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_maximized_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_maximized_set(IntPtr obj, bool maximized);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_modal_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_modal_set(IntPtr obj, bool modal);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_noblank_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_noblank_set(IntPtr obj, bool noblank);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_norender_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_norender_pop(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_norender_push(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_win_profile_get")]
+        internal static extern IntPtr _elm_win_profile_get(IntPtr obj);
+
+        internal static string elm_win_profile_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_win_profile_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_profile_set(IntPtr obj, string profile);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_quickpanel_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_quickpanel_priority_major_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_quickpanel_priority_major_set(IntPtr obj, int priority);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_quickpanel_priority_minor_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_quickpanel_priority_minor_set(IntPtr obj, int priority);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_quickpanel_set(IntPtr obj, bool quickpanel);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_quickpanel_zone_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_quickpanel_zone_set(IntPtr obj, int zone);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_render(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_screen_constrain_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_screen_constrain_set(IntPtr obj, bool constrain);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_screen_position_get(IntPtr obj, out int x, out int y);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_shaped_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_shaped_set(IntPtr obj, bool shaped);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_size_base_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_size_base_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_size_step_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_size_step_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_socket_listen(IntPtr obj, string svcname, int svcnum, bool svcsys);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_trap_data_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_trap_set(IntPtr obj, IntPtr trap);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_urgent_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_urgent_set(IntPtr obj, bool urgent);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_util_dialog_add(IntPtr obj, string name, string title);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_withdrawn_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_withdrawn_set(IntPtr obj, bool withdrawn);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_wm_rotation_manual_rotation_done(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_wm_rotation_manual_rotation_done_get(IntPtr obj, bool withdrawn);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_wm_rotation_manual_rotation_done_set(IntPtr obj, bool set);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_win_wm_rotation_preferred_rotation_get(IntPtr obj, bool withdrawn);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_win_available_profiles_get(IntPtr obj, out string[] profiles, out int count);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_available_profiles_set(IntPtr obj, string[] profiles, int count);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_win_fake_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_fake_canvas_set(IntPtr obj, IntPtr oee);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_win_illume_command_send(IntPtr obj, IntPtr param);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Elementary.cs b/src/ElmSharp/Interop/Interop.Elementary.cs
new file mode 100644 (file)
index 0000000..601f8ee
--- /dev/null
@@ -0,0 +1,795 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Elementary
+    {
+        internal enum Edje_Message_Type
+        {
+            EDJE_MESSAGE_NONE = 0,
+
+            // A message with a string as value. Use #Edje_Message_String structs as message body, for this type.
+            EDJE_MESSAGE_STRING = 2,
+
+            // A message with an integer number as value. Use #Edje_Message_Int structs as message body, for this type.
+            EDJE_MESSAGE_INT = 3,
+
+            // A message with a floating pointer number as value. Use #Edje_Message_Float structs as message body, for this type.
+            EDJE_MESSAGE_FLOAT = 4,
+
+            // A message with a list of strings as value. Use #Edje_Message_String_Set structs as message body, for this type.
+            EDJE_MESSAGE_STRING_SET = 5,
+
+            // A message with a list of integer numbers as value. Use #Edje_Message_Int_Set structs as message body, for this type.
+            EDJE_MESSAGE_INT_SET = 6,
+
+            // A message with a list of floating point numbers as value. Use #Edje_Message_Float_Set structs as message body, for this type.
+            EDJE_MESSAGE_FLOAT_SET = 7,
+
+            // A message with a struct containing a string and an integer number as value. Use #Edje_Message_String_Int structs as message body, for this type.
+            EDJE_MESSAGE_STRING_INT = 8,
+
+            // A message with a struct containing a string and a floating point number as value. Use #Edje_Message_String_Float structs as message body, for this type.
+            EDJE_MESSAGE_STRING_FLOAT = 9,
+
+            // A message with a struct containing a string and list of integer numbers as value. Use #Edje_Message_String_Int_Set structs as message body, for this type.
+            EDJE_MESSAGE_STRING_INT_SET = 10,
+
+            // A message with a struct containing a string and list of floating point numbers as value. Use #Edje_Message_String_Float_Set structs as message body, for this type.
+            EDJE_MESSAGE_STRING_FLOAT_SET = 11
+        }
+        internal enum Elm_Focus_Autoscroll_Mode
+        {
+            ELM_FOCUS_AUTOSCROLL_MODE_SHOW,
+            ELM_FOCUS_AUTOSCROLL_MODE_NONE,
+            ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_scroll_bring_in_scroll_friction_set(double time);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_config_scroll_bring_in_scroll_friction_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern Elm_Focus_Autoscroll_Mode elm_config_focus_autoscroll_mode_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_config_accel_preference_set(string preference);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_scale_set(double scale);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_config_scale_get();
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_config_profile_get")]
+        internal static extern IntPtr _elm_config_profile_get();
+
+        internal static string elm_config_profile_get()
+        {
+            return Marshal.PtrToStringAnsi(_elm_config_profile_get());
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_preferred_engine_set(string name);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_config_longpress_timeout_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_reload();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_all_flush();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_finger_size_set(int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_config_finger_size_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_config_mirrored_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_mirrored_set(bool mirrored);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_mirrored_automatic_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_mirrored_automatic_set(IntPtr obj, bool automatic);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_mirrored_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_mirrored_set(IntPtr obj, bool mirrored);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_grid_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_grid_pack(IntPtr obj, IntPtr subObj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_grid_pack_get(IntPtr subObj, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_grid_pack_set(IntPtr subObj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_grid_size_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tree_dump(IntPtr top);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_disabled_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_disabled_set(IntPtr obj, bool disabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_init(int argc, string[] argv);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool ecore_main_loop_glib_integrate();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_run();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_exit();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_shutdown();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_app_base_scale_set(double base_scale);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_app_base_scale_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_conformant_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get")]
+        internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, IntPtr part);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get")]
+        internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_text_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_unset(IntPtr obj);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_tooltip_style_get")]
+        internal static extern IntPtr _elm_object_tooltip_style_get(IntPtr obj);
+
+        internal static string elm_object_tooltip_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_object_tooltip_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_tooltip_window_mode_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_tooltip_window_mode_set(IntPtr obj, bool disable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_move_freeze_push(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_move_freeze_pop(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_object_tooltip_move_freeze_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_show(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_hide(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_orient_set(IntPtr obj, int orient);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_object_tooltip_orient_get(IntPtr obj);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate IntPtr Elm_Tooltip_Content_Cb(IntPtr data, IntPtr obj, IntPtr tooltip);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Content_Cb func, IntPtr data, Interop.Evas.SmartCallback del);
+
+        internal static string elm_object_part_text_get(IntPtr obj, string part)
+        {
+            return Marshal.PtrToStringAnsi(_elm_object_part_text_get(obj, part));
+        }
+
+        internal static string elm_object_part_text_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_object_part_text_get(obj, IntPtr.Zero));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
+
+        internal static void elm_object_content_set(IntPtr obj, IntPtr content)
+        {
+            elm_object_part_content_set(obj, IntPtr.Zero, content);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_part_content_unset(IntPtr obj, string part);
+
+        internal static void elm_object_content_unset(IntPtr obj)
+        {
+            elm_object_part_content_unset(obj, null);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get")]
+        internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part);
+
+        internal static string elm_layout_text_get(IntPtr obj, string part)
+        {
+            return Marshal.PtrToStringAnsi(_elm_layout_text_get(obj, part));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_file_get(IntPtr obj, IntPtr file, IntPtr group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_signal_emit(IntPtr obj, string emission, string source);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Edje_Signal_Cb(IntPtr data, IntPtr obj, string emission, string source);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_box_append(IntPtr obj, string part, IntPtr child);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_box_prepend(IntPtr obj, string part, IntPtr child);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_box_remove(IntPtr obj, string part, IntPtr child);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_box_remove_all(IntPtr obj, string part, bool clear);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_data_get")]
+        internal static extern IntPtr _elm_layout_data_get(IntPtr obj, string key);
+
+        internal static string elm_layout_data_get(IntPtr obj, string key)
+        {
+            return Marshal.PtrToStringAnsi(_elm_layout_data_get(obj, key));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_text_valign_set(IntPtr obj, string part, double valign);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_layout_text_valign_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_notify_add(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_notify_align_set(IntPtr obj, double horizontal, double vertical);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_notify_timeout_set(IntPtr obj, double timeout);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_object_scale_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_scale_set(IntPtr obj, double scale);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_signal_emit(IntPtr obj, string emission, string source);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_style_set(IntPtr obj, string style);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get")]
+        internal static extern IntPtr _elm_object_style_get(IntPtr obj);
+
+        internal static string elm_object_style_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_elm_object_style_get(obj));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_color_class_color_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_color_class_color_set(IntPtr obj, string colorClass, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_focus_highlight_animate_set(bool animate);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_config_focus_highlight_animate_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_config_focus_highlight_enabled_set(bool enable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_config_focus_highlight_enabled_get();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_tree_focus_allow_set(IntPtr obj, bool focusable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_tree_focus_allow_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_focus_next_object_get(IntPtr obj, int dir);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_object_focused_object_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_focus_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_object_focus_allow_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_focus_next(IntPtr obj, int direction);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_focus_next_object_set(IntPtr obj, IntPtr next, int direction);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_focus_next_item_set(IntPtr obj, IntPtr nextItem, int direction);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_extension_add(IntPtr theme, string path);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_overlay_add(IntPtr theme, string path);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_language_set(string lang);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_policy_set(uint policy, int value);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_theme_new();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_free(IntPtr theme);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_ref_set(IntPtr theme, IntPtr themeRef);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_extension_del(IntPtr theme, string item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_overlay_del(IntPtr theme, string item);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_set(IntPtr obj, string theme);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_flush(IntPtr theme);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_full_flush();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_layout_edje_get(IntPtr obj);
+
+        internal static void SetObjectText(IntPtr obj, string text)
+        {
+            elm_object_part_text_set(obj, IntPtr.Zero, text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_cache_all_flush();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_object_domain_translatable_part_text_set(IntPtr obj, string part, string domain, string text);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_color_class_del(IntPtr obj, string colorClass);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_part_exists(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_part_geometry_get(IntPtr obj, string part, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part);
+
+        internal static string edje_object_part_text_get(IntPtr obj, string part)
+        {
+            var text = _edje_object_part_text_get(obj, part);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part);
+
+        internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part)
+        {
+            var text = _edje_object_part_text_style_user_peek(obj, part);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_mirrored_set(IntPtr obj, bool rtl);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr edje_object_add(IntPtr evas);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_file_set(IntPtr obj, string file, string group);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_part_box_append(IntPtr obj, string part, IntPtr child);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_part_box_prepend(IntPtr obj, string part, IntPtr child);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_state_get")]
+        internal static extern IntPtr _edje_object_part_state_get(IntPtr obj, string part, out double value);
+
+        internal static string edje_object_part_state_get(IntPtr obj, string part, out double value)
+        {
+            return Marshal.PtrToStringAnsi(_edje_object_part_state_get(obj, part, out value));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr edje_object_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_signal_callback_del_full(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_color_class_set(string colorClass, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_color_class_get(string colorClass, out int r, out int g, out int b, out int a, out int r2, out int g2, out int b2, out int a2,
+            out int r3, out int g3, out int b3, out int a3);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_color_class_set(IntPtr obj, string colorClass, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_color_class_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a, out int r2, out int g2, out int b2, out int a2,
+            out int r3, out int g3, out int b3, out int a3);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_message_signal_process();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_message_handler_set(IntPtr obj, Edje_Message_Handler_Cb func, IntPtr data);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Edje_Message_Handler_Cb(IntPtr data, IntPtr obj, Edje_Message_Type type, int id, IntPtr msg);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_message_send(IntPtr obj, Edje_Message_Type type, int id, IntPtr msg);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_object_message_signal_process(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_text_class_set(IntPtr obj, string textClass, string font, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_object_text_class_get(IntPtr obj, string textClass, out string font, out int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_text_class_set(string textClass, string font, int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool edje_text_class_get(string textClass, out string font, out int size);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void edje_text_class_del(string textClass);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_add();
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_del(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_object_add(IntPtr transit, IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_translation_add(IntPtr transit, int fromDx, int fromDy, int toDx, int toDy);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_objects_final_state_keep_set(IntPtr transit, bool stateKeep);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_tween_mode_set(IntPtr transit, int tweenMode);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_repeat_times_set(IntPtr transit, int repeat);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_duration_set(IntPtr transit, double duration);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_go(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_zoom_add(IntPtr transit, float fromRate, float toRate);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_color_add(IntPtr transit, int fromR, int fromG, int fromB, int fromA, int toR, int toG, int toB, int toA);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_auto_reverse_set(IntPtr transit, bool reverse);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_effect_add(IntPtr transit, Elm_Transit_Effect_Transition_Cb transitionCb, IntPtr effect, Elm_Transit_Effect_End_Cb endCb);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_fade_add(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_resizing_add(IntPtr transit, int fromW, int fromH, int toW, int toH);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_event_enabled_set(IntPtr transit, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_smooth_set(IntPtr transit, bool enabled);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_effect_del(IntPtr transit, Elm_Transit_Effect_Transition_Cb transitionCb, IntPtr effect);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_object_remove(IntPtr transit, IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_transit_objects_final_state_keep_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_transit_event_enabled_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_del_cb_set(IntPtr transit, Elm_Transit_Del_Cb cb, IntPtr data);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_transit_auto_reverse_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_transit_repeat_times_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_transit_tween_mode_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_tween_mode_factor_set(IntPtr transit, double v1, double v2);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_tween_mode_factor_get(IntPtr transit, out double v1, out double v2);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_tween_mode_factor_n_set(IntPtr transit, int vSize, out double v);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_transit_duration_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_go_in(IntPtr transit, double interval);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_paused_set(IntPtr transit, bool paused);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_transit_paused_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern double elm_transit_progress_value_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_chain_transit_add(IntPtr transit, IntPtr chainTransit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_transit_chain_transit_del(IntPtr transit, IntPtr chainTransit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_chain_transits_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_transit_smooth_get(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_flip_add(IntPtr transit, int axis, bool cw);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_resizable_flip_add(IntPtr transit, int axis, bool cw);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_wipe_add(IntPtr transit, int type, int dir);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_blend_add(IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_rotation_add(IntPtr transit, float fromDegree, float toDegree);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern IntPtr elm_transit_effect_image_animation_add(IntPtr transit, IntPtr images);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate int Eina_Compare_Cb(IntPtr data1, IntPtr data2);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Elm_Transit_Effect_Transition_Cb(IntPtr effect, IntPtr transit, double progress);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Elm_Transit_Effect_End_Cb(IntPtr effect, IntPtr transit);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Elm_Transit_Del_Cb(IntPtr data, IntPtr transit);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_box_insert_at(IntPtr obj, string part, IntPtr child, uint pos);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_box_insert_before(IntPtr obj, string part, IntPtr child, IntPtr reference);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_edje_object_can_access_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_edje_object_can_access_set(IntPtr obj, bool canAccess);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_layout_freeze(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_part_cursor_engine_only_get(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_part_cursor_engine_only_set(IntPtr obj, string part, bool engineOnly);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_part_cursor_get")]
+        internal static extern IntPtr _elm_layout_part_cursor_get(IntPtr obj, string part);
+
+        internal static string elm_layout_part_cursor_get(IntPtr obj, string part)
+        {
+            return Marshal.PtrToStringAnsi(_elm_layout_part_cursor_get(obj, part));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_part_cursor_set(IntPtr obj, string part, string cursor);
+
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_part_cursor_style_get")]
+        internal static extern IntPtr _elm_layout_part_cursor_style_get(IntPtr obj, string part);
+
+        internal static string elm_layout_part_cursor_style_get(IntPtr obj, string part)
+        {
+            return Marshal.PtrToStringAnsi(_elm_layout_part_cursor_style_get(obj, part));
+        }
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_part_cursor_style_set(IntPtr obj, string part, string style);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_layout_part_cursor_unset(IntPtr obj, string part);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_sizing_eval(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_layout_sizing_restricted_eval(IntPtr obj, bool width, bool height);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern int elm_layout_thaw(IntPtr obj);
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Eo.cs b/src/ElmSharp/Interop/Interop.Eo.cs
new file mode 100644 (file)
index 0000000..9ff0936
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eo
+    {
+        [DllImport(Libraries.Eo)]
+        internal static extern IntPtr eo_class_get(IntPtr obj);
+
+        [DllImport(Libraries.Eo, EntryPoint = "eo_class_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _eo_class_name_get(IntPtr klass);
+
+        internal static string eo_class_name_get(IntPtr obj)
+        {
+            var name = _eo_class_name_get(obj);
+            return Marshal.PtrToStringAnsi(name);
+        }
+
+    }
+
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Evas.Image.cs b/src/ElmSharp/Interop/Interop.Evas.Image.cs
new file mode 100644 (file)
index 0000000..c18cbdd
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Evas
+    {
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_file_set(IntPtr obj, string file, string key);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_border_set(IntPtr obj, int l, int r, int t, int b);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_object_image_border_center_fill_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_border_center_fill_set(IntPtr obj, int filled);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_alpha_set(IntPtr obj, bool has_alpha);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_image_alpha_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern LoadError evas_object_image_load_error_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_size_get(IntPtr obj, IntPtr x, out int y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_size_get(IntPtr obj, out int x, IntPtr y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_size_get(IntPtr obj, out int x, out int y);
+    }
+}
\ No newline at end of file
diff --git a/src/ElmSharp/Interop/Interop.Evas.cs b/src/ElmSharp/Interop/Interop.Evas.cs
new file mode 100644 (file)
index 0000000..60e3d16
--- /dev/null
@@ -0,0 +1,818 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Evas
+    {
+        public enum ObjectCallbackType
+        {
+            MouseIn,
+            MouseOut,
+            MouseDown,
+            MouseUp,
+            MouseMove,
+            MouseWheel,
+            MultiDown,
+            MultiUp,
+            MultiMove,
+            Free,
+            KeyDown,
+            KeyUp,
+            FocusIn,
+            FocusOut,
+            Show,
+            Hide,
+            Move,
+            Resize,
+            Restack,
+            Del,
+            Hold,
+            ChangedSizeHints,
+            ImagePreloaded,
+            CanvasFocusIn,
+            CanvasFocusOut,
+            RenderFlushPre,
+            RenderFlushPost,
+            CanvasObjectFocusIn,
+            CanvasObjectFocusOut,
+            ImageUnloaded,
+            RenderPre,
+            RenderPost,
+            ImageResize,
+            DeviceChanged,
+            AxisUpdate,
+            CanvasViewportResize
+        }
+
+        public enum LoadError
+        {
+            None = 0, /* No error on load */
+            Generic = 1, /* A non-specific error occurred */
+            DoesNotRxist = 2, /* File (or file path) does not exist */
+            PermissionDenied = 3, /* Permission denied to an existing file (or path) */
+            ResourceAllocationFailed = 4, /* Allocation of resources failure prevented load */
+            CorruptFile = 5, /* File corrupt (but was detected as a known format) */
+            UnknownFormat = 6 /* File is not a known format */
+        }
+
+        public enum Colorspace
+        {
+            Argb8888, /* ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
+            Ycbcr422p709pl, /* YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
+            Ergb565a5p, /* 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
+            Egry8, /* 8bit grayscale */
+            Eycbcr422601pl, /*  YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
+            Eycbcr420nv12601pl, /* YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+            Eycbcr420tm12601pl, /* YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+            Eagry88, /* AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */
+            Eetc1, /* OpenGL ETC1 encoding of RGB texture (4 bit per pixel) @since 1.10 */
+            Ergb8etc2, /* OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 1.10 */
+            Ergba8etc2eac, /* OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 1.10 */
+            Eetc1alpha,     /* ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 */
+        }
+
+        public enum ImageScaleHint
+        {
+            None = 0, /* No scale hint at all */
+            Dynamic = 1, /* Image is being re-scaled over time, thus turning scaling cache @b off for its data */
+            Static = 2 /* Image is not being re-scaled over time, thus turning scaling cache @b on for its data */
+        }
+
+        public enum RenderOp
+        {
+            Blend = 0, /* default op: d = d*(1-sa) + s */
+            BlendRel = 1, /* d = d*(1 - sa) + s*da */
+            Copy = 2, /* d = s */
+            CopyRel = 3, /* d = s*da */
+            Add = 4, /* d = d + s */
+            AddRel = 5, /* d = d + s*da */
+            Sub = 6, /* d = d - s */
+            SubRel = 7, /* d = d - s*da */
+            Tint = 8, /* d = d*s + d*(1 - sa) + s*(1 - da) */
+            TintRel = 9, /* d = d*(1 - sa + s) */
+            Mask = 10, /* d = d*sa */
+            Mul = 11 /* d = d*s */
+        }
+
+        public enum ObjectCallbackPriority
+        {
+            After = 100,
+            Before = -100,
+            Default = 0
+        }
+
+        public enum TableHomogeneousMode
+        {
+            None = 0,
+            Table = 1,
+            Item = 2
+        }
+
+        public enum TextStyleType
+        {
+            Plain, /* plain, standard text */
+            Shadow, /* text with shadow underneath */
+            Outline, /* text with an outline */
+            SoftOutline, /* text with a soft outline */
+            Glow, /* text with a glow effect */
+            OutlineShadow, /* text with both outline and shadow effects */
+            FarShadow, /* text with (far) shadow underneath */
+            OutlineSoftShadow, /* text with outline and soft shadow effects combined */
+            SoftShadow, /* text with(soft) shadow underneath */
+            FarSoftShadow, /* text with(far soft) shadow underneath */
+            ShadowDirectionBottomRight, /* shadow growing to bottom right */
+            ShadowDirectionBottom, /* shadow growing to the bottom */
+            ShadowDirectionBottomLeft, /* shadow growing to bottom left */
+            ShadowDirectionLeft, /* shadow growing to the left */
+            ShadowDirectionTopLeft, /* shadow growing to top left */
+            ShadowDirectionTop, /* shadow growing to the top */
+            ShadowDirectionTopRight, /* shadow growing to top right */
+            ShadowDirectionRight, /* shadow growing to the right */
+        }
+
+        //public struct TextBlockStyle
+        //{
+        //    string StyleText;
+        //    string DefaultTag;
+
+        //    List objects;
+        //    bool DeleteMe;
+        //}
+
+        //public struct StyleTag
+        //{
+        //}
+
+        internal delegate void EventCallback(IntPtr data, IntPtr evas, IntPtr obj, IntPtr info);
+
+        internal delegate void EvasCallback(IntPtr data, IntPtr evas, IntPtr info);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_callback_add(IntPtr obj, ObjectCallbackType type, EvasCallback func, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_callback_del(IntPtr obj, ObjectCallbackType type, EvasCallback func);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_event_callback_add(IntPtr obj, ObjectCallbackType type, EventCallback func, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_event_callback_del(IntPtr obj, ObjectCallbackType type, EventCallback func);
+
+        public delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+        public static readonly string BackKeyName = "XF86Back";
+        public static readonly string MenuKeyName = "XF86Menu";
+
+        public enum ButtonFlags
+        {
+            None, DoubleClick, TripleClick
+        }
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_key_grab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier, bool exclusive);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_key_ungrab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_data_get(IntPtr obj, string keyname);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_data_set(IntPtr obj, string keyname, IntPtr data);
+
+        [DllImport(Libraries.Evas, EntryPoint = "evas_object_type_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+        internal static extern IntPtr _evas_object_type_get(IntPtr obj);
+
+        internal static string evas_object_type_get(IntPtr obj)
+        {
+            var text = _evas_object_type_get(obj);
+            return Marshal.PtrToStringAnsi(text);
+        }
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_evas_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_image_add(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_del(IntPtr objectPtr);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_show(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_hide(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_visible_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_callback_add(IntPtr obj, string eventName, SmartCallback seh, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_callback_del(IntPtr obj, string eventName, SmartCallback seh);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_min_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_min_get(IntPtr obj, IntPtr w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_max_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_max_get(IntPtr obj, IntPtr w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, out double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, IntPtr y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_weight_get(IntPtr obj, IntPtr x, out double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, out double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, IntPtr y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_align_get(IntPtr obj, IntPtr x, out double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_weight_set(IntPtr obj, double x, double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_align_set(IntPtr obj, double x, double y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_move(IntPtr obj, int x, int y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_resize(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_set(IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, out int x, IntPtr y, IntPtr w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, out int y, IntPtr w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, IntPtr w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, IntPtr w, IntPtr h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_smart_members_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_map_new(int count);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_points_populate_from_object_full(IntPtr map, IntPtr obj, int z);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_points_populate_from_geometry(IntPtr map, int x, int y, int w, int h, int z);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_3d_rotate(IntPtr map, double dx, double dy, double dz, int cx, int cy, int cz);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_zoom(IntPtr map, double x, double y, int cx, int cy);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_point_coord_set(IntPtr map, int idx, int x, int y, int z);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_point_coord_get(IntPtr map, int idx, out int x, out int y, out int z);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_map_enable_set(IntPtr obj, bool enabled);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_map_enable_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_object_move_sync_set(IntPtr map, bool enabled);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_map_util_object_move_sync_get(IntPtr map);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_map_set(IntPtr obj, IntPtr map);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_map_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_free(IntPtr map);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_polygon_add(IntPtr evas);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_polygon_point_add(IntPtr evas, int x, int y);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_polygon_points_clear(IntPtr evas);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_rectangle_add(IntPtr evas);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_color_get(IntPtr obj, IntPtr r, IntPtr g, IntPtr b, out int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_clip_set(IntPtr obj, IntPtr clip);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_clip_unset(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_clip_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_lower(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_feed_mouse_move(IntPtr obj, int x, int y, int timestamp, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_feed_mouse_down(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_feed_mouse_up(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_feed_key_down(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_feed_key_up(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_ref(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_unref(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_object_ref_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_repeat_events_set(IntPtr obj, bool repeat);
+
+        [DllImport(Libraries.Evas)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool evas_object_repeat_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_propagate_events_set(IntPtr obj, bool propagate);
+
+        [DllImport(Libraries.Evas)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool evas_object_propagate_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_pass_events_set(IntPtr obj, bool propagate);
+
+        [DllImport(Libraries.Evas)]
+        [return: MarshalAs(UnmanagedType.U1)]
+        internal static extern bool evas_object_pass_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_textblock_size_native_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_textblock_size_formatted_get(IntPtr obj, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_changed(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_calculate(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_color_argb_premul(int a, ref int r, ref int g, ref int b);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_damage_rectangle_add(IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_data_argb_premul(uint data, uint length);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_event_callback_del_full(IntPtr obj, ObjectCallbackType type, EvasCallback func, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_font_path_global_append(string path);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_image_cache_flush(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_image_cache_set(IntPtr obj, int size);
+
+        [DllImport(Libraries.Evas, EntryPoint = "evas_load_error_str")]
+        internal static extern IntPtr _evas_load_error_str(LoadError error);
+
+        internal static string evas_load_error_str(LoadError error)
+        {
+            return Marshal.PtrToStringAnsi(_evas_load_error_str(error));
+        }
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_data_del(IntPtr obj, string key);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_focus_set(IntPtr obj, bool focus);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_freeze_events_set(IntPtr obj, bool freeze);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_colorspace_set(IntPtr obj, Colorspace colorSpace);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_data_copy_set(IntPtr obj, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_image_data_get(IntPtr obj, bool forWriting);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_data_set(IntPtr obj, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_data_update_add(IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_fill_set(IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_image_filled_add(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_filled_set(IntPtr obj, bool setting);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_memfile_set(IntPtr obj, IntPtr data, int size, string format, string key);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_pixels_dirty_set(IntPtr obj, bool dirty);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_save(IntPtr obj, string file, string key, string flags);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_scale_hint_set(IntPtr obj, ImageScaleHint hint);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_size_set(IntPtr obj, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_smooth_scale_set(IntPtr obj, bool smoothScale);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_source_set(IntPtr obj, IntPtr src);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_image_source_visible_set(IntPtr obj, bool visible);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_layer_set(IntPtr obj, int layer);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_raise(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_render_op_set(IntPtr obj, RenderOp op);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_aspect_set(IntPtr obj, int aspect, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_smart_add(IntPtr obj, IntPtr smart);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_smart_data_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_data_set(IntPtr obj, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_member_add(IntPtr obj, IntPtr smart);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_member_del(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_stack_above(IntPtr obj, IntPtr avobe);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_text_add(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_font_set(IntPtr obj, string font, int size);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_text_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_textblock_add(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_textblock_style_set(IntPtr obj, IntPtr textBlockStyle);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_textblock_text_markup_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_obscured_clear(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_smart_class_new(IntPtr obj);
+
+        [DllImport(Libraries.Evas, EntryPoint = "evas_device_name_get")]
+        internal static extern IntPtr _evas_device_name_get(IntPtr obj);
+
+        internal static string evas_device_name_get(IntPtr obj)
+        {
+            return Marshal.PtrToStringAnsi(_evas_device_name_get(obj));
+        }
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_font_path_global_clear();
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_object_above_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_event_callback_priority_add(IntPtr obj, ObjectCallbackType type, ObjectCallbackPriority priority, EventCallback func, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_focus_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_freeze_events_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_object_layer_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_callback_priority_add(IntPtr obj, string eventName, ObjectCallbackPriority priority, EventCallback func, IntPtr data);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_smart_clipped_smart_set(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_table_homogeneous_set(IntPtr obj, TableHomogeneousMode mode);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_table_pack(IntPtr obj, IntPtr child, uint col, uint row, uint colspan, uint rowspan);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_table_padding_set(IntPtr obj, int horizontal, int vertical);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_filter_program_set(IntPtr obj, string program);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_glow_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_outline_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_shadow_color_set(IntPtr obj, int r, int g, int b, int a);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_text_style_set(IntPtr obj, TextStyleType type);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern bool evas_object_textblock_line_number_geometry_get(IntPtr obj, int line, out int x, out int y, out int w, out int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_textblock_valign_set(IntPtr obj, double align);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_string_char_len_get(string str);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_textblock_style_free(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern IntPtr evas_textblock_style_new();
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_textblock_style_set(IntPtr obj, string text);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern string evas_textblock_text_markup_to_utf8(IntPtr obj, string text);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern string evas_textblock_text_utf8_to_markup(IntPtr obj, string text);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_obscured_rectangle_add(IntPtr obj, int x, int y, int w, int h);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_render(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_norender(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern int evas_image_cache_get(IntPtr obj);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_font_path_global_prepend(string path);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_color_argb_unpremul(int a, ref int r, ref int g, ref int b);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_color_hsv_to_rgb(int r, int g, int b, out float h, out float s, out float v);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_color_rgb_to_hsv(float h, float s, float v, out int r, out int g, out int b);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_stack_below(IntPtr obj, IntPtr below);
+
+        [DllImport(Libraries.Evas)]
+        internal static extern void evas_object_size_hint_aspect_get(IntPtr obj, out int aspect, out int w, out int h);
+
+        internal static void SetX(IntPtr obj, int x)
+        {
+            int y = GetY(obj);
+            evas_object_move(obj, x, y);
+        }
+
+        internal static void SetY(IntPtr obj, int y)
+        {
+            int x = GetX(obj);
+            evas_object_move(obj, x, y);
+        }
+
+        internal static void SetWidth(IntPtr obj, int w)
+        {
+            int h = GetHeight(obj);
+            evas_object_resize(obj, w, h);
+        }
+
+        internal static void SetHeight(IntPtr obj, int h)
+        {
+            int w = GetWidth(obj);
+            evas_object_resize(obj, w, h);
+        }
+
+        internal static int GetX(IntPtr obj)
+        {
+            int x;
+            evas_object_geometry_get(obj, out x, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+            return x;
+        }
+
+        internal static int GetY(IntPtr obj)
+        {
+            int y;
+            evas_object_geometry_get(obj, IntPtr.Zero, out y, IntPtr.Zero, IntPtr.Zero);
+            return y;
+        }
+
+        internal static int GetWidth(IntPtr obj)
+        {
+            int w;
+            evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, out w, IntPtr.Zero);
+            return w;
+        }
+
+        internal static int GetHeight(IntPtr obj)
+        {
+            int h;
+            evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out h);
+            return h;
+        }
+
+        internal static double GetAlignX(IntPtr obj)
+        {
+            double x;
+            evas_object_size_hint_align_get(obj, out x, IntPtr.Zero);
+            return x;
+        }
+
+        internal static double GetAlignY(IntPtr obj)
+        {
+            double y;
+            evas_object_size_hint_align_get(obj, IntPtr.Zero, out y);
+            return y;
+        }
+
+        internal static void SetAlignX(IntPtr obj, double x)
+        {
+            double y = GetAlignY(obj);
+            evas_object_size_hint_align_set(obj, x, y);
+        }
+
+        internal static void SetAlignY(IntPtr obj, double y)
+        {
+            double x = GetAlignX(obj);
+            evas_object_size_hint_align_set(obj, x, y);
+        }
+
+        internal static double GetWeightX(IntPtr obj)
+        {
+            double x;
+            evas_object_size_hint_weight_get(obj, out x, IntPtr.Zero);
+            return x;
+        }
+
+        internal static double GetWeightY(IntPtr obj)
+        {
+            double y;
+            evas_object_size_hint_weight_get(obj, IntPtr.Zero, out y);
+            return y;
+        }
+
+        internal static void SetWeightX(IntPtr obj, double x)
+        {
+            double y = GetWeightY(obj);
+            evas_object_size_hint_weight_set(obj, x, y);
+        }
+
+        internal static void SetWeightY(IntPtr obj, double y)
+        {
+            double x = GetWeightX(obj);
+            evas_object_size_hint_weight_set(obj, x, y);
+        }
+
+        internal static int GetAlpha(IntPtr obj)
+        {
+            int a;
+            evas_object_color_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out a);
+            return a;
+        }
+
+        internal static void SetAlpha(IntPtr obj, int a)
+        {
+            evas_object_color_set(obj, a, a, a, a);
+        }
+
+        internal static void SetPremultipliedColor(IntPtr obj, int r, int g, int b, int a)
+        {
+            evas_object_color_set(obj, r * a / 255, g * a / 255, b * a / 255, a);
+        }
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Libc.cs b/src/ElmSharp/Interop/Interop.Libc.cs
new file mode 100644 (file)
index 0000000..1e29684
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+
+        // Broken-down time is stored in the structure tm which is defined in <time.h> as follows:
+        [StructLayout(LayoutKind.Sequential)]
+        internal struct SystemTime
+        {
+            public int tm_sec;
+            public int tm_min;
+            public int tm_hour;
+            public int tm_mday;
+            public int tm_mon;
+            public int tm_year;
+            public int tm_wday;
+            public int tm_yday;
+            public int tm_isdst;
+
+            // The glibc version of struct tm has additional fields
+            public long tm_gmtoff;
+            public IntPtr tm_zone;
+
+            public static implicit operator SystemTime(DateTime value)
+            {
+                SystemTime tm = new SystemTime();
+                tm.tm_sec = value.Second;
+                tm.tm_min = value.Minute;
+                tm.tm_hour = value.Hour;
+                tm.tm_mday = value.Day;
+                tm.tm_mon = value.Month - 1;
+                tm.tm_year = value.Year - 1900;
+                tm.tm_wday = (int)value.DayOfWeek;
+                tm.tm_yday = value.DayOfYear;
+                tm.tm_isdst = value.IsDaylightSavingTime() ? 1 : 0;
+                return tm;
+            }
+
+            public static implicit operator DateTime(SystemTime value)
+            {
+                DateTime date = new DateTime(value.tm_year + 1900, value.tm_mon + 1, value.tm_mday, value.tm_hour, value.tm_min, value.tm_sec);
+                return date;
+            }
+        }
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Libdl.cs b/src/ElmSharp/Interop/Interop.Libdl.cs
new file mode 100644 (file)
index 0000000..4f233f8
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libdl
+    {
+        private const int RTLD_NOW = 2;
+
+        [DllImport(Libraries.Libdl)]
+        private static extern IntPtr dlopen(string filename, int flags);
+
+        [DllImport(Libraries.Libdl)]
+        private static extern int dlclose(IntPtr handle);
+
+        [DllImport(Libraries.Libdl)]
+        private static extern IntPtr dlsym(IntPtr handle, string symbol);
+
+        [DllImport(Libraries.Libdl)]
+        private static extern IntPtr dlerror();
+
+        internal static IntPtr LoadLibrary(string filename)
+        {
+            return dlopen(filename, RTLD_NOW);
+        }
+
+        internal static void FreeLibrary(IntPtr handle)
+        {
+            dlclose(handle);
+        }
+
+        internal static IntPtr GetProcAddress(IntPtr handle, string name)
+        {
+            dlerror();
+            var res = dlsym(handle, name);
+            var errPtr = dlerror();
+            if (errPtr != IntPtr.Zero)
+            {
+                throw new Exception("dlsym : " + Marshal.PtrToStringAnsi(errPtr));
+            }
+            return res;
+        }
+    }
+}
diff --git a/src/ElmSharp/Interop/Interop.Libraries.cs b/src/ElmSharp/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..7f1ca6a
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static class Libraries
+    {
+        internal const string Libc = "libc.so.6";
+        internal const string Libdl = "libdl.so.2";
+        internal const string Evas = "libevas.so.1";
+        internal const string Elementary = "libelementary.so.1";
+        internal const string Eina = "libeina.so.1";
+        internal const string Ecore = "libecore.so.1";
+        internal const string EcoreInput = "libecore_input.so.1";
+        internal const string Eo = "libeo.so.1";
+        internal const string Eext = "libefl-extension.so.0";
+    }
+}
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..5f53d8d
--- /dev/null
@@ -0,0 +1,40 @@
+PROJ_DIR=$(shell pwd)
+SRCS=\
+       src/Interop/Interop.Libteec.cs \
+       src/Interop/Interop.Types.cs \
+       src/Interop/Interop.Libraries.cs \
+       src/Interop/Interop.Errors.cs \
+       src/Secure/Libteec.cs \
+       src/Secure/Properties/AssemblyInfo.cs \
+       Test.cs
+
+test.exe: ${SRCS}
+       mcs ${SRCS} -out:test.exe
+
+.PHONY: build
+build: test.exe
+
+.PHONY: build-csuml
+build-csuml:
+       (cd ~/csapi/csuml && dotnet restore && dotnet build)
+
+pack: ${SRCS}
+       zip -r csapi-libteec.zip src
+
+csapi-libteec.puml: build-csuml ${SRCS}
+       @echo "create csapi-libteec.puml"
+       (cd ~/csapi/csuml && dotnet run -- ${PROJ_DIR}/filelist.lst) > csapi-libteec.puml
+
+csapi-libteec.png: csapi-libteec.puml
+       java -jar ~/bin/plantuml.jar csapi-libteec.puml
+
+
+# .phony is a target that is not a real file
+.PHONY: diagram diagram-show
+diagram: csapi-libteec.png
+diagram-show: diagram
+       xdg-open csapi-libteec.png
+
+xbuild-hello:
+       xbuild /p:Configuration=Release HelloWorld.csproj
+
diff --git a/src/Test.cs b/src/Test.cs
new file mode 100644 (file)
index 0000000..6798db0
--- /dev/null
@@ -0,0 +1,30 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Threading.Tasks;
+
+using Tizen.Security.TEEC;
+
+class Test {
+       static void Main() {
+               Guid ta_uuid = new Guid();
+               Context ctx = new Context(null);
+               Session ses = null;
+
+               ctx.OpenSession(ta_uuid);
+               ses.Close();
+
+               CancellationTokenSource token = new CancellationTokenSource();
+               Task<Session> ses_task = ctx.OpenSessionAsync(ta_uuid, token.Token);
+               ses = ses_task.Result;
+               ses.Close();
+
+               IntPtr buf = Marshal.AllocHGlobal(20*1024);
+               SharedMemory shm = ctx.RegisterSharedMemory(buf, 20*1024, SharedMemoryFlags.Input|SharedMemoryFlags.Output);
+               ctx.ReleaseSharedMemory(shm);
+               Marshal.FreeHGlobal(buf);
+
+               shm = ctx.AllocateSharedMemory(10*1024, SharedMemoryFlags.Input);
+               ctx.ReleaseSharedMemory(shm);
+       }
+}
diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.Account.cs b/src/Tizen.Account.AccountManager/Interop/Interop.Account.cs
new file mode 100644 (file)
index 0000000..9789044
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Account.AccountManager;
+/// <summary>
+/// Interop for Account class APIs
+/// </summary>
+/// <since_tizen> 3 </since_tizen>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Interop for Account class APIs
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    internal static partial class Account
+    {
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_create", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Create(out IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_destroy", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_account_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountId(IntPtr data, out int accountId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountUserName(IntPtr data, out string userName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountUserName(IntPtr handle, string userName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_display_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountDisplayName(IntPtr handle, out string displayName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_display_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountDisplayName(IntPtr handle, string displayName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountCapability(IntPtr handle, string capabilityType, out int capabilityValue);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_capability", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountCapability(IntPtr handle, string capabilityType, int capabilityValue);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_icon_path", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountIconPath(IntPtr handle, out string iconPath);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_icon_path", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountIconPath(IntPtr handle, string iconPath);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_domain_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountDomainName(IntPtr handle, out string domainName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_domain_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountDomainName(IntPtr handle, string domainName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_email_address", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountEmail(IntPtr handle, out string email);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_email_address", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountEmail(IntPtr handle, string email);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_package_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountPackageName(IntPtr handle, out string name);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_package_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountPackageName(IntPtr handle, string name);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_access_token", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountAccessToken(IntPtr handle, out string accessToken);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_access_token", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountAccessToken(IntPtr handle, string accessToken);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_text", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountUserText(IntPtr handle, int index, out string userText);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_text", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountUserText(IntPtr handle, int index, string userText);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_int", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountUserInt(IntPtr handle, int index, out int value);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_int", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountUserInt(IntPtr handle, int index, int value);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_auth_type", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountAuthType(IntPtr handle, out int authType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_auth_type", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountAuthType(IntPtr handle, int authType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_secret", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountSercet(IntPtr handle, out int secretType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_secret", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountSecret(IntPtr handle, int secretType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_sync_support", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountSyncSupport(IntPtr handle, out int syncType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_sync_support", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountSyncSupport(IntPtr handle, int syncType);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_source", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountSource(IntPtr handle, out string source);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_source", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountSource(IntPtr handle, string source);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountCustomValue(IntPtr handle, string key, out string value);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_custom", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SetAccountCustomValue(IntPtr handle, string key, string value);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UpdateAccountSyncStatusById(int accountId, int status);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability_all")]
+        internal static extern int GetAllAccountCapabilities(IntPtr handle, AccountCapabilityCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id")]
+        internal static extern int QueryAccountCapabilityById(AccountCapabilityCallback callback, int accountId, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom_all")]
+        internal static extern int GetAllAccountCustomValues(IntPtr handle, AccountCustomCallback callback, IntPtr userData);
+
+        //Callbacks
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AccountCapabilityCallback(string capabilityType, int capabilityState, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AccountCustomCallback(string key, string value, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AccountCallback(IntPtr data, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs b/src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs
new file mode 100644 (file)
index 0000000..f201061
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Account.AccountManager;
+
+/// <summary>
+/// Interop for AccountProvider class APIs
+/// </summary>
+/// <since_tizen> 3 </since_tizen>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Interop for AccountProvider class APIs
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    internal static partial class AccountProvider
+    {
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_create", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Create(out IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_destroy", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_app_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAppId(IntPtr handle, out string appId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_supported_feature", CallingConvention = CallingConvention.Cdecl)]
+       [return: MarshalAs(UnmanagedType.I1)]
+        internal static extern bool IsFeatureSupported(string appId, string capability);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_service_provider_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetServiceProviderId(IntPtr handle, out string providerId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_icon_path", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountProviderIconPath(IntPtr handle, out string iconPath);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_small_icon_path", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountProviderSmallIconPath(IntPtr handle, out string iconPath);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_multiple_account_support", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetMultipleAccountSupport(IntPtr handle, out int suppport);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label_by_locale", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetlabelbyLocale(IntPtr handle, string locale, out string label);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_app_id_exist", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAppIdExists(string appId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_foreach_account_type_from_db", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAllAccountProviders(AccountProviderCallback callback, IntPtr data);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_provider_feature_by_app_id")]
+        internal static extern int GetAccountProviderFeaturesByAppId(AccountProviderFeatureCallback callback, string appId, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_provider_feature_all")]
+        internal static extern int GetAccountProviderFeatures(IntPtr handle, AccountProviderFeatureCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label")]
+        internal static extern int GetAccountProviderLabels(IntPtr handle, LabelCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_label_by_app_id")]
+        internal static extern int GetLablesByAppId(LabelCallback callback, string appId, IntPtr userData);
+
+
+        //Callbacks
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AccountProviderFeatureCallback(string appId, string key, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AccountProviderCallback(IntPtr handle, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool LabelCallback(string appId, string label, string locale, IntPtr user_data);
+
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs b/src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs
new file mode 100644 (file)
index 0000000..7bb1275
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Interop for Account class APIs
+/// </summary>
+/// <since_tizen> 3 </since_tizen>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Interop for Account class APIs
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    internal static partial class AccountService
+    {
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UpdateAccountToDBById(IntPtr handle, int id);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_user_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UpdateAccountToDBByUserName(IntPtr handle, string userName, string packageName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_account_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int QueryAccountById(int accountId, out IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_user_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int QueryAccountByUserName(Interop.Account.AccountCallback callback, string userName, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_package_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int QueryAccountByPackageName(Interop.Account.AccountCallback callback, string packageName, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int QueryAccountCapabilityById(Interop.Account.AccountCapabilityCallback callback, int accoutId, IntPtr data);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UpdateAccountSyncStatusById(int accoutId, int status);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_insert_to_db", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int AddAccount(IntPtr handle, out int accountId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_id", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int DeleteAccountById(int accountId);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_user_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int DeleteAccountByUser(string userName, string packageName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_package_name", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int DeleteAccountByPackage(string packageName);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_total_count_from_db", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int GetAccountCount(out int count);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_foreach_account_from_db")]
+        internal static extern int AccountForeachAccountFromDb(Interop.Account.AccountCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_capability")]
+        internal static extern int GetAccountByCapability(Interop.Account.AccountCallback callback, string capabilityType, int value, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_capability_type")]
+        internal static extern int GetAccountByCapabilityType(Interop.Account.AccountCallback callback, string capabilityType, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_foreach_account_type_from_db")]
+        internal static extern int GetAllAccountproviders(Interop.AccountProvider.AccountProviderCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_by_provider_feature")]
+        internal static extern int GetAccountProviderByFeature(Interop.AccountProvider.AccountProviderCallback callback, string key, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_by_app_id")]
+        internal static extern int GetAccountProviderByAppId(string appId, out IntPtr handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_subscribe_create")]
+        internal static extern int CreateAccountSubscriber(out Interop.AccountService.SafeAccountSubscriberHandle handle);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_subscribe_notification")]
+        internal static extern int RegisterSubscriber(Interop.AccountService.SafeAccountSubscriberHandle handle, Interop.AccountService.SubscribeCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AccountSvc, EntryPoint = "account_unsubscribe_notification")]
+        internal static extern int UnregisterSubscriber(Interop.AccountService.SafeAccountSubscriberHandle handle);
+
+        //Callbacks
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool SubscribeCallback(string eventType, int accountId, IntPtr userData);
+
+        internal sealed class SafeAccountSubscriberHandle : SafeHandle
+        {
+            public SafeAccountSubscriberHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs b/src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..f1530bd
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+/// <summary>
+/// Interop for Library reference
+/// </summary>
+/// <since_tizen> 3 </since_tizen>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Interop for Library reference
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    internal static partial class Libraries
+    {
+        public const string AccountSvc = "libaccounts-svc.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj
new file mode 100644 (file)
index 0000000..d1b0495
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.7</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Account Service APIs for Tizen.Account.AccountManager</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Account.AccountManager.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+  
+</Project>
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.snk b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.snk
new file mode 100644 (file)
index 0000000..24dc971
Binary files /dev/null and b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.snk differ
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs
new file mode 100644 (file)
index 0000000..df10a15
--- /dev/null
@@ -0,0 +1,619 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// Represents the Account Information.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Account : IDisposable
+    {
+        private IntPtr _handle = IntPtr.Zero;
+        internal Account(IntPtr handle)
+        {
+            Handle = handle;
+        }
+
+        ~Account()
+        {
+            Dispose(false);
+        }
+        /// <summary>
+        /// Creates a new Account instance.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Account Instance.</returns>
+        public static Account CreateAccount()
+        {
+            IntPtr handle;
+            AccountError err = (AccountError)Interop.Account.Create(out handle);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to create new error.");
+            }
+
+            return new Account(handle);
+        }
+
+        /// <summary>
+        /// Id of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>Account Id shall be created only when account is added to the database.</remarks>
+        public int AccountId
+        {
+            get
+            {
+                int id = 0;
+                AccountError res = (AccountError)Interop.Account.GetAccountId(_handle, out id);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get Id for the Account");
+                }
+
+                return id;
+            }
+        }
+
+        /// <summary>
+        /// UserName of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>User Name of the Account.</value>
+        public string UserName
+        {
+            get
+            {
+                string name = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountUserName(_handle, out name);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get UserName for the Account");
+                }
+
+                return name;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountUserName(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set UserName for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Display Name of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>DisplayName of the  Account.</value>
+        public string DisplayName
+        {
+            get
+            {
+                string name = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountDisplayName(_handle, out name);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get DisplayName for the Account");
+                }
+
+                return name;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountDisplayName(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set DisplayName for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Icon path of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Icon path of the Account.</value>
+        public string IconPath
+        {
+            get
+            {
+                string path = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountIconPath(_handle, out path);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get IconPath for the Account");
+                }
+
+                return path;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountIconPath(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set IconPath for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Domain name of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Domain name of the Account.</value>
+        public string DomainName
+        {
+            get
+            {
+                string name = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountDomainName(_handle, out name);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get DomainName for the Account");
+                }
+
+                return name;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountDomainName(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set DomainName for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Email Id of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Email Id of the Account.</value>
+        public string EmailId
+        {
+            get
+            {
+                string email = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountEmail(_handle, out email);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get email for the Account");
+                }
+
+                return email;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountEmail(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set email for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Package Name of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Package Name.</value>
+        public string PackageName
+        {
+            get
+            {
+                string name = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountPackageName(_handle, out name);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get PacakageName for the Account");
+                }
+
+                return name;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountPackageName(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set PacakageName for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Access Token of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Access Token.</value>
+        public string AccessToken
+        {
+            get
+            {
+                string token = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountAccessToken(_handle, out token);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get token for the Account");
+                }
+
+                return token;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountAccessToken(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set token for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Authentication type of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Authentication type.</value>
+        public AccountAuthType AuthType
+        {
+            get
+            {
+                int user;
+                AccountError res = (AccountError)Interop.Account.GetAccountAuthType(_handle, out user);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get AuthType for the Account");
+                }
+
+                return (AccountAuthType)user;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountAuthType(_handle, (int)value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set AuthType for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Secrecy State of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Secrecy State.</value>
+        public AccountSecrecyState SecrecyState
+        {
+            get
+            {
+                int state;
+                AccountError res = (AccountError)Interop.Account.GetAccountSercet(_handle, out state);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get User Secret for the Account");
+                }
+
+                return (AccountSecrecyState)state;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountSecret(_handle, (int)value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set User Secret for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sync State of the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Sync State.</value>
+        public AccountSyncState SyncState
+        {
+            get
+            {
+                int supported;
+                AccountError res = (AccountError)Interop.Account.GetAccountSyncSupport(_handle, out supported);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get AuthType for the Account");
+                }
+
+                return (AccountSyncState)supported;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountSyncSupport(_handle, (int)value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set AuthType for Account");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Source of the Account .
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Account Source.</value>
+        public string Source
+        {
+            get
+            {
+                string text = "";
+                AccountError res = (AccountError)Interop.Account.GetAccountSource(_handle, out text);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get User Secret for the Account");
+                }
+
+                return text;
+            }
+
+            set
+            {
+                AccountError res = (AccountError)Interop.Account.SetAccountSource(_handle, value);
+                if (res != AccountError.None)
+                {
+                    throw AccountErrorFactory.CreateException(res, "Failed to Set User Secret for Account");
+                }
+            }
+        }
+
+        internal IntPtr Handle
+        {
+            get
+            {
+                return _handle;
+            }
+
+            set
+            {
+                _handle = value;
+            }
+        }
+        /// <summary>
+        /// Sets the account capability.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="capabilityType"> The Account capability type</param>
+        /// <param name="state">The Account capability state</param>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public void SetCapability(string capabilityType, CapabilityState state)
+        {
+            AccountError ret = (AccountError)Interop.Account.SetAccountCapability(_handle, capabilityType, (int)state);
+            if (ret != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(ret, "failed to set account capability");
+            }
+        }
+        /// <summary>
+        /// Gets all the capabilities of an account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="capabilityType"> The capability type to get the capability value.</param>
+        /// <returns>The capability value (on/off) of the specified CapabilityState .</returns>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public CapabilityState GetCapability(string capabilityType)
+        {
+            int type;
+            AccountError res = (AccountError)Interop.Account.GetAccountCapability(_handle, capabilityType, out type);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to GetCapability for Account");
+            }
+
+            return (CapabilityState)type;
+        }
+
+        /// <summary>
+        /// Gets all the capabilities of an account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>List of Cpabailities as Dictionary</returns>
+        public Dictionary<string, CapabilityState> GetAllCapabilities()
+        {
+
+            AccountError res = AccountError.None;
+            Dictionary<string, CapabilityState> list = new Dictionary<string, CapabilityState>();
+            Interop.Account.AccountCapabilityCallback capabilityCallback = (string type, int state, IntPtr data) =>
+            {
+                list.Add(type, (CapabilityState)state);
+                return true;
+            };
+
+            res = (AccountError)Interop.Account.GetAllAccountCapabilities(_handle, capabilityCallback, IntPtr.Zero);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to get account capabilities");
+            }
+
+            return list;
+        }
+
+        /// <summary>
+        /// Sets the Custom Value to the Account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">key to be added to the Account.</param>
+        /// <param name="value">value to be updated for respective key for the Account.</param>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public void SetCustomValue(string key, string value)
+        {
+            AccountError err = (AccountError)Interop.Account.SetAccountCustomValue(_handle, key, value);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to set the value for : " + key);
+            }
+        }
+
+        /// <summary>
+        /// Gets the user specific custom text of an account key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The key to retrieve custom text .</param>
+        /// <returns>The text of the given key</returns>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="InvalidOperationException">If there is no given capability type in the account </exception>
+        public string GetCustomValue(string key)
+        {
+            string result = "";
+            AccountError err = (AccountError)Interop.Account.GetAccountCustomValue(_handle, key, out result);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + key);
+            }
+
+            return result;
+        }
+
+        /// <summary>
+        /// Gets All the custome values.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>List of custom key, value pairs as Dictionary.</returns>
+        public Dictionary<string, string> GetAllCustomValues()
+        {
+            AccountError res = AccountError.None;
+            Dictionary<string, string> list = new Dictionary<string, string>();
+
+            Interop.Account.AccountCustomCallback customCallback = (string key, string value, IntPtr data) =>
+            {
+                list.Add(key, value);
+                return true;
+            };
+
+            res = (AccountError)Interop.Account.GetAllAccountCustomValues(_handle, customCallback, IntPtr.Zero);
+
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to get account capabilities");
+            }
+
+            return list;
+        }
+
+        /// <summary>
+        /// Sets the user text.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="index">The index of the user text (must be in range from 0 to 4) </param>
+        /// <param name="text">The text string to set as the user text</param>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public void SetUserText(int index, string text)
+        {
+            AccountError err = (AccountError)Interop.Account.SetAccountUserText(_handle, index, text);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index);
+            }
+        }
+
+        /// <summary>
+        /// Gets the user text.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="index">The index of the user text (range: 0 ~ 4)</param>
+        /// <returns>The user text of the given key</returns>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <exception cref="OutOfMemoryException">In case of out of memory</exception>
+        public string GetUserText(int index)
+        {
+            string result = "";
+            AccountError err = (AccountError)Interop.Account.GetAccountUserText(_handle, index, out result);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index);
+            }
+
+            return result;
+        }
+
+        /// <summary>
+        /// Gets the user int value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="index">The index of the user int (range: 0 ~ 4)</param>
+        /// <returns>The user int of the given key</returns>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public int GetUserInt(int index)
+        {
+            int result = -1;
+            AccountError err = (AccountError)Interop.Account.GetAccountUserInt(_handle, index, out result);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index);
+            }
+
+            return result;
+        }
+
+        /// <summary>
+        /// Sets the user integer value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="index">The index of the user integer (must be in range from 0 to 4) </param>
+        /// <param name="value">The integer to set as the user integer</param>
+        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        public void SetUserInt(int index, int value)
+        {
+            AccountError err = (AccountError)Interop.Account.SetAccountUserInt(_handle, index, value);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index);
+            }
+        }
+
+        /// <summary>
+        /// Overloaded Dispose API for destroying the Account Handle.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (!disposing)
+            {
+                if (_handle != IntPtr.Zero)
+                {
+                    _handle = IntPtr.Zero;
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs
new file mode 100644 (file)
index 0000000..b55a458
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// Enumeration for the state of capability
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum CapabilityState
+    {
+        /// <summary>
+        /// Account capability is invalid
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        InvalidState,
+
+        /// <summary>
+        /// Account capability is disabled
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Disabled,
+
+        /// <summary>
+        /// Account capability is enabled
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Enabled
+    }
+
+    /// <summary>
+    /// Enumeration for the state of account secrecy.
+    /// </summary>
+    public enum AccountSecrecyState
+    {
+        /// <summary>
+        /// Account secrecy is invalid
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        InvalidState,
+
+        /// <summary>
+        /// Account is not visible
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Invisible,
+
+        /// <summary>
+        /// Account is visible
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Visible
+    }
+
+    /// <summary>
+    /// Enumeration for the account sync status.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AccountSyncState
+    {
+        /// <summary>
+        /// Account sync is invalid
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        InvalidState,
+
+        /// <summary>
+        /// Account sync not supported
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        NotSupported,
+
+        /// <summary>
+        /// Account sync supported but all synchronization functionalities are off
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Off,
+
+        /// <summary>
+        /// Account sync support and sync status is idle
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Idle,
+
+        /// <summary>
+        /// Account sync support and sync status is running
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Running
+    }
+
+    /// <summary>
+    /// Enumeration for the account auth type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AccountAuthType
+    {
+        /// <summary>
+        /// Auth type is invalid
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Invalid,
+
+        /// <summary>
+        /// XAuth type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        XAuth,
+
+        /// <summary>
+        /// OAuth type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        OAuth,
+
+        /// <summary>
+        /// Client-Login type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ClientLogin
+    }
+
+    /// <summary>
+    /// Account information change notification type
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    /// <remarks>
+    /// When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
+    /// </remarks>
+    public enum AccountNotificationType
+    {
+        /// <summary>
+        /// The insert notification type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Insert,
+        /// <summary>
+        /// The delete notification type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Delete,
+        /// <summary>
+        /// The update notification type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Update,
+        /// <summary>
+        /// The sync update notification type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        syncUpdate
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs
new file mode 100644 (file)
index 0000000..48f9164
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// Enum to give the type of error occured, if any.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AccountError
+    {
+        //TIZEN_ERROR_ACCOUNT = -0x01000000
+        /// <summary>
+        /// Successful.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        None = Tizen.Internals.Errors.ErrorCode.None,
+        /// <summary>
+        /// Invalid parameter.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+        /// <summary>
+        /// Out of memory.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+        /// <summary>
+        /// Same user name exists in your application
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Duplcated = -0x01000000 | 0x01,
+        /// <summary>
+        /// Empty Data
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        NoData = Tizen.Internals.Errors.ErrorCode.NoData,
+        /// <summary>
+        /// elated record does not exist
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        RecordNotFound = -0x01000000 | 0x03,
+        /// <summary>
+        /// Invalid Operation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation,
+        /// <summary>
+        /// DB operation failed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        DBFailed = -0x01000000 | 0x04,
+        /// <summary>
+        ///  DB is not connected.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        DBNotOpened = -0x01000000 | 0x05,
+        /// <summary>
+        /// DB query syntax error
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        QuerySyntaxError = -0x01000000 | 0x06,
+        /// <summary>
+        /// Iterator has reached the end
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        IteratorEnd = -0x01000000 | 0x07,
+        /// <summary>
+        /// Notification failed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        NotificationFailed = -0x01000000 | 0x08,
+        /// <summary>
+        /// Permission denied.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+        /// <summary>
+        /// XML parse failed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        XMLParseFailed = -0x01000000 | 0x0a,
+        /// <summary>
+        /// XML File not found
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        XMLFileNotFound = -0x01000000 | 0x0b,
+        /// <summary>
+        /// Subscription failed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        EventSubscriptionFailed = -0x01000000 | 0x0c,
+        /// <summary>
+        /// Account provider is not registered
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ProviderNotRegistered = -0x01000000 | 0x0d,
+        /// <summary>
+        /// Multiple accounts are not supported.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        MultipleNotAllowed = -0x01000000 | 0x0e,
+        /// <summary>
+        /// SQLite busy handler expired
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        DBBusy = -0x01000000 | 0x10
+    };
+
+    internal class AccountErrorFactory
+    {
+        internal const string LogTag = "Tizen.Account.AccountManager";
+
+        internal static Exception CreateException(AccountError err, string msg)
+        {
+            Log.Info(LogTag, "Got Error " + err + " throwing Exception with msg " + msg);
+            Exception exp;
+            switch (err)
+            {
+                case AccountError.InvalidParameter:
+                    {
+                        exp = new ArgumentException(msg + " Invalid Parameters Provided");
+                        break;
+                    }
+
+                case AccountError.OutOfMemory:
+                    {
+                        exp = new OutOfMemoryException(msg + " Out Of Memory");
+                        break;
+                    }
+
+                case AccountError.InvalidOperation:
+                    {
+                        exp = new InvalidOperationException(msg + " Inavlid operation");
+                        break;
+                    }
+
+                case AccountError.NoData:
+                    {
+                        exp = new InvalidOperationException(msg + " Empty Data");
+                        break;
+                    }
+
+                case AccountError.PermissionDenied:
+                    {
+                        exp = new UnauthorizedAccessException(msg + " Permission Denied");
+                        break;
+                    }
+
+                case AccountError.DBFailed:
+                    {
+                        exp = new InvalidOperationException(msg + " DataBase Failed");
+                        break;
+                    }
+
+                case AccountError.DBBusy:
+                    {
+                        exp = new InvalidOperationException(msg + " DataBase Busy");
+                        break;
+                    }
+
+                case AccountError.QuerySyntaxError:
+                    {
+                        exp = new InvalidOperationException(msg + " Network Error");
+                        break;
+                    }
+                case AccountError.XMLFileNotFound:
+                    {
+                        exp = new System.IO.FileNotFoundException(msg + " XML File not found");
+                        break;
+                    }
+                case AccountError.XMLParseFailed:
+                    {
+                        exp = new System.IO.InvalidDataException(msg + " XML parse error");
+                        break;
+                    }
+
+                default:
+                    {
+                        exp = new InvalidOperationException(err + " " + msg);
+                        break;
+                    }
+            }
+
+            return exp;
+        }
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs
new file mode 100644 (file)
index 0000000..606a286
--- /dev/null
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    ///  Account Id.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class AccountProvider : IDisposable
+    {
+        internal IntPtr _handle;
+        internal AccountProvider(IntPtr handle)
+        {
+            Handle = handle;
+        }
+
+        ~AccountProvider()
+        {
+            Dispose(false);
+        }
+
+        internal IntPtr Handle
+        {
+            get
+            {
+                return _handle;
+            }
+
+            set
+            {
+                _handle = value;
+            }
+        }
+        /// <summary>
+        ///  Account Id.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string AppId
+        {
+            get
+            {
+                string id = "";
+                AccountError res = (AccountError)Interop.AccountProvider.GetAppId(Handle, out id);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get AppId for the AccountProvider");
+                }
+
+                return id;
+            }
+        }
+
+        /// <summary>
+        ///  Serviceprovider Id of the account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string ServiceProviderId
+        {
+            get
+            {
+                string id = "";
+                AccountError res = (AccountError)Interop.AccountProvider.GetServiceProviderId(Handle, out id);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get ServiceProviderId for the AccountProvider");
+                }
+
+                return id;
+            }
+        }
+
+        /// <summary>
+        ///  Icon path of an account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string IconPath
+        {
+            get
+            {
+                string path = "";
+                AccountError res = (AccountError)Interop.AccountProvider.GetAccountProviderIconPath(Handle, out path);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get IconPath for the AccountProvider");
+                }
+
+                return path;
+            }
+        }
+
+        /// <summary>
+        ///  Small icon path of an account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string SmallIconPath
+        {
+            get
+            {
+                string path = "";
+                AccountError res = (AccountError)Interop.AccountProvider.GetAccountProviderSmallIconPath(Handle, out path);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get SmallIconPath for the AccountProvider");
+                }
+
+                return path;
+            }
+        }
+
+        /// <summary>
+        ///  Flag for account provider If supports multiple accounts.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public bool MultipleAccountSupport
+        {
+            get
+            {
+                int multiple = 0;
+                AccountError res = (AccountError)Interop.AccountProvider.GetMultipleAccountSupport(Handle, out multiple);
+                if (res != AccountError.None)
+                {
+                    Log.Warn(AccountErrorFactory.LogTag, "Failed to get SmallIconPath for the AccountProvider");
+                }
+
+                return (multiple == 0) ? false : true;
+            }
+        }
+
+        /// <summary>
+        /// Retrieves all the capability information of the account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <returns>
+        /// list of capability information.
+        /// </returns>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public IEnumerable<string> GetAllCapabilities()
+        {
+            List<string> capabilities = new List<string>();
+            AccountError res;
+            Interop.AccountProvider.AccountProviderFeatureCallback callback = (string appId, string key, IntPtr data) =>
+            {
+                capabilities.Add(key);
+                return true;
+            };
+
+            res = (AccountError)Interop.AccountProvider.GetAccountProviderFeatures(Handle, callback, IntPtr.Zero);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to GetAllCapabilities for AccountProvider");
+            }
+
+            return capabilities;
+        }
+
+        /// <summary>
+        /// Gets the specific label information detail of an account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="locale">
+        /// The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.
+        /// For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
+        /// </param>
+        /// <returns>The label text given for the locale</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given locale</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public string GetLabel(string locale)
+        {
+            string label;
+            AccountError res = (AccountError)Interop.AccountProvider.GetlabelbyLocale(Handle, locale, out label);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to GetLabel for AccountProvider");
+            }
+
+            return label;
+        }
+
+        /// <summary>
+        /// Gets the specific label information detail of an account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">
+        /// The application ID to search
+        /// </param>
+        /// <returns> All the labels information for the given application Id.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static Dictionary<string, string> GetLabelsByAppId(string appId)
+        {
+
+            Dictionary<string, string> labels = new Dictionary<string, string>();
+            Interop.AccountProvider.LabelCallback callback = (string applicationId, string label, string locale, IntPtr userData) =>
+            {
+                labels.Add(locale, label);
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountProvider.GetLablesByAppId(callback, appId, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetLablesByAppId");
+            }
+
+            return labels;
+        }
+
+        /// <summary>
+        /// Gets the label information detail of an account provider.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns> All the labels information for the given account provider.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public Dictionary<string, string> GetLabels()
+        {
+
+            Dictionary<string, string> labels = new Dictionary<string, string>();
+            Interop.AccountProvider.LabelCallback callback = (string applicationId, string label, string locale, IntPtr userData) =>
+            {
+                labels.Add(locale, label);
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountProvider.GetAccountProviderLabels(Handle, callback, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderLabels");
+            }
+
+            return labels;
+        }
+
+        /// <summary>
+        /// Checks whether the given appId exists in the account provider DB.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">The application ID to check.</param>
+        /// <returns>returns true If App is supported </returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public bool IsAppSupported(string appId)
+        {
+            bool isSupported = false;
+            AccountError res = (AccountError)Interop.AccountProvider.GetAppIdExists(appId);
+
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to GetLabel for AccountProvider");
+            }
+            else
+            {
+                isSupported = true;
+            }
+
+            return isSupported;
+        }
+
+        /// <summary>
+        /// Checks whether the given application ID supports the capability.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">The application Id</param>
+        /// <param name="capability">The capability information</param>
+        /// <returns>
+        /// TRUE if the application supports the given capability,
+        /// otherwise FALSE if the application does not support the given capability
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static bool IsFeatureSupportedByApp(string appId, string capability)
+        {
+            bool supported = Interop.AccountProvider.IsFeatureSupported(appId, capability);
+            if (!supported)
+            {
+                //Get last result and validate error code.
+                AccountError err = (AccountError)ErrorFacts.GetLastResult();
+                if ((err != AccountError.None) && (err != AccountError.RecordNotFound))
+                {
+                    throw AccountErrorFactory.CreateException(err, "Failed to get IsFeatureSupported");
+                }
+            }
+
+            return supported;
+        }
+
+        /// <summary>
+        ///     Retrieves capability information with application ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">application Id</param>
+        /// <returns> Capability information list for the given appId.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<string> GetFeaturesByAppId(string appId)
+        {
+
+            List<string> features = new List<string>();
+            Interop.AccountProvider.AccountProviderFeatureCallback callback = (string applicationId, string key, IntPtr userData) =>
+            {
+                features.Add(key);
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountProvider.GetAccountProviderFeaturesByAppId(callback, appId, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderFeaturesByAppId");
+            }
+
+            return (IEnumerable<string>)features;
+        }
+
+        /// <summary>
+        /// Overloaded Dispose API for destroying the AccountProvider Handle.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (!disposing)
+            {
+                if (_handle != IntPtr.Zero)
+                {
+                    Interop.AccountProvider.Destroy(_handle);
+                    _handle = IntPtr.Zero;
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs
new file mode 100644 (file)
index 0000000..fc7cbd4
--- /dev/null
@@ -0,0 +1,606 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// The AccountManager APIs is separated into two major sections:
+    /// 1. Registering an account provider while an application is installed. This information will be used for the Add account screen.
+    /// 2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu.
+    ///
+    /// The APIs of both of the sections consist of the following functionality:
+    /// <list>
+    /// <item> Create an account or account provider </item>
+    /// <item> Update an account or account provider(Only available for the creator) </item>
+    /// <item> Delete an account or account provider(Only available for the creator) </item>
+    /// <item> Read an account or account provider with some filter </item>
+    /// </list>
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+
+    public static class AccountService
+    {
+        /// <summary>
+        /// This is contact capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string ContactCapability = "http://tizen.org/account/capability/contact";
+
+        /// <summary>
+        /// This is calendar capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string CalendarCapability = "http://tizen.org/account/capability/calendar";
+
+        /// <summary>
+        /// This is email capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string EmailCapability = "http://tizen.org/account/capability/email";
+
+        /// <summary>
+        /// This is photo capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string PhotoCapability = "http://tizen.org/account/capability/photo";
+
+        /// <summary>
+        /// This is video capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string VideoCapability = "http://tizen.org/account/capability/video";
+
+        /// <summary>
+        /// This is music capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string MusicCapability = "http://tizen.org/account/capability/music";
+
+        /// <summary>
+        /// This is document capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string DocumentCapability = "http://tizen.org/account/capability/document";
+
+        /// <summary>
+        /// This is message capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string MessageCapability = "http://tizen.org/account/capability/message";
+
+        /// <summary>
+        /// This is game capability string.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static readonly string GameCapability = "http://tizen.org/account/capability/game";
+
+        /// <summary>
+        /// Retrieves all accounts details from the account database.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>List of Accounts</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error. </exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<Account> GetAccountsAsync()
+        {
+            List<Account> accounts = new List<Account>();
+            List<int> values = new List<int>();
+            Interop.Account.AccountCallback accountCallback = (IntPtr data, IntPtr userdata) =>
+            {
+                Account account = new Account(data);
+                values.Add(account.AccountId);
+                account.Dispose();
+                return true;
+            };
+
+            AccountError res = (AccountError)Interop.AccountService.AccountForeachAccountFromDb(accountCallback, IntPtr.Zero);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to AccountForeachAccountFromDb");
+            }
+
+            foreach (int i in values)
+            {
+                Account account = AccountService.GetAccountById(i);
+                accounts.Add(account);
+            }
+
+            return accounts;
+        }
+
+        /// <summary>
+        /// Retrieve an account with the account ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="accountId"> The account Id to be searched.</param>
+        /// <returns>Account instance with reference to the given id.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account id</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static Account GetAccountById(int accountId)
+        {
+            Account account = Account.CreateAccount();
+            IntPtr handle = account.Handle;
+            AccountError res = (AccountError)Interop.AccountService.QueryAccountById(accountId, out handle);
+            if (res != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(res, "Failed to get accounts from the database for account id: " + accountId);
+            }
+
+            account.Handle = handle;
+            return account;
+        }
+
+        /// <summary>
+        /// Retrieves all AccountProviders details from the account database.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>List of AccountProviders</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<AccountProvider> GetAccountProviders()
+        {
+            List<string> values = new List<string>();
+            List<AccountProvider> providers = new List<AccountProvider>();
+            Interop.AccountProvider.AccountProviderCallback accountCallback = (IntPtr handle, IntPtr data) =>
+            {
+                AccountProvider provider = new AccountProvider(handle);
+                values.Add(provider.AppId);
+                provider.Dispose();
+                return true;
+            };
+
+            AccountError res = (AccountError)Interop.AccountService.GetAllAccountproviders(accountCallback, IntPtr.Zero);
+            if (res != AccountError.None)
+            {
+                Log.Warn(AccountErrorFactory.LogTag, "Failed to get account providers from the database");
+                throw AccountErrorFactory.CreateException(res, "Failed to get account providers from the database");
+            }
+
+            foreach (string val in values)
+            {
+                AccountProvider provider = GetAccountProviderByAppId(val);
+                providers.Add(provider);
+            }
+
+            return providers;
+        }
+
+        /// <summary>
+        /// Retrieves the account provider information with application Id.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application Id.</param>
+        /// <returns>The AccountProvider instance associated with the given application Id.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static AccountProvider GetAccountProviderByAppId(string appId)
+        {
+            IntPtr handle;
+            Interop.AccountProvider.Create(out handle);
+            AccountError err = (AccountError)Interop.AccountService.GetAccountProviderByAppId(appId, out handle);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderByAppId");
+            }
+
+            AccountProvider provider = new AccountProvider(handle);
+            return provider;
+        }
+
+        /// <summary>
+        /// Retrieves all the account providers information with feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="feature">The capability value to search for account providers.</param>
+        /// <returns>Retrieves AccountProviders information with the capability name.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given feature</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<AccountProvider> GetAccountProvidersByFeature(string feature)
+        {
+            List<string> values = new List<string>();
+            List<AccountProvider> providers = new List<AccountProvider>();
+            Interop.AccountProvider.AccountProviderCallback providerCallback = (IntPtr handle, IntPtr data) =>
+            {
+                AccountProvider provider = new AccountProvider(handle);
+                values.Add(provider.AppId);
+                provider.Dispose();
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountService.GetAccountProviderByFeature(providerCallback, feature, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderByFeature");
+            }
+
+            foreach (string val in values)
+            {
+                AccountProvider provider = GetAccountProviderByAppId(val);
+                providers.Add(provider);
+            }
+
+            return providers;
+        }
+
+        /// <summary>
+        /// Inserts into the Database with the new account Infomration.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="account">New Account instance to be added.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write </privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="OutOfMemoryException"> In case of OutOfMemory error.</exception>
+        public static int AddAccount(Account account)
+        {
+            if (account == null)
+            {
+                throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to AddAccount");
+            }
+
+            int id = -1;
+            AccountError err = (AccountError)Interop.AccountService.AddAccount(account.Handle, out id);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to AddAccount");
+            }
+
+            return id;
+        }
+
+        /// <summary>
+        /// Updates the account details to the account database.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="account">account instance to be updated.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write </privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="OutOfMemoryException"> In case of OutOfMemory error.</exception>
+        public static void UpdateAccount(Account account)
+        {
+            if (account == null)
+            {
+                throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to UpdateAccount");
+            }
+
+            AccountError err = (AccountError)Interop.AccountService.UpdateAccountToDBById(account.Handle, account.AccountId);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to UpdateAccount");
+            }
+        }
+
+        /// <summary>
+        /// Deletes the account information from the Database.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="account">Account instance to be deleted from the database.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write </privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static void DeleteAccount(Account account)
+        {
+            if (account == null)
+            {
+                throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to DeleteAccount");
+            }
+
+            AccountError err = (AccountError)Interop.AccountService.DeleteAccountById(account.AccountId);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to delete the account by Id: " + account.AccountId);
+            }
+        }
+
+        /// <summary>
+        /// Deletes an account from the account database by user name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="userName">The user name of the account to delete.</param>
+        /// <param name="packageName">The package name of the account to delete.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write </privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static void DeleteAccount(string userName, string packageName)
+        {
+            AccountError err = (AccountError)Interop.AccountService.DeleteAccountByUser(userName, packageName);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to delete the account by userName: " + userName);
+            }
+        }
+
+        /// <summary>
+        /// Deletes an account from the account database by package name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="packageName">The package name of the account to delete.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write </privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static void DeleteAccount(string packageName)
+        {
+            AccountError err = (AccountError)Interop.AccountService.DeleteAccountByPackage(packageName);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to delete the account by package name: " + packageName);
+            }
+
+        }
+
+        /// <summary>
+        /// Retrieves all accounts with the given user name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="userName">The user name to search .</param>
+        /// <returns>Accounts list matched with the user name</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given username</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<Account> GetAccountsByUserName(string userName)
+        {
+            List<Account> accounts = new List<Account>();
+            List<int> values = new List<int>();
+            Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
+            {
+                Account account = new Account(handle);
+                values.Add(account.AccountId);
+                account.Dispose();
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountService.QueryAccountByUserName(accountCallback, userName, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByUserName");
+            }
+
+            foreach (int i in values)
+            {
+                Account account = AccountService.GetAccountById(i);
+                accounts.Add(account);
+            }
+
+            return accounts;
+        }
+
+        /// <summary>
+        /// Retrieves all accounts with the given package name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="packageName"> The package name to Search</param>
+        /// <returns>Accounts list matched with the package name</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given package name</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<Account> GetAccountsByPackageName(string packageName)
+        {
+            List<Account> accounts = new List<Account>();
+            List<int> values = new List<int>();
+            Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
+            {
+                Account account = new Account(handle);
+                values.Add(account.AccountId);
+                account.Dispose();
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountService.QueryAccountByPackageName(accountCallback, packageName, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByPackageName");
+            }
+
+            foreach (int i in values)
+            {
+                Account account = AccountService.GetAccountById(i);
+                accounts.Add(account);
+            }
+
+            return accounts;
+        }
+
+        /// <summary>
+        /// Retrieves all accounts with the given cpability type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type"> Capability type</param>
+        /// <returns>Accounts list matched with the capability type</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given capability type</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static IEnumerable<Account> GetAccountsByCapabilityType(string type)
+        {
+            List<Account> accounts = new List<Account>();
+            List<int> values = new List<int>();
+            Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
+            {
+                Account account = new Account(handle);
+                values.Add(account.AccountId);
+                account.Dispose();
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountService.GetAccountByCapabilityType(accountCallback, type, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByCapabilityType");
+            }
+
+            foreach (int i in values)
+            {
+                Account account = AccountService.GetAccountById(i);
+                accounts.Add(account);
+            }
+
+            return accounts;
+        }
+
+        /// <summary>
+        /// Retrieves all capabilities with the given account
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="accountId">account instance</param>
+        /// <returns>Capabilities list as Dictionary of Capability type and State.</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account id</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static Dictionary<string, CapabilityState> GetCapabilitiesById(int accountId)
+        {
+            Dictionary<string, CapabilityState> capabilities = new Dictionary<string, CapabilityState>();
+            Interop.Account.AccountCapabilityCallback capabilityCallback = (string type, int capabilityState, IntPtr data) =>
+            {
+                capabilities.Add(type, (CapabilityState)capabilityState);
+                return true;
+            };
+
+            AccountError err = (AccountError)Interop.AccountService.QueryAccountCapabilityById(capabilityCallback, accountId, IntPtr.Zero);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAllCapabilitiesById");
+            }
+
+            return capabilities;
+        }
+
+        /// <summary>
+        /// Gets the count of accounts in the account database.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The number of accounts in the database</returns>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static int GetAccountsCount()
+        {
+            int count = 0;
+            AccountError err = (AccountError)Interop.AccountService.GetAccountCount(out count);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to GetAccountCount");
+            }
+
+            return count;
+        }
+
+        /// <summary>
+        /// Updates the sync status of the given account.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="account"> Account for which sync status needs to be updated</param>
+        /// <param name="status">Sync State</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <privilege>http://tizen.org/privilege/account.write</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static void UpdateSyncStatusById(Account account, AccountSyncState status)
+        {
+            AccountError err = (AccountError)Interop.AccountService.UpdateAccountSyncStatusById(account.AccountId, (int)status);
+            if (err != AccountError.None)
+            {
+                throw AccountErrorFactory.CreateException(err, "Failed to UpdateSyncStatusById");
+            }
+        }
+
+        private static readonly Interop.AccountService.SubscribeCallback s_accountUpdatedCallback = (string eventType, int accountId, IntPtr userData) =>
+        {
+            AccountSubscriberEventArgs eventArgs = new AccountSubscriberEventArgs(eventType, accountId);
+            s_accountUpdated?.Invoke(null, eventArgs);
+            return true;
+        };
+
+        private static Interop.AccountService.SafeAccountSubscriberHandle s_subscriberHandle;
+
+        private static event EventHandler<AccountSubscriberEventArgs> s_accountUpdated;
+        /// <summary>
+        /// ContentUpdated event is triggered when the media item info from DB changes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// ContentUpdate event is triggered if the MediaInformaion updated/deleted or new Inforamtion is Inserted.
+        /// </remarks>
+        /// <param name="sender"></param>
+        /// <param name="e">A ContentUpdatedEventArgs object that contains information about the update operation.</param>
+        /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        public static event EventHandler<AccountSubscriberEventArgs> AccountUpdated
+        {
+            add
+            {
+                if (s_accountUpdated == null)
+                {
+                    if (s_subscriberHandle == null)
+                    {
+                        Interop.AccountService.CreateAccountSubscriber(out s_subscriberHandle);
+                    }
+
+                    AccountError ret = (AccountError)Interop.AccountService.RegisterSubscriber(s_subscriberHandle, s_accountUpdatedCallback, IntPtr.Zero);
+
+                    if (ret != AccountError.None)
+                    {
+                        throw AccountErrorFactory.CreateException(ret, "Error in callback handling");
+                    }
+                }
+
+                s_accountUpdated += value;
+            }
+
+            remove
+            {
+                s_accountUpdated -= value;
+                if (s_accountUpdated == null)
+                {
+                    AccountError ret = (AccountError)Interop.AccountService.UnregisterSubscriber(s_subscriberHandle);
+                    if (ret != AccountError.None)
+                    {
+                        throw AccountErrorFactory.CreateException(ret, "Error in callback handling");
+                    }
+                    s_subscriberHandle = null;
+                }
+            }
+        }
+
+    }
+}
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs
new file mode 100644 (file)
index 0000000..153c427
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// Event arguments passed when Event is triggered to notify that account is updated/removed from the account database.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class AccountSubscriberEventArgs : EventArgs
+    {
+        private const string NotiInsert = "insert";
+        private const string NotiDelete = "delete";
+        private const string NotiUpdate = "update";
+        private const string NotiSyncUpdate = "sync_update";
+        internal AccountSubscriberEventArgs(string eventType, int accountId)
+        {
+            if (eventType.CompareTo(NotiInsert) == 0)
+            {
+                EventType = AccountNotificationType.Insert;
+            }
+            else if (eventType.CompareTo(NotiDelete) == 0)
+            {
+                EventType = AccountNotificationType.Delete;
+            }
+            else if (eventType.CompareTo(NotiUpdate) == 0)
+            {
+                EventType = AccountNotificationType.Update;
+            }
+            else if (eventType.CompareTo(NotiSyncUpdate) == 0)
+            {
+                EventType = AccountNotificationType.syncUpdate;
+            }
+
+            AccountId = accountId;
+        }
+
+        /// <summary>
+        /// The account event type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public AccountNotificationType EventType
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The account ID to update
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public int AccountId
+        {
+            get;
+            internal set;
+        }
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs
new file mode 100755 (executable)
index 0000000..13c7170
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..955fffe
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    /// <summary>
+    /// Wrapper class for maintaining names of dependent native libraries.
+    /// </summary>
+    internal static partial class Libraries
+    {
+        public const string FidoClient = "libfido-client.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs
new file mode 100755 (executable)
index 0000000..7cbd9f9
--- /dev/null
@@ -0,0 +1,68 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Internals.Errors;
+
+internal static partial class Interop
+{
+    internal static partial class UafAuthenticator
+    {
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_foreach_authenticator")]
+        internal static extern int ForeachAuthenticator(FidoAuthenticatorCallback cb, IntPtr /* void */ userData);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_title")]
+        internal static extern int GetTitle(IntPtr /* fido_authenticator_h */ auth, out IntPtr title);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_aaid")]
+        internal static extern int GetAaid(IntPtr /* fido_authenticator_h */ auth, out IntPtr aaid);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_description")]
+        internal static extern int GetDescription(IntPtr /* fido_authenticator_h */ auth, out IntPtr desc);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_assertion_scheme")]
+        internal static extern int GetAssertionScheme(IntPtr /* fido_authenticator_h */ auth, out IntPtr scheme);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_algorithm")]
+        internal static extern int GetAlgorithm(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_algo_e */ algo);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_foreach_attestation_type")]
+        internal static extern int ForeachAttestationType(IntPtr /* fido_authenticator_h */ auth, FidoAttestationTypeCallback cb, IntPtr /* void */ userData);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_verification_method")]
+        internal static extern int GetVerificationMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_user_verify_type_e */ userVerification);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_key_protection_method")]
+        internal static extern int GetKeyProtectionMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_key_protection_type_e */ keyProtection);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_matcher_protection_method")]
+        internal static extern int GetMatcherProtectionMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_matcher_protection_type_e */ matcherProtection);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_attachment_hint")]
+        internal static extern int GetAttachmentHint(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_attachment_hint_e */ attachmentHint);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_is_second_factor_only")]
+        internal static extern bool GetIsSecondFactorOnly(IntPtr /* fido_authenticator_h */ auth);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_tc_discplay")]
+        internal static extern int GetTcDiscplay(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_tc_display_type_e */ tcDisplay);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_tc_display_type")]
+        internal static extern int GetTcDisplayType(IntPtr /* fido_authenticator_h */ auth, out IntPtr tcDisplayContentType);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_icon")]
+        internal static extern int GetIcon(IntPtr /* fido_authenticator_h */ auth, out IntPtr icon);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void FidoAuthenticatorCallback(IntPtr /* fido_authenticator_h */ authInfo, IntPtr /* void */ userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void FidoAttestationTypeCallback(int /* fido_auth_attestation_type_e */ attType, IntPtr /* void */ userData);
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs
new file mode 100755 (executable)
index 0000000..2c4072d
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Internals.Errors;
+
+internal static partial class Interop
+{
+    internal static partial class UafClient
+    {
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_get_client_vendor")]
+        internal static extern int FidoGetClientVendor(out string vendorName);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_get_client_version")]
+        internal static extern int FidoGetClientVersion(out int clientMajorVersion, out int clientMinorVersion);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_is_supported")]
+        internal static extern int FidoUafIsSupported(string uafMessageJson, out bool isSupported);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_get_response_message")]
+        internal static extern int FidoUafGetResponseMessage(string uafRequestJson, string channelBinding, FidoUafResponseMessageCallback callback, IntPtr /* void */ userData);
+
+        [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_set_server_result")]
+        internal static extern int FidoUafSetServerResult(int responseCode, string uafResponseJson);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void FidoUafResponseMessageCallback(int /* fido_error_e */ tizenErrorCode, string uafResponseJson, IntPtr /* void */ userData);
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj
new file mode 100644 (file)
index 0000000..d01cc96
--- /dev/null
@@ -0,0 +1,24 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.3</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>FIDO UAF API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Account.FidoClient.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.snk b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.snk
new file mode 100755 (executable)
index 0000000..847fdf6
Binary files /dev/null and b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.snk differ
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs
new file mode 100755 (executable)
index 0000000..220b131
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// Contains information about the authenticators registered on the device.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    /// <example>
+    /// <code>
+    ///     IEnumerable<AuthenticatorInformation> authInfos = await UafAuthenticatorFinder.DiscoverAuthenticatorsAsync();
+    ///     foreach (AuthenticatorInformation authInfo in authInfos)
+    ///     {
+    ///         string aaid = authInfo.Aaid;
+    ///         string title = authInfo.Title;
+    ///     }
+    /// </code>
+    /// </example>
+    public class AuthenticatorInformation
+    {
+        internal AuthenticatorInformation()
+        {
+        }
+
+        /// <summary>
+        /// The authenticator Title
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Title { get; internal set; }
+
+        /// <summary>
+        /// The Authenticator AAID (Authenticator Attestation ID)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Aaid { get; internal set; }
+
+        /// <summary>
+        /// The Authenticator description
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Description { get; internal set; }
+
+        /// <summary>
+        /// The Authenticator assertion scheme.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string AssertionScheme { get; internal set; }
+
+        /// <summary>
+        /// The Authenticator algorithm.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public AuthenticationAlgorithm AuthenticationAlgorithm { get; internal set; }
+
+        /// <summary>
+        /// The user verification method of this Authenticator
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public UserVerificationMethod UserVerification { get; internal set; }
+
+        /// <summary>
+        /// The key protection method of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public KeyProtectionType KeyProtection { get; internal set; }
+
+        /// <summary>
+        /// The matcher protection method of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public MatcherProtectionType MatcherProtection { get; internal set; }
+
+        /// <summary>
+        /// The attachment hint of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public AuthenticatorAttachmentHint AttachmentHint { get; internal set; }
+
+        /// <summary>
+        /// Denotes the Authenticator is Second factor only which is supported by U2F standards.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public bool IsSecondFactorOnly { get; internal set; }
+
+        /// <summary>
+        /// The available attestation types for this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public IEnumerable<AuthenticatorAttestationType> AttestationTypes { get; internal set; }
+
+        /// <summary>
+        /// The Transaction Confirmation display type of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public TransactionConfirmationDisplayType TcDisplayType { get; internal set; }
+
+        /// <summary>
+        /// The Transaction Confirmation display type of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string TcDisplayContentType { get; internal set; }
+
+        /// <summary>
+        /// The icon of this Authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Icon { get; internal set; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs
new file mode 100755 (executable)
index 0000000..ef3191a
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Account.FidoClient
+{
+    internal enum FidoErrorCode
+    {
+        None = ErrorCode.None,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        NoData = ErrorCode.NoData,
+        NotSupported = ErrorCode.NotSupported,
+        PermissionDenied = ErrorCode.PermissionDenied,
+        UserActionInProgress = -0x01030000 | 0x01,
+        UserCancelled = -0x01030000 | 0x02,
+        UnsupportedVersion = -0x01030000 | 0x03,
+        NoSuitableAuthenticator = -0x01030000 | 0x04,
+        ProtocolError = -0x01030000 | 0x05,
+        UntrustedFacetId = -0x01030000 | 0x06,
+        Unknown = ErrorCode.Unknown
+    }
+
+    internal class ErrorFactory
+    {
+        internal static string LogTag = "Tizen.Account.FidoClient";
+
+        internal static Exception GetException(int error)
+        {
+            if ((FidoErrorCode)error == FidoErrorCode.OutOfMemory)
+            {
+                return new OutOfMemoryException("Out of memory");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.InvalidParameter)
+            {
+                return new ArgumentException("Invalid parameter");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.UserActionInProgress)
+            {
+                return new InvalidOperationException("User action already in progress");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.NotSupported)
+            {
+                return new NotSupportedException("FIDO is unsupported.");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.PermissionDenied)
+            {
+                return new UnauthorizedAccessException("Permission denied");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.UnsupportedVersion)
+            {
+                return new NotSupportedException("UAF message's version is not supported.");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.NoSuitableAuthenticator)
+            {
+                return new Exception("Suitable authenticator can't be found");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.ProtocolError)
+            {
+                return new ArgumentException("Protocol error, the interaction may have timed out, or the UAF message is malformed.");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.UserCancelled)
+            {
+                return new Exception("User has canceled the operation.");
+            }
+            else if ((FidoErrorCode)error == FidoErrorCode.UntrustedFacetId)
+            {
+                return new Exception(" The caller's id is not allowed to use this operation.");
+            }
+            else
+            {
+                return new Exception("Unknown error");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs
new file mode 100755 (executable)
index 0000000..bed73d4
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// Class to find available FIDO specific authenticators on the device
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class UafAuthenticatorFinder
+    {
+        /// <summary>
+        /// Retrieves  all the available FIDO authenticators supported by this Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Enumerable list of authenticators</returns>
+        /// <privilege>http://tizen.org/privilege/fido.client</privilege>
+        /// <feature>http://tizen.org/feature/fido.uaf</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the application does not have privilege to access this method</exception>
+        /// <exception cref="NotSupportedException">FIDO is not supported</exception>
+
+        /// <example>
+        /// <code>
+        ///     IEnumerable<AuthenticatorInformation> authInfos = await UafAuthenticatorFinder.DiscoverAuthenticatorsAsync();
+        ///     foreach (AuthenticatorInformation authInfo in authInfos)
+        ///     {
+        ///         string aaid = authInfo.Aaid;
+        ///         string title = authInfo.Title;
+        ///     }
+        /// </code>
+        /// </example>
+        public static async Task<IEnumerable<AuthenticatorInformation>> DiscoverAuthenticatorsAsync()
+        {
+            IEnumerable<AuthenticatorInformation> result = null;
+            await Task.Run(() => result = Discover());
+            return result;
+        }
+
+        private static IEnumerable<AuthenticatorInformation> Discover()
+        {
+            IList<AuthenticatorInformation> result = new List<AuthenticatorInformation>();
+
+            Interop.UafAuthenticator.FidoAuthenticatorCallback cb = (IntPtr authHandle, IntPtr userData) =>
+            {
+                Log.Info(ErrorFactory.LogTag, "Iterating authenticators");
+                result.Add(GetAuthInfo(authHandle));
+            };
+
+            int ret = Interop.UafAuthenticator.ForeachAuthenticator(cb, IntPtr.Zero);
+            if(ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            return result;
+        }
+
+        private static AuthenticatorInformation GetAuthInfo(IntPtr authHandle)
+        {
+            var authInfo = new AuthenticatorInformation();
+
+            IntPtr stringPtr;
+            int ret = Interop.UafAuthenticator.GetTitle(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.Title = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.UafAuthenticator.GetAaid(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.Aaid = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.UafAuthenticator.GetDescription(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.Description = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.UafAuthenticator.GetAssertionScheme(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.AssertionScheme = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            int authAlgo;
+            ret = Interop.UafAuthenticator.GetAlgorithm(authHandle, out authAlgo);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            int usrVerificationMethod;
+            ret = Interop.UafAuthenticator.GetVerificationMethod(authHandle, out usrVerificationMethod);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            int keyProtectionType;
+            ret = Interop.UafAuthenticator.GetKeyProtectionMethod(authHandle, out keyProtectionType);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            int matcherProtection;
+            ret = Interop.UafAuthenticator.GetMatcherProtectionMethod(authHandle, out matcherProtection);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            int attachmentHint;
+            ret = Interop.UafAuthenticator.GetAttachmentHint(authHandle, out attachmentHint);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            bool isSecondaryOnly = Interop.UafAuthenticator.GetIsSecondFactorOnly(authHandle);
+
+            int tcDisplayType;
+            ret = Interop.UafAuthenticator.GetTcDiscplay(authHandle, out tcDisplayType);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.UafAuthenticator.GetTcDisplayType(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.TcDisplayContentType = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.UafAuthenticator.GetIcon(authHandle, out stringPtr);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            authInfo.Icon = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            var attestationTypes = new List<AuthenticatorAttestationType> ();
+            Interop.UafAuthenticator.FidoAttestationTypeCallback cb = (int type, IntPtr usrData) =>
+            {
+                attestationTypes.Add((AuthenticatorAttestationType)type);
+            };
+
+            ret = Interop.UafAuthenticator.ForeachAttestationType(authHandle, cb, IntPtr.Zero);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            authInfo.AuthenticationAlgorithm = (AuthenticationAlgorithm)authAlgo;
+            authInfo.UserVerification = (UserVerificationMethod)usrVerificationMethod;
+            authInfo.KeyProtection = (KeyProtectionType)keyProtectionType;
+            authInfo.MatcherProtection = (MatcherProtectionType)matcherProtection;
+            authInfo.AttachmentHint = (AuthenticatorAttachmentHint)attachmentHint;
+            authInfo.IsSecondFactorOnly = isSecondaryOnly;
+            authInfo.TcDisplayType = (TransactionConfirmationDisplayType)tcDisplayType;
+            authInfo.AttestationTypes = attestationTypes;
+
+            return authInfo;
+        }
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs
new file mode 100755 (executable)
index 0000000..da3f9da
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Threading.Tasks;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// The FIDO UAF Client APIs
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class UafClient
+    {
+        private static string _vendorName = null;
+        private static int _majorVersion;
+        private static int _minorVersion;
+
+        static UafClient()
+        {
+            int ret = Interop.UafClient.FidoGetClientVendor(out _vendorName);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.UafClient.FidoGetClientVersion(out _majorVersion, out _minorVersion);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// The FIDO Client vendor name
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static string VendorName
+        {
+            get
+            {
+                return _vendorName;
+            }
+        }
+
+        /// <summary>
+        /// The FIDO Client Major version
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static int MajorVersion
+        {
+            get
+            {
+                return _majorVersion;
+            }
+        }
+
+        /// <summary>
+        /// The FIDO Client Minor version
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static int MinorVersion
+        {
+            get
+            {
+                return _minorVersion;
+            }
+        }
+
+        /// <summary>
+        /// The FIDO Server response for successfull interaction.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static int StautsOk
+        {
+            get
+            {
+                return 1200;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the FIDO message can be processed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="uafMessage">The FIDO UAF message which is received from the relying party server</param>
+        /// <returns>True if the message can be handled by the device, else false</returns>
+        /// <privilege>http://tizen.org/privilege/fido.client</privilege>
+        /// <feature>http://tizen.org/feature/fido.uaf</feature>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the application does not have privilege to access this method</exception>
+        /// <exception cref="NotSupportedException">FIDO is not supported</exception>
+        /// <example>
+        /// <code>
+        ///     UafMessage uafRequest = new UafMessage()
+        ///     {
+        ///         Operation = "UafRequestJson"
+        ///     };
+        ///     bool response = await UafClient.CheckPolicyAsync(uafRequest);
+        /// </code>
+        /// </example>
+        public static async Task<bool> CheckPolicyAsync(UafMessage uafMessage)
+        {
+            if (uafMessage == null)
+            {
+                Log.Error(ErrorFactory.LogTag, "Invalid request or request is null");
+                throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter);
+            }
+
+            bool result = false;
+            await Task.Run(() => result = CheckPolicy(uafMessage.Operation));
+            return result;
+        }
+
+        /// <summary>
+        /// Processes the given FIDO UAF message.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="uafMessage">The FIDO UAF message which is received from the relying party server</param>
+        /// <param name="channelBindng">The channel binding data in JSON format which is received from the relying party server</param>
+        /// <returns>FIDO response message</returns>
+        /// <privilege>http://tizen.org/privilege/fido.client</privilege>
+        /// <feature>http://tizen.org/feature/fido.uaf</feature>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the application does not have privilege to access this method</exception>
+        /// <exception cref="NotSupportedException">FIDO is not supported</exception>
+        /// <example>
+        /// <code>
+        ///     UafMessage uafRequest = new UafMessage()
+        ///     {
+        ///         Operation = "UafAuthRequestJson"
+        ///     };
+        ///
+        ///     var response = await UafClient.ProcessRequestAsync(uafRequest, null);
+        /// </code>
+        /// </example>
+        public static async Task<UafResponse> ProcessRequestAsync(UafMessage uafMessage, string channelBindng)
+        {
+            if (uafMessage == null)
+            {
+                Log.Error(ErrorFactory.LogTag, "Invalid request or request is null");
+                throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter);
+            }
+
+            TaskCompletionSource<UafResponse> tcs = new TaskCompletionSource<UafResponse>();
+            Interop.UafClient.FidoUafResponseMessageCallback cb = (int errorCode, string uafResponseJson, IntPtr userData) =>
+            {
+                if (uafMessage == null)
+                {
+                    Log.Error(ErrorFactory.LogTag, "Invalid request or request is null");
+                    tcs.SetException(ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter));
+                }
+
+                if (errorCode != (int)FidoErrorCode.None)
+                {
+                    Log.Error(ErrorFactory.LogTag, "Interop callback failed with error code: [" + errorCode + "]");
+                    tcs.SetException(ErrorFactory.GetException(errorCode));
+                }
+
+                tcs.SetResult(new UafResponse() { Response = uafResponseJson });
+            };
+
+            int ret = Interop.UafClient.FidoUafGetResponseMessage(uafMessage.Operation, channelBindng, cb, IntPtr.Zero);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            return await tcs.Task;
+        }
+
+        /// <summary>
+        /// Notifies the FIDO client about the server result. FIDO Server sends the result of processing a UAF message to FIDO client.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="responseCode">The status code received from Server.(StautsOk implies success)</param>
+        /// <param name="response">The FIDO response message sent to server in JSON format</param>
+        /// <privilege>http://tizen.org/privilege/fido.client</privilege>
+        /// <feature>http://tizen.org/feature/fido.uaf</feature>
+        /// <remarks>
+        /// This is especially important for cases when a new registration may be considered by the client to be in a pending state until it is communicated that the server accepted it
+        /// </remarks>
+        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the application does not have privilege to access this method</exception>
+        /// <exception cref="NotSupportedException">FIDO is not supported</exception>
+        /// <example>
+        /// <code>
+        ///     UafResponse response = new UafResponse()
+        ///     {
+        ///         Response = "Responsejson"
+        ///     };
+        ///
+        ///     await UafClient.NotifyResultAsync(UafClient.StautsOk, response);
+        /// </code>
+        /// </example>
+        public static async Task NotifyResultAsync(int responseCode, UafResponse response)
+        {
+            if (response == null)
+            {
+                Log.Error(ErrorFactory.LogTag, "Invalid parameter");
+                throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter);
+            }
+
+            await Task.Run(() => NotifyResult(responseCode, response.Response));
+        }
+
+        private static bool CheckPolicy(string uafOperation)
+        {
+            bool isSupported;
+            int ret = Interop.UafClient.FidoUafIsSupported(uafOperation, out isSupported);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+            return isSupported;
+        }
+
+        private static void NotifyResult(int responseCode, string response)
+        {
+            int ret = Interop.UafClient.FidoUafSetServerResult(responseCode, response);
+            if (ret != (int)FidoErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ErrorFacts.GetErrorMessage(ret) + "]");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs
new file mode 100755 (executable)
index 0000000..89367ff
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// Authenticator's supported algorithm and encoding
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AuthenticationAlgorithm
+    {
+        /// <summary>
+        /// SECP256R1 ECDSA SHA256 Raw
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Secp256r1EcdsaSha256Raw = 0X01,
+
+        /// <summary>
+        /// SECP256R1 ECDSA SHA256 DER
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Secp256r1EcdsaSha256Der = 0X02,
+
+        /// <summary>
+        /// RSA PSS SHA256 Raw
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        RsassaPssSha256Raw = 0X03,
+
+        /// <summary>
+        /// RSA PSS SHA256 DER
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        RsassaPssSha256Der = 0X04,
+
+        /// <summary>
+        /// SECP256K1 ECDSA SHA256 Raw
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Secp256k1EcdsaSha256Raw = 0X05,
+
+        /// <summary>
+        /// SECP256K1 ECDSA SHA256 DER
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Secp256k1EcdsaSha256Der = 0X06
+    }
+
+    /// <summary>
+    /// Authenticator's supported user verification method type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum UserVerificationMethod
+    {
+        /// <summary>
+        /// User presence verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Presence = 0X01,
+
+        /// <summary>
+        /// User fingerprint verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Fingerprint = 0X02,
+
+        /// <summary>
+        /// User passcode verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Passcode = 0X04,
+
+        /// <summary>
+        /// User voiceprint verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Voiceprint = 0X08,
+
+        /// <summary>
+        /// User faceprint verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Faceprint = 0X10,
+        /// <summary>
+        /// User location verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Location = 0X20,
+
+        /// <summary>
+        /// User eyeprint verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Eyeprint = 0X40,
+
+        /// <summary>
+        /// User pattern verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Pattern = 0X80,
+
+        /// <summary>
+        /// User handprint verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Handprint = 0X100,
+
+        /// <summary>
+        /// Silent verification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        None = 0X200,
+
+        /// <summary>
+        /// If an authenticator sets multiple flags for user verification types, it may also set this flag to indicate that all verification methods will be enforced (e.g. faceprint AND voiceprint). If flags for multiple user verification methods are set and this flag is not set, verification with only one is necessary (e.g. fingerprint OR passcode).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        All = 0X400
+    }
+
+    /// <summary>
+    /// Authenticator's supported key protection method type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum KeyProtectionType
+    {
+        /// <summary>
+        /// Software based key management.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Software = 0X01,
+
+        /// <summary>
+        /// Hardware based key management.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Hardware = 0X02,
+
+        /// <summary>
+        /// Trusted Execution Environment based key management.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Tee = 0X04,
+
+        /// <summary>
+        /// Secure Element based key management.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        SecureElement = 0X08,
+
+        /// <summary>
+        /// Authenticator does not store (wrapped) UAuth keys at the client, but relies on a server-provided key handle.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        RemoteHandle = 0X10
+    }
+
+    /// <summary>
+    /// Authenticator's supported matcher protection type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum MatcherProtectionType
+    {
+        /// <summary>
+        /// Authenticator's matcher is running in software.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Software = 0X01,
+
+        /// <summary>
+        /// Authenticator's matcher is running inside the Trusted Execution Environment.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Tee = 0X02,
+
+        /// <summary>
+        /// Aauthenticator's matcher is running on the chip.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        OnChip = 0X04
+    }
+
+    /// <summary>
+    /// Authenticator's supproted method to communicate to FIDO user device.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AuthenticatorAttachmentHint
+    {
+        /// <summary>
+        /// Authenticator is permanently attached to the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Internal = 0X01,
+
+        /// <summary>
+        /// Authenticator is removable or remote from the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        External = 0X02,
+
+        /// <summary>
+        /// The external authenticator currently has an exclusive wired connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Wired = 0X04,
+
+        /// <summary>
+        /// The external authenticator communicates with the FIDO User Device through wireless means.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Wireless = 0X08,
+
+        /// <summary>
+        /// Authenticator is able to communicate by NFC to the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Nfc = 0X10,
+
+        /// <summary>
+        /// Authenticator is able to communicate by Bluetooth to the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Bt = 0X20,
+
+        /// <summary>
+        /// Authenticator is connected to the FIDO User Device ver a non-exclusive network (e.g. over a TCP/IP LAN or WAN, as opposed to a PAN or point-to-point connection).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Nw = 0X40,
+
+        /// <summary>
+        /// The external authenticator is in a "ready" state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Ready = 0X80,
+
+        /// <summary>
+        /// The external authenticator is able to communicate using WiFi Direct with the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        WifiDirect = 0X100
+    }
+
+    /// <summary>
+    /// Authenticator's supported Attestation type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AuthenticatorAttestationType
+    {
+        /// <summary>
+        /// Full basic attestation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        BasicFull = 0X3e07,
+
+        /// <summary>
+        /// Surrogate basic attestation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        BasicSurrogate = 0X3e08,
+    }
+
+    /// <summary>
+    /// Transaction confirmation display capability type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum TransactionConfirmationDisplayType
+    {
+        /// <summary>
+        /// Some form of transaction confirmation display is available on this authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Any = 0X01,
+
+        /// <summary>
+        /// Software-based transaction confirmation display operating in a privileged context is available on this authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        PrivilegedSoftware = 0X02,
+
+        /// <summary>
+        /// Transaction confirmation display is in a Trusted Execution Environment.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Tee = 0X04,
+
+        /// <summary>
+        /// Transaction confirmation display based on hardware assisted capabilities is available on this authenticator.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Hw = 0X08,
+
+        /// <summary>
+        /// Transaction confirmation display is provided on a distinct device from the FIDO User Device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Remote = 0X10
+    }
+}
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs
new file mode 100755 (executable)
index 0000000..92fe2fe
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// The FIDO message received from the relying party server
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class UafMessage
+    {
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public UafMessage()
+        {
+        }
+
+        /// <summary>
+        /// The FIDO message in JSON format which is received from the relying party server
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Operation { get; set; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs
new file mode 100755 (executable)
index 0000000..bc63076
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Account.FidoClient
+{
+    /// <summary>
+    /// Represents FIDO response message
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class UafResponse
+    {
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public UafResponse()
+        {
+        }
+
+        /// <summary>
+        /// FIDO response message in JSON format
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string Response { set; get; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs b/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs
new file mode 100755 (executable)
index 0000000..bb4bbf9
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using Tizen.Internals.Errors;
+using Tizen.Applications;
+using Tizen.Applications.Notifications;
+
+internal static partial class Interop
+{
+    internal static partial class Alarm
+    {
+        [StructLayout(LayoutKind.Sequential)]
+        internal struct DateTime
+        {
+            internal int sec;
+            internal int min;
+            internal int hour;
+            internal int mday; /* day of the month, range 1 to 31*/
+            internal int mon;
+            internal int year;
+            internal int wday; /* day of the week, range 0 to 6*/
+            internal int yday; /* day in the year, range 0 to 365*/
+            internal int isdst; /* daylight saving time*/
+            internal long tm_gmtoff;
+            internal IntPtr tm_zone;
+        };
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_after_delay")]
+        internal static extern int CreateAlarmAfterDelay(SafeAppControlHandle appControl, int delay, int period, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_once_after_delay")]
+        internal static extern int CreateAlarmOnceAfterDelay(SafeAppControlHandle appControl, int delay, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_once_at_date")]
+        internal static extern int CreateAlarmOnceAtDate(SafeAppControlHandle appControl, ref DateTime date, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_with_recurrence_week_flag")]
+        internal static extern int CreateAlarmRecurWeek(SafeAppControlHandle appControl, ref DateTime date, int week, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_recurrence_week_flag")]
+        internal static extern int GetAlarmWeekFlag(int alarmId, out int weekFlag);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_cancel")]
+        internal static extern int CancelAlarm(int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_cancel_all")]
+        internal static extern int CancelAllAlarms();
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_date")]
+        internal static extern int GetAlarmScheduledDate(int alarmId, out DateTime date);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_current_time")]
+        internal static extern int GetCurrentTime(out DateTime date);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_app_control")]
+        internal static extern int GetAlarmAppControl(int alarmId, out SafeAppControlHandle control);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_period")]
+        internal static extern int GetAlarmScheduledPeriod(int alarmId, out int period);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_set_global")]
+        internal static extern int SetAlarmGlobalFlag(int alarmId, bool global);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_global")]
+        internal static extern int GetAlarmGlobalFlag(int alarmId, out bool global);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_foreach_registered_alarm")]
+        internal static extern int GetAllRegisteredAlarms(RegisteredAlarmCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_once_at_date")]
+        internal static extern AlarmError CreateAlarmNotiOnceAtDate(NotificationSafeHandle noti, ref DateTime date, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_after_delay")]
+        internal static extern AlarmError CreateAlarmNotiAfterDelay(NotificationSafeHandle noti, int delay, int period, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_once_after_delay")]
+        internal static extern AlarmError CreateAlarmNotiOnceAfterDelay(NotificationSafeHandle noti, int delay, out int alarmId);
+
+        [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_with_recurrence_week_flag")]
+        internal static extern AlarmError CreateAlarmNotiRecurWeek(NotificationSafeHandle noti, ref DateTime date, int week, out int alarmId);
+
+        //callback
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool RegisteredAlarmCallback(int alarmId, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..63f4a29
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Alarm = "libcapi-appfw-alarm.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj b/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj
new file mode 100755 (executable)
index 0000000..9008ad0
--- /dev/null
@@ -0,0 +1,19 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.9</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Alarm.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+    <ProjectReference Include="..\Tizen.Applications.Notification\Tizen.Applications.Notification.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.snk b/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.snk differ
diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs
new file mode 100755 (executable)
index 0000000..af69b75
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The Alarm API allows setting an "alarm clock" for the delivery of a notification at some point in the future.
+    /// </summary>
+    /// <example>
+    /// <code>
+    /// public class AlarmExample
+    /// {
+    ///     /// ...
+    ///     IEnumerable &lt; Alarm &gt; alarms = AlarmManager.GetAllScheduledAlarms();
+    ///     alarms[0].Cancel();
+    /// }
+    /// </code>
+    /// </example>
+    public class Alarm
+    {
+        private const string _logTag = "Tizen.Applications.Alarm";
+
+        /// <summary>
+        /// Constructor created with new AlarmId.
+        /// </summary>
+        /// <param name="id"></param>
+        internal Alarm(int id)
+        {
+            AlarmId = id;
+        }
+
+        /// <summary>
+        /// The alarm ID uniquely identifies an alarm.
+        /// </summary>
+        public int AlarmId
+        {
+            get; private set;
+        }
+
+        /// <summary>
+        /// Gets the recurrence days of the week.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        /// <remarks>
+        /// week_flag may be a combination of days, like Tuesday | Friday
+        /// </remarks>
+        public AlarmWeekFlag WeekFlag
+        {
+            get
+            {
+                int week;
+                AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmWeekFlag(AlarmId, out week);
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+
+                return (AlarmWeekFlag)week;
+            }
+        }
+
+        /// <summary>
+        /// Gets the scheduled time.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        public DateTime ScheduledDate
+        {
+            get
+            {
+                Interop.Alarm.DateTime value;
+                AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmScheduledDate(AlarmId, out value);
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+
+                DateTime time = AlarmManager.ConvertIntPtrToDateTime(value);
+                return time;
+            }
+        }
+
+        /// <summary>
+        /// Gets the period of time between the recurrent alarms.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        public int Period
+        {
+            get
+            {
+                int period;
+                AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmScheduledPeriod(AlarmId, out period);
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+
+                return period;
+            }
+        }
+
+        /// <summary>
+        /// Gets the AppControl to be invoked when the the alarm is triggered.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        public AppControl AlarmAppControl
+        {
+            get
+            {
+                SafeAppControlHandle handle;
+                AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmAppControl(AlarmId, out handle);
+
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+
+                return new AppControl(handle);
+            }
+        }
+
+        /// <summary>
+        /// Gets whether the alarm will launch global application or not.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        public bool Global
+        {
+            get
+            {
+                bool global;
+                AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmGlobalFlag(AlarmId, out global);
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+
+                return global;
+            }
+
+            set
+            {
+                AlarmError ret = (AlarmError)Interop.Alarm.SetAlarmGlobalFlag(AlarmId, value);
+                if (ret != AlarmError.None)
+                {
+                    Log.Error(_logTag, "Failed to get WeekFlag");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Cancels the the specific alarm.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied due to insufficient previlleges.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public void Cancel()
+        {
+            AlarmError ret = (AlarmError)Interop.Alarm.CancelAlarm(AlarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to Cancel alarm");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs
new file mode 100755 (executable)
index 0000000..4524882
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    internal enum AlarmError
+    {
+        None = Tizen.Internals.Errors.ErrorCode.None,
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+        InvalidTime = -0x01100000 | 0x05,
+        InvalidDate = -0x01100000 | 0x06,
+        ConnectionFail = -0x01100000 | 0x07,
+        NotPermittedApp = -0x01100000 | 0x08,
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied
+    }
+    internal static class AlarmErrorFactory
+    {
+        private const string _logTag = "Tizen.Applications.Alarm";
+
+        internal static Exception GetException(AlarmError ret, string msg)
+        {
+            switch (ret)
+            {
+                case AlarmError.InvalidParameter:
+                //fall through
+                case AlarmError.InvalidTime:
+                //fall through
+                case AlarmError.InvalidDate:
+                    Log.Error(_logTag, msg);
+                    return new ArgumentException(ret + " error occurred.");
+                case AlarmError.NotPermittedApp:
+                //fall through
+                case AlarmError.PermissionDenied:
+                    Log.Error(_logTag, msg);
+                    return new UnauthorizedAccessException(ret + "error occured.");
+                default:
+                    Log.Error(_logTag, msg);
+                    return new InvalidOperationException(ret + " error occurred.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs
new file mode 100755 (executable)
index 0000000..60d2954
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Runtime.InteropServices;
+    using Tizen.Applications.Notifications;
+
+    /// <summary>
+    /// Enumeration for Alarm Week Flag, the days of the week.
+    /// </summary>
+    [Flags]
+    public enum AlarmWeekFlag
+    {
+        /// <summary>
+        /// Identifier for Sunday.
+        /// </summary>
+        Sunday = 0x01,
+
+        /// <summary>
+        /// Identifier for Monday.
+        /// </summary>
+        Monday = 0x02,
+
+        /// <summary>
+        /// Identifier for Tuesday.
+        /// </summary>
+        Tuesday = 0x04,
+
+        /// <summary>
+        /// Identifier for Wednesday.
+        /// </summary>
+        Wednesday = 0x08,
+
+        /// <summary>
+        /// Identifier for Thursday.
+        /// </summary>
+        Thursday = 0x10,
+
+        /// <summary>
+        /// Identifier for Friday.
+        /// </summary>
+        Friday = 0x20,
+
+        /// <summary>
+        /// Identifier for Saturday.
+        /// </summary>
+        Saturday = 0x40,
+
+        /// <summary>
+        /// All Days of the Week.
+        /// </summary>
+        AllDays = Sunday |Monday|Tuesday|Wednesday|Thursday|Friday|Saturday,
+
+        /// <summary>
+        /// Only Weekdays
+        /// </summary>
+        WeekDays = Monday | Tuesday | Wednesday | Thursday | Friday
+    }
+
+    /// <summary>
+    /// Mobile devices typically give constant access to information from various sources.Some of this information is best delivered through alarms -
+    /// the most obvious case is a calendar scheduling application which lets you know when a meeting is about to start.Alarms are certainly better than actively waiting in a loop.
+    /// They are also better than putting an interface to sleep because they do not block your main UI thread.
+    /// Use of alarms helps build smooth user experiences and implements unattended data synchronization tasks.
+    /// If an application is installed after setting the alarm, your alarm is cancelled automatically.
+    /// </summary>
+    /// <example>
+    /// <code>
+    /// public class AlarmManagerExample
+    /// {
+    ///     /// ...
+    ///     Alarm alarm = AlarmManager.CreateAlarm(24000,1000,null);
+    ///     AlarmManager.CancelAll();
+    /// }
+    /// </code>
+    /// </example>
+
+    public static class AlarmManager
+    {
+        private const string LogTag = "Tizen.Applications.Alarm";
+
+        private static Interop.Alarm.DateTime ConvertDateTimeToStruct(DateTime value)
+        {
+            Interop.Alarm.DateTime time = new Interop.Alarm.DateTime();
+            time.sec = value.Second;
+            time.min = value.Minute;
+            time.hour = value.Hour;
+            time.mday = value.Day;
+            time.mon = value.Month - 1;
+            time.year = value.Year - 1900;
+            time.wday = (int)value.DayOfWeek;
+            time.yday = value.DayOfYear;
+            time.isdst = 0;
+            return time;
+        }
+
+        internal static DateTime ConvertIntPtrToDateTime(Interop.Alarm.DateTime time)
+        {
+            DateTime value = new DateTime(1900 + time.year, 1 + time.mon, time.mday, time.hour, time.min, time.sec, DateTimeKind.Utc);
+            return value;
+        }
+
+        /// <summary>
+        /// Sets an alarm to be triggered after a specific time.
+        /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds.
+        /// </summary>
+        /// <param name="delay">The amount of time before the first execution (in seconds).</param>
+        /// <param name="period"> The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy.
+        /// The actual interval is calculated by the OS. The minimum value is 600sec</param>
+        /// <param name="appControl"> The destination AppControl to perform a specific task when the alarm is triggered </param>
+        /// <returns>Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public static Alarm CreateAlarm(int delay, int period, AppControl appControl)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            SafeAppControlHandle handle = (appControl == null) ? null : appControl.SafeAppControlHandle;
+            AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmAfterDelay(handle, delay, period, out alarmId);
+            alarm = new Alarm(alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets an alarm to be triggered after a specific time.
+        /// The alarm will go off delay seconds later.
+        /// </summary>
+        /// <param name="delay"> The amount of time before the execution (in seconds) </param>
+        /// <param name="appControl"> The destination AppControl to perform a specific task when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public static Alarm CreateAlarm(int delay, AppControl appControl)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAfterDelay(appControl.SafeAppControlHandle, delay, out alarmId);
+            alarm = new Alarm(alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets an alarm to be triggered at a specific time.
+        /// The date describes the time of the first occurrence.
+        /// </summary>
+        /// <param name="value"> The first active alarm time </param>
+        /// <param name="appControl"> The destination AppControl to perform specific work when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <remarks>This operation is permitted wit UI application appcontrol only.</remarks>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public static Alarm CreateAlarm(DateTime value, AppControl appControl)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value);
+            AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAtDate(appControl.SafeAppControlHandle, ref time, out alarmId);
+            alarm = new Alarm(alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets an alarm to be triggered periodically, starting at a specific time.
+        /// The date describes the time of the first occurrence.
+        /// weekFlag is the repeat value of the days of the week.
+        /// If weekFlag is AlarmWeekFlag.Tuesday, the alarm will repeat every Tuesday at a specific time.
+        /// </summary>
+        /// <remarks>This operation is permitted wit UI application appcontrol only.</remarks>
+        /// <param name="value"> The first active alarm time </param>
+        /// <param name="weekFlag"> The day of the week, AlarmWeekFlag may be a combination of days, like AlarmWeekFlag.Sunday | AlarmWeekFlag.Monday</param>
+        /// <param name="appControl"> The destination AppControl to perform specific work when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public static Alarm CreateAlarm(DateTime value, AlarmWeekFlag weekFlag, AppControl appControl)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value);
+            AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmRecurWeek(appControl.SafeAppControlHandle, ref time, (int)weekFlag, out alarmId);
+            alarm = new Alarm(alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets a notification alarm to be triggered at a specific time.
+        /// The date describes the time of the first occurrence.
+        /// </summary>
+        /// <param name="dateTime"> The first active alarm time </param>
+        /// <param name="notification"> The notification to be posted when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Alarm CreateAlarm(DateTime dateTime, Notification notification)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification);
+            Interop.Alarm.DateTime time = ConvertDateTimeToStruct(dateTime);
+            AlarmError ret = Interop.Alarm.CreateAlarmNotiOnceAtDate(safeHandle, ref time, out alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            alarm = new Alarm(alarmId);
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets a notification alarm to be triggered after a specific time.
+        /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds.
+        /// </summary>
+        /// <param name="delay">The amount of time before the first execution (in seconds). </param>
+        /// <param name="period"> The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy. </param>
+        /// <param name="notification"> The notification to be posted when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Alarm CreateAlarm(int delay, int period, Notification notification)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification);
+            AlarmError ret = Interop.Alarm.CreateAlarmNotiAfterDelay(safeHandle, delay, period, out alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            alarm = new Alarm(alarmId);
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets a notification alarm to be triggered periodically, starting at a specific time.
+        /// The date describes the time of the first occurrence.
+        /// weekFlag is the repeat value of the days of the week.
+        /// If weekFlag is AlarmWeekFlag.Tuesday, the alarm will repeat every Tuesday at a specific time.
+        /// </summary>
+        /// <param name="dateTime"> The first active alarm time </param>
+        /// <param name="weekFlag"> The day of the week, AlarmWeekFlag may be a combination of days,
+        ///                         like AlarmWeekFlag.Sunday | AlarmWeekFlag.Monday</param>
+        /// <param name="notification"> The notification to be posted when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Alarm CreateAlarm(DateTime dateTime, AlarmWeekFlag weekFlag, Notification notification)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification);
+            Interop.Alarm.DateTime time = ConvertDateTimeToStruct(dateTime);
+            AlarmError ret = Interop.Alarm.CreateAlarmNotiRecurWeek(safeHandle, ref time, (int)weekFlag, out alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            alarm = new Alarm(alarmId);
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Sets a notification alarm to be triggered after a specific time.
+        /// The alarm will go off delay seconds later.
+        /// </summary>
+        /// <param name="delay">The amount of time before the first execution (in seconds).</param>
+        /// <param name="notification"> The notification to be posted when the alarm is triggered </param>
+        /// <returns> Alarm Instance created with the set param values.</returns>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Alarm CreateAlarm(int delay, Notification notification)
+        {
+            Alarm alarm = null;
+            int alarmId;
+            NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification);
+            AlarmError ret = Interop.Alarm.CreateAlarmNotiOnceAfterDelay(safeHandle, delay, out alarmId);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
+            }
+
+            alarm = new Alarm(alarmId);
+
+            return alarm;
+        }
+
+        /// <summary>
+        /// Cancels all scheduled alarms that are registered by the application that calls this API.
+        /// </summary>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        public static void CancelAll()
+        {
+            AlarmError ret = (AlarmError)Interop.Alarm.CancelAllAlarms();
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to cancel Alarms");
+            }
+        }
+
+        /// <summary>
+        /// Retrieves all registered alarms.
+        /// </summary>
+        /// <returns>List of all Alarm instances.</returns>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/alarm.get</privilege>
+        public static IEnumerable<Alarm> GetAllScheduledAlarms()
+        {
+            List<Alarm> alarms = new List<Alarm>();
+            Interop.Alarm.RegisteredAlarmCallback callback = (int alarmId, IntPtr userData) =>
+            {
+                alarms.Add(new Alarm(alarmId));
+                return true;
+            };
+
+            AlarmError ret = (AlarmError)Interop.Alarm.GetAllRegisteredAlarms(callback, IntPtr.Zero);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to get Alarms");
+            }
+
+            return alarms;
+        }
+
+        /// <summary>
+        /// Gets the current system time.
+        /// </summary>
+        /// <returns>The current system time</returns>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        public static DateTime GetCurrentTime()
+        {
+            DateTime time;
+            Interop.Alarm.DateTime value;
+            AlarmError ret = (AlarmError)Interop.Alarm.GetCurrentTime(out value);
+            if (ret != AlarmError.None)
+            {
+                throw AlarmErrorFactory.GetException(ret, "Failed to get Currenttime");
+            }
+            else
+            {
+
+                time = ConvertIntPtrToDateTime(value);
+            }
+
+            return time;
+        }
+
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs
new file mode 100755 (executable)
index 0000000..3718191
--- /dev/null
@@ -0,0 +1,71 @@
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class AttachPanel
+    {
+        internal enum ErrorCode : int
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            AlreadyExists = -0x02850000 | 0x01,
+            NotInitialized = -0x02850000 | 0x02,
+            UnsupportedContentCategory = -0x02850000 | 0x03,
+            AlreadyDestroyed = -0x02850000 | 0x05,
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AttachPanelEventCallback(IntPtr attachPanel, int eventType, IntPtr eventInfo, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AttachPanelResultCallback(IntPtr attachPanel, int category, IntPtr result, int resultCode, IntPtr userData);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_create")]
+        internal static extern ErrorCode CreateAttachPanel(IntPtr conform, ref IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_destroy")]
+        internal static extern ErrorCode DestroyAttachPanel(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_add_content_category")]
+        internal static extern ErrorCode AddCategory(IntPtr attach_panel, int content_category, IntPtr extraData);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_remove_content_category")]
+        internal static extern ErrorCode RemoveCategory(IntPtr attach_panel, int content_category);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_extra_data")]
+        internal static extern ErrorCode SetExtraData(IntPtr attach_panel, int content_category, IntPtr extraData);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_result_cb")]
+        internal static extern ErrorCode SetResultCb(IntPtr attach_panel, AttachPanelResultCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_result_cb")]
+        internal static extern ErrorCode UnsetResultCb(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_event_cb")]
+        internal static extern ErrorCode SetEventCb(IntPtr attach_panel, AttachPanelEventCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_event_cb")]
+        internal static extern ErrorCode UnsetEventCb(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_show")]
+        internal static extern ErrorCode Show(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_show_without_animation")]
+        internal static extern ErrorCode ShowWithoutAnimation(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_hide")]
+        internal static extern ErrorCode Hide(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_hide_without_animation")]
+        internal static extern ErrorCode HideWithoutAnimation(IntPtr attach_panel);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_get_visibility")]
+        internal static extern ErrorCode GetVisibility(IntPtr attach_panel, out int visible);
+
+        [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_get_state")]
+        internal static extern ErrorCode GetState(IntPtr attach_panel, out int state);
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..4b4049b
--- /dev/null
@@ -0,0 +1,7 @@
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string AttachPanel = "libattach-panel.so.0.1.0";
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj
new file mode 100755 (executable)
index 0000000..516b392
--- /dev/null
@@ -0,0 +1,26 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.3</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Attach Panel API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.AttachPanel.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+    <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.snk b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.snk
new file mode 100644 (file)
index 0000000..f03f8cb
Binary files /dev/null and b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.snk differ
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs
new file mode 100755 (executable)
index 0000000..bd403f0
--- /dev/null
@@ -0,0 +1,263 @@
+using System;
+
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Represents immutable class for attach panel.
+    /// </summary>
+    public partial class AttachPanel
+    {
+        /// <summary>
+        /// Represents immutable class for attach panel.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="conformant">The caller's conformant</param>
+        /// <exception cref="OutOfMemoryException">Thrown when an attempt to allocate memory fails.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is already exist or the <paramref name="conformant"/> is not a conformant object</exception>
+        public AttachPanel(IntPtr conformant)
+        {
+            if (conformant == IntPtr.Zero)
+            {
+                throw new ArgumentNullException("Use the value property, not null value");
+            }
+            IntPtr candidateAttachPanel = new IntPtr();
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.CreateAttachPanel(conformant, ref candidateAttachPanel);
+            checkException(err);
+
+            Tizen.Log.Debug("AttachPanelSharp", "Success to create an AttachPanel Instance");
+            isCreationSucceed = true;
+            _attachPanel = candidateAttachPanel;
+
+            if (_eventEventHandler == null)
+            {
+                StateEventListenStart();
+            }
+
+            if (_resultEventHandler == null)
+            {
+                ResultEventListenStart();
+            }
+        }
+
+        ~AttachPanel()
+        {
+            if (isCreationSucceed &&
+                _attachPanel != IntPtr.Zero)
+            {
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.DestroyAttachPanel(_attachPanel);
+                checkException(err);
+                _attachPanel = IntPtr.Zero;
+            }
+        }
+
+        /// <summary>
+        /// Gets the state of the AttachPanel.
+        /// </summary>
+        /// <value>The AttachPanel window state</value>
+        public int State
+        {
+            get
+            {
+                int state;
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetState(_attachPanel, out state);
+                checkException(err);
+                return state;
+            }
+        }
+
+        /// <summary>
+        /// Gets the value that indicates whether the AttachPanel is visible.
+        /// </summary>
+        /// <value>visible value of AttachPanel state</value>
+        public int Visible
+        {
+            get
+            {
+                int visible;
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetVisibility(_attachPanel, out visible);
+                checkException(err);
+                return visible;
+            }
+        }
+
+        /// <summary>
+        /// Add a content category in the AttachPanel.
+        /// </summary>
+        /// <param name="category">The ContentCategory to be added in the AttachPanel</param>
+        /// <param name="extraData">The AttachPanel send some information using Bundle</param>
+        /// <privilege>http://tizen.org/privilege/mediastorage</privilege>
+        /// <privilege>http://tizen.org/privilege/camera</privilege>
+        /// <privilege>http://tizen.org/privilege/recorder</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        /// <feature>http://tizen.org/feature/camera</feature>
+        /// <feature>http://tizen.org/feature/microphone</feature>
+        /// <remarks>
+        /// The caller app has to check the return value of this function.
+        /// Content categories will be shown as the sequence of using AddCategory
+        /// Some contents need time to load it all.
+        /// So, it is needed to use this before the mainloop of Show
+        /// Privileges,
+        /// http://tizen.org/privilege/mediastorage, for using Image or Camera
+        /// http://tizen.org/privilege/camera, for using Camera or TakePicture
+        /// http://tizen.org/privilege/recorder, for using Voice
+        /// http://tizen.org/privilege/appmanager.launch, for adding content categories on the More tab
+        /// http://tizen.org/feature/camera, for using Camera or TakePicture
+        /// http://tizen.org/feature/microphone, for using Voice
+        /// Deliver more information to the callee with a bundle if you need.
+        /// http://tizen.org/appcontrol/data/total_count
+        /// http://tizen.org/appcontrol/data/total_size
+        /// </remarks>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when the <paramref name="category"/> is not a valid category</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method</exception>
+        /// <exception cref="NotSupportedException">Thrown when the device does not supported the <paramref name="category"/> feature </exception>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is not created yet or already destroyed</exception>
+        public void AddCategory(ContentCategory category, Bundle extraData)
+        {
+            IntPtr bundle = IntPtr.Zero;
+            if (extraData != null)
+            {
+                bundle = extraData.SafeBundleHandle.DangerousGetHandle();
+            }
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.AddCategory(_attachPanel, (int)category, bundle);
+            checkException(err);
+        }
+
+        /// <summary>
+        /// Removes the ContentCategory from the AttachPanel
+        /// </summary>
+        /// <param name="category">The ContentCategory adding in the AttachPanel</param>
+        ///  <exception cref="ArgumentOutOfRangeException">Thrown when the <paramref name="category"/> is not a valid category</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is not created yet or already destroyed</exception>
+        public void RemoveCategory(ContentCategory category)
+        {
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.RemoveCategory(_attachPanel, (int)category);
+            checkException(err);
+        }
+
+        /// <summary>
+        /// Sets extraData to send to the ContentCategory using a Bundle
+        /// </summary>
+        /// <param name="category">The ContentCategory that some information to be set in the AttachPanel.</param>
+        /// <param name="extraData">The AttachPanel send some information using Bundle</param>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when the <paramref name="category"/> is not a valid category</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is destroyed</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when an attempt to allocate memory fails.</exception>
+        public void SetExtraData(ContentCategory category, Bundle extraData)
+        {
+            if(extraData == null)
+            {
+                checkException(Interop.AttachPanel.ErrorCode.InvalidParameter);
+            }
+
+            IntPtr bundle = IntPtr.Zero;
+            if (extraData != null)
+            {
+                bundle = extraData.SafeBundleHandle.DangerousGetHandle();
+            }
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.SetExtraData(_attachPanel, (int)category, bundle);
+            checkException(err);
+        }
+
+        /// <summary>
+        /// Shows the attach panel with animations
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is destroyed</exception>
+        public void Show()
+        {
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel);
+            checkException(err);
+        }
+
+        /// <summary>
+        /// Shows the attach panel and selects whether or not to animate
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is destroyed</exception>
+        public void Show(bool animation)
+        {
+            if (animation)
+            {
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel);
+                checkException(err);
+            }
+            else
+            {
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.ShowWithoutAnimation(_attachPanel);
+                checkException(err);
+            }
+        }
+
+        /// <summary>
+        /// Hides the attach panel with animations
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is destroyed</exception>
+        public void Hide()
+        {
+            Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel);
+            checkException(err);
+        }
+
+        /// <summary>
+        /// Hides the attach panel and selects whether or not to animate
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when the AttachPanel is destroyed</exception>
+        public void Hide(bool animation)
+        {
+            if (animation)
+            {
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel);
+                checkException(err);
+            }
+            else
+            {
+                Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.HideWithoutAnimation(_attachPanel);
+                checkException(err);
+            }
+        }
+
+        /// <summary>
+        /// Occurs when reserved events are published from the panel-side.
+        /// </summary>
+        public event EventHandler<StateEventArgs> EventChanged
+        {
+            add
+            {
+                if (_eventEventHandler == null)
+                {
+                    StateEventListenStart();
+                }
+                _eventEventHandler += value;
+            }
+            remove
+            {
+                _eventEventHandler -= value;
+                if (_eventEventHandler == null)
+                {
+                    StateEventListenStop();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Occurs when an user selects and confirms something to attach in the AttachPanel
+        /// </summary>
+        public event EventHandler<ResultEventArgs> ResultCallback
+        {
+            add
+            {
+                if (_resultEventHandler == null)
+                {
+                    ResultEventListenStart();
+                }
+                _resultEventHandler += value;
+            }
+            remove
+            {
+                _resultEventHandler -= value;
+                if (_resultEventHandler == null)
+                {
+                    ResultEventListenStop();
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs
new file mode 100755 (executable)
index 0000000..e40af2d
--- /dev/null
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications.AttachPanel
+{
+    public partial class AttachPanel
+    {
+        private static IntPtr _attachPanel;
+        private bool isCreationSucceed;
+
+        private static event EventHandler<StateEventArgs> _eventEventHandler;
+        private static event EventHandler<ResultEventArgs> _resultEventHandler;
+
+        private static Interop.AttachPanel.AttachPanelEventCallback SetEventListener;
+        private static Interop.AttachPanel.AttachPanelResultCallback SetResultListener;
+
+        private void StateEventListenStart()
+        {
+            Interop.AttachPanel.ErrorCode err = 0;
+
+            SetEventListener = (attachPanel, eventType, eventInfo, userData) =>
+            {
+                _eventEventHandler?.Invoke(null, new StateEventArgs(attachPanel, (EventType)eventType, eventInfo, userData));
+            };
+            err = Interop.AttachPanel.SetEventCb(_attachPanel, SetEventListener, IntPtr.Zero);
+            checkException(err);
+        }
+        private void StateEventListenStop()
+        {
+            Interop.AttachPanel.ErrorCode err = 0;
+            err =  Interop.AttachPanel.UnsetEventCb(_attachPanel);
+            checkException(err);
+        }
+
+        private void ResultEventListenStart()
+        {
+            Interop.AttachPanel.ErrorCode err = 0;
+            SetResultListener = (attachPanel, category, resulthandler, resultCode, userData) =>
+            {
+                SafeAppControlHandle handle = new SafeAppControlHandle(resulthandler, false);
+                AppControl result = new AppControl(handle);
+                _resultEventHandler?.Invoke(null, new ResultEventArgs(attachPanel, (ContentCategory)category, result, (AppControlReplyResult)resultCode, userData));
+            };
+            err = Interop.AttachPanel.SetResultCb(_attachPanel, SetResultListener, IntPtr.Zero);
+            checkException(err);
+        }
+
+        private void ResultEventListenStop()
+        {
+            Interop.AttachPanel.ErrorCode err = 0;
+            err = Interop.AttachPanel.UnsetResultCb(_attachPanel);
+            checkException(err);
+        }
+
+        internal static void checkException(Interop.AttachPanel.ErrorCode err)
+        {
+            switch (err)
+            {
+                case Interop.AttachPanel.ErrorCode.InvalidParameter:
+                    throw new ArgumentOutOfRangeException("Invalid parameter error at unmanaged code");
+                case Interop.AttachPanel.ErrorCode.OutOfMemory:
+                    throw new OutOfMemoryException("Out of Memory");
+                case Interop.AttachPanel.ErrorCode.PermissionDenied:
+                    throw new UnauthorizedAccessException();
+                case Interop.AttachPanel.ErrorCode.AlreadyExists:
+                    throw new InvalidOperationException("Already Exists");
+                case Interop.AttachPanel.ErrorCode.NotInitialized:
+                    throw new InvalidOperationException("Not initialized");
+                case Interop.AttachPanel.ErrorCode.UnsupportedContentCategory:
+                    throw new NotSupportedException("Unsupported Content Category");
+                case Interop.AttachPanel.ErrorCode.AlreadyDestroyed:
+                    throw new InvalidOperationException("Already Destroyed");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs
new file mode 100755 (executable)
index 0000000..e86b9ea
--- /dev/null
@@ -0,0 +1,57 @@
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Enumeration for the attach panel content category.
+    /// </summary>
+    public enum ContentCategory
+    {
+        /// <summary>
+        /// Attaching images from the gallery
+        /// </summary>
+        Image = 1,
+        /// <summary>
+        /// Taking pictures to attach
+        /// </summary>
+        Camera,
+        /// <summary>
+        /// Taking a voice clip to attach
+        /// </summary>
+        Voice,
+        /// <summary>
+        /// Attaching video from the gallery
+        /// </summary>
+        Video,
+        /// <summary>
+        /// Attaching audio from my files
+        /// </summary>
+        Audio,
+        /// <summary>
+        /// Attaching calendar data from the calendar
+        /// </summary>
+        Calendar,
+        /// <summary>
+        /// Attaching contact data from the contacts
+        /// </summary>
+        Contact,
+        /// <summary>
+        /// Attaching files data from my files
+        /// </summary>
+        Myfiles,
+        /// <summary>
+        /// Taking a video clip to attach
+        /// </summary>
+        VideoRecorder,
+        /// <summary>
+        /// Attaching files from the document list
+        /// </summary>
+        Document,
+        /// <summary>
+        /// Launching apps to take pictures will be attached
+        /// </summary>
+        TakePicture,
+        /// <summary>
+        /// Attaching memo data from the memo
+        /// </summary>
+        Memo,
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs
new file mode 100755 (executable)
index 0000000..dc460a1
--- /dev/null
@@ -0,0 +1,25 @@
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Enumeration for the attach panel event.
+    /// </summary>
+    public enum EventType
+    {
+        /// <summary>
+        /// Attach panel starts the effect to show
+        /// </summary>
+        ShowStart = 1,
+        /// <summary>
+        /// Attach panel finishes the effect to show
+        /// </summary>
+        ShowFinish,
+        /// <summary>
+        /// Attach panel starts the effect to hide the panel
+        /// </summary>
+        HideStart,
+        /// <summary>
+        /// Attach panel finishes the effect to hide the panel
+        /// </summary>
+        HideFinish,
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs
new file mode 100755 (executable)
index 0000000..6628b9d
--- /dev/null
@@ -0,0 +1,51 @@
+using System;
+
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Class for event arguments of the result event
+    /// </summary>
+    public class ResultEventArgs : EventArgs
+    {
+        private readonly IntPtr _attachPanel;
+        private readonly ContentCategory _category;
+        private readonly AppControl _result;
+        private readonly AppControlReplyResult _resultCode;
+        private readonly IntPtr _userData;
+
+        internal ResultEventArgs(IntPtr attachPanel, ContentCategory category, AppControl result, AppControlReplyResult resultCode, IntPtr userData)
+        {
+            _attachPanel = attachPanel;
+            _category = category;
+            _result = result;
+            _resultCode = resultCode;
+            _userData = userData;
+        }
+
+        /// <summary>
+        ///  Property for attach panel object.
+        /// </summary>
+        public IntPtr AttachPanel { get { return _attachPanel; } }
+
+        /// <summary>
+        /// Results are from the content category.
+        /// </summary>
+        public ContentCategory Category { get { return _category; } }
+
+        /// <summary>
+        /// Property for result
+        /// The caller app has to use ExtraData property to get received data.
+        /// </summary>
+        public AppControl Result {  get { return _result; } }
+
+        /// <summary>
+        /// Property for result of AppControl
+        /// </summary>
+        public AppControlReplyResult ResultCode { get { return _resultCode; } }
+
+        /// <summary>
+        /// Property for user data
+        /// </summary>
+        public IntPtr UserData { get { return _userData; } }
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs
new file mode 100755 (executable)
index 0000000..5354c5f
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Class for event arguments of the state event
+    /// </summary>
+    public class StateEventArgs : EventArgs
+    {
+        private readonly IntPtr _attachPanel;
+        private readonly EventType _eventType;
+        private readonly IntPtr _eventInfo;
+        private readonly IntPtr _userData;
+
+        internal StateEventArgs(IntPtr attachPanel, EventType eventType, IntPtr eventInfo, IntPtr userData)
+        {
+            _attachPanel = attachPanel;
+            _eventType = eventType;
+            _eventInfo = eventInfo;
+            _userData = userData;
+        }
+
+        /// <summary>
+        /// Property for attach panel object
+        /// </summary>
+        public IntPtr AttachPanel { get { return _attachPanel;  } }
+
+        /// <summary>
+        /// Property for event type.
+        /// </summary>
+        public EventType EventType { get { return _eventType;  } }
+
+        /// <summary>
+        /// Additional event information.
+        /// This can be NULL if there are no necessary information.
+        /// </summary>
+        public IntPtr EventInfo {  get { return _eventInfo;  } }
+
+        /// <summary>
+        /// Property for user data.
+        /// </summary>
+        public IntPtr UserData { get { return _userData; } }
+    }
+}
diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs
new file mode 100755 (executable)
index 0000000..a2474db
--- /dev/null
@@ -0,0 +1,21 @@
+namespace Tizen.Applications.AttachPanel
+{
+    /// <summary>
+    /// Enumeration for the attach panel's window state.
+    /// </summary>
+    public enum StateType
+    {
+        /// <summary>
+        /// Attach panel is not visible
+        /// </summary>
+        Hidden = 0,
+        /// <summary>
+        /// Attach panel is in partial window mode
+        /// </summary>
+        Partial,
+        /// <summary>
+        /// Attach panel is in full screen mode
+        /// </summary>
+        Full,
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Badge/GlobalSuppressions.cs b/src/Tizen.Applications.Badge/GlobalSuppressions.cs
new file mode 100755 (executable)
index 0000000..9d74253
Binary files /dev/null and b/src/Tizen.Applications.Badge/GlobalSuppressions.cs differ
diff --git a/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs b/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs
new file mode 100755 (executable)
index 0000000..53b1b1a
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class Badge
+    {
+        internal enum Action : uint
+        {
+            Create = 0,
+            Remove,
+            Update,
+            ChangedDisplay,
+            ServiceReady
+        }
+
+        internal delegate void ForeachCallback(string appId, uint count, IntPtr userData);
+
+        internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_add")]
+        internal static extern BadgeError Add(string appId);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_remove")]
+        internal static extern BadgeError Remove(string appId);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_set_count")]
+        internal static extern BadgeError SetCount(string appId, uint count);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_get_count")]
+        internal static extern BadgeError GetCount(string appId, out uint count);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_set_display")]
+        internal static extern BadgeError SetDisplay(string appId, uint isDisplay);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_get_display")]
+        internal static extern BadgeError GetDisplay(string appId, out uint isDisplay);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_foreach")]
+        internal static extern BadgeError Foreach(ForeachCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_register_changed_cb")]
+        internal static extern BadgeError SetChangedCallback(ChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")]
+        internal static extern BadgeError UnsetChangedCallback(ChangedCallback callback);
+    }
+}
diff --git a/src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..01ccffd
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Badge = "libbadge.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj b/src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj
new file mode 100755 (executable)
index 0000000..9d38bdc
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.6</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Badge API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Badge.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.snk b/src/Tizen.Applications.Badge/Tizen.Applications.Badge.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Badge/Tizen.Applications.Badge.snk differ
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs
new file mode 100755 (executable)
index 0000000..89b317a
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Immutable class for getting information of the badge.
+    /// </summary>
+    public class Badge
+    {
+        private readonly string _appId;
+        private readonly int _count;
+        private readonly bool _isDisplay;
+
+        internal Badge(string appid, int count, bool isDisplay)
+        {
+            _appId = appid;
+            _count = count;
+            _isDisplay = isDisplay;
+        }
+
+        /// <summary>
+        /// Property for the count value of the badge.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public int Count
+        {
+            get
+            {
+                return _count;
+            }
+        }
+
+        /// <summary>
+        /// Property for the application ID of the badge.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public string AppId
+        {
+            get
+            {
+                return _appId;
+            }
+        }
+
+        /// <summary>
+        /// Property for the flag of 'display'.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public bool IsDisplay
+        {
+            get
+            {
+                return _isDisplay;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs
new file mode 100755 (executable)
index 0000000..85e72a7
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    using System;
+    using System.Collections.Generic;
+    /// <summary>
+    /// The class for badge operation.
+    /// </summary>
+    public static class BadgeControl
+    {
+        private static event EventHandler<BadgeEventArgs> s_changed;
+        private static bool s_registered = false;
+        private static Interop.Badge.ChangedCallback s_callback;
+
+        /// <summary>
+        /// Event handler for receiving badge events.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static event EventHandler<BadgeEventArgs> Changed
+        {
+            add
+            {
+                if (s_changed == null && !s_registered)
+                {
+                    if (s_callback == null)
+                    {
+                        s_callback = new Interop.Badge.ChangedCallback(OnChangedEvent);
+                    }
+
+                    BadgeError err = Interop.Badge.SetChangedCallback(s_callback, IntPtr.Zero);
+                    if (err != BadgeError.None)
+                    {
+                        throw BadgeErrorFactory.GetException(err, "Failed to add event handler");
+                    }
+
+                    s_registered = true;
+                }
+
+                s_changed += value;
+            }
+            remove
+            {
+                s_changed -= value;
+                if (s_changed == null && s_registered)
+                {
+                    BadgeError err = Interop.Badge.UnsetChangedCallback(s_callback);
+                    if (err != BadgeError.None)
+                    {
+                        throw BadgeErrorFactory.GetException(err, "Failed to remove event handler");
+                    }
+
+                    s_callback = null;
+                    s_registered = false;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the badge information from the application ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Badge Find(string appId)
+        {
+            uint count;
+            uint display;
+
+            BadgeError err = Interop.Badge.GetCount(appId, out count);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to find badge count of " + appId);
+            }
+
+            err = Interop.Badge.GetDisplay(appId, out display);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to find badge display of " + appId);
+            }
+
+            return new Badge(appId, (int)count, display == 0 ? false : true);
+        }
+
+        /// <summary>
+        /// Removes the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of a an invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Remove(string appId)
+        {
+            BadgeError err = Interop.Badge.Remove(appId);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to Remove badge of " + appId);
+            }
+        }
+
+        /// <summary>
+        /// Adds the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <param name="count">Count value.</param>
+        /// <param name="isDisplay">True if it should be displayed.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Add(string appId, int count = 1, bool isDisplay = true)
+        {
+            BadgeError err = Interop.Badge.Add(appId);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to add badge of " + appId);
+            }
+
+            try
+            {
+                Update(appId, count, isDisplay);
+            }
+            catch (Exception e)
+            {
+                Remove(appId);
+                throw e;
+            }
+        }
+
+        /// <summary>
+        /// Updates the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <param name="count">Count value.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Update(string appId, int count)
+        {
+            BadgeError err = Interop.Badge.SetCount(appId, (uint)count);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to update badge of " + appId);
+            }
+        }
+
+        /// <summary>
+        /// Updates the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <param name="isDisplay">True if it should be displayed.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Update(string appId, bool isDisplay)
+        {
+            BadgeError err = Interop.Badge.SetDisplay(appId, isDisplay ? 1U : 0U);
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to update badge of " + appId);
+            }
+        }
+
+        /// <summary>
+        /// Updates the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="appId">Application ID.</param>
+        /// <param name="count">Count value.</param>
+        /// <param name="isDisplay">True if it should be displayed.</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Update(string appId, int count, bool isDisplay)
+        {
+            Update(appId, count);
+            Update(appId, isDisplay);
+        }
+
+        /// <summary>
+        /// Gets all the badge information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static IEnumerable<Badge> GetBadges()
+        {
+            IList<Badge> list = new List<Badge>();
+
+            BadgeError err = Interop.Badge.Foreach((appId, count, userData) =>
+            {
+                uint display = 0;
+                BadgeError errGetDisplay = Interop.Badge.GetDisplay(appId, out display);
+                if (errGetDisplay != BadgeError.None)
+                {
+                    throw BadgeErrorFactory.GetException(errGetDisplay, "Failed to get badges ");
+                }
+
+                list.Add(new Badge(appId, (int)count, display == 0 ? false : true));
+            }, IntPtr.Zero);
+
+            if (err != BadgeError.None)
+            {
+                throw BadgeErrorFactory.GetException(err, "Failed to get badges");
+            }
+
+            return list;
+        }
+
+        private static void OnChangedEvent(Interop.Badge.Action action, string appId, uint count, IntPtr userData)
+        {
+            uint display = 0;
+            uint countLocal = 0;
+
+            switch (action)
+            {
+                case Interop.Badge.Action.Create:
+                    s_changed?.Invoke(null, new BadgeEventArgs()
+                    {
+                        Reason = BadgeEventArgs.Action.Add,
+                        Badge = new Badge(appId, 0, false)
+                    });
+                    break;
+
+                case Interop.Badge.Action.Remove:
+                    s_changed?.Invoke(null, new BadgeEventArgs()
+                    {
+                        Reason = BadgeEventArgs.Action.Remove,
+                        Badge = new Badge(appId, 0, false)
+                    });
+                    break;
+
+                case Interop.Badge.Action.Update:
+                    Interop.Badge.GetDisplay(appId, out display);
+                    s_changed?.Invoke(null, new BadgeEventArgs()
+                    {
+                        Reason = BadgeEventArgs.Action.Update,
+                        Badge = new Badge(appId, (int)count, display == 0 ? false : true)
+                    });
+                    break;
+
+                case Interop.Badge.Action.ChangedDisplay:
+                    Interop.Badge.GetCount(appId, out countLocal);
+                    s_changed?.Invoke(null, new BadgeEventArgs()
+                    {
+                        Reason = BadgeEventArgs.Action.Update,
+                        Badge = new Badge(appId, (int)countLocal, count == 0 ? false : true)
+                    });
+                    break;
+
+                case Interop.Badge.Action.ServiceReady:
+                    // Ignore
+                    break;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs
new file mode 100755 (executable)
index 0000000..ff0d909
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    using System;
+    using System.Runtime.CompilerServices;
+
+    internal enum BadgeError
+    {
+        None = Tizen.Internals.Errors.ErrorCode.None,
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+        IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+        DbError = -0x01120000 | 0x01,
+        AlreadyExists = -0x01120000 | 0x02,
+        DBusError = -0x01120000 | 0x03,
+        DoesnotExist = -0x01120000 | 0x04,
+        ServiceError = -0x01120000 | 0x05,
+        InvalidPackage = -0x01120000 | 0x06
+    }
+
+    /// <summary>
+    /// Immutable class for getting the badge information.
+    /// </summary>
+    internal static class BadgeErrorFactory
+    {
+        private static readonly string LogTag = "Tizen.Applications.Badge";
+
+        internal static Exception GetException(BadgeError ret, string msg, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
+        {
+            Log.Error(LogTag, memberName + " : " + lineNumber);
+
+            switch (ret)
+            {
+                case BadgeError.InvalidParameter:
+                    Log.Error(LogTag, msg);
+                    return new ArgumentException(ret + " error occurred.");
+                case BadgeError.PermissionDenied:
+                    throw new UnauthorizedAccessException("Permission denied (http://tizen.org/privilege/notification)");
+                default:
+                    Log.Error(LogTag, msg);
+                    return new InvalidOperationException(ret + " error occurred.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs
new file mode 100755 (executable)
index 0000000..bfcc85f
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    using System;
+
+    /// <summary>
+    /// The class for event arguments of the badge event.
+    /// </summary>
+    public class BadgeEventArgs : EventArgs
+    {
+        internal BadgeEventArgs()
+        {
+        }
+
+        /// <summary>
+        /// Enumeration for the badge action.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public enum Action : int
+        {
+            /// <summary>
+            /// The badge was added.
+            /// </summary>
+            Add = 0,
+
+            /// <summary>
+            /// The badge was removed.
+            /// </summary>
+            Remove,
+
+            /// <summary>
+            /// The badge was updated.
+            /// </summary>
+            Update,
+        }
+
+        /// <summary>
+        /// The property for the badge object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public Badge Badge { get; internal set; }
+
+        /// <summary>
+        /// The property for the action value.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public Action Reason { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs b/src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs
new file mode 100755 (executable)
index 0000000..5ad41f5
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using Tizen.Internals.Errors;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class AppCommon
+    {
+       internal enum ResourceCategory : int
+        {
+            Image = 0,
+            Layout,
+            Sound,
+            Binary
+        }
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")]
+        internal static extern ErrorCode AppGetId(out string appId);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_name")]
+        internal static extern ErrorCode AppGetName(out string name);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_resource_path")]
+        internal static extern string AppGetResourcePath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_data_path")]
+        internal static extern string AppGetDataPath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_cache_path")]
+        internal static extern string AppGetCachePath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_data_path")]
+        internal static extern string AppGetSharedDataPath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_resource_path")]
+        internal static extern string AppGetSharedResourcePath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_trusted_path")]
+        internal static extern string AppGetSharedTrustedPath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_tep_resource_path")]
+        internal static extern string AppGetTepResourcePath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_cache_path")]
+        internal static extern string AppGetExternalCachePath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_data_path")]
+        internal static extern string AppGetExternalDataPath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_shared_data_path")]
+        internal static extern string AppGetExternalSharedDataPath();
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_get_version")]
+        internal static extern ErrorCode AppGetVersion(out string version);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")]
+        internal static extern ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")]
+        internal static extern ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")]
+        internal static extern ErrorCode AppEventGetLanguage(IntPtr handle, out string lang);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")]
+        internal static extern ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_resource_manager_get")]
+        internal static extern ErrorCode AppResourceManagerGet(ResourceCategory category, string id, out string path);
+
+        [DllImport(Libraries.Application, EntryPoint = "app_resource_manager_get")]
+        internal static extern ErrorCode LegacyAppResourceManagerGet(ResourceCategory category, string id, out string path);
+
+        [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_device_orientation")]
+        internal static extern ErrorCode AppEventGetDeviceOrientation(IntPtr handle, out DeviceOrientation orientation);
+    }
+}
+
diff --git a/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs b/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs
new file mode 100755 (executable)
index 0000000..c379698
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class AppControl
+    {
+        internal const int AppStartedStatus = 1;
+
+        internal delegate bool ExtraDataCallback(IntPtr handle, string key, IntPtr userData);
+        internal delegate bool AppMatchedCallback(IntPtr handle, string applicationId, IntPtr userData);
+        internal delegate void ReplyCallback(IntPtr request, IntPtr reply, int result, IntPtr userData);
+
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            AppNotFound = -0x01100000 | 0x21,
+            KeyNotFound = Tizen.Internals.Errors.ErrorCode.KeyNotAvailable,
+            KeyRejected = Tizen.Internals.Errors.ErrorCode.KeyRejected,
+            InvalidDataType = -0x01100000 | 0x22,
+            LaunchRejected = -0x01100000 | 0x23,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            LaunchFailed = -0x01100000 | 0x24,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
+        }
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_create")]
+        internal static extern ErrorCode Create(out SafeAppControlHandle handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_clone")]
+        internal static extern ErrorCode DangerousClone(out SafeAppControlHandle clone, IntPtr handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")]
+        internal static extern ErrorCode GetAppId(IntPtr app_control, out IntPtr app_id);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_operation")]
+        internal static extern ErrorCode GetOperation(SafeAppControlHandle handle, out string operation);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_operation")]
+        internal static extern ErrorCode SetOperation(SafeAppControlHandle handle, string operation);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_uri")]
+        internal static extern ErrorCode GetUri(SafeAppControlHandle handle, out string uri);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_uri")]
+        internal static extern ErrorCode SetUri(SafeAppControlHandle handle, string uri);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_mime")]
+        internal static extern ErrorCode GetMime(SafeAppControlHandle handle, out string mime);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_mime")]
+        internal static extern ErrorCode SetMime(SafeAppControlHandle handle, string mime);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_category")]
+        internal static extern ErrorCode GetCategory(SafeAppControlHandle handle, out string category);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_category")]
+        internal static extern ErrorCode SetCategory(SafeAppControlHandle handle, string category);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")]
+        internal static extern ErrorCode GetAppId(SafeAppControlHandle handle, out string appId);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_app_id")]
+        internal static extern ErrorCode SetAppId(SafeAppControlHandle handle, string appId);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_launch_mode")]
+        internal static extern ErrorCode SetLaunchMode(SafeAppControlHandle handle, int mode);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_launch_mode")]
+        internal static extern ErrorCode GetLaunchMode(SafeAppControlHandle handle, out int mode);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_caller")]
+        internal static extern ErrorCode GetCaller(SafeAppControlHandle handle, out string caller);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_reply_requested")]
+        internal static extern ErrorCode IsReplyRequested(SafeAppControlHandle handle, out bool requested);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data")]
+        internal static extern ErrorCode AddExtraData(SafeAppControlHandle handle, string key, string value);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_remove_extra_data")]
+        internal static extern ErrorCode RemoveExtraData(SafeAppControlHandle handle, string key);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data")]
+        internal static extern ErrorCode GetExtraData(SafeAppControlHandle handle, string key, out string value);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data_array")]
+        internal static extern ErrorCode AddExtraDataArray(SafeAppControlHandle handle, string key, string[] value, int length);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data_array")]
+        internal static extern ErrorCode GetExtraDataArray(SafeAppControlHandle handle, string key, out IntPtr value, out int length);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_extra_data_array")]
+        internal static extern ErrorCode IsExtraDataArray(SafeAppControlHandle handle, string key, out bool array);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_destroy")]
+        internal static extern ErrorCode DangerousDestroy(IntPtr handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_extra_data")]
+        internal static extern ErrorCode ForeachExtraData(SafeAppControlHandle handle, ExtraDataCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_app_matched")]
+        internal static extern ErrorCode ForeachAppMatched(SafeAppControlHandle handle, AppMatchedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_send_launch_request")]
+        internal static extern ErrorCode SendLaunchRequest(SafeAppControlHandle handle, ReplyCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_send_terminate_request")]
+        internal static extern ErrorCode SendTerminateRequest(SafeAppControlHandle handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_reply_to_launch_request")]
+        internal static extern ErrorCode ReplyToLaunchRequest(SafeAppControlHandle reply, SafeAppControlHandle request, int result);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_enable_app_started_result_event")]
+        internal static extern ErrorCode EnableAppStartedResultEvent(SafeAppControlHandle handle);
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs b/src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs
new file mode 100644 (file)
index 0000000..0879a32
--- /dev/null
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class ApplicationManager
+    {
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            NoSuchApp = -0x01110000 | 0x01,
+            DbFailed = -0x01110000 | 0x03,
+            InvalidPackage = -0x01110000 | 0x04,
+            AppNoRunning = -0x01110000 | 0x05,
+            RequestFailed = -0x01110000 | 0x06,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied
+        }
+
+        internal enum AppContextEvent
+        {
+            Launched = 0,
+            Terminated = 1
+        }
+
+        internal enum AppManagerEventStatusType
+        {
+            All = 0x00,
+            Enable = 0x01,
+            Disable = 0x02
+        }
+
+        internal enum AppManagerEventType
+        {
+            Enable = 0,
+            Disable = 1
+        }
+
+        internal enum AppManagerEventState
+        {
+            Started = 0,
+            Completed = 1,
+            Failed = 2
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AppManagerEventCallback(string appType, string appId, AppManagerEventType eventType, AppManagerEventState eventState, IntPtr eventHandle, IntPtr userData);
+        //void(* app_manager_event_cb)(const char *type, const char *app_id, app_manager_event_type_e event_type, app_manager_event_state_e event_state, app_manager_event_h handle, void *user_data)
+
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AppManagerAppContextEventCallback(IntPtr handle, AppContextEvent state, IntPtr userData);
+        //void(* app_manager_app_context_event_cb)(app_context_h app_context, app_context_event_e event, void *user_data)
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AppManagerAppInfoCallback(IntPtr handle, IntPtr userData);
+        //bool(* app_manager_app_info_cb )(app_info_h app_info, void *user_data)
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AppManagerAppContextCallback(IntPtr handle, IntPtr userData);
+        //bool(* app_manager_app_context_cb)(app_context_h app_context, void *user_data)
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AppInfoFilterCallback(IntPtr handle, IntPtr userData);
+        //bool(* app_info_filter_cb )(app_info_h app_info, void *user_data)
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool AppInfoMetadataCallback(string key, string value, IntPtr userData);
+        //bool(* app_info_metadata_cb )(const char *metadata_key, const char *metadata_value, void *user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_set_app_context_event_cb")]
+        internal static extern ErrorCode AppManagerSetAppContextEvent(AppManagerAppContextEventCallback callback, IntPtr userData);
+        //int app_manager_set_app_context_event_cb( app_manager_app_context_event_cb callback, void * user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_unset_app_context_event_cb")]
+        internal static extern void AppManagerUnSetAppContextEvent();
+        //void app_manager_unset_app_context_event_cb (void);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_running_app_context")]
+        internal static extern ErrorCode AppManagerForeachRunningAppContext(AppManagerAppContextCallback callback, IntPtr userData);
+        //int app_manager_foreach_running_app_context(app_manager_app_context_cb callback, void *user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_app_context")]
+        internal static extern ErrorCode AppManagerForeachAppContext(AppManagerAppContextCallback callback, IntPtr userData);
+        //int app_manager_foreach_app_context(app_manager_app_context_cb callback, void *user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_context")]
+        internal static extern ErrorCode AppManagerGetAppContext(string applicationId, out IntPtr handle);
+        //int app_manager_get_app_context(const char* app_id, app_context_h *app_context);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_id")]
+        internal static extern ErrorCode AppManagerGetAppId(int processId, out string applicationId);
+        //int app_manager_get_app_id (pid_t pid, char **appid);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_is_running")]
+        internal static extern ErrorCode AppManagerIsRunning(string applicationId, out bool running);
+        //int app_manager_is_running (const char *appid, bool *running);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_resume_app")]
+        internal static extern ErrorCode AppManagerResumeApp(IntPtr handle);
+        //int app_manager_resume_app (app_context_h handle);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_request_terminate_bg_app")]
+        internal static extern ErrorCode AppManagerRequestTerminateBgApp(IntPtr handle);
+        //int app_manager_request_terminate_bg_app (app_context_h handle);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_app_info")]
+        internal static extern ErrorCode AppManagerForeachAppInfo(AppManagerAppInfoCallback callback, IntPtr userData);
+        //int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_info")]
+        internal static extern ErrorCode AppManagerGetAppInfo(string applicationId, out IntPtr handle);
+        //int app_manager_get_app_info(const char * app_id, app_info_h * app_info)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_data_path")]
+        internal static extern ErrorCode AppManagerGetSharedDataPath(string applicationId, out string path);
+        //int app_manager_get_shared_data_path (const char *appid, char **path);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_resource_path")]
+        internal static extern ErrorCode AppManagerGetSharedResourcePath(string applicationId, out string path);
+        //int app_manager_get_shared_resource_path (const char *appid, char **path);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_trusted_path")]
+        internal static extern ErrorCode AppManagerGetSharedTrustedPath(string applicationId, out string path);
+        //int app_manager_get_shared_trusted_path (const char *appid, char **path);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_external_shared_data_path")]
+        internal static extern ErrorCode AppManagerGetExternalSharedDataPath(string applicationId, out string path);
+        //int app_manager_get_external_shared_data_path (const char *appid, char **path);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_create")]
+        internal static extern ErrorCode AppManagerEventCreate(out IntPtr handle);
+        //int app_manager_event_create (app_manager_event_h *handle);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_set_status")]
+        internal static extern ErrorCode AppManagerEventSetStatus(IntPtr handle, AppManagerEventStatusType statusType);
+        //int app_manager_event_set_status (app_manager_event_h handle, int status_type);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_set_event_cb")]
+        internal static extern ErrorCode AppManagerSetEventCallback(IntPtr handle, AppManagerEventCallback callback, IntPtr userData);
+        //int app_manager_set_event_cb (app_manager_event_h handle, app_manager_event_cb callback, void *user_data);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_unset_event_cb")]
+        internal static extern ErrorCode AppManagerUnSetEventCallback(IntPtr handle);
+        //int app_manager_unset_event_cb (app_manager_event_h handle);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_destroy")]
+        internal static extern ErrorCode AppManagerEventDestroy(IntPtr handle);
+        //int app_manager_event_destroy (app_manager_event_h handle);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_terminate_app")]
+        internal static extern ErrorCode AppManagerTerminateApp(IntPtr handle);
+        //int app_manager_terminate_app (app_context_h app_context);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_context_by_instance_id")]
+        internal static extern ErrorCode AppManagerGetAppContextByInstanceId(string applicationId, string instanceId, out IntPtr handle);
+        //int app_manager_get_app_context_by_instance_id (const char *app_id, const char *instance_id, app_context_h *app_context);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_destroy")]
+        internal static extern ErrorCode AppContextDestroy(IntPtr handle);
+        //int app_context_destroy(app_context_h app_context)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_app_id")]
+        internal static extern ErrorCode AppContextGetAppId(IntPtr handle, out string applicationId);
+        //int app_context_get_app_id(app_context_h app_context, char **app_id)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_package_id")]
+        internal static extern ErrorCode AppContextGetPackageId(IntPtr handle, out string packageId);
+        //int app_context_get_package_id(app_context_h app_context, char **package_id)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_pid")]
+        internal static extern ErrorCode AppContextGetPid(IntPtr handle, out int processId);
+        //int app_context_get_pid (app_context_h app_context, pid_t *pid)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_app_state")]
+        internal static extern ErrorCode AppContextGetAppState(IntPtr handle, out int state);
+        //int app_context_get_app_state (app_context_h app_context, app_state_e *state)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_terminated")]
+        internal static extern ErrorCode AppContextIsTerminated(IntPtr handle, out bool terminated);
+        //int app_context_is_terminated (app_context_h app_context, bool *terminated);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_equal")]
+        internal static extern ErrorCode AppContextIsEqual(IntPtr first, IntPtr second, out bool equal);
+        //int app_context_is_equal (app_context_h lhs, app_context_h rhs, bool *equal);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_sub_app")]
+        internal static extern ErrorCode AppContextIsSubApp(IntPtr handle, out bool is_sub_app);
+        //int app_context_is_sub_app (app_context_h app_context, bool *is_sub_app);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_context_clone")]
+        internal static extern ErrorCode AppContextClone(out IntPtr destination, IntPtr source);
+        //int app_context_clone (app_context_h *clone, app_context_h app_context);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_create")]
+        internal static extern ErrorCode AppInfoCreate(string applicationId, out IntPtr handle);
+        //int app_info_create (const char *app_id, app_info_h *app_info);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_destroy")]
+        internal static extern ErrorCode AppInfoDestroy(IntPtr handle);
+        //int app_info_destroy (app_info_h app_info);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_app_id")]
+        internal static extern ErrorCode AppInfoGetAppId(IntPtr handle, out string applicationId);
+        //int app_info_get_app_id (app_info_h app_info, char **app_id);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_exec")]
+        internal static extern ErrorCode AppInfoGetExec(IntPtr handle, out string exec);
+        //int app_info_get_exec (app_info_h app_info, char **exec);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_label")]
+        internal static extern ErrorCode AppInfoGetLabel(IntPtr handle, out string label);
+        //int app_info_get_label (app_info_h app_info, char **label);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_localed_label")]
+        internal static extern ErrorCode AppInfoGetLocaledLabel(string applicationId, string locale, out string label);
+        //int app_info_get_localed_label (const char *app_id, const char *locale, char **label);
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_icon")]
+        internal static extern ErrorCode AppInfoGetIcon(IntPtr handle, out string path);
+        //int app_info_get_icon (app_info_h app_info, char **path)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_package")]
+        internal static extern ErrorCode AppInfoGetPackage(IntPtr handle, out string package);
+        //int app_info_get_package (app_info_h app_info, char **package)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_type")]
+        internal static extern ErrorCode AppInfoGetType(IntPtr handle, out string type);
+        //int app_info_get_type (app_info_h app_info, char **type)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_foreach_metadata")]
+        internal static extern ErrorCode AppInfoForeachMetadata(IntPtr handle, AppInfoMetadataCallback callback, IntPtr userData);
+        //int app_info_foreach_metadata(app_info_h app_info, app_info_metadata_cb callback, void *user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_nodisplay")]
+        internal static extern ErrorCode AppInfoIsNodisplay(IntPtr handle, out bool noDisplay);
+        //int app_info_is_nodisplay (app_info_h app_info, bool *nodisplay)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_equal")]
+        internal static extern ErrorCode AppInfoIsEqual(IntPtr first, IntPtr second, out bool equal);
+        //int app_info_is_equal (app_info_h lhs, app_info_h rhs, bool *equal)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_enabled")]
+        internal static extern ErrorCode AppInfoIsEnabled(IntPtr handle, out bool enabled);
+        //int app_info_is_enabled (app_info_h app_info, bool *enabled)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_onboot")]
+        internal static extern ErrorCode AppInfoIsOnBoot(IntPtr handle, out bool onBoot);
+        //int app_info_is_onboot (app_info_h app_info, bool *onboot)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_preload")]
+        internal static extern ErrorCode AppInfoIsPreLoad(IntPtr handle, out bool preLoaded);
+        //int app_info_is_preload (app_info_h app_info, bool *preload)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_clone")]
+        internal static extern ErrorCode AppInfoClone(out IntPtr destination, IntPtr source);
+        //int app_info_clone(app_info_h * clone, app_info_h app_info)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_create")]
+        internal static extern ErrorCode AppInfoFilterCreate(out IntPtr handle);
+        //int app_info_filter_create(app_info_filter_h * handle)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_destroy")]
+        internal static extern ErrorCode AppInfoFilterDestroy(IntPtr handle);
+        //int app_info_filter_destroy(app_info_filter_h handle)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_add_bool")]
+        internal static extern ErrorCode AppInfoFilterAddBool(IntPtr handle, string property, bool value);
+        //int app_info_filter_add_bool(app_info_filter_h handle, const char *property, const bool value)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_add_string")]
+        internal static extern ErrorCode AppInfoFilterAddString(IntPtr handle, string property, string value);
+        //int app_info_filter_add_string(app_info_filter_h handle, const char *property, const char *value)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_count_appinfo")]
+        internal static extern ErrorCode AppInfoFilterCountAppinfo(IntPtr handle, out int count);
+        //int app_info_filter_count_appinfo(app_info_filter_h handle, int *count)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_foreach_appinfo")]
+        internal static extern ErrorCode AppInfoFilterForeachAppinfo(IntPtr handle, AppInfoFilterCallback callback, IntPtr userData);
+        //int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb callback, void * user_data)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_create")]
+        internal static extern ErrorCode AppInfoMetadataFilterCreate(out IntPtr handle);
+        //int app_info_metadata_filter_create (app_info_metadata_filter_h *handle)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_destroy")]
+        internal static extern ErrorCode AppInfoMetadataFilterDestroy(IntPtr handle);
+        //int app_info_metadata_filter_destroy (app_info_metadata_filter_h handle)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_add")]
+        internal static extern ErrorCode AppInfoMetadataFilterAdd(IntPtr handle, string key, string value);
+        //int app_info_metadata_filter_add (app_info_metadata_filter_h handle, const char *key, const char *value)
+
+        [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_foreach")]
+        internal static extern ErrorCode AppInfoMetadataFilterForeach(IntPtr handle, AppInfoFilterCallback callback, IntPtr userData);
+        //int app_info_metadata_filter_foreach (app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data)
+
+        [StructLayout(LayoutKind.Sequential)]
+        internal struct RuaRec
+        {
+            internal int id;
+            internal IntPtr pkgName;
+            internal IntPtr appPath;
+            internal IntPtr arg;
+            internal IntPtr launchTime;
+            internal IntPtr instanceId;
+            internal IntPtr instanceName;
+            internal IntPtr icon;
+            internal IntPtr uri;
+            internal IntPtr image;
+        };
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_history_get_rec")]
+        internal static extern ErrorCode RuaHistoryGetRecord(out RuaRec record, IntPtr table, int nRows, int nCols, int row);
+        //int rua_history_get_rec(struct rua_rec *rec, char** table, int nrows, int ncols, int row);
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_history_load_db")]
+        internal static extern ErrorCode RuaHistoryLoadDb(out IntPtr table, out int nRows, out int nCols);
+        //int rua_history_load_db(char*** table, int *nrows, int *ncols);
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_history_unload_db")]
+        internal static extern ErrorCode RuaHistoryUnLoadDb(ref IntPtr table);
+        //int rua_history_unload_db(char*** table);
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_delete_history_with_pkgname")]
+        internal static extern ErrorCode RuaDeleteHistoryWithPkgname(string pkgName);
+        //int rua_delete_history_with_pkgname(char* pkg_name);
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_delete_history_with_apppath")]
+        internal static extern ErrorCode RuaDeleteHistoryWithApppath(string appPath);
+        //int rua_delete_history_with_apppath(char* app_path);
+
+        [DllImport(Libraries.Rua, EntryPoint = "rua_clear_history")]
+        internal static extern ErrorCode RuaClearHistory();
+        //int rua_clear_history(void);
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.Bundle.cs b/src/Tizen.Applications.Common/Interop/Interop.Bundle.cs
new file mode 100755 (executable)
index 0000000..65c314a
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class Bundle
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void Iterator(string key, int type, IntPtr keyval, IntPtr userData);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_create")]
+        internal static extern SafeBundleHandle Create();
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_free")]
+        internal static extern int DangerousFree(IntPtr handle);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_del")]
+        internal static extern int RemoveItem(SafeBundleHandle handle, string key);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str")]
+        internal static extern int AddString(SafeBundleHandle handle, string key, string value);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_type")]
+        internal static extern int GetType(SafeBundleHandle handle, string key);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str")]
+        internal static extern int GetString(SafeBundleHandle handle, string key, out IntPtr value);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_byte")]
+        internal static extern unsafe int AddByte(SafeBundleHandle handle, string key, byte* value, int size);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_byte")]
+        internal static extern int GetByte(SafeBundleHandle handle, string key, out IntPtr value, out int size);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str_array")]
+        internal static extern int AddStringArray(SafeBundleHandle handle, string key, string[] value, int size);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str_array")]
+        internal static extern IntPtr GetStringArray(SafeBundleHandle handle, string key, out int size);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_foreach")]
+        internal static extern void Foreach(SafeBundleHandle handle, Iterator iterator, IntPtr userData);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_encode")]
+        internal static extern void BundleEncode(SafeBundleHandle handle, out string str, out int len);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_decode")]
+        internal static extern SafeBundleHandle BundleDecode(string bundleRaw, int len);
+
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_dup")]
+        internal static extern SafeBundleHandle DangerousClone(IntPtr handle);
+
+        internal static class UnsafeCode
+        {
+            internal static unsafe int AddItem(SafeBundleHandle handle, string key, byte[] value, int offset, int count)
+            {
+                fixed (byte* pointer = value)
+                {
+                    return AddByte(handle, key, pointer + offset, count);
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.Glib.cs b/src/Tizen.Applications.Common/Interop/Interop.Glib.cs
new file mode 100755 (executable)
index 0000000..576a6e2
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Glib
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool GSourceFunc(IntPtr userData);
+
+        [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint IdleAdd(GSourceFunc d, IntPtr data);
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.Libc.cs b/src/Tizen.Applications.Common/Interop/Interop.Libc.cs
new file mode 100755 (executable)
index 0000000..825599e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+    }
+}
diff --git a/src/Tizen.Applications.Common/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Common/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..8a417c6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string AppCommon = "libcapi-appfw-app-common.so.0";
+        public const string AppControl = "libcapi-appfw-app-control.so.0";
+        public const string AppEvent = "libcapi-appfw-event.so.0";
+        public const string AppManager = "libcapi-appfw-app-manager.so.0";
+        public const string Bundle = "libbundle.so.0";
+        public const string Rua = "librua.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+        public const string Application = "libcapi-appfw-application.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications.Common.csproj b/src/Tizen.Applications.Common/Tizen.Applications.Common.csproj
new file mode 100755 (executable)
index 0000000..4a6e0ce
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.10</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Common.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="$(TizenVersion)" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Common/Tizen.Applications.Common.snk b/src/Tizen.Applications.Common/Tizen.Applications.Common.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Common/Tizen.Applications.Common.snk differ
diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs
new file mode 100755 (executable)
index 0000000..aabbbeb
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications.CoreBackend
+{
+    /// <summary>
+    /// Abstract class to provide default event handlers for apps.
+    /// </summary>
+    public abstract class DefaultCoreBackend : ICoreBackend
+    {
+        /// <summary>
+        /// Low level event types
+        /// </summary>
+        public enum AppEventType
+        {
+            LowMemory = 0,
+            LowBattery,
+            LanguageChanged,
+            DeviceOrientationChanged,
+            RegionFormatChanged,
+            SuspendedStateChanged
+        }
+
+        protected static readonly string LogTag = typeof(DefaultCoreBackend).Namespace;
+
+        protected IDictionary<EventType, object> Handlers = new Dictionary<EventType, object>();
+
+        public DefaultCoreBackend()
+        {
+        }
+
+        ~DefaultCoreBackend()
+        {
+            Dispose(false);
+        }
+
+        public void AddEventHandler(EventType evType, Action handler)
+        {
+            Handlers.Add(evType, handler);
+        }
+
+        public void AddEventHandler<TEventArgs>(EventType evType, Action<TEventArgs> handler) where TEventArgs : EventArgs
+        {
+            Handlers.Add(evType, handler);
+        }
+
+        public virtual void Run(string[] args)
+        {
+            TizenSynchronizationContext.Initialize();
+        }
+
+        public abstract void Exit();
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected abstract void Dispose(bool disposing);
+
+        protected virtual void OnLowMemoryNative(IntPtr infoHandle, IntPtr data)
+        {
+            LowMemoryStatus status = LowMemoryStatus.None;
+            ErrorCode err = Interop.AppCommon.AppEventGetLowMemoryStatus(infoHandle, out status);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to get memory status. Err = " + err);
+            }
+            if (Handlers.ContainsKey(EventType.LowMemory))
+            {
+                var handler = Handlers[EventType.LowMemory] as Action<LowMemoryEventArgs>;
+                handler?.Invoke(new LowMemoryEventArgs(status));
+            }
+        }
+
+        protected virtual void OnLowBatteryNative(IntPtr infoHandle, IntPtr data)
+        {
+            LowBatteryStatus status = LowBatteryStatus.None;
+            ErrorCode err = Interop.AppCommon.AppEventGetLowBatteryStatus(infoHandle, out status);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to get battery status. Err = " + err);
+            }
+            if (Handlers.ContainsKey(EventType.LowBattery))
+            {
+                var handler = Handlers[EventType.LowBattery] as Action<LowBatteryEventArgs>;
+                handler?.Invoke(new LowBatteryEventArgs(status));
+            }
+        }
+
+        protected virtual void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            string lang;
+            ErrorCode err = Interop.AppCommon.AppEventGetLanguage(infoHandle, out lang);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to get changed language. Err = " + err);
+            }
+            if (Handlers.ContainsKey(EventType.LocaleChanged))
+            {
+                var handler = Handlers[EventType.LocaleChanged] as Action<LocaleChangedEventArgs>;
+                handler?.Invoke(new LocaleChangedEventArgs(lang));
+            }
+        }
+
+        protected virtual void OnRegionChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            string region;
+            ErrorCode err = Interop.AppCommon.AppEventGetRegionFormat(infoHandle, out region);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to get changed region format. Err = " + err);
+            }
+            if (Handlers.ContainsKey(EventType.RegionFormatChanged))
+            {
+                var handler = Handlers[EventType.RegionFormatChanged] as Action<RegionFormatChangedEventArgs>;
+                handler?.Invoke(new RegionFormatChangedEventArgs(region));
+            }
+        }
+
+        protected virtual void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            DeviceOrientation orientation;
+            ErrorCode err = Interop.AppCommon.AppEventGetDeviceOrientation(infoHandle, out orientation);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to get deivce orientation. Err = " + err);
+            }
+            if (Handlers.ContainsKey(EventType.DeviceOrientationChanged))
+            {
+                var handler = Handlers[EventType.DeviceOrientationChanged] as Action<DeviceOrientationEventArgs>;
+                handler?.Invoke(new DeviceOrientationEventArgs(orientation));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs
new file mode 100755 (executable)
index 0000000..e24cddf
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+namespace Tizen.Applications.CoreBackend
+{
+    /// <summary>
+    /// Class that represents the type of event for backends. This class can be converted from string type.
+    /// </summary>
+    public class EventType
+    {
+        /// <summary>
+        /// Pre-defined event type. "PreCreated"
+        /// </summary>
+        public static readonly EventType PreCreated = "PreCreated";
+
+        /// <summary>
+        /// Pre-defined event type. "Created"
+        /// </summary>
+        public static readonly EventType Created = "Created";
+
+        /// <summary>
+        /// Pre-defined event type. "Terminated"
+        /// </summary>
+        public static readonly EventType Terminated = "Terminated";
+
+        /// <summary>
+        /// Pre-defined event type. "AppControlReceived"
+        /// </summary>
+        public static readonly EventType AppControlReceived = "AppControlReceived";
+
+        /// <summary>
+        /// Pre-defined event type. "Resumed"
+        /// </summary>
+        public static readonly EventType Resumed = "Resumed";
+
+        /// <summary>
+        /// Pre-defined event type. "Paused"
+        /// </summary>
+        public static readonly EventType Paused = "Paused";
+
+        /// <summary>
+        /// Pre-defined event type. "LowMemory"
+        /// </summary>
+        public static readonly EventType LowMemory = "LowMemory";
+
+        /// <summary>
+        /// Pre-defined event type. "LowBattery"
+        /// </summary>
+        public static readonly EventType LowBattery = "LowBattery";
+
+        /// <summary>
+        /// Pre-defined event type. "LocaleChanged"
+        /// </summary>
+        public static readonly EventType LocaleChanged = "LocaleChanged";
+
+        /// <summary>
+        /// Pre-defined event type. "RegionFormatChanged"
+        /// </summary>
+        public static readonly EventType RegionFormatChanged = "RegionFormatChanged";
+
+        /// <summary>
+        /// Pre-defined event type. "DeviceOrientationChanged"
+        /// </summary>
+        public static readonly EventType DeviceOrientationChanged = "DeviceOrientationChanged";
+
+        private string _typeName;
+
+        /// <summary>
+        /// Initializes the EventType class.
+        /// </summary>
+        /// <param name="name">The name of event type.</param>
+        public EventType(string name)
+        {
+            _typeName = name;
+        }
+
+        /// <summary>
+        /// Returns the name of event type.
+        /// </summary>
+        public override string ToString()
+        {
+            return _typeName;
+        }
+
+        /// <summary>
+        /// Returns the hash code for event type string.
+        /// </summary>
+        public override int GetHashCode()
+        {
+            if (_typeName == null) return 0;
+            return _typeName.GetHashCode();
+        }
+
+        /// <summary>
+        /// Determines whether this instance and a specified object.
+        /// </summary>
+        public override bool Equals(object obj)
+        {
+            EventType other = obj as EventType;
+            return other != null && other._typeName == this._typeName;
+        }
+
+        /// <summary>
+        /// Converts a string to EventType instance.
+        /// </summary>
+        public static implicit operator EventType(string value)
+        {
+            return new EventType(value);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs
new file mode 100755 (executable)
index 0000000..0ba8be5
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications.CoreBackend
+{
+    /// <summary>
+    /// Interface that represents the backend lifecycles.
+    /// </summary>
+    public interface ICoreBackend : IDisposable
+    {
+        /// <summary>
+        /// Adds an event handler.
+        /// </summary>
+        /// <param name="evType">The type of event.</param>
+        /// <param name="handler">The handler method without arguments.</param>
+        void AddEventHandler(EventType evType, Action handler);
+
+        /// <summary>
+        /// Adds an event handler.
+        /// </summary>
+        /// <typeparam name="TEventArgs">The EventArgs type used in arguments of the handler method.</typeparam>
+        /// <param name="evType">The type of event.</param>
+        /// <param name="handler">The handler method with a TEventArgs type argument.</param>
+        void AddEventHandler<TEventArgs>(EventType evType, Action<TEventArgs> handler) where TEventArgs : EventArgs;
+
+        /// <summary>
+        /// Runs the mainloop of backend.
+        /// </summary>
+        /// <param name="args"></param>
+        void Run(string[] args);
+
+        /// <summary>
+        /// Exits the mainloop of backend.
+        /// </summary>
+        void Exit();
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs
new file mode 100755 (executable)
index 0000000..1128f02
--- /dev/null
@@ -0,0 +1,1038 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents the control message to exchange between applications.
+    /// </summary>
+    /// <example>
+    /// <code>
+    /// public class AppControlExample : UIApplication
+    /// {
+    ///     /// ...
+    ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+    ///     {
+    ///         AppControl appControl = new AppControl();
+    ///         appControl.ApplicationId = "org.tizen.calculator";
+    ///         AppControl.SendLaunchRequest(appControl, (launchRequest, replyRequest, result) => {
+    ///             // ...
+    ///         });
+    ///     }
+    /// }
+    /// </code>
+    /// </example>
+    public class AppControl
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        private static Dictionary<int, Interop.AppControl.ReplyCallback> s_replyNativeCallbackMaps = new Dictionary<int, Interop.AppControl.ReplyCallback>();
+        private static int s_replyNativeCallbackId = 0;
+
+        private readonly SafeAppControlHandle _handle;
+
+        private string _operation = null;
+        private string _mime = null;
+        private string _uri = null;
+        private string _category = null;
+        private string _applicationId = null;
+        private ExtraDataCollection _extraData = null;
+
+        /// <summary>
+        /// Initializes the instance of the AppControl class.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when failed to create AppControl handle.</exception>
+        public AppControl()
+        {
+            Interop.AppControl.ErrorCode err = Interop.AppControl.Create(out _handle);
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err);
+            }
+        }
+
+        /// <summary>
+        /// Initializes the instance of the AppControl class with parameter.
+        /// </summary>
+        /// <param name="enableAppStartedResultEvent">The flag value to receive an additional launch result event on launch request.</param>
+        /// <exception cref="InvalidOperationException">Thrown when failed to create AppControl handle.</exception>
+        public AppControl(bool enableAppStartedResultEvent)
+        {
+            Interop.AppControl.ErrorCode err = Interop.AppControl.Create(out _handle);
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err);
+            }
+
+            if (enableAppStartedResultEvent)
+            {
+                err = Interop.AppControl.EnableAppStartedResultEvent(_handle);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    throw new InvalidOperationException("Failed to set EnableAppStartedResultEvent");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Initializes the instance of the AppControl class with the SafeAppControlHandle.
+        /// </summary>
+        /// <param name="handle"></param>
+        public AppControl(SafeAppControlHandle handle)
+        {
+            if (handle == null)
+            {
+                throw new ArgumentNullException("handle");
+            }
+
+            Interop.AppControl.ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle.DangerousGetHandle());
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to clone the appcontrol handle. Err = " + err);
+            }
+        }
+
+        private AppControl(IntPtr handle)
+        {
+            Interop.AppControl.ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle);
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to clone the appcontrol handle. Err = " + err);
+            }
+        }
+
+        #region Public Properties
+
+        /// <summary>
+        /// Gets the SafeAppControlHandle instance.
+        /// </summary>
+        public SafeAppControlHandle SafeAppControlHandle
+        {
+            get
+            {
+                return _handle;
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the operation to be performed.
+        /// </summary>
+        /// <value>
+        /// The operation is the mandatory information for the launch request. If the operation is not specified,
+        /// AppControlOperations.Default is used for the launch request. If the operation is AppControlOperations.Default,
+        /// the package information is mandatory to explicitly launch the application.
+        /// (if the operation is null for setter, it clears the previous value.)
+        /// </value>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.Operation = AppControlOperations.Default;
+        /// Log.Debug(LogTag, "Operation: " + appControl.Operation);
+        /// </code>
+        /// </example>
+        public string Operation
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_operation))
+                {
+                    Interop.AppControl.ErrorCode err = Interop.AppControl.GetOperation(_handle, out _operation);
+                    if (err != Interop.AppControl.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the operation from the appcontrol. Err = " + err);
+                    }
+                }
+                return _operation;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetOperation(_handle, value);
+                if (err == Interop.AppControl.ErrorCode.None)
+                {
+                    _operation = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the operation to the appcontrol. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the explicit MIME type of the data.
+        /// </summary>
+        /// <value>
+        /// (if the mime is null for setter, it clears the previous value.)
+        /// </value>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.Mime = "image/jpg";
+        /// Log.Debug(LogTag, "Mime: " + appControl.Mime);
+        /// </code>
+        /// </example>
+        public string Mime
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_mime))
+                {
+                    Interop.AppControl.ErrorCode err = Interop.AppControl.GetMime(_handle, out _mime);
+                    if (err != Interop.AppControl.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the mime from the appcontrol. Err = " + err);
+                    }
+                }
+                return _mime;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetMime(_handle, value);
+                if (err == Interop.AppControl.ErrorCode.None)
+                {
+                    _mime = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the mime to the appcontrol. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the URI of the data.
+        /// </summary>
+        /// <value>
+        /// Since Tizen 2.4, if the parameter 'uri' is started with 'file://' and
+        /// it is a regular file in this application's data path which can be obtained
+        /// by property DataPath in ApplicationInfo class,
+        /// it will be shared to the callee application.
+        /// Framework will grant a temporary permission to the callee application for this file and
+        /// revoke it when the callee application is terminated.
+        /// The callee application can just read it.
+        /// (if the uri is null for setter, it clears the previous value.)
+        /// </value>
+        /// <example>
+        /// <code>
+        /// public class AppControlExample : UIApplication
+        /// {
+        ///     ...
+        ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        ///     {
+        ///         ...
+        ///         AppControl appControl = new AppControl();
+        ///         appContrl.Uri = this.ApplicationInfo.DataPath + "image.jpg";
+        ///         Log.Debug(LogTag, "Set Uri: " + appControl.Uri);
+        ///     }
+        /// }
+        /// </code>
+        /// </example>
+        public string Uri
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_uri))
+                {
+                    Interop.AppControl.ErrorCode err = Interop.AppControl.GetUri(_handle, out _uri);
+                    if (err != Interop.AppControl.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the uri from the appcontrol. Err = " + err);
+                    }
+                }
+                return _uri;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetUri(_handle, value);
+                if (err == Interop.AppControl.ErrorCode.None)
+                {
+                    _uri = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the uri to the appcontrol. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the explicit category.
+        /// </summary>
+        /// <value>
+        /// (if the category is null for setter, it clears the previous value.)
+        /// </value>
+        public string Category
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_category))
+                {
+                    Interop.AppControl.ErrorCode err = Interop.AppControl.GetCategory(_handle, out _category);
+                    if (err != Interop.AppControl.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the category from the appcontrol. Err = " + err);
+                    }
+                }
+                return _category;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetCategory(_handle, value);
+                if (err == Interop.AppControl.ErrorCode.None)
+                {
+                    _category = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the category to the appcontrol. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the application id to explicitly launch.
+        /// </summary>
+        /// <value>
+        /// (if the application id is null for setter, it clears the previous value.)
+        /// </value>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.ApplicationId = "org.tizen.calculator";
+        /// Log.Debug(LogTag, "ApplicationId: " + appControl.ApplicationId);
+        /// </code>
+        /// </example>
+        public string ApplicationId
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_applicationId))
+                {
+                    Interop.AppControl.ErrorCode err = Interop.AppControl.GetAppId(_handle, out _applicationId);
+                    if (err != Interop.AppControl.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the application id from the AppControl. Err = " + err);
+                    }
+                }
+                return _applicationId;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetAppId(_handle, value);
+                if (err == Interop.AppControl.ErrorCode.None)
+                {
+                    _applicationId = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the application id to the AppControl. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the launch mode of the application.
+        /// </summary>
+        /// <value>
+        /// Although LaunchMode were set as AppControlLaunchMode.Group,
+        /// callee application would be launched as single mode
+        /// if the manifest file of callee application defined the launch mode as "single".
+        /// This property can just set the preference of caller application to launch an application.
+        /// Sub-applications which were launched as group mode always have own process.
+        /// Since Tizen 3.0, if launch mode not set in the caller app control,
+        /// this property returns AppControlLaunchMode.Single launch mode.
+        /// </value>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.LaunchMode = AppControlLaunchMode.Group;
+        /// </code>
+        /// </example>
+        public AppControlLaunchMode LaunchMode
+        {
+            get
+            {
+                int value = 0;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.GetLaunchMode(_handle, out value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the LaunchMode from the AppControl. Err = " + err);
+                }
+                return (AppControlLaunchMode)value;
+            }
+            set
+            {
+                Interop.AppControl.ErrorCode err = Interop.AppControl.SetLaunchMode(_handle, (int)value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to set the LaunchMode to the AppControl. Err = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the collection of the extra data.
+        /// </summary>
+        /// <value>
+        /// Extra data for communication between AppControls.
+        /// </value>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.ExtraData.Add("key", "value");
+        /// ...
+        /// </code>
+        /// </example>
+        public ExtraDataCollection ExtraData
+        {
+            get
+            {
+                if (_extraData == null)
+                    _extraData = new ExtraDataCollection(_handle);
+                return _extraData;
+            }
+        }
+
+        #endregion // Public Properties
+
+        /// <summary>
+        /// Retrieves all applications that can be launched to handle the given app_control request.
+        /// </summary>
+        /// <param name="control">The AppControl</param>
+        /// <returns>ApplicationIds</returns>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid parameter</exception>
+        /// <example>
+        /// <code>
+        /// IEnumerable<string> applicationIds = AppControl.GetMatchedApplicationIds(control);
+        /// if (applicationIds != null)
+        /// {
+        ///     foreach (string id in applicationIds)
+        ///     {
+        ///         // ...
+        ///     }
+        /// }
+        /// </code>
+        /// </example>
+        public static IEnumerable<string> GetMatchedApplicationIds(AppControl control)
+        {
+            if (control == null)
+            {
+                throw new ArgumentNullException("control");
+            }
+
+            List<string> ids = new List<string>();
+            Interop.AppControl.AppMatchedCallback callback = (handle, applicationId, userData) =>
+            {
+                if (applicationId == null)
+                {
+                        return false;
+                }
+
+                ids.Add(applicationId);
+                return true;
+            };
+
+            Interop.AppControl.ErrorCode err = Interop.AppControl.ForeachAppMatched(control._handle, callback, IntPtr.Zero);
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                    throw new InvalidOperationException("Failed to get matched application ids. err = " + err);
+            }
+
+            return ids;
+        }
+
+        /// <summary>
+        /// Sends the launch request.
+        /// </summary>
+        /// <remarks>
+        /// The operation is mandatory information for the launch request.
+        /// If the operation is not specified, AppControlOperations.Default is used by default.
+        /// If the operation is AppControlOperations.Default, the application ID is mandatory to explicitly launch the application. \n
+        /// Since Tizen 2.4, the launch request of the service application over out of packages is restricted by the platform.
+        /// Also, implicit launch requests are NOT delivered to service applications since 2.4.
+        /// To launch a service application, an explicit launch request with application ID given by property ApplicationId MUST be sent.
+        /// </remarks>
+        /// <param name="launchRequest">The AppControl</param>
+        /// <exception cref="ArgumentNullException">Thrown when failed because of a null arguament</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid operation</exception>
+        /// <exception cref="TimeoutException">Thrown when failed because of timeout</exception>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.ApplicationId = "org.tizen.calculator";
+        /// AppControl.SendLaunchRequest(appControl);
+        /// </code>
+        /// </example>
+        public static void SendLaunchRequest(AppControl launchRequest)
+        {
+            SendLaunchRequest(launchRequest, null);
+        }
+
+        /// <summary>
+        /// Sends the launch request.
+        /// </summary>
+        /// <remarks>
+        /// The operation is mandatory information for the launch request.
+        /// If the operation is not specified, AppControlOperations.Default is used by default.
+        /// If the operation is AppControlOperations.Default, the application ID is mandatory to explicitly launch the application. \n
+        /// Since Tizen 2.4, the launch request of the service application over out of packages is restricted by the platform.
+        /// Also, implicit launch requests are NOT delivered to service applications since 2.4.
+        /// To launch a service application, an explicit launch request with application ID given by property ApplicationId MUST be sent.
+        /// </remarks>
+        /// <param name="launchRequest">The AppControl</param>
+        /// <param name="replyAfterLaunching">The callback function to be called when the reply is delivered</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of arguament is invalid</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid operation</exception>
+        /// <exception cref="TimeoutException">Thrown when failed because of timeout</exception>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        /// <example>
+        /// <code>
+        /// AppControl appControl = new AppControl();
+        /// appControl.ApplicationId = "org.tizen.calculator";
+        /// AppControl.SendLaunchRequest(appControl, (launchRequest, replyRequest, result) => {
+        ///     // ...
+        /// });
+        /// </code>
+        /// </example>
+        public static void SendLaunchRequest(AppControl launchRequest, AppControlReplyCallback replyAfterLaunching)
+        {
+            if (launchRequest == null)
+            {
+                throw new ArgumentNullException("launchRequest");
+            }
+
+            Interop.AppControl.ErrorCode err;
+
+            if (replyAfterLaunching != null)
+            {
+                int id = 0;
+                lock (s_replyNativeCallbackMaps)
+                {
+                    id = s_replyNativeCallbackId++;
+                    s_replyNativeCallbackMaps[id] = (launchRequestHandle, replyRequestHandle, result, userData) =>
+                    {
+                        if (replyAfterLaunching != null)
+                        {
+                            Log.Debug(LogTag, "Reply Callback is launched");
+                            replyAfterLaunching(new AppControl(launchRequestHandle), new AppControl(replyRequestHandle), (AppControlReplyResult)result);
+                            if (result != Interop.AppControl.AppStartedStatus)
+                            {
+                                lock (s_replyNativeCallbackMaps)
+                                {
+                                    s_replyNativeCallbackMaps.Remove(id);
+                                }
+                            }
+                        }
+                    };
+                }
+                err = Interop.AppControl.SendLaunchRequest(launchRequest._handle, s_replyNativeCallbackMaps[id], IntPtr.Zero);
+            }
+            else
+            {
+                err = Interop.AppControl.SendLaunchRequest(launchRequest._handle, null, IntPtr.Zero);
+            }
+
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                switch (err)
+                {
+                    case Interop.AppControl.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.AppControl.ErrorCode.TimedOut:
+                        throw new TimeoutException("Timed out");
+                    default:
+                        throw new InvalidOperationException("Error = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sends the terminate request to the application that is launched by AppControl.
+        /// </summary>
+        /// <remarks>
+        /// You are not allowed to terminate other general applications using this API.
+        /// This API can be used to terminate sub-applications which were launched as group mode by caller application.
+        /// Once callee application is being terminated by this API,
+        /// other applications which were launched by callee application as group mode will be terminated as well
+        /// </remarks>
+        /// <param name="terminateRequest">The AppControl</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of arguament is invalid</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid operation</exception>
+        /// <exception cref="TimeoutException">Thrown when failed because of timeout</exception>
+        /// <example>
+        /// <code>
+        /// AppControl terminateRequest = new AppControl();
+        /// terminateRequest.ApplicationId = "org.tizen.calculator";
+        /// AppControl.SendTerminateRequest(terminateRequest);
+        /// </code>
+        /// </example>
+        public static void SendTerminateRequest(AppControl terminateRequest)
+        {
+            if (terminateRequest == null)
+            {
+                throw new ArgumentNullException("terminateRequest");
+            }
+            Interop.AppControl.ErrorCode err;
+
+            err = Interop.AppControl.SendTerminateRequest(terminateRequest._handle);
+
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                switch (err)
+                {
+                    case Interop.AppControl.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.AppControl.ErrorCode.TimedOut:
+                        throw new TimeoutException("Timed out");
+                    default:
+                        throw new InvalidOperationException("Error = " + err);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Class for Extra Data
+        /// </summary>
+        public class ExtraDataCollection
+        {
+            private readonly SafeAppControlHandle _handle;
+
+            internal ExtraDataCollection(SafeAppControlHandle handle)
+            {
+                _handle = handle;
+            }
+
+            /// <summary>
+            /// Adds extra data.
+            /// </summary>
+            /// <remarks>
+            /// The function replaces any existing value for the given key.
+            /// </remarks>
+            /// <param name="key">The name of the extra data</param>
+            /// <param name="value">The value associated with the given key</param>
+            /// <exception cref="ArgumentNullException">Thrown when key or value is a zero-length string</exception>
+            /// <exception cref="ArgumentException">Thrown when the application tries to use the same key with system-defined key</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// appControl.ExtraData.Add("myKey", "myValue");
+            /// </code>
+            /// </example>
+            public void Add(string key, string value)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                if (string.IsNullOrEmpty(value))
+                {
+                    throw new ArgumentNullException("value");
+                }
+                Interop.AppControl.ErrorCode err = Interop.AppControl.AddExtraData(_handle, key, value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    switch (err)
+                    {
+                        case Interop.AppControl.ErrorCode.InvalidParameter:
+                            throw new ArgumentException("Invalid parameter: key or value is a zero-length string");
+                        case Interop.AppControl.ErrorCode.KeyRejected:
+                            throw new ArgumentException("Key is rejected: the key is system-defined key.");
+                        default:
+                            throw new InvalidOperationException("Error = " + err);
+                    }
+                }
+            }
+
+            /// <summary>
+            /// Adds extra data.
+            /// </summary>
+            /// <remarks>
+            /// The function replaces any existing value for the given key.
+            /// </remarks>
+            /// <param name="key">The name of the extra data</param>
+            /// <param name="value">The value associated with the given key</param>
+            /// <exception cref="ArgumentNullException">Thrown when key or value is a zero-length string</exception>
+            /// <exception cref="ArgumentException">Thrown when the application tries to use the same key with system-defined key</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// string[] myValues = new string[] { "first", "second", "third" };
+            /// appControl.ExtraData.Add("myKey", myValues);
+            /// </code>
+            /// </example>
+            public void Add(string key, IEnumerable<string> value)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                if (value == null)
+                {
+                    throw new ArgumentNullException("value");
+                }
+                string[] valueArray = value.ToArray();
+                Interop.AppControl.ErrorCode err = Interop.AppControl.AddExtraDataArray(_handle, key, valueArray, valueArray.Length);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    switch (err)
+                    {
+                        case Interop.AppControl.ErrorCode.InvalidParameter:
+                            throw new ArgumentException("Invalid parameter: key or value is a zero-length string");
+                        case Interop.AppControl.ErrorCode.KeyRejected:
+                            throw new ArgumentException("Key is rejected: the key is system-defined key.");
+                        default:
+                            throw new InvalidOperationException("Error = " + err);
+                    }
+                }
+            }
+
+            /// <summary>
+            /// Gets the extra data.
+            /// </summary>
+            /// <typeparam name="T">Only string and IEnumerable&lt;string&gt;</typeparam>
+            /// <param name="key">The name of extra data</param>
+            /// <returns>The value associated with the given key</returns>
+            /// <exception cref="ArgumentNullException">Thrown when the key is invalid parameter</exception>
+            /// <exception cref="KeyNotFoundException">Thrown when the key is not found</exception>
+            /// <exception cref="ArgumentException">Thrown when the key is rejected</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// string myValue = appControl.ExtraData.Get<string>("myKey");
+            /// </code>
+            /// </example>
+            public T Get<T>(string key)
+            {
+                object ret = Get(key);
+                return (T)ret;
+            }
+
+            /// <summary>
+            /// Gets the extra data.
+            /// </summary>
+            /// <param name="key">The name of extra data</param>
+            /// <returns>The value associated with the given key</returns>
+            /// <exception cref="ArgumentNullException">Thrown when the key is invalid parameter</exception>
+            /// <exception cref="KeyNotFoundException">Thrown when the key is not found</exception>
+            /// <exception cref="ArgumentException">Thrown when the key is rejected</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// string myValue = appControl.ExtraData.Get("myKey") as string;
+            /// if (myValue != null)
+            /// {
+            ///     // ...
+            /// }
+            /// </code>
+            /// </example>
+            public object Get(string key)
+            {
+                if (IsCollection(key))
+                {
+                    return GetDataCollection(key);
+                }
+                else
+                {
+                    return GetData(key);
+                }
+            }
+
+            /// <summary>
+            /// Gets all keys in extra data.
+            /// </summary>
+            /// <returns>The keys in the AppControl</returns>
+            /// <exception cref="InvalidOperationException">Thrown when invalid parameter</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// IEnumerable<string> keys = appControl.GetKeys();
+            /// if (keys != null)
+            /// {
+            ///     foreach (string key in keys)
+            ///     {
+            ///         // ...
+            ///     }
+            /// }
+            /// </code>
+            /// </example>
+            public IEnumerable<string> GetKeys()
+            {
+                List<string> keys = new List<string>();
+                Interop.AppControl.ExtraDataCallback callback = (handle, key, userData) =>
+                {
+                    if (key == null)
+                    {
+                        return false;
+                    }
+
+                    keys.Add(key);
+                    return true;
+                };
+
+                Interop.AppControl.ErrorCode err = Interop.AppControl.ForeachExtraData(_handle, callback, IntPtr.Zero);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    throw new InvalidOperationException("Failed to get keys. err = " + err);
+                }
+
+                return keys;
+            }
+
+            /// <summary>
+            /// Tries getting the extra data.
+            /// </summary>
+            /// <param name="key">The name of extra data</param>
+            /// <param name="value">The value associated with the given key</param>
+            /// <returns>The result whether getting the value is done</returns>
+            /// <exception cref="ArgumentNullException">Thrown when the key is invalid parameter</exception>
+            /// <exception cref="KeyNotFoundException">Thrown when the key is not found</exception>
+            /// <exception cref="ArgumentException">Thrown when the key is rejected</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// string myValue = string.Empty;
+            /// bool result = appControl.ExtraData.TryGet("myKey", out myValue);
+            /// if (result != null)
+            /// {
+            ///     // ...
+            /// }
+            /// </code>
+            /// </example>
+            public bool TryGet(string key, out string value)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                Interop.AppControl.GetExtraData(_handle, key, out value);
+                if (value != null)
+                {
+                    return true;
+                }
+                else
+                {
+                    value = default(string);
+                    return false;
+                }
+            }
+
+            /// <summary>
+            /// Tries getting the extra data.
+            /// </summary>
+            /// <param name="key">The name of extra data</param>
+            /// <param name="value">The value associated with the given key</param>
+            /// <returns>The result whether getting the value is done</returns>
+            /// <exception cref="ArgumentNullException">Thrown when the key is invalid parameter</exception>
+            /// <exception cref="KeyNotFoundException">Thrown when the key is not found</exception>
+            /// <exception cref="ArgumentException">Thrown when the key is rejected</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// IEnumerable<string> myValue = null;
+            /// bool result = appControl.ExtraData.TryGet("myKey", out myValue);
+            /// if (result)
+            /// {
+            ///     foreach (string value in myValue)
+            ///     {
+            ///         // ...
+            ///     }
+            /// }
+            /// </code>
+            /// </example>
+            public bool TryGet(string key, out IEnumerable<string> value)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                IntPtr valuePtr = IntPtr.Zero;
+                int len = -1;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraDataArray(_handle, key, out valuePtr, out len);
+                if (err == Interop.AppControl.ErrorCode.None && valuePtr != IntPtr.Zero)
+                {
+                    List<string> stringList = new List<string>();
+                    for (int i = 0; i < len; ++i)
+                    {
+                        IntPtr charArr = Marshal.ReadIntPtr(valuePtr, IntPtr.Size * i);
+                        stringList.Add(Marshal.PtrToStringAnsi(charArr));
+                        Interop.Libc.Free(charArr);
+                    }
+                    Interop.Libc.Free(valuePtr);
+                    value = stringList;
+                    return true;
+                }
+                else
+                {
+                    value = default(IEnumerable<string>);
+                    return false;
+                }
+            }
+
+            /// <summary>
+            /// Removes the extra data.
+            /// </summary>
+            /// <param name="key">The name of the extra data</param>
+            /// <exception cref="ArgumentNullException">Thrown when the key is a zero-length string</exception>
+            /// <exception cref="KeyNotFoundException">Thrown when the key is not found</exception>
+            /// <exception cref="ArgumentException">Thrown when the key is rejected</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// appControl.ExtraData.Remove("myKey");
+            /// </code>
+            /// </example>
+            public void Remove(string key)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                Interop.AppControl.ErrorCode err = Interop.AppControl.RemoveExtraData(_handle, key);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    switch (err)
+                    {
+                        case Interop.AppControl.ErrorCode.InvalidParameter:
+                            throw new ArgumentException("Invalid parameter: key is a zero-length string");
+                        case Interop.AppControl.ErrorCode.KeyNotFound:
+                            throw new KeyNotFoundException("Key is not found"); ;
+                        case Interop.AppControl.ErrorCode.KeyRejected:
+                            throw new ArgumentException("Key is rejected: the key is system-defined key.");
+                        default:
+                            throw new InvalidOperationException("Error = " + err);
+                    }
+                }
+            }
+
+            /// <summary>
+            /// Counts keys in the extra data.
+            /// </summary>
+            /// <returns>The number of counting keys</returns>
+            /// <exception cref="InvalidOperationException">Thrown when invalid parameter</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// int numberOfKeys = appControl.ExtraData.Count();
+            /// </code>
+            /// </example>
+            public int Count()
+            {
+                return GetKeys().Count();
+            }
+
+            /// <summary>
+            /// Checks whether the extra data associated with the given key is of collection data type.
+            /// </summary>
+            /// <param name="key">The name of the extra data</param>
+            /// <returns>If true the extra data is of array data type, otherwise false</returns>
+            /// <exception cref="ArgumentNullException">Thrown when the key is a zero-length string</exception>
+            /// <exception cref="InvalidOperationException">Thrown when failed to check the key</exception>
+            /// <example>
+            /// <code>
+            /// AppControl appControl = new AppControl();
+            /// bool result = appControl.ExtraData.IsCollection("myKey");
+            /// </code>
+            /// </example>
+            public bool IsCollection(string key)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                bool isArray = false;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.IsExtraDataArray(_handle, key, out isArray);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    throw new InvalidOperationException("Error = " + err);
+                }
+                return isArray;
+            }
+
+            private string GetData(string key)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                string value = string.Empty;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraData(_handle, key, out value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    switch (err)
+                    {
+                        case Interop.AppControl.ErrorCode.InvalidParameter:
+                            throw new ArgumentException("Invalid parameter: key is a zero-length string");
+                        case Interop.AppControl.ErrorCode.KeyNotFound:
+                            throw new KeyNotFoundException("Key is not found"); ;
+                        case Interop.AppControl.ErrorCode.InvalidDataType:
+                            throw new ArgumentException("Invalid data type: value is data collection type");
+                        case Interop.AppControl.ErrorCode.KeyRejected:
+                            throw new ArgumentException("Key is rejected: the key is system-defined key.");
+                        default:
+                            throw new InvalidOperationException("Error = " + err);
+                    }
+                }
+                return value;
+            }
+
+            private IEnumerable<string> GetDataCollection(string key)
+            {
+                if (string.IsNullOrEmpty(key))
+                {
+                    throw new ArgumentNullException("key");
+                }
+                IntPtr valuePtr = IntPtr.Zero;
+                int len = -1;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraDataArray(_handle, key, out valuePtr, out len);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    switch (err)
+                    {
+                        case Interop.AppControl.ErrorCode.InvalidParameter:
+                            throw new ArgumentException("Invalid parameter: key is a zero-length string");
+                        case Interop.AppControl.ErrorCode.KeyNotFound:
+                            throw new KeyNotFoundException("Key is not found"); ;
+                        case Interop.AppControl.ErrorCode.InvalidDataType:
+                            throw new ArgumentException("Invalid data type: value is data collection type");
+                        case Interop.AppControl.ErrorCode.KeyRejected:
+                            throw new ArgumentException("Key is rejected: the key is system-defined key.");
+                        default:
+                            throw new InvalidOperationException("Error = " + err);
+                    }
+                }
+
+                List<string> valueArray = new List<string>();
+                if (valuePtr != IntPtr.Zero)
+                {
+                    for (int i = 0; i < len; ++i)
+                    {
+                        IntPtr charArr = Marshal.ReadIntPtr(valuePtr, IntPtr.Size * i);
+                        valueArray.Add(Marshal.PtrToStringAnsi(charArr));
+                        Interop.Libc.Free(charArr);
+                    }
+                    Interop.Libc.Free(valuePtr);
+                }
+                return valueArray;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs
new file mode 100755 (executable)
index 0000000..fddfd09
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Data of the AppControl.
+    /// </summary>
+    public static class AppControlData
+    {
+        /// <summary>
+        /// Subject
+        /// </summary>
+        public const string Subject = "http://tizen.org/appcontrol/data/subject";
+
+        /// <summary>
+        /// Recipients
+        /// </summary>
+        public const string To = "http://tizen.org/appcontrol/data/to";
+
+        /// <summary>
+        /// E-mail addresses that should be carbon copied
+        /// </summary>
+        public const string Cc = "http://tizen.org/appcontrol/data/cc";
+
+        /// <summary>
+        /// E-mail addresses that should be blind carbon copied
+        /// </summary>
+        public const string Bcc = "http://tizen.org/appcontrol/data/bcc";
+
+        /// <summary>
+        /// Text
+        /// </summary>
+        public const string Text = "http://tizen.org/appcontrol/data/text";
+
+        /// <summary>
+        /// Title
+        /// </summary>
+        public const string Title = "http://tizen.org/appcontrol/data/title";
+
+        /// <summary>
+        /// Selected items
+        /// </summary>
+        public const string Selected = "http://tizen.org/appcontrol/data/selected";
+
+        /// <summary>
+        /// Paths of items
+        /// </summary>
+        public const string Path = "http://tizen.org/appcontrol/data/path";
+
+        /// <summary>
+        /// Selection mode. ("single" or "multiple")
+        /// </summary>
+        public const string SectionMode = "http://tizen.org/appcontrol/data/selection_mode";
+
+        /// <summary>
+        /// All-day mode of event ("true" or "false")
+        /// </summary>
+        public const string AllDay = "http://tizen.org/appcontrol/data/calendar/all_day";
+
+        /// <summary>
+        /// Start time of event (format: YYYY-MM-DD HH:MM:SS)
+        /// </summary>
+        public const string StartTime = "http://tizen.org/appcontrol/data/calendar/start_time";
+
+        /// <summary>
+        /// End time of event (format: YYYY-MM-DD HH:MM:SS)
+        /// </summary>
+        public const string Endtime = "http://tizen.org/appcontrol/data/calendar/end_time";
+
+        /// <summary>
+        /// E-mail addressed
+        /// </summary>
+        public const string Email = "http://tizen.org/appcontrol/data/email";
+
+        /// <summary>
+        /// Phone numbers
+        /// </summary>
+        public const string Phone = "http://tizen.org/appcontrol/data/phone";
+
+        /// <summary>
+        /// URLs
+        /// </summary>
+        public const string Url = "http://tizen.org/appcontrol/data/url";
+
+        /// <summary>
+        /// IDs
+        /// </summary>
+        public const string Ids = "http://tizen.org/appcontrol/data/id";
+
+        /// <summary>
+        /// Type
+        /// </summary>
+        public const string Type = "http://tizen.org/appcontrol/data/type";
+
+        /// <summary>
+        /// Total count
+        /// </summary>
+        public const string TotalCount = "http://tizen.org/appcontrol/data/total_count";
+
+        /// <summary>
+        /// Total size (unit : bytes)
+        /// </summary>
+        public const string TotalSize = "http://tizen.org/appcontrol/data/total_size";
+
+        /// <summary>
+        /// Name
+        /// </summary>
+        public const string Name = "http://tizen.org/appcontrol/data/name";
+
+        /// <summary>
+        /// Location
+        /// </summary>
+        public const string Location = "http://tizen.org/appcontrol/data/location";
+
+        /// <summary>
+        /// Select the type of input method
+        /// </summary>
+        public const string InputType = "http://tizen.org/appcontrol/data/input_type";
+
+        /// <summary>
+        /// Send the pre inputted text such as "http://" in web
+        /// </summary>
+        public const string InputDefaultText = "http://tizen.org/appcontrol/data/input_default_text";
+
+        /// <summary>
+        /// Send guide text to show to user such as "Input user name"
+        /// </summary>
+        public const string InputGuideText = "http://tizen.org/appcontrol/data/input_guide_text";
+
+        /// <summary>
+        /// Send text to receive answer result from smart reply
+        /// </summary>
+        public const string InputPredictionHint = "http://tizen.org/appcontrol/data/input_prediction_hint";
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs
new file mode 100755 (executable)
index 0000000..728612c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for App Control Launch Mode.
+    /// </summary>
+    public enum AppControlLaunchMode
+    {
+        /// <summary>
+        /// Prefer to launch an application as single mode
+        /// </summary>
+        Single = 0,
+
+        /// <summary>
+        /// Prefer to launch an application as group mode
+        /// </summary>
+        Group,
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs
new file mode 100755 (executable)
index 0000000..c045651
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Operations of the AppControl.
+    /// </summary>
+    public static class AppControlOperations
+    {
+        /// <summary>
+        /// An explicit launch for a homescreen application.
+        /// </summary>
+        public const string Main = "http://tizen.org/appcontrol/operation/main";
+
+        /// <summary>
+        /// An explicit launch for an application that excludes a homescreen application.
+        /// </summary>
+        public const string Default = "http://tizen.org/appcontrol/operation/default";
+
+        /// <summary>
+        /// Provides an editable access to the given data.
+        /// </summary>
+        public const string Edit = "http://tizen.org/appcontrol/operation/edit";
+
+        /// <summary>
+        /// Displays the data.
+        /// </summary>
+        public const string View = "http://tizen.org/appcontrol/operation/view";
+
+        /// <summary>
+        /// Picks items.
+        /// </summary>
+        public const string Pick = "http://tizen.org/appcontrol/operation/pick";
+
+        /// <summary>
+        /// Creates contents.
+        /// </summary>
+        public const string CreateContent = "http://tizen.org/appcontrol/operation/create_content";
+
+        /// <summary>
+        /// Performs a call to someone.
+        /// </summary>
+        public const string Call = "http://tizen.org/appcontrol/operation/call";
+
+        /// <summary>
+        /// Delivers some data to someone else.
+        /// </summary>
+        public const string Send = "http://tizen.org/appcontrol/operation/send";
+
+        /// <summary>
+        /// Delivers text data to someone else.
+        /// </summary>
+        public const string SendText = "http://tizen.org/appcontrol/operation/send_text";
+
+        /// <summary>
+        /// Shares an item with someone else.
+        /// </summary>
+        public const string Share = "http://tizen.org/appcontrol/operation/share";
+
+        /// <summary>
+        /// Shares multiple items with someone else.
+        /// </summary>
+        public const string MultiShare = "http://tizen.org/appcontrol/operation/multi_share";
+
+        /// <summary>
+        /// Shares text data with someone else.
+        /// </summary>
+        public const string ShareText = "http://tizen.org/appcontrol/operation/share_text";
+
+        /// <summary>
+        /// Dials a number. This shows a UI with the number to be dialed, allowing the user to explicitly initiate the call.
+        /// </summary>
+        public const string Dial = "http://tizen.org/appcontrol/operation/dial";
+
+        /// <summary>
+        /// Performs a search.
+        /// </summary>
+        public const string Search = "http://tizen.org/appcontrol/operation/search";
+
+        /// <summary>
+        /// Downloads items.
+        /// </summary>
+        public const string Download = "http://tizen.org/appcontrol/operation/download";
+
+        /// <summary>
+        /// Prints contents.
+        /// </summary>
+        public const string Print = "http://tizen.org/appcontrol/operation/print";
+
+        /// <summary>
+        /// Composes a message.
+        /// </summary>
+        public const string Compose = "http://tizen.org/appcontrol/operation/compose";
+
+        /// <summary>
+        /// Can be launched by interested System-Event.
+        /// </summary>
+        public const string LaunchOnEvent = "http://tizen.org/appcontrol/operation/launch_on_event";
+
+        /// <summary>
+        /// Adds an item.
+        /// </summary>
+        public const string Add = "http://tizen.org/appcontrol/operation/add";
+
+        /// <summary>
+        /// Captures images by camera applications.
+        /// </summary>
+        public const string ImageCapture = "http://tizen.org/appcontrol/operation/image_capture";
+
+        /// <summary>
+        /// Captures videos by camera applications.
+        /// </summary>
+        public const string VideoCapture = "http://tizen.org/appcontrol/operation/video_capture";
+
+        /// <summary>
+        /// Shows system settings.
+        /// </summary>
+        public const string Setting = "http://tizen.org/appcontrol/operation/setting";
+
+        /// <summary>
+        /// Shows settings to enable Bluetooth.
+        /// </summary>
+        public const string SettingBluetoothEnable = "http://tizen.org/appcontrol/operation/setting/bt_enable";
+
+        /// <summary>
+        /// Shows settings to configure Bluetooth visibility.
+        /// </summary>
+        public const string SettingBluetoothVisibility = "http://tizen.org/appcontrol/operation/setting/bt_visibility";
+
+        /// <summary>
+        /// Shows settings to allow configuration of current location sources.
+        /// </summary>
+        public const string SettingLocation = "http://tizen.org/appcontrol/operation/setting/location";
+
+        /// <summary>
+        /// Shows NFC settings.
+        /// </summary>
+        public const string SettingNfc = "http://tizen.org/appcontrol/operation/setting/nfc";
+
+        /// <summary>
+        /// Shows settings to allow configuration of Wi-Fi.
+        /// </summary>
+        public const string SettingWifi = "http://tizen.org/appcontrol/operation/setting/wifi";
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs
new file mode 100755 (executable)
index 0000000..7318466
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Arguments for the event that raised when the application receives the AppControl.
+    /// </summary>
+    public class AppControlReceivedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Initializes AppControlReceivedEventArgs class.
+        /// </summary>
+        /// <param name="appControl"></param>
+        public AppControlReceivedEventArgs(ReceivedAppControl appControl)
+        {
+            ReceivedAppControl = appControl;
+        }
+
+        /// <summary>
+        /// The received AppControl.
+        /// </summary>
+        public ReceivedAppControl ReceivedAppControl { get; private set; }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs
new file mode 100755 (executable)
index 0000000..1a9c6c9
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Reply callback for the launch request
+    /// </summary>
+    /// <param name="launchRequest">The AppControl of the launch request that has been sent</param>
+    /// <param name="replyRequest">The AppControl in which the results of the callee are contained</param>
+    /// <param name="result">The result of the launch request</param>
+    public delegate void AppControlReplyCallback(AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result);
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs
new file mode 100755 (executable)
index 0000000..7fed628
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for App Control Result.
+    /// </summary>
+    public enum AppControlReplyResult
+    {
+        /// <summary>
+        /// Callee application launched actually
+        /// </summary>
+        AppStarted = 1,
+
+        /// <summary>
+        /// Operation is succeeded
+        /// </summary>
+        Succeeded = 0,
+
+        /// <summary>
+        /// Operation is failed by the callee
+        /// </summary>
+        Failed = -1,
+
+        /// <summary>
+        /// Operation is canceled by the platform
+        /// </summary>
+        Canceled = -2,
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Application.cs b/src/Tizen.Applications.Common/Tizen.Applications/Application.cs
new file mode 100755 (executable)
index 0000000..2049f57
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Class that represents a Tizen application.
+    /// </summary>
+    public abstract class Application : IDisposable
+    {
+        internal const string LogTag = "Tizen.Applications";
+
+        private static Application s_CurrentApplication = null;
+
+        private object _lock = new object();
+
+        private DirectoryInfo _directoryInfo;
+        private ApplicationInfo _applicationInfo;
+
+        /// <summary>
+        /// Gets the instance of current application.
+        /// </summary>
+        public static Application Current { get { return s_CurrentApplication; } }
+
+        /// <summary>
+        /// Gets the class representing directory information of current application.
+        /// </summary>
+        public DirectoryInfo DirectoryInfo
+        {
+            get
+            {
+                lock (_lock)
+                {
+                    if (_directoryInfo == null)
+                    {
+                        _directoryInfo = new DirectoryInfo();
+                    }
+                }
+                return _directoryInfo;
+            }
+        }
+
+        /// <summary>
+        /// Gets the class representing information of current application.
+        /// </summary>
+        public ApplicationInfo ApplicationInfo
+        {
+            get
+            {
+                lock (_lock)
+                {
+                    if (_applicationInfo == null)
+                    {
+                        string appId = string.Empty;
+                        Interop.AppCommon.AppGetId(out appId);
+                        if (!string.IsNullOrEmpty(appId))
+                        {
+                            _applicationInfo = new ApplicationInfo(appId);
+                        }
+                    }
+                }
+                return _applicationInfo;
+            }
+        }
+
+        /// <summary>
+        /// Runs the application's main loop.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public virtual void Run(string[] args)
+        {
+            if (args == null)
+            {
+                throw new ArgumentNullException("args");
+            }
+            s_CurrentApplication = this;
+        }
+
+        /// <summary>
+        /// Exits the main loop of application. 
+        /// </summary>
+        public abstract void Exit();
+
+        #region IDisposable Support
+        private bool _disposedValue = false; // To detect redundant calls
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                if (disposing)
+                {
+                    if (_applicationInfo != null)
+                    {
+                        _applicationInfo.Dispose();
+                    }
+                }
+
+                _disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Finalizer of the Application class.
+        /// </summary>
+        ~Application()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Releases all resources used by the Application class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+        #endregion
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs
new file mode 100644 (file)
index 0000000..5b185d3
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Arguments for the event that is raised when the application is disabled.
+    /// </summary>
+    public class ApplicationDisabledEventArgs : EventArgs
+    {
+        private readonly ApplicationEventState _eventState;
+        private readonly string _applicationId;
+
+        internal ApplicationDisabledEventArgs(string appId, ApplicationEventState eventState)
+        {
+            _applicationId = appId;
+            _eventState = eventState;
+        }
+
+        /// <summary>
+        /// The Id of the application
+        /// </summary>
+        public string ApplicationId { get { return _applicationId; } }
+
+        /// <summary>
+        /// The Event state of the application
+        /// </summary>
+        public ApplicationEventState EventState { get { return _eventState; } }
+    }
+}
+
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs
new file mode 100644 (file)
index 0000000..fa72e8a
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Arguments for the event that is raised when the application is enabled.
+    /// </summary>
+    public class ApplicationEnabledEventArgs : EventArgs
+    {
+        private readonly ApplicationEventState _eventState;
+        private readonly string _applicationId;
+
+        internal ApplicationEnabledEventArgs(string appId, ApplicationEventState eventState)
+        {
+            _applicationId = appId;
+            _eventState = eventState;
+        }
+
+        /// <summary>
+        /// The Id of the application
+        /// </summary>
+        public string ApplicationId { get { return _applicationId; } }
+
+        /// <summary>
+        /// The Event state of the application
+        /// </summary>
+        public ApplicationEventState EventState { get { return _eventState; } }
+    }
+}
+
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs
new file mode 100644 (file)
index 0000000..8ef9597
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration of the application event state
+    /// </summary>
+    public enum ApplicationEventState
+    {
+        /// <summary>
+        /// Processing Started.
+        /// </summary>
+        Started = Interop.ApplicationManager.AppManagerEventState.Started,
+        /// <summary>
+        /// Processing Completed.
+        /// </summary>
+        Completed = Interop.ApplicationManager.AppManagerEventState.Completed,
+        /// <summary>
+        /// Processing Failed.
+        /// </summary>
+        Failed = Interop.ApplicationManager.AppManagerEventState.Failed
+    }
+}
+
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs
new file mode 100755 (executable)
index 0000000..34d7b19
--- /dev/null
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provides methods and properties to get information of the application.
+    /// </summary>
+    public class ApplicationInfo : IDisposable
+    {
+        private const string LogTag = "Tizen.Applications";
+        private bool _disposed = false;
+        private IntPtr _infoHandle = IntPtr.Zero;
+        private string _applicationId = string.Empty;
+        private Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+
+        internal ApplicationInfo(IntPtr infoHandle)
+        {
+            err = Interop.ApplicationManager.AppInfoGetAppId(infoHandle, out _applicationId);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw new ArgumentException("Invalid native handle.");
+            }
+            _infoHandle = infoHandle;
+        }
+
+        /// <summary>
+        /// A constructor of ApplicationInfo that takes the application id.
+        /// </summary>
+        /// <param name="applicationId">application id.</param>
+        public ApplicationInfo(string applicationId)
+        {
+            _applicationId = applicationId;
+        }
+
+        /// <summary>
+        /// Destructor of the class
+        /// </summary>
+        ~ApplicationInfo()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets the application id.
+        /// </summary>
+        public string ApplicationId
+        {
+            get
+            {
+                if (!string.IsNullOrEmpty(_applicationId))
+                    return _applicationId;
+                IntPtr infoHandle = GetInfoHandle();
+                string appid = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetAppId(infoHandle, out appid);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the application id. err = " + err);
+                    }
+                }
+                return appid;
+            }
+        }
+
+        /// <summary>
+        /// Gets the package id of the application.
+        /// </summary>
+        public string PackageId
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                string packageid = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetPackage(infoHandle, out packageid);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the package id of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return packageid;
+            }
+        }
+
+        /// <summary>
+        /// Gets the label of the application.
+        /// </summary>
+        public string Label
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                string label = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetLabel(infoHandle, out label);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the app label of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return label;
+            }
+        }
+
+        /// <summary>
+        /// Gets the executable path of the application.
+        /// </summary>
+        public string ExecutablePath
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                string exec = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetExec(infoHandle, out exec);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the executable file path of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return exec;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the icon image.
+        /// </summary>
+        public string IconPath
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                string path = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetIcon(infoHandle, out path);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the app icon path of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Gets the application type name.
+        /// </summary>
+        public string ApplicationType
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                string type = string.Empty;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoGetType(infoHandle, out type);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the application type of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return type;
+            }
+        }
+
+        /// <summary>
+        /// Gets the application's metadata.
+        /// </summary>
+        public IDictionary<String, String> Metadata
+        {
+            get
+            {
+                IDictionary<string, string> metadata = new Dictionary<String, String>();
+
+                Interop.ApplicationManager.AppInfoMetadataCallback cb = (string key, string value, IntPtr userData) =>
+                {
+                    if (key.Length != 0)
+                    {
+                        metadata.Add(key, value);
+                    }
+                    return true;
+                };
+
+                IntPtr infoHandle = GetInfoHandle();
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoForeachMetadata(infoHandle, cb, IntPtr.Zero);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get application metadata of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return metadata;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether application information is nodisplay. If the application icon is not displayed on the menu screen, true; otherwise, false.
+        /// </summary>
+        public bool IsNoDisplay
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                bool nodisplay = false;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoIsNodisplay(infoHandle, out nodisplay);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the IsNoDisplay value of " + _applicationId + ". err = " + err);
+
+                    }
+                }
+                return nodisplay;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether application is launched on booting time. If the application will be automatically start on boot, true; otherwise, false.
+        /// </summary>
+        public bool IsOnBoot
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                bool onboot = false;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoIsOnBoot(infoHandle, out onboot);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the IsOnBoot value of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return onboot;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether application is preloaded. If the application is preloaded, true; otherwise, false.
+        /// </summary>
+        public bool IsPreload
+        {
+            get
+            {
+                IntPtr infoHandle = GetInfoHandle();
+                bool preloaded = false;
+                if (infoHandle != IntPtr.Zero)
+                {
+                    err = Interop.ApplicationManager.AppInfoIsPreLoad(infoHandle, out preloaded);
+                    if (err != Interop.ApplicationManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the IsPreload value of " + _applicationId + ". err = " + err);
+                    }
+                }
+                return preloaded;
+            }
+        }
+
+        /// <summary>
+        /// Gets the shared data path.
+        /// </summary>
+        public string SharedDataPath
+        {
+            get
+            {
+                string path = string.Empty;
+                err = Interop.ApplicationManager.AppManagerGetSharedDataPath(ApplicationId, out path);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the SharedDataPath of " + _applicationId + ". err = " + err);
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Gets the shared resource path.
+        /// </summary>
+        public string SharedResourcePath
+        {
+            get
+            {
+                string path = string.Empty;
+                err = Interop.ApplicationManager.AppManagerGetSharedResourcePath(ApplicationId, out path);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the SharedResourcePath of " + _applicationId + ". err = " + err);
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Gets the shared trust path.
+        /// </summary>
+        public string SharedTrustedPath
+        {
+            get
+            {
+                string path = string.Empty;
+                err = Interop.ApplicationManager.AppManagerGetSharedTrustedPath(ApplicationId, out path);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the SharedTrustedPath of " + _applicationId + ". err = " + err);
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Gets the external shared data path.
+        /// </summary>
+        public string ExternalSharedDataPath
+        {
+            get
+            {
+                string path = string.Empty;
+                err = Interop.ApplicationManager.AppManagerGetExternalSharedDataPath(ApplicationId, out path);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the ExternalSharedDataPath of " + _applicationId + ". err = " + err);
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Gets the localized label of application for the given locale.
+        /// </summary>
+        /// <param name="locale">locale.</param>
+        public string GetLocalizedLabel(string locale)
+        {
+            string label = string.Empty;
+            err = Interop.ApplicationManager.AppInfoGetLocaledLabel(ApplicationId, locale, out label);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get the GetLocalizedLabel of " + _applicationId + ". err = " + err);
+                label = Label;
+            }
+            return label;
+        }
+
+        private IntPtr GetInfoHandle()
+        {
+            if (_infoHandle == IntPtr.Zero)
+            {
+                IntPtr infoHandle = IntPtr.Zero;
+                err = Interop.ApplicationManager.AppManagerGetAppInfo(_applicationId, out infoHandle);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the handle of the ApplicationInfo. err = " + err);
+                }
+                _infoHandle = infoHandle;
+            }
+            return _infoHandle;
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ApplicationInfo class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+            if (disposing)
+            {
+            }
+            if (_infoHandle != IntPtr.Zero)
+            {
+                Interop.ApplicationManager.AppInfoDestroy(_infoHandle);
+                _infoHandle = IntPtr.Zero;
+            }
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs
new file mode 100755 (executable)
index 0000000..bba97b3
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class is a parameter of GetInstalledApplicationsAsync method.
+    /// </summary>
+    public class ApplicationInfoFilter
+    {
+        /// <summary>
+        ///
+        /// </summary>
+        public ApplicationInfoFilter()
+        {
+            Filter = new Dictionary<string, string>();
+        }
+
+        /// <summary>
+        /// This class is a possible key to use in the InstalledApplicationFilter.
+        /// </summary>
+        public static class Keys
+        {
+            /// <summary>
+            ///
+            /// </summary>
+            public const string Id = "PACKAGE_INFO_PROP_APP_ID";
+            /// <summary>
+            ///
+            /// </summary>
+            public const string Type = "PACKAGE_INFO_PROP_APP_TYPE";
+            /// <summary>
+            ///
+            /// </summary>
+            public const string Category = "PACKAGE_INFO_PROP_APP_CATEGORY";
+            /// <summary>
+            ///
+            /// </summary>
+            public const string NoDisplay = "PACKAGE_INFO_PROP_APP_NODISPLAY";
+            /// <summary>
+            ///
+            /// </summary>
+            public const string TaskManage = "PACKAGE_INFO_PROP_APP_TASKMANAGE";
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        public IDictionary<string, string> Filter
+        {
+            get; private set;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs
new file mode 100755 (executable)
index 0000000..b4bc005
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class is a parameter of GetInstalledApplicationsAsync method.
+    /// </summary>
+    public class ApplicationInfoMetadataFilter : ApplicationInfoFilter
+    {
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs
new file mode 100755 (executable)
index 0000000..7f9c4b7
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Arguments for the event that is raised when the application is launched.
+    /// </summary>
+    public class ApplicationLaunchedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The information of the application.
+        /// </summary>
+        public ApplicationRunningContext ApplicationRunningContext { get; internal set; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs
new file mode 100755 (executable)
index 0000000..adc70c3
--- /dev/null
@@ -0,0 +1,608 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class has the methods and events of the ApplicationManager.
+    /// </summary>
+    public static class ApplicationManager
+    {
+        private const string LogTag = "Tizen.Applications";
+        private static EventHandler<ApplicationLaunchedEventArgs> s_launchedHandler;
+        private static EventHandler<ApplicationTerminatedEventArgs> s_terminatedHandler;
+        private static Interop.ApplicationManager.AppManagerAppContextEventCallback s_applicationChangedEventCallback;
+        private static EventHandler<ApplicationEnabledEventArgs> _enabledHandler;
+        private static EventHandler<ApplicationDisabledEventArgs> _disabledHandler;
+        private static Interop.ApplicationManager.AppManagerEventCallback _eventCallback;
+        private static IntPtr _eventHandle = IntPtr.Zero;
+
+        /// <summary>
+        /// Occurs whenever the installed application is enabled.
+        /// </summary>
+        public static event EventHandler<ApplicationEnabledEventArgs> ApplicationEnabled
+        {
+            add
+            {
+                if (_enabledHandler == null && _disabledHandler == null)
+                {
+                    RegisterApplicationEvent();
+                }
+                _enabledHandler += value;
+            }
+            remove
+            {
+                _enabledHandler -= value;
+                if (_enabledHandler == null && _disabledHandler == null)
+                {
+                    UnRegisterApplicationEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Occurs whenever the installed application is disabled.
+        /// </summary>
+        public static event EventHandler<ApplicationDisabledEventArgs> ApplicationDisabled
+        {
+            add
+            {
+                if (_disabledHandler == null && _enabledHandler == null)
+                {
+                    RegisterApplicationEvent();
+                }
+                _disabledHandler += value;
+            }
+            remove
+            {
+                _disabledHandler -= value;
+                if (_disabledHandler == null && _enabledHandler == null)
+                {
+                    UnRegisterApplicationEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Occurs whenever the installed applications get launched.
+        /// </summary>
+        public static event EventHandler<ApplicationLaunchedEventArgs> ApplicationLaunched
+        {
+            add
+            {
+                if (s_launchedHandler == null && s_terminatedHandler == null)
+                {
+                    RegisterApplicationChangedEvent();
+                }
+                s_launchedHandler += value;
+            }
+            remove
+            {
+                s_launchedHandler -= value;
+                if (s_launchedHandler == null && s_terminatedHandler == null)
+                {
+                    UnRegisterApplicationChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Occurs whenever the installed applications get terminated.
+        /// </summary>
+        public static event EventHandler<ApplicationTerminatedEventArgs> ApplicationTerminated
+        {
+            add
+            {
+                if (s_launchedHandler == null && s_terminatedHandler == null)
+                {
+                    RegisterApplicationChangedEvent();
+                }
+                s_terminatedHandler += value;
+            }
+            remove
+            {
+                s_terminatedHandler -= value;
+                if (s_launchedHandler == null && s_terminatedHandler == null)
+                {
+                    UnRegisterApplicationChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the information of the installed applications asynchronously.
+        /// </summary>
+        public static async Task<IEnumerable<ApplicationInfo>> GetInstalledApplicationsAsync()
+        {
+            return await Task.Run(() =>
+            {
+                Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+                List<ApplicationInfo> result = new List<ApplicationInfo>();
+
+                Interop.ApplicationManager.AppManagerAppInfoCallback cb = (IntPtr infoHandle, IntPtr userData) =>
+                {
+                    if (infoHandle != IntPtr.Zero)
+                    {
+                        IntPtr clonedHandle = IntPtr.Zero;
+                        err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle);
+                        if (err != Interop.ApplicationManager.ErrorCode.None)
+                        {
+                            Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err);
+                            return false;
+                        }
+                        ApplicationInfo app = new ApplicationInfo(clonedHandle);
+                        result.Add(app);
+                        return true;
+                    }
+                    return false;
+                };
+                err = Interop.ApplicationManager.AppManagerForeachAppInfo(cb, IntPtr.Zero);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach the appinfo.");
+                }
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// Gets the information of the installed applications with the ApplicationInfoFilter asynchronously.
+        /// </summary>
+        /// <param name="filter">Key-value pairs for filtering.</param>
+        public static async Task<IEnumerable<ApplicationInfo>> GetInstalledApplicationsAsync(ApplicationInfoFilter filter)
+        {
+            return await Task.Run(() =>
+            {
+                List<ApplicationInfo> result = new List<ApplicationInfo>();
+
+                Interop.ApplicationManager.AppInfoFilterCallback cb = (IntPtr infoHandle, IntPtr userData) =>
+                {
+                    if (infoHandle != IntPtr.Zero)
+                    {
+                        IntPtr clonedHandle = IntPtr.Zero;
+                        Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle);
+                        if (err != Interop.ApplicationManager.ErrorCode.None)
+                        {
+                            Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err);
+                            return false;
+                        }
+                        ApplicationInfo app = new ApplicationInfo(clonedHandle);
+                        result.Add(app);
+                        return true;
+                    }
+                    return false;
+                };
+                filter.Fetch(cb);
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// Gets the information of the installed applications with the ApplicationInfoMetadataFilter asynchronously.
+        /// </summary>
+        /// <param name="filter">Key-value pairs for filtering.</param>
+        public static async Task<IEnumerable<ApplicationInfo>> GetInstalledApplicationsAsync(ApplicationInfoMetadataFilter filter)
+        {
+            return await Task.Run(() =>
+            {
+                List<ApplicationInfo> result = new List<ApplicationInfo>();
+
+                Interop.ApplicationManager.AppInfoFilterCallback cb = (IntPtr infoHandle, IntPtr userData) =>
+                {
+                    if (infoHandle != IntPtr.Zero)
+                    {
+                        IntPtr clonedHandle = IntPtr.Zero;
+                        Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle);
+                        if (err != Interop.ApplicationManager.ErrorCode.None)
+                        {
+                            Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err);
+                            return false;
+                        }
+                        ApplicationInfo app = new ApplicationInfo(clonedHandle);
+                        result.Add(app);
+                        return true;
+                    }
+                    return false;
+                };
+                filter.Fetch(cb);
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// Gets the information of the running applications asynchronously.
+        /// </summary>
+        public static async Task<IEnumerable<ApplicationRunningContext>> GetRunningApplicationsAsync()
+        {
+            return await Task.Run(() =>
+            {
+                Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+                List<ApplicationRunningContext> result = new List<ApplicationRunningContext>();
+
+                Interop.ApplicationManager.AppManagerAppContextCallback cb = (IntPtr contextHandle, IntPtr userData) =>
+                {
+                    if (contextHandle != IntPtr.Zero)
+                    {
+                        IntPtr clonedHandle = IntPtr.Zero;
+                        err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle);
+                        if (err != Interop.ApplicationManager.ErrorCode.None)
+                        {
+                            Log.Warn(LogTag, "Failed to clone the app context. err = " + err);
+                            return false;
+                        }
+                        ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle);
+                        result.Add(context);
+                        return true;
+                    }
+                    return false;
+                };
+
+                err = Interop.ApplicationManager.AppManagerForeachAppContext(cb, IntPtr.Zero);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach appcontext.");
+                }
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// Gets the information of the running applications including subapp asynchronously.
+        /// </summary>
+        public static async Task<IEnumerable<ApplicationRunningContext>> GetAllRunningApplicationsAsync()
+        {
+            return await Task.Run(() =>
+            {
+                Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+                List<ApplicationRunningContext> result = new List<ApplicationRunningContext>();
+
+                Interop.ApplicationManager.AppManagerAppContextCallback cb = (IntPtr contextHandle, IntPtr userData) =>
+                {
+                    if (contextHandle != IntPtr.Zero)
+                    {
+                        IntPtr clonedHandle = IntPtr.Zero;
+                        err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle);
+                        if (err != Interop.ApplicationManager.ErrorCode.None)
+                        {
+                            Log.Warn(LogTag, "Failed to clone the app context. err = " + err);
+                            return false;
+                        }
+                        ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle);
+                        result.Add(context);
+                        return true;
+                    }
+                    return false;
+                };
+
+                err = Interop.ApplicationManager.AppManagerForeachRunningAppContext(cb, IntPtr.Zero);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach appcontext.");
+                }
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// Gets the information of the specified application with the application id.
+        /// </summary>
+        /// <param name="applicationId">Application id.</param>
+        public static ApplicationInfo GetInstalledApplication(string applicationId)
+        {
+            IntPtr infoHandle = IntPtr.Zero;
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppManagerGetAppInfo(applicationId, out infoHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to get the installed application information of " + applicationId + ".");
+            }
+            ApplicationInfo app = new ApplicationInfo(infoHandle);
+            return app;
+        }
+
+        /// <summary>
+        /// Returns if the specified application is running or not.
+        /// </summary>
+        /// <param name="applicationId">The application Id.</param>
+        /// <returns>Returns true if the given application is running, otherwise false.</returns>
+        /// <exception cref="ArgumentException">Thrown when the given parameter is invalid.</exception>
+        public static bool IsRunning(string applicationId)
+        {
+            bool isRunning = false;
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppManagerIsRunning(applicationId, out isRunning);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(Interop.ApplicationManager.ErrorCode.InvalidParameter, "Invalid parameter");
+            }
+            return isRunning;
+        }
+
+        private static void RegisterApplicationChangedEvent()
+        {
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+            s_applicationChangedEventCallback = (IntPtr contextHandle, Interop.ApplicationManager.AppContextEvent state, IntPtr userData) =>
+            {
+                if (contextHandle == IntPtr.Zero) return;
+
+                IntPtr clonedHandle = IntPtr.Zero;
+                err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to register the application context event.");
+                }
+                using (ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle))
+                {
+                    if (state == Interop.ApplicationManager.AppContextEvent.Launched)
+                    {
+                        s_launchedHandler?.Invoke(null, new ApplicationLaunchedEventArgs { ApplicationRunningContext = context });
+                    }
+                    else if (state == Interop.ApplicationManager.AppContextEvent.Terminated)
+                    {
+                        s_terminatedHandler?.Invoke(null, new ApplicationTerminatedEventArgs { ApplicationRunningContext = context });
+                    }
+                }
+            };
+            err = Interop.ApplicationManager.AppManagerSetAppContextEvent(s_applicationChangedEventCallback, IntPtr.Zero);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to register the application context event.");
+            }
+        }
+
+        private static void UnRegisterApplicationChangedEvent()
+        {
+            Interop.ApplicationManager.AppManagerUnSetAppContextEvent();
+        }
+
+        private static void RegisterApplicationEvent()
+        {
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+            err = Interop.ApplicationManager.AppManagerEventCreate(out _eventHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the application event handle");
+            }
+
+            err = Interop.ApplicationManager.AppManagerEventSetStatus(_eventHandle, Interop.ApplicationManager.AppManagerEventStatusType.All);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle);
+                _eventHandle = IntPtr.Zero;
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to set the application event");
+            }
+
+            _eventCallback = (string appType, string appId, Interop.ApplicationManager.AppManagerEventType eventType, Interop.ApplicationManager.AppManagerEventState eventState, IntPtr eventHandle, IntPtr UserData) =>
+            {
+                if (eventType == Interop.ApplicationManager.AppManagerEventType.Enable)
+                {
+                    _enabledHandler?.Invoke(null, new ApplicationEnabledEventArgs(appId, (ApplicationEventState)eventState));
+                }
+                else if (eventType == Interop.ApplicationManager.AppManagerEventType.Disable)
+                {
+                    _disabledHandler?.Invoke(null, new ApplicationDisabledEventArgs(appId, (ApplicationEventState)eventState));
+                }
+            };
+            err = Interop.ApplicationManager.AppManagerSetEventCallback(_eventHandle, _eventCallback, IntPtr.Zero);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle);
+                _eventHandle = IntPtr.Zero;
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to set the application event callback");
+            }
+        }
+
+        private static void UnRegisterApplicationEvent()
+        {
+            if (_eventHandle != IntPtr.Zero)
+            {
+                Interop.ApplicationManager.AppManagerUnSetEventCallback(_eventHandle);
+                Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle);
+                _eventHandle = IntPtr.Zero;
+            }
+        }
+
+        /// <summary>
+        /// Gets the information of the recent applications.
+        /// </summary>
+        /// <returns>Returns a dictionary containing all recent application info.</returns>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid operation</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static IEnumerable<RecentApplicationInfo> GetRecentApplications()
+        {
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+
+            List<RecentApplicationInfo> result = new List<RecentApplicationInfo>();
+            IntPtr table;
+            int nrows, ncols;
+
+            err = Interop.ApplicationManager.RuaHistoryLoadDb(out table, out nrows, out ncols);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to load a table for the recent application list.");
+            }
+
+            for (int row = 0; row < nrows; ++row)
+            {
+                Interop.ApplicationManager.RuaRec record;
+
+                err = Interop.ApplicationManager.RuaHistoryGetRecord(out record, table, nrows, ncols, row);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to get record.");
+                }
+
+                RecentApplicationInfo info = new RecentApplicationInfo(record);
+                result.Add(info);
+            }
+
+            err = Interop.ApplicationManager.RuaHistoryUnLoadDb(ref table);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to unload a table for the recent application list.");
+            }
+
+            return result;
+        }
+    }
+
+    internal static class FilterExtension
+    {
+        private const string LogTag = "Tizen.Applications";
+        internal static void Fetch(this ApplicationInfoFilter filter, Interop.ApplicationManager.AppInfoFilterCallback callback)
+        {
+            if (filter is ApplicationInfoMetadataFilter)
+            {
+                ApplicationInfoMetadataFilter metaFilter = (ApplicationInfoMetadataFilter)filter;
+                metaFilter.Fetch(callback);
+                return;
+            }
+
+            IntPtr nativeHandle = MakeNativeAppInfoFilter(filter.Filter);
+            if (nativeHandle == IntPtr.Zero)
+            {
+                throw ApplicationManagerErrorFactory.NativeFilterHandleIsInvalid();
+            }
+            try
+            {
+                Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoFilterForeachAppinfo(nativeHandle, callback, IntPtr.Zero);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to get application information list with filter.");
+                }
+            }
+            finally
+            {
+                Interop.ApplicationManager.AppInfoFilterDestroy(nativeHandle);
+            }
+        }
+
+        internal static void Fetch(this ApplicationInfoMetadataFilter filter, Interop.ApplicationManager.AppInfoFilterCallback callback)
+        {
+            IntPtr nativeHandle = MakeNativeAppMetadataFilter(filter.Filter);
+            if (nativeHandle == IntPtr.Zero)
+            {
+                throw ApplicationManagerErrorFactory.NativeFilterHandleIsInvalid();
+            }
+            try
+            {
+                Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoMetadataFilterForeach(nativeHandle, callback, IntPtr.Zero);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to get metadata list with filter.");
+                }
+            }
+            finally
+            {
+                Interop.ApplicationManager.AppInfoMetadataFilterDestroy(nativeHandle);
+            }
+        }
+
+        private static IntPtr MakeNativeAppInfoFilter(IDictionary<string, string> filter)
+        {
+            if (filter == null || filter.Count == 0)
+            {
+                throw ApplicationManagerErrorFactory.FilterIsInvalid();
+            }
+
+            IntPtr infoHandle = IntPtr.Zero;
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoFilterCreate(out infoHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the filter handle.");
+            }
+
+            foreach (var item in filter)
+            {
+                if ((item.Key == ApplicationInfoFilter.Keys.Id) ||
+                    (item.Key == ApplicationInfoFilter.Keys.Type) ||
+                    (item.Key == ApplicationInfoFilter.Keys.Category))
+                {
+                    err = Interop.ApplicationManager.AppInfoFilterAddString(infoHandle, item.Key, item.Value);
+                }
+                else if ((item.Key == ApplicationInfoFilter.Keys.NoDisplay) ||
+                         (item.Key == ApplicationInfoFilter.Keys.TaskManage))
+                {
+                    err = Interop.ApplicationManager.AppInfoFilterAddBool(infoHandle, item.Key, Convert.ToBoolean(item.Value));
+                }
+                else
+                {
+                    Log.Warn(LogTag, string.Format("'{0}' is not supported key for the filter.", item.Key));
+                }
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Interop.ApplicationManager.AppInfoFilterDestroy(infoHandle);
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to add item to the filter.");
+                }
+            }
+            return infoHandle;
+        }
+
+        private static IntPtr MakeNativeAppMetadataFilter(IDictionary<string, string> filter)
+        {
+            if (filter == null || filter.Count == 0)
+            {
+                throw ApplicationManagerErrorFactory.FilterIsInvalid();
+            }
+
+            IntPtr infoHandle = IntPtr.Zero;
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoMetadataFilterCreate(out infoHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the filter for searching with metadata.");
+            }
+            foreach (var item in filter)
+            {
+                err = Interop.ApplicationManager.AppInfoMetadataFilterAdd(infoHandle, item.Key, item.Value);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Interop.ApplicationManager.AppInfoMetadataFilterDestroy(infoHandle);
+                    throw ApplicationManagerErrorFactory.GetException(err, "Failed to add the item to the filter.");
+                }
+            }
+            return infoHandle;
+        }
+    }
+
+    internal static class ApplicationManagerErrorFactory
+    {
+        internal static Exception NativeFilterHandleIsInvalid()
+        {
+            return new InvalidOperationException("The native handle for filtering is invalid.");
+        }
+
+        internal static Exception FilterIsInvalid()
+        {
+            return new ArgumentException("The filter is invalid.");
+        }
+
+        internal static Exception GetException(Interop.ApplicationManager.ErrorCode err, string message)
+        {
+            string errMessage = String.Format("{0} err = {1}", message, err);
+            switch (err)
+            {
+                case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+                    return new ArgumentException(errMessage);
+                default:
+                    return new InvalidOperationException(errMessage);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs
new file mode 100644 (file)
index 0000000..0220424
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provides methods and properties to get information of the application.
+    /// </summary>
+    public class ApplicationRunningContext : IDisposable
+    {
+        private const string LogTag = "Tizen.Applications";
+        private bool _disposed = false;
+        private IntPtr _contextHandle = IntPtr.Zero;
+        private Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+
+        internal ApplicationRunningContext(IntPtr contextHandle)
+        {
+            _contextHandle = contextHandle;
+        }
+
+        /// <summary>
+        /// A constructor of ApplicationRunningContext that takes the application id.
+        /// </summary>
+        /// <param name="applicationId">application id.</param>
+        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of application not exist error or system error.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
+        public ApplicationRunningContext(string applicationId)
+        {
+            IntPtr contextHandle = IntPtr.Zero;
+            err = Interop.ApplicationManager.AppManagerGetAppContext(applicationId, out contextHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get the handle of the ApplicationRunningContext. err = " + err);
+                switch (err)
+                {
+                    case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid Parameter.");
+                    case Interop.ApplicationManager.ErrorCode.NoSuchApp:
+                        throw new InvalidOperationException("No such application.");
+                    case Interop.ApplicationManager.ErrorCode.OutOfMemory:
+                        throw new OutOfMemoryException("Out of memory");
+                    default:
+                        throw new InvalidOperationException("Invalid Operation.");
+                }
+            }
+            _contextHandle = contextHandle;
+        }
+
+        /// <summary>
+        /// A constructor of ApplicationRunningContext that takes the application id.
+        /// </summary>
+        /// <param name="applicationId">application id.</param>
+        /// <param name="instanceId">instance id.</param>
+        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of application not exist error or system error.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ApplicationRunningContext(string applicationId, string instanceId)
+        {
+            IntPtr contextHandle = IntPtr.Zero;
+            err = Interop.ApplicationManager.AppManagerGetAppContextByInstanceId(applicationId, instanceId, out contextHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get the handle of the ApplicationRunningContext. err = " + err);
+                switch (err)
+                {
+                    case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid Parameter.");
+                    case Interop.ApplicationManager.ErrorCode.NoSuchApp:
+                        throw new InvalidOperationException("No such application.");
+                    case Interop.ApplicationManager.ErrorCode.OutOfMemory:
+                        throw new OutOfMemoryException("Out of memory");
+                    default:
+                        throw new InvalidOperationException("Invalid Operation.");
+                }
+            }
+            _contextHandle = contextHandle;
+        }
+
+        /// <summary>
+        /// Destructor of the class
+        /// </summary>
+        ~ApplicationRunningContext()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Enumeration for the Application State.
+        /// </summary>
+        public enum AppState
+        {
+            /// <summary>
+            /// The undefined state
+            /// </summary>
+            Undefined = 0,
+
+            /// <summary>
+            /// The UI application is running in the foreground.
+            /// </summary>
+            Foreground,
+
+            /// <summary>
+            /// The UI application is running in the background.
+            /// </summary>
+            Background,
+
+            /// <summary>
+            /// The Service application is running.
+            /// </summary>
+            Service,
+
+            /// <summary>
+            /// The application is terminated.
+            /// </summary>
+            Terminated,
+        }
+
+        /// <summary>
+        /// Gets the application id.
+        /// </summary>
+        public string ApplicationId
+        {
+            get
+            {
+                string appid = string.Empty;
+                err = Interop.ApplicationManager.AppContextGetAppId(_contextHandle, out appid);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the application id. err = " + err);
+                }
+                return appid;
+            }
+        }
+
+        /// <summary>
+        /// Gets the package id of the application.
+        /// </summary>
+        public string PackageId
+        {
+            get
+            {
+                string packageid = string.Empty;
+                err = Interop.ApplicationManager.AppContextGetPackageId(_contextHandle, out packageid);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the package id. err = " + err);
+                }
+                return packageid;
+            }
+        }
+
+        /// <summary>
+        /// Gets the application's process id.
+        /// </summary>
+        public int ProcessId
+        {
+            get
+            {
+                int pid = 0;
+                err = Interop.ApplicationManager.AppContextGetPid(_contextHandle, out pid);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the process id. err = " + err);
+                }
+                return pid;
+            }
+        }
+
+        /// <summary>
+        /// Gets the state of the application.
+        /// </summary>
+        public AppState State
+        {
+            get
+            {
+                int state = 0;
+
+                err = Interop.ApplicationManager.AppContextGetAppState(_contextHandle, out state);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the application state. err = " + err);
+                }
+                return (AppState)state;
+            }
+        }
+
+        /// <summary>
+        /// Gets whether the application is sub application of the application group.
+        /// </summary>
+        public bool IsSubApp
+        {
+            get
+            {
+                bool subapp = false;
+                err = Interop.ApplicationManager.AppContextIsSubApp(_contextHandle, out subapp);
+                if (err != Interop.ApplicationManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the IsSubApp value. err = " + err);
+                }
+                return subapp;
+            }
+        }
+
+        /// <summary>
+        /// Terminates the application.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of permission denied or system error.</exception>
+        /// <privilege>http://tizen.org/privilege/appmanager.kill</privilege>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Terminate()
+        {
+            err = Interop.ApplicationManager.AppManagerTerminateApp(_contextHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                switch (err)
+                {
+                    case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid argument.");
+                    case Interop.ApplicationManager.ErrorCode.PermissionDenied:
+                        throw new InvalidOperationException("Permission denied.");
+                    default:
+                        throw new InvalidOperationException("Invalid Operation.");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ApplicationRunningContext class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (_contextHandle != IntPtr.Zero)
+            {
+                Interop.ApplicationManager.AppContextDestroy(_contextHandle);
+                _contextHandle = IntPtr.Zero;
+            }
+            _disposed = true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs
new file mode 100755 (executable)
index 0000000..622dc91
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Arguments for the event that is raised when the application is terminated.
+    /// </summary>
+    public class ApplicationTerminatedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The information of the application.
+        /// </summary>
+        public ApplicationRunningContext ApplicationRunningContext { get; internal set; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs
new file mode 100755 (executable)
index 0000000..857c3a7
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for applications type.
+    /// </summary>
+    public enum ApplicationType
+    {
+        /// <summary>
+        /// All applications.
+        /// </summary>
+        All = 0,
+        /// <summary>
+        /// UI applications.
+        /// </summary>
+        Ui = 1,
+        /// <summary>
+        /// Service applications.
+        /// </summary>
+        Service = 2
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs
new file mode 100755 (executable)
index 0000000..1b56e8e
--- /dev/null
@@ -0,0 +1,714 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// A Bundle object represents a bundle.
+    /// A bundle holds items (key-value pairs) and can be used with other Tizen APIs.
+    /// Keys can be used to access values.
+    /// This class is accessed by using a constructor to create a new instance of this object.
+    /// A bundle instance is not guaranteed to be thread safe if the instance is modified by multiple threads.
+    /// </summary>
+    public class Bundle : IDisposable
+    {
+        private SafeBundleHandle _handle;
+        private bool _disposed = false;
+        private readonly HashSet<string> _keys;
+
+        /// <summary>
+        /// The Bundle constructor.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// </code>
+        public Bundle()
+        {
+            _handle = Interop.Bundle.Create();
+            BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle);
+            _keys = new HashSet<string>();
+        }
+
+        /// <summary>
+        /// The Bundle constructor.
+        /// </summary>
+        /// <param name="handle">The SafeBundleHandle instance.</param>
+        /// <exception cref="System.ArgumentNullException">Thrown when the handle is null or invalid.</exception>
+        public Bundle(SafeBundleHandle handle)
+        {
+            if (handle == null || handle.IsInvalid)
+            {
+                throw new ArgumentNullException("handle");
+            }
+
+            _handle = Interop.Bundle.DangerousClone(handle.DangerousGetHandle());
+            _keys = new HashSet<string>();
+            Interop.Bundle.Iterator iterator = (string key, int type, IntPtr keyval, IntPtr userData) =>
+            {
+                _keys.Add(key);
+            };
+
+            Interop.Bundle.Foreach(_handle, iterator, IntPtr.Zero);
+            if ((BundleErrorFactory.BundleError)ErrorFacts.GetLastResult() == BundleErrorFactory.BundleError.InvalidParameter)
+            {
+                throw new ArgumentException("Invalid parameter - cannot create bundle instance");
+            }
+        }
+
+        private enum BundleTypeProperty
+        {
+            Array = 0x0100,
+            Primitive = 0x0200,
+            Measurable = 0x0400
+        }
+
+        private enum BundleType
+        {
+            None = -1,
+            Any = 0,
+            String = 1 | BundleTypeProperty.Measurable,
+            StringArray = String | BundleTypeProperty.Array | BundleTypeProperty.Measurable,
+            Byte = 2,
+            ByteArray = Byte | BundleTypeProperty.Array
+        }
+
+        /// <summary>
+        /// The number of items in a Bundle object.
+        /// </summary>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// Console.WriteLine("There are {0} items in the bundle", bundle.Count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _keys.Count;
+            }
+        }
+
+        /// <summary>
+        /// The keys in a Bundle object.
+        /// </summary>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string1", "a_string1");
+        /// bundle.AddItem("string2", "a_string2");
+        /// bundle.AddItem("string3", "a_string3");
+        /// Console.WriteLine("The bundle contains the following keys:");
+        /// foreach(string key in bundle.Keys)
+        /// {
+        ///     Console.WriteLine(key);
+        /// }
+        /// </code>
+        public IEnumerable<string> Keys
+        {
+            get
+            {
+                return _keys;
+            }
+        }
+
+        /// <summary>
+        /// Gets the SafeBundleHandle instance.
+        /// </summary>
+        public SafeBundleHandle SafeBundleHandle
+        {
+            get { return _handle; }
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Checks whether the bundle contains an item with a specified key.
+        /// </summary>
+        /// <param name="key">The key to check for.</param>
+        /// <returns>true if the bundle contains the key. false otherwise.</returns>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// if (bundle.Contains("string"))
+        /// {
+        ///     string aValue = bundle.GetItem<string>("string");
+        ///     Console.WriteLine(aValue);
+        /// }
+        /// </code>
+        public bool Contains(string key)
+        {
+            return _keys.Contains(key);
+        }
+
+        /// <summary>
+        /// Adds an item into the bundle.
+        /// </summary>
+        /// <param name="key">The key to identify the item with. If an item with the key already exists in the Bundle, this method will not succeed.</param>
+        /// <param name="value">The value of the item.</param>
+        /// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+        /// bundle.AddItem("byte_array", byteArray);
+        /// </code>
+        public void AddItem(string key, byte[] value)
+        {
+            if (value == null)
+            {
+                throw new ArgumentNullException("value");
+            }
+            AddItem(key, value, 0, value.Length);
+        }
+
+        /// <summary>
+        /// Adds an item into the bundle.
+        /// </summary>
+        /// <param name="key">The key to identify the item with. If an item with the key already exists in the Bundle, this method will not succeed.</param>
+        /// <param name="value">The value of the item.</param>
+        /// <param name="offset">The zero-based byte offset in value from which to add to the bundle.</param>
+        /// <param name="count">The maximum number of bytes to add to the bundle starting with offset.</param>
+        /// <exception cref="System.ArgumentOutOfRangeException">Thrown when the offset or count is out of range.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+        /// bundle.AddItem("byte_array", byteArray, 2, 3);
+        /// </code>
+        public void AddItem(string key, byte[] value, int offset, int count)
+        {
+            if (!_keys.Contains(key))
+            {
+                if (value == null)
+                {
+                    throw new ArgumentNullException("value");
+                }
+                if (offset < 0)
+                {
+                    throw new ArgumentOutOfRangeException("offset", offset, "Cannot be less than 0");
+                }
+                if (offset > value.Length - 1)
+                {
+                    throw new ArgumentOutOfRangeException("offset", offset, "Greater than last index of array");
+                }
+                if (count < 1)
+                {
+                    throw new ArgumentOutOfRangeException("count", count, "Must be at least 1");
+                }
+                if (offset + count > value.Length)
+                {
+                    throw new ArgumentException("The count is too large for the specified offset");
+                }
+                // Code is in Interop file because it is unsafe
+                int ret = Interop.Bundle.UnsafeCode.AddItem(_handle, key, value, offset, count);
+                BundleErrorFactory.CheckAndThrowException(ret, _handle);
+                _keys.Add(key);
+            }
+            else
+            {
+                throw new ArgumentException("Key already exists", "key");
+            }
+        }
+
+        /// <summary>
+        /// Adds an item into the bundle.
+        /// </summary>
+        /// <param name="key">The key to identify the item with. If an item with the key already exists in the Bundle, this method will not succeed.</param>
+        /// <param name="value">The value of the item.</param>
+        /// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// </code>
+        public void AddItem(string key, string value)
+        {
+            if (!_keys.Contains(key))
+            {
+                int ret = Interop.Bundle.AddString(_handle, key, value);
+                BundleErrorFactory.CheckAndThrowException(ret, _handle);
+                _keys.Add(key);
+            }
+            else
+            {
+                throw new ArgumentException("Key already exists", "key");
+            }
+        }
+
+        /// <summary>
+        /// Adds an item into the bundle.
+        /// </summary>
+        /// <param name="key">The key to identify the item with. If an item with the key already exists in the Bundle, this method will not succeed.</param>
+        /// <param name="value">The value of the item.</param>
+        /// <exception cref="System.ArgumentException">Thrown when the key already exists or when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string[] stringArray = { "a", "b", "c" };
+        /// bundle.AddItem("string_array", stringArray);
+        /// </code>
+        public void AddItem(string key, IEnumerable<string> value)
+        {
+            if (!_keys.Contains(key))
+            {
+                string[] valueArray = value.Select(v => v == null ? string.Empty : v).ToArray();
+                int ret = Interop.Bundle.AddStringArray(_handle, key, valueArray, valueArray.Count());
+                BundleErrorFactory.CheckAndThrowException(ret, _handle);
+                _keys.Add(key);
+            }
+            else
+            {
+                throw new ArgumentException("Key already exists", "key");
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of a bundle item with a specified key.
+        /// </summary>
+        /// <param name="key">The key of the bundle item whose value is desired.</param>
+        /// <returns>The value of the bundle item.</returns>
+        /// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// if (bundle.Contains("string"))
+        /// {
+        ///     object aValue = bundle.GetItem("string");
+        ///     if (bundle.Is<string>("string");)
+        ///     {
+        ///         string aString = (string)aValue;
+        ///         Console.WriteLine(aString);
+        ///     }
+        /// }
+        /// </code>
+        public object GetItem(string key)
+        {
+            if (_keys.Contains(key))
+            {
+                int type = Interop.Bundle.GetType(_handle, key);
+                BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle);
+                switch (type)
+                {
+                    case (int)BundleType.String:
+                        // get string
+                        IntPtr stringPtr;
+                        int retString = Interop.Bundle.GetString(_handle, key, out stringPtr);
+                        BundleErrorFactory.CheckAndThrowException(retString, _handle);
+                        string stringValue = Marshal.PtrToStringAnsi(stringPtr);
+                        if (stringValue == null)
+                            return string.Empty;
+                        return stringValue;
+
+                    case (int)BundleType.StringArray:
+                        // get string array
+                        int stringArraySize;
+                        IntPtr stringArrayPtr = Interop.Bundle.GetStringArray(_handle, key, out stringArraySize);
+                        BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle);
+                        string[] stringArray;
+                        IntPtrToStringArray(stringArrayPtr, stringArraySize, out stringArray);
+                        return stringArray;
+
+                    case (int)BundleType.Byte:
+                        // get byte array
+                        IntPtr byteArrayPtr;
+                        int byteArraySize;
+                        int retByte = Interop.Bundle.GetByte(_handle, key, out byteArrayPtr, out byteArraySize);
+                        BundleErrorFactory.CheckAndThrowException(retByte, _handle);
+                        byte[] byteArray = new byte[byteArraySize];
+                        Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize);
+                        return byteArray;
+
+                    default:
+                        throw new ArgumentException("Key does not exist in the bundle", "key");
+                }
+            }
+            else
+            {
+                throw new ArgumentException("Key does not exist in the bundle (may be null or empty string)", "key");
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of a bundle item with a specified key.
+        /// Note that this is a generic method.
+        /// </summary>
+        /// <typeparam name="T">The generic type to return.</typeparam>
+        /// <param name="key">The key of the bundle item whose value is desired.</param>
+        /// <returns>The value of the bundle item if it is of the specified generic type.</returns>
+        /// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidCastException">Thrown when the value of the bundle item cannot be converted to the specified generic type.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string[] stringArray = { "a", "b", "c" };
+        /// bundle.AddItem("string_array", stringArray);
+        /// if (bundle.Is<string>("string_array"))
+        /// {
+        ///     Console.WriteLine("It is a string");
+        ///     Console.WriteLine(bundle.GetItem<string>("string_array"));
+        /// }
+        /// else if (bundle.Is<string[]>("string_array"))
+        /// {
+        ///     Console.WriteLine("It is a string[]");
+        ///     string[] anArray = bundle.GetItem<string[]>("string_array");
+        ///     foreach (string value in anArray)
+        ///     {
+        ///         Console.WriteLine(value);
+        ///     }
+        /// }
+        /// </code>
+        public T GetItem<T>(string key)
+        {
+            return (T)GetItem(key);
+        }
+
+        /// <summary>
+        /// Gets the value of a bundle item with a specified key.
+        /// </summary>
+        /// <param name="key">The key of the bundle item whose value is desired.</param>
+        /// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
+        /// <returns>true if an item with the key exists and if the value is the same type as the output value parameter. false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// byte[] byteArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+        /// bundle.AddItem("byte_array", byteArray);
+        /// byte[] aByteArray;
+        /// if (bundle.TryGetItem("byte_array", out aByteArray))
+        /// {
+        ///     Console.WriteLine("First item in the byte array: {0}", aByteArray[0]);
+        /// }
+        /// </code>
+        public bool TryGetItem(string key, out byte[] value)
+        {
+            if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.Byte)
+            {
+                value = GetItem<byte[]>(key);
+                return true;
+            }
+            else
+            {
+                if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter)
+                {
+                    throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)");
+                }
+                value = default(byte[]);
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of a bundle item with a specified key.
+        /// </summary>
+        /// <param name="key">The key of the bundle item whose value is desired.</param>
+        /// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
+        /// <returns>true if an item with the key exists and if the value is the same type as the output value parameter. false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// string aString;
+        /// if (bundle.TryGetItem("string", out aString))
+        /// {
+        ///     Console.WriteLine(aString);
+        /// }
+        /// </code>
+        public bool TryGetItem(string key, out string value)
+        {
+            if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.String)
+            {
+                value = GetItem<string>(key);
+                return true;
+            }
+            else
+            {
+                if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter)
+                {
+                    throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)");
+                }
+                value = default(string);
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of a bundle item with a specified key.
+        /// </summary>
+        /// <param name="key">The key of the bundle item whose value is desired.</param>
+        /// <param name="value">The value of the bundle item. If the key does not exist or the type of this parameter is incorrect, it is the default value for the value parameter type.</param>
+        /// <returns>true if an item with the key exists and if the value is the same type as the output value parameter. false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string[] stringArray = { "a", "b", "c" };
+        /// bundle.AddItem("string_array", stringArray);
+        /// System.Collections.Generic.IEnumerable<string> aStringEnumerable;
+        /// if (bundle.TryGetItem("string", out aStringEnumerable))
+        /// {
+        ///     foreach (string value in aStringEnumerable)
+        ///     {
+        ///         Console.WriteLine(value);
+        ///     }
+        /// }
+        /// </code>
+        public bool TryGetItem(string key, out IEnumerable<string> value)
+        {
+            if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.StringArray)
+            {
+                value = GetItem<IEnumerable<string>>(key);
+                return true;
+            }
+            else
+            {
+                if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter)
+                {
+                    throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)");
+                }
+                value = default(IEnumerable<string>);
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether an item is of a specific type.
+        /// </summary>
+        /// <typeparam name="T">The generic type to check for.</typeparam>
+        /// <param name="key">The key whose type wants to be checked.</param>
+        /// <returns>true if the item is of the specified type. false otherwise.</returns>
+        /// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string[] stringArray = { "a", "b", "c" };
+        /// bundle.AddItem("string_array", stringArray);
+        /// if (bundle.Is<string[]>("string_array"))
+        /// {
+        ///     Console.WriteLine("It is a string[]");
+        ///     string[] anArray = bundle.GetItem<string[]>("string_array");
+        ///     foreach (string value in anArray)
+        ///     {
+        ///         Console.WriteLine(value);
+        ///     }
+        /// }
+        /// </code>
+        public bool Is<T>(string key)
+        {
+            if (_keys.Contains(key))
+            {
+                int type = Interop.Bundle.GetType(_handle, key);
+                switch (type)
+                {
+                    case (int)BundleType.String:
+                        return typeof(string) == typeof(T);
+
+                    case (int)BundleType.StringArray:
+                        return typeof(T).GetTypeInfo().IsAssignableFrom(typeof(string[]).GetTypeInfo());
+
+                    case (int)BundleType.Byte:
+                        return typeof(byte[]) == typeof(T);
+
+                    default:
+                        throw new ArgumentException("Key does not exist in the bundle", "key");
+                }
+            }
+            else
+            {
+                throw new ArgumentException("Key does not exist in the bundle (may be null or empty string)", "key");
+            }
+        }
+
+        /// <summary>
+        /// Removes a a bundle item with a specific key from a Bundle.
+        /// </summary>
+        /// <param name="key">The key of the item to delete.</param>
+        /// <returns>true if the item is successfully found and removed. false otherwise (even if the item is not found).</returns>
+        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// bundle.AddItem("string", "a_string");
+        /// if (bundle.Contains("string"))
+        /// {
+        ///     if (bundle.RemoveItem("string"))
+        ///     {
+        ///         Console.WriteLine("Removed");
+        ///     }
+        /// }
+        /// </code>
+        public bool RemoveItem(string key)
+        {
+            if (_keys.Contains(key))
+            {
+                int ret = Interop.Bundle.RemoveItem(_handle, key);
+                if (ret == (int)BundleErrorFactory.BundleError.KeyNotAvailable)
+                {
+                    return false;
+                }
+                BundleErrorFactory.CheckAndThrowException(ret, _handle);
+                _keys.Remove(key);
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Decodes an encoded bundle data.
+        /// </summary>
+        /// <param name="bundleRaw">The encoded bundle data. bundleRaw should be return value of Tizen.Applications.Bundle.Encode, otherwise this method will not succeed</param>
+        /// <returns>Decoded Bundle object.</returns>
+        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string bundleRaw = bundle.Encode();
+        /// Bundle data = bundle.Decode(bundleRaw);
+        /// </code>
+        public static Bundle Decode(string bundleRaw)
+        {
+            SafeBundleHandle handle;
+
+            handle = Interop.Bundle.BundleDecode(bundleRaw, bundleRaw.Length);
+            if (ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter)
+            {
+                throw new ArgumentException("Invalid bundle raw");
+            }
+
+            return new Bundle(handle);
+        }
+
+        /// <summary>
+        /// Encodes bundle to string.
+        /// </summary>
+        /// <returns>Encoded Bundle data in string.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when out of memory or when the Bundle instance has been disposed.</exception>
+        /// <code>
+        /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+        /// string bundleRaw = bundle.Encode();
+        /// </code>
+        public string Encode()
+        {
+            string bundleRaw;
+            int len;
+
+            Interop.Bundle.BundleEncode(_handle, out bundleRaw, out len);
+            if (ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter)
+            {
+                throw new InvalidOperationException("Invalid bundle");
+            }
+
+            return bundleRaw;
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (disposing)
+                {
+                    if (_handle != null && !_handle.IsInvalid)
+                        _handle.Dispose();
+                }
+
+                _disposed = true;
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the Bundle class.
+        /// </summary>
+        ~Bundle()
+        {
+            Dispose(false);
+        }
+
+        static private void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray)
+        {
+            managedArray = new string[size];
+            IntPtr[] IntPtrArray = new IntPtr[size];
+
+            Marshal.Copy(unmanagedArray, IntPtrArray, 0, size);
+
+            for (int iterator = 0; iterator < size; iterator++)
+            {
+                managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]);
+            }
+        }
+    }
+
+    internal static class BundleErrorFactory
+    {
+        internal enum BundleError
+        {
+            None = ErrorCode.None,
+            OutOfMemory = ErrorCode.OutOfMemory,
+            InvalidParameter = ErrorCode.InvalidParameter,
+            KeyNotAvailable = ErrorCode.KeyNotAvailable,
+            KeyExists = -0x01180000 | 0x01
+        }
+
+        static internal void CheckAndThrowException(int error, SafeBundleHandle handle)
+        {
+            if ((BundleError)error == BundleError.None)
+            {
+                return;
+            }
+            else if ((BundleError)error == BundleError.OutOfMemory)
+            {
+                throw new InvalidOperationException("Out of memory");
+            }
+            else if ((BundleError)error == BundleError.InvalidParameter)
+            {
+                if (handle.IsInvalid)
+                {
+                    throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)");
+                }
+                throw new ArgumentException("Invalid parameter");
+            }
+            else if ((BundleError)error == BundleError.KeyNotAvailable)
+            {
+                throw new ArgumentException("Key does not exist in the bundle");
+            }
+            else if ((BundleError)error == BundleError.KeyExists)
+            {
+                throw new ArgumentException("Key already exists");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs
new file mode 100755 (executable)
index 0000000..5bf6e39
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+using Tizen.Applications.CoreBackend;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Class that represents an application controlled lifecycles by the backend system.
+    /// </summary>
+    public class CoreApplication : Application
+    {
+        private readonly ICoreBackend _backend;
+        private bool _disposedValue = false;
+
+        /// <summary>
+        /// Initializes the CoreApplication class.
+        /// </summary>
+        /// <param name="backend">The backend instance implementing ICoreBacked interface.</param>
+        public CoreApplication(ICoreBackend backend)
+        {
+            _backend = backend;
+        }
+
+        /// <summary>
+        /// Occurs when the application is launched.
+        /// </summary>
+        public event EventHandler Created;
+
+        /// <summary>
+        /// Occurs when the application is about to shutdown.
+        /// </summary>
+        public event EventHandler Terminated;
+
+        /// <summary>
+        /// Occurs whenever the application receives the appcontrol message.
+        /// </summary>
+        public event EventHandler<AppControlReceivedEventArgs> AppControlReceived;
+
+        /// <summary>
+        /// Occurs when the system memory is low.
+        /// </summary>
+        public event EventHandler<LowMemoryEventArgs> LowMemory;
+
+        /// <summary>
+        /// Occurs when the system battery is low.
+        /// </summary>
+        public event EventHandler<LowBatteryEventArgs> LowBattery;
+
+        /// <summary>
+        /// Occurs when the system language is chagned.
+        /// </summary>
+        public event EventHandler<LocaleChangedEventArgs> LocaleChanged;
+
+        /// <summary>
+        /// Occurs when the region format is changed.
+        /// </summary>
+        public event EventHandler<RegionFormatChangedEventArgs> RegionFormatChanged;
+
+        /// <summary>
+        /// Occurs when the device orientation is changed.
+        /// </summary>
+        public event EventHandler<DeviceOrientationEventArgs> DeviceOrientationChanged;
+
+        /// <summary>
+        /// The backend instance.
+        /// </summary>
+        protected ICoreBackend Backend { get { return _backend; } }
+
+        /// <summary>
+        /// Runs the application's main loop.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public override void Run(string[] args)
+        {
+            base.Run(args);
+
+            _backend.AddEventHandler(EventType.Created, OnCreate);
+            _backend.AddEventHandler(EventType.Terminated, OnTerminate);
+            _backend.AddEventHandler<AppControlReceivedEventArgs>(EventType.AppControlReceived, OnAppControlReceived);
+            _backend.AddEventHandler<LowMemoryEventArgs>(EventType.LowMemory, OnLowMemory);
+            _backend.AddEventHandler<LowBatteryEventArgs>(EventType.LowBattery, OnLowBattery);
+            _backend.AddEventHandler<LocaleChangedEventArgs>(EventType.LocaleChanged, OnLocaleChanged);
+            _backend.AddEventHandler<RegionFormatChangedEventArgs>(EventType.RegionFormatChanged, OnRegionFormatChanged);
+            _backend.AddEventHandler<DeviceOrientationEventArgs>(EventType.DeviceOrientationChanged, OnDeviceOrientationChanged);
+
+            string[] argsClone = null;
+
+            if (args == null)
+            {
+                argsClone = new string[1];
+            }
+            else
+            {
+                argsClone = new string[args.Length + 1];
+                args.CopyTo(argsClone, 1);
+            }
+            argsClone[0] = string.Empty;
+            _backend.Run(argsClone);
+        }
+
+        /// <summary>
+        /// Exits the main loop of the application.
+        /// </summary>
+        public override void Exit()
+        {
+            _backend.Exit();
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the application is launched.
+        /// If base.OnCreated() is not called, the event 'Created' will not be emitted.
+        /// </summary>
+        protected virtual void OnCreate()
+        {
+            Created?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the application is terminated.
+        /// If base.OnTerminate() is not called, the event 'Terminated' will not be emitted.
+        /// </summary>
+        protected virtual void OnTerminate()
+        {
+            Terminated?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the application receives the appcontrol message.
+        /// If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be emitted.
+        /// </summary>
+        /// <param name="e"></param>
+        protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
+        {
+            AppControlReceived?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the system memory is low.
+        /// If base.OnLowMemory() is not called, the event 'LowMemory' will not be emitted.
+        /// </summary>
+        protected virtual void OnLowMemory(LowMemoryEventArgs e)
+        {
+            LowMemory?.Invoke(this, e);
+            System.GC.Collect();
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the system battery is low.
+        /// If base.OnLowBattery() is not called, the event 'LowBattery' will not be emitted.
+        /// </summary>
+        protected virtual void OnLowBattery(LowBatteryEventArgs e)
+        {
+            LowBattery?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the system language is changed.
+        /// If base.OnLocaleChanged() is not called, the event 'LocaleChanged' will not be emitted.
+        /// </summary>
+        protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
+        {
+            LocaleChanged?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the region format is changed.
+        /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted.
+        /// </summary>
+        protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+        {
+            RegionFormatChanged?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the device orientation is changed.
+        /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted.
+        /// </summary>
+        protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
+        {
+            DeviceOrientationChanged?.Invoke(this, e);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                if (disposing)
+                {
+                    _backend.Dispose();
+                }
+
+                _disposedValue = true;
+            }
+            base.Dispose(disposing);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs b/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs
new file mode 100755 (executable)
index 0000000..5b41aea
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for device orientation.
+    /// </summary>
+    public enum DeviceOrientation
+    {
+        /// <summary>
+        /// The device orientation is 0
+        /// </summary>
+        Orientation_0 = 0,
+
+        /// <summary>
+        /// The device orientation is 90
+        /// </summary>
+        Orientation_90 = 90,
+
+        /// <summary>
+        /// The device orientation is 180
+        /// </summary>
+        Orientation_180 = 180,
+
+        /// <summary>
+        /// The device orientation is 270
+        /// </summary>
+        Orientation_270 = 270,
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs
new file mode 100755 (executable)
index 0000000..750e316
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class for the argument of the DeviceOrientationChanged EventHandler
+    /// </summary>
+    public class DeviceOrientationEventArgs : EventArgs
+    {
+        /// <summary>
+        ///  Initializes DeviceOrientationEventArgs class
+        /// </summary>
+        /// <param name="orientation">The information of the DeviceOrientation</param>
+        public DeviceOrientationEventArgs(DeviceOrientation orientation)
+        {
+            DeviceOrientation = orientation;
+        }
+
+        /// <summary>
+        /// The property to get the intformation of the DeviceOrientation
+        /// </summary>
+        public DeviceOrientation DeviceOrientation { get; private set; }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs
new file mode 100755 (executable)
index 0000000..4b7f06b
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents directory information of the application.
+    /// </summary>
+    public class DirectoryInfo
+    {
+        private string _dataPath;
+        private string _cachePath;
+        private string _resourcePath;
+
+        private string _sharedDataPath;
+        private string _sharedResourcePath;
+        private string _sharedTrustedPath;
+
+        private string _externalDataPath;
+        private string _externalCachePath;
+        private string _externalSharedDataPath;
+
+        private string _expansionPackageResourcePath;
+
+        internal DirectoryInfo()
+        {
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's data directory which is used to store private data of the application.
+        /// </summary>
+        public string Data
+        {
+            get
+            {
+                if (_dataPath == null)
+                    _dataPath = Interop.AppCommon.AppGetDataPath();
+                return _dataPath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's cache directory which is used to store temporary data of the application.
+        /// </summary>
+        public string Cache
+        {
+            get
+            {
+                if (_cachePath == null)
+                    _cachePath = Interop.AppCommon.AppGetCachePath();
+                return _cachePath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application resource directory. The resource files are delivered with the application package.
+        /// </summary>
+        public string Resource
+        {
+            get
+            {
+                if (_resourcePath == null)
+                    _resourcePath = Interop.AppCommon.AppGetResourcePath();
+                return _resourcePath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's shared data directory which is used to share data with other applications.
+        /// </summary>
+        public string SharedData
+        {
+            get
+            {
+                if (_sharedDataPath == null)
+                    _sharedDataPath = Interop.AppCommon.AppGetSharedDataPath();
+                return _sharedDataPath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's shared resource directory which is used to share resources with other applications.
+        /// </summary>
+        public string SharedResource
+        {
+            get
+            {
+                if (_sharedResourcePath == null)
+                    _sharedResourcePath = Interop.AppCommon.AppGetSharedResourcePath();
+                return _sharedResourcePath;
+            }
+        }
+
+
+        /// <summary>
+        /// Gets the absolute path to the application's shared trusted directory which is used to share data with a family of trusted applications.
+        /// </summary>
+        public string SharedTrusted
+        {
+            get
+            {
+                if (_sharedTrustedPath == null)
+                    _sharedTrustedPath = Interop.AppCommon.AppGetSharedTrustedPath();
+                return _sharedTrustedPath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's external data directory which is used to store data of the application.
+        /// </summary>
+        public string ExternalData
+        {
+            get
+            {
+                if (_externalDataPath == null)
+                    _externalDataPath = Interop.AppCommon.AppGetExternalDataPath();
+                return _externalDataPath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's external cache directory which is used to store temporary data of the application.
+        /// </summary>
+        public string ExternalCache
+        {
+            get
+            {
+                if (_externalCachePath == null)
+                    _externalCachePath = Interop.AppCommon.AppGetExternalCachePath();
+                return _externalCachePath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's external shared data directory which is used to share data with other applications.
+        /// </summary>
+        public string ExternalSharedData
+        {
+            get
+            {
+                if (_externalSharedDataPath == null)
+                    _externalSharedDataPath = Interop.AppCommon.AppGetExternalSharedDataPath();
+                return _externalSharedDataPath;
+            }
+        }
+
+        /// <summary>
+        /// Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package.
+        /// </summary>
+        public string ExpansionPackageResource
+        {
+            get
+            {
+                if (_expansionPackageResourcePath == null)
+                    _expansionPackageResourcePath = Interop.AppCommon.AppGetTepResourcePath();
+                return _expansionPackageResourcePath;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..a1e99ba
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class for the argument of the LocaleChanged EventHandler
+    /// </summary>
+    public class LocaleChangedEventArgs : EventArgs
+    {
+
+        /// <summary>
+        /// Initializes LocaleChangedEventArgs class
+        /// </summary>
+        /// <param name="locale">The information of the Locale</param>
+        public LocaleChangedEventArgs(string locale)
+        {
+            Locale = locale;
+        }
+
+        /// <summary>
+        /// The property to get the intformation of the Locale
+        /// </summary>
+        public string Locale { get; private set; }
+
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs
new file mode 100755 (executable)
index 0000000..bf0c49a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class for the argument of the LowBattery EventHandler
+    /// </summary>
+    public class LowBatteryEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Initializes LowBatteryEventArgs class
+        /// </summary>
+        /// <param name="status">The information of the LowBatteryEventArgs</param>
+        public LowBatteryEventArgs(LowBatteryStatus status)
+        {
+            LowBatteryStatus = status;
+        }
+
+        /// <summary>
+        /// The property to get the intformation of the LowBatteryStatus
+        /// </summary>
+        public LowBatteryStatus LowBatteryStatus { get; private set; }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs
new file mode 100755 (executable)
index 0000000..a835521
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for low battery status.
+    /// </summary>
+    public enum LowBatteryStatus
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// The battery status is under 1%
+        /// </summary>
+        PowerOff = 1,
+
+        /// <summary>
+        /// The battery status is under 5%
+        /// </summary>
+        CriticalLow
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs
new file mode 100755 (executable)
index 0000000..e42fedc
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class for the argument of the LowMemory EventHandler
+    /// </summary>
+    public class LowMemoryEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Initializes LowMemoryEventArgs class
+        /// </summary>
+        /// <param name="status">The information of the LowMemoryStatus</param>
+        public LowMemoryEventArgs(LowMemoryStatus status)
+        {
+            LowMemoryStatus = status;
+        }
+
+        /// <summary>
+        /// The property to get the intformation of the LowMemoryStatus
+        /// </summary>
+        public LowMemoryStatus LowMemoryStatus { get; private set; }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs
new file mode 100755 (executable)
index 0000000..e704de3
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for low memory status.
+    /// </summary>
+    public enum LowMemoryStatus
+    {
+        /// <summary>
+        /// Not initialized status
+        /// </summary>
+        None = 0x00,
+
+        /// <summary>
+        /// Normal status
+        /// </summary>
+        Normal = 0x01,
+
+        /// <summary>
+        /// Soft warning status
+        /// </summary>
+        SoftWarning = 0x02,
+
+        /// <summary>
+        /// Hard warning status
+        /// </summary>
+        HardWarning = 0x04,
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs
new file mode 100755 (executable)
index 0000000..638ee7a
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents the received AppControl.
+    /// </summary>
+    /// <example>
+    /// <code>
+    /// public class ReceivedAppControlExample : UIApplication
+    /// {
+    ///     // ...
+    ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+    ///     {
+    ///         ReceivedAppControl control = e.ReceivedAppControl;
+    ///         if (control.Operation == AppControlOperations.Pick)
+    ///         {
+    ///             Log.Debug(LogTag, "Received AppControl is Pick");
+    ///         }
+    ///         if (control.IsReplyRequest)
+    ///         {
+    ///             AppControl replyRequest = new AppControl();
+    ///             replyRequest.ExtraData.Add("myKey", "I'm replying");
+    ///             control.ReplyToLaunchRequest(replyRequest, AppControlReplyResult.Succeeded);
+    ///         }
+    ///     }
+    /// }
+    /// </code>
+    /// </example>
+    public class ReceivedAppControl : AppControl
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        /// <summary>
+        /// Initializes a ReceivedAppControl class.
+        /// </summary>
+        public ReceivedAppControl(SafeAppControlHandle handle) : base(handle)
+        {
+        }
+
+        /// <summary>
+        /// Gets the application ID of the caller from the launch request.
+        /// </summary>
+        /// <value>
+        /// The application ID of the caller
+        /// </value>
+        /// <example>
+        /// <code>
+        ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        ///     {
+        ///         ReceivedAppControl control = e.ReceivedAppControl;
+        ///         string caller = control.CallerApplicationId;
+        ///     }
+        /// </code>
+        /// </example>
+        public string CallerApplicationId
+        {
+            get
+            {
+                string value = String.Empty;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.GetCaller(SafeAppControlHandle, out value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the caller application id from the AppControl. Err = " + err);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the caller is requesting a reply from the launch request.
+        /// </summary>
+        /// <value>
+        /// If true this ReceivedAppControl is requested by the caller, otherwise false
+        /// </value>
+        /// <example>
+        /// <code>
+        ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        ///     {
+        ///         ReceivedAppControl control = e.ReceivedAppControl;
+        ///         bool isReply = control.IsReplyRequest;
+        ///     }
+        /// </code>
+        /// </example>
+        public bool IsReplyRequest
+        {
+            get
+            {
+                bool value = false;
+                Interop.AppControl.ErrorCode err = Interop.AppControl.IsReplyRequested(SafeAppControlHandle, out value);
+                if (err != Interop.AppControl.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to check the reply  of the AppControl is requested. Err = " + err);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Replies to the launch request sent by the caller.
+        /// If the caller application sent the launch request to receive the result, the callee application can return the result back to the caller.
+        /// </summary>
+        /// <param name="replyRequest">The AppControl in which the results of the callee are contained</param>
+        /// <param name="result">The result code of the launch request</param>
+        /// <example>
+        /// <code>
+        ///     protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        ///     {
+        ///         ReceivedAppControl control = e.ReceivedAppControl;
+        ///         if (control.IsReplyRequest)
+        ///         {
+        ///             AppControl replyRequest = new AppControl();
+        ///             replyRequest.ExtraData.Add("myKey", "I'm replying");
+        ///             control.ReplyToLaunchRequest(replyRequest, AppControlReplyResult.Succeeded);
+        ///         }
+        ///     }
+        /// </code>
+        /// </example>
+        public void ReplyToLaunchRequest(AppControl replyRequest, AppControlReplyResult result)
+        {
+            if (replyRequest == null)
+            {
+                throw new ArgumentNullException("replyRequest");
+            }
+            Interop.AppControl.ErrorCode err = Interop.AppControl.ReplyToLaunchRequest(replyRequest.SafeAppControlHandle, this.SafeAppControlHandle, (int)result);
+            if (err != Interop.AppControl.ErrorCode.None)
+                throw new InvalidOperationException("Failed to reply. Err = " + err);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs
new file mode 100755 (executable)
index 0000000..5bc84fe
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provides methods and properties to get information of recent application.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class RecentApplicationControl
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        private readonly string _pkgId;
+
+        internal RecentApplicationControl(String pkgId)
+        {
+            _pkgId = pkgId;
+        }
+
+        /// <summary>
+        /// Deletes the application from recent application list.
+        /// </summary>
+        /// <privlevel>platform</privlevel>
+        public void Delete()
+        {
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+            err = Interop.ApplicationManager.RuaDeleteHistoryWithPkgname(_pkgId);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to delete application from recent application list.");
+            }
+        }
+
+        /// <summary>
+        /// Delete all recent applicationsfrom recent application list.
+        /// </summary>
+        /// <privlevel>platform</privlevel>
+        public static void DeleteAll()
+        {
+            Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
+            err = Interop.ApplicationManager.RuaClearHistory();
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                throw ApplicationManagerErrorFactory.GetException(err, "Failed to clear the recent application list.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs
new file mode 100755 (executable)
index 0000000..613e7d6
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provides methods and properties to get information of recent application.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class RecentApplicationInfo : ApplicationInfo
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        /// <summary>
+        /// Gets the instance id.
+        /// </summary>
+        public string InstanceId { get; private set; }
+
+        /// <summary>
+        /// Gets the instance Name.
+        /// </summary>
+        public string InstanceName { get; private set; }
+
+        /// <summary>
+        /// Gets the arguements.
+        /// </summary>
+        public string Arg { get; private set; }
+
+        /// <summary>
+        /// Gets the uri.
+        /// </summary>
+        public string Uri { get; private set; }
+
+        /// <summary>
+        /// Gets the launchTime.
+        /// </summary>
+        public DateTime LaunchTime { get; private set; }
+
+        /// <summary>
+        /// Gets the recent application controller.
+        /// </summary>
+        public RecentApplicationControl Controller { get; private set; }
+
+        internal RecentApplicationInfo(Interop.ApplicationManager.RuaRec record) : base(Marshal.PtrToStringAnsi(record.pkgName))
+        {
+            InstanceId = Marshal.PtrToStringAnsi(record.instanceId);
+            InstanceName = Marshal.PtrToStringAnsi(record.instanceName);
+            Arg = Marshal.PtrToStringAnsi(record.arg);
+            Uri = Marshal.PtrToStringAnsi(record.uri);
+            long seconds = record.launchTime.ToInt64();
+            LaunchTime = new DateTime(1970, 1, 1).AddSeconds(seconds);
+            Controller = new RecentApplicationControl(Marshal.PtrToStringAnsi(record.pkgName));
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..a481093
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class for the argument of the RegionFormatChanged EventHandler
+    /// </summary>
+    public class RegionFormatChangedEventArgs : EventArgs
+    {
+
+        /// <summary>
+        /// Initializes RegionFormatChangedEventArgs class
+        /// </summary>
+        /// <param name="region">The information of the Region</param>
+        public RegionFormatChangedEventArgs(string region)
+        {
+            Region = region;
+        }
+
+        /// <summary>
+        /// The property to get the intformation of the Region
+        /// </summary>
+        public string Region { get; private set; }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs
new file mode 100755 (executable)
index 0000000..c20840a
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Class for getting resource path.
+    /// </summary>
+    public static class ResourceManager
+    {
+        /// <summary>
+        /// Enumeration for Resource category.
+        /// </summary>
+        public enum Category : int
+        {
+            /// <summary>
+            /// Image format.
+            /// </summary>
+            Image = 0,
+
+            /// <summary>
+            /// Layout format.
+            /// </summary>
+            Layout,
+
+            /// <summary>
+            /// Sound format.
+            /// </summary>
+            Sound,
+
+            /// <summary>
+            /// Binary format.
+            /// </summary>
+            Binary
+        }
+
+        private static ErrorCode AppResourceManagerGet(Category category, string id, out string path)
+        {
+            ErrorCode err;
+
+            try
+            {
+                err = Interop.AppCommon.AppResourceManagerGet(
+                             (Interop.AppCommon.ResourceCategory)category, id, out path);
+            }
+            catch (System.TypeLoadException)
+            {
+                err = Interop.AppCommon.LegacyAppResourceManagerGet(
+                             (Interop.AppCommon.ResourceCategory)category, id, out path);
+            }
+
+            return err;
+        }
+
+        /// <summary>
+        /// Converts resource ID to path name.
+        /// </summary>
+        /// <param name="category">Category to search</param>
+        /// <param name="id">ID to search</param>
+        /// <returns>Found resource path</returns>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions</exception>
+        public static string GetPath(Category category, string id)
+        {
+            string path;
+            ErrorCode err = AppResourceManagerGet(category, id, out path);
+
+            switch (err)
+            {
+                case ErrorCode.InvalidParameter:
+                throw new InvalidOperationException("Invalid parameter");
+
+                case ErrorCode.OutOfMemory:
+                throw new InvalidOperationException("Out-of-memory at unmanaged code");
+
+                case ErrorCode.IoError:
+                throw new InvalidOperationException("IO error at unmanaged code");
+            }
+
+            return path;
+        }
+
+        /// <summary>
+        /// Converts resource ID to path name.
+        /// </summary>
+        /// <param name="category">Category to search</param>
+        /// <param name="id">ID to search</param>
+        /// <returns>Found resource path or null when the resource doesn't exist</returns>
+        /// <exception cref="InvalidOperationException">Thrown in case of failed conditions</exception>
+        public static string TryGetPath(Category category, string id)
+        {
+            string path;
+            ErrorCode err = AppResourceManagerGet(category, id, out path);
+
+            switch (err)
+            {
+                case ErrorCode.InvalidParameter:
+                throw new InvalidOperationException("Invalid parameter");
+
+                case ErrorCode.OutOfMemory:
+                throw new InvalidOperationException("Out-of-memory at unmanaged code");
+
+                case ErrorCode.IoError:
+                return null;
+            }
+
+            return path;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs b/src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs
new file mode 100755 (executable)
index 0000000..5bbdf60
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents a wrapper class for a unmanaged AppControl handle.
+    /// </summary>
+    public sealed class SafeAppControlHandle : SafeHandle
+    {
+        /// <summary>
+        /// Initializes a new instance of the SafeAppControlHandle class.
+        /// </summary>
+        public SafeAppControlHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the SafeAppControlHandle class.
+        /// </summary>
+        /// <param name="existingHandle">An IntPtr object that represents the pre-existing handle to use.</param>
+        /// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release.</param>
+        public SafeAppControlHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        public override bool IsInvalid
+        {
+            get { return this.handle == IntPtr.Zero; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, executes the code required to free the handle.
+        /// </summary>
+        /// <returns>true if the handle is released successfully</returns>
+        protected override bool ReleaseHandle()
+        {
+            Interop.AppControl.DangerousDestroy(this.handle);
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs b/src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs
new file mode 100755 (executable)
index 0000000..c3bab4b
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents a wrapper class for a unmanaged Bundle handle.
+    /// </summary>
+    public sealed class SafeBundleHandle : SafeHandle
+    {
+        /// <summary>
+        /// Initializes a new instance of the SafeBundleHandle class.
+        /// </summary>
+        public SafeBundleHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the SafeBundleHandle class.
+        /// </summary>
+        /// <param name="existingHandle">An IntPtr object that represents the pre-existing handle to use.</param>
+        /// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release.</param>
+        public SafeBundleHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        public override bool IsInvalid
+        {
+            get { return this.handle == IntPtr.Zero; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, executes the code required to free the handle.
+        /// </summary>
+        /// <returns>true if the handle is released successfully</returns>
+        protected override bool ReleaseHandle()
+        {
+            Interop.Bundle.DangerousFree(this.handle);
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs b/src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs
new file mode 100644 (file)
index 0000000..dcfb4c8
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Concurrent;
+using System.Threading;
+
+namespace Tizen.Applications
+{
+
+    /// <summary>
+    /// Provides a synchronization context for the Tizen application model.
+    /// </summary>
+    public class TizenSynchronizationContext : SynchronizationContext
+    {
+        private readonly Interop.Glib.GSourceFunc _wrapperHandler;
+        private readonly Object _transactionLock = new Object();
+        private readonly ConcurrentDictionary<int, Action> _handlerMap = new ConcurrentDictionary<int, Action>();
+        private int _transactionId = 0;
+
+        /// <summary>
+        /// Initializes a new instance of the TizenSynchronizationContext class.
+        /// </summary>
+        public TizenSynchronizationContext()
+        {
+            _wrapperHandler = new Interop.Glib.GSourceFunc(Handler);
+        }
+
+        /// <summary>
+        /// Initilizes a new TizenSynchronizationContext and install into current thread
+        /// </summary>
+        /// <remarks>
+        /// It is equivalent
+        /// <code>
+        /// SetSynchronizationContext(new TizenSynchronizationContext());
+        /// </code>
+        /// </remarks>
+        public static void Initialize()
+        {
+            SetSynchronizationContext(new TizenSynchronizationContext());
+        }
+
+
+        /// <summary>
+        /// Dispatches an asynchronous message to a Tizen main loop.
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>
+        /// The Post method starts an asynchronous request to post a message.</remarks>
+        public override void Post(SendOrPostCallback d, object state)
+        {
+            Post(() =>
+            {
+                d(state);
+            });
+        }
+
+        /// <summary>
+        /// Dispatches a synchronous message to a Tizen main loop
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>
+        /// The Send method starts a synchronous request to send a message.</remarks>
+        public override void Send(SendOrPostCallback d, object state)
+        {
+            var mre = new ManualResetEvent(false);
+            Exception err = null;
+            Post(() =>
+            {
+                try
+                {
+                    d(state);
+                }
+                catch (Exception ex)
+                {
+                    err = ex;
+                }
+                finally
+                {
+                    mre.Set();
+                }
+            });
+            mre.WaitOne();
+            if (err != null)
+            {
+                throw err;
+            }
+        }
+
+        private void Post(Action action)
+        {
+            int id = 0;
+            lock (_transactionLock)
+            {
+                id = _transactionId++;
+            }
+            _handlerMap.TryAdd(id, action);
+            Interop.Glib.IdleAdd(_wrapperHandler, (IntPtr)id);
+        }
+
+        private bool Handler(IntPtr userData)
+        {
+            int key = (int)userData;
+            if (_handlerMap.ContainsKey(key))
+            {
+                Action action;
+                _handlerMap.TryRemove(key, out action);
+                action?.Invoke();
+            }
+            return false;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs b/src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs
new file mode 100755 (executable)
index 0000000..b19f6ee
--- /dev/null
@@ -0,0 +1,466 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Tizen.Applications;
+using Tizen;
+using Tizen.Applications.DataControl;
+
+internal static partial class Interop
+{
+    internal static partial class DataControl
+    {
+
+        internal enum NativeResultType : int
+        {
+            Success = Tizen.Internals.Errors.ErrorCode.None,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            MaxExceed = -0x01190000 | 0x01,
+        }
+
+        internal sealed class SafeBulkDataHandle : SafeHandle
+        {
+            internal SafeBulkDataHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            internal SafeBulkDataHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+            {
+                SetHandle(existingHandle);
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                DataControl.BulkFree(this.handle);
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+
+        internal sealed class SafeBulkResultDataHandle : SafeHandle
+        {
+            internal SafeBulkResultDataHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            internal SafeBulkResultDataHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+            {
+                SetHandle(existingHandle);
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                DataControl.BulkResultFree(this.handle);
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+
+        internal sealed class SafeCursorHandle : SafeHandle
+        {
+            internal SafeCursorHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            internal SafeCursorHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+            {
+                SetHandle(existingHandle);
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+
+        internal sealed class SafeDataControlHandle : SafeHandle
+        {
+            internal SafeDataControlHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            internal SafeDataControlHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+            {
+                SetHandle(existingHandle);
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                DataControl.Destroy(this.handle);
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_create")]
+        internal static extern ResultType DataControlCreate(out SafeDataControlHandle handle);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_destroy")]
+        internal static extern ResultType Destroy(IntPtr handle);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_provider_id")]
+        internal static extern ResultType DataControlGetProviderId(SafeDataControlHandle handle, out string providerId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_set_provider_id")]
+        internal static extern ResultType DataControlSetProviderId(SafeDataControlHandle handle, string providerId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_set_data_id")]
+        internal static extern ResultType DataControlSetDataId(SafeDataControlHandle handle, string dataId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_data_id")]
+        internal static extern ResultType DataControlGetDataId(SafeDataControlHandle handle, out string dataId);
+
+        internal delegate void MapGetResponseCallback(int requestID,
+            IntPtr provider, string[] resultValueList, int resultValueCount, bool providerResult, string error, IntPtr userData);
+        internal delegate void MapSetResponseCallback(int requestID,
+            IntPtr provider, bool providerResult, string error, IntPtr userData);
+        internal delegate void MapAddResponseCallback(int requestID,
+            IntPtr provider, bool providerResult, string error, IntPtr userData);
+        internal delegate void MapRemoveResponseCallback(int requestID,
+            IntPtr provider, bool providerResult, string error, IntPtr userData);
+        internal delegate void MapBulkAddResponseCallback(int requestID,
+            IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData);
+
+        [StructLayoutAttribute(LayoutKind.Sequential)]
+        internal struct MapResponseCallbacks
+        {
+            public MapGetResponseCallback Get;
+            public MapSetResponseCallback Set;
+            public MapAddResponseCallback Add;
+            public MapRemoveResponseCallback Remove;
+        }
+
+        internal delegate void SqlSelectResponseCallback(int requestID,
+            IntPtr provider, IntPtr cursor, bool providerResult, string error, IntPtr userData);
+        internal delegate void SqlInsertResponseCallback(int requestID,
+            IntPtr provider, long inserted_row_id, bool providerResult, string error, IntPtr userData);
+        internal delegate void SqlUpdateResponseCallback(int requestID,
+            IntPtr provider, bool providerResult, string error, IntPtr userData);
+        internal delegate void SqlDeleteResponseCallback(int requestID,
+            IntPtr provider, bool providerResult, string error, IntPtr userData);
+        internal delegate void SqlBulkInsertResponseCallback(int requestID,
+            IntPtr provider, IntPtr bulk_results, bool providerResult, string error, IntPtr userData);
+
+        [StructLayoutAttribute(LayoutKind.Sequential)]
+        internal struct SqlResponseCallbacks
+        {
+            public SqlSelectResponseCallback Select;
+            public SqlInsertResponseCallback Insert;
+            public SqlUpdateResponseCallback Update;
+            public SqlDeleteResponseCallback Delete;
+        }
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_register_response_cb")]
+        internal static extern ResultType RegisterMapResponse(SafeDataControlHandle provider, ref MapResponseCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_unregister_response_cb")]
+        internal static extern ResultType UnregisterMapResponse(SafeDataControlHandle provider);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_register_add_bulk_data_response_cb")]
+        internal static extern ResultType RegisterMapBulkResponseCallback(SafeDataControlHandle provider, MapBulkAddResponseCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_unregister_add_bulk_data_response_cb")]
+        internal static extern ResultType UnregisterMapBulkResponseCallback(SafeDataControlHandle provider);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_register_response_cb")]
+        internal static extern ResultType RegisterSqlResponseCallback(SafeDataControlHandle provider, ref SqlResponseCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_unregister_response_cb")]
+        internal static extern ResultType UnregisterSqlResponseCallback(SafeDataControlHandle provider);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_register_insert_bulk_data_response_cb")]
+        internal static extern ResultType RegisterSqlBulkResponseCallback(SafeDataControlHandle provider, SqlBulkInsertResponseCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_unregister_insert_bulk_data_response_cb")]
+        internal static extern ResultType UnregisterSqlBulkResponseCallback(SafeDataControlHandle provider);
+
+        internal delegate void MapGetRequestCallback(int requestID,
+            IntPtr provider, string key, IntPtr userData);
+        internal delegate void MapSetRequestCallback(int requestID,
+            IntPtr provider, string key, string oldValue, string newValue, IntPtr userData);
+        internal delegate void MapAddRequestCallback(int requestID,
+            IntPtr provider, string key, string value, IntPtr userData);
+        internal delegate void MapRemoveRequestCallback(int requestID,
+            IntPtr provider, string key, string value, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MapBulkAddRequestCallback(int requestID,
+            IntPtr provider, IntPtr bulkData, IntPtr userData);
+
+        [StructLayoutAttribute(LayoutKind.Sequential)]
+        internal struct MapRequestCallbacks
+        {
+            public MapGetRequestCallback Get;
+            public MapSetRequestCallback Set;
+            public MapAddRequestCallback Add;
+            public MapRemoveRequestCallback Remove;
+        }
+
+        internal delegate void SqlInsertRequestCallback(int requestID,
+            IntPtr provider, IntPtr insertData, IntPtr userData);
+        internal delegate void SqlSelectRequestCallback(int requestID,
+            IntPtr provider, IntPtr columnList, int columnCount, string where, string order, IntPtr userData);
+        internal delegate void SqlUpdateRequestCallback(int requestID,
+            IntPtr provider, IntPtr updateData, string where, IntPtr userData);
+        internal delegate void SqlDeleteRequestCallback(int requestID,
+            IntPtr provider, string where, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void SqlBulkInsertRequestCallback(int requestID,
+            IntPtr provider, IntPtr bulk_data, IntPtr userData);
+
+        [StructLayoutAttribute(LayoutKind.Sequential)]
+        internal struct SqlRequestCallbacks
+        {
+            public SqlInsertRequestCallback Insert;
+            public SqlSelectRequestCallback Select;
+            public SqlUpdateRequestCallback Update;
+            public SqlDeleteRequestCallback Delete;
+        }
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_register_cb")]
+        internal static extern ResultType RegisterMapRequest(ref MapRequestCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_register_cb")]
+        internal static extern ResultType RegisterSqlRequest(ref SqlRequestCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_register_insert_bulk_data_request_cb")]
+        internal static extern ResultType RegisterSqlBulkRequest(SqlBulkInsertRequestCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_unregister_insert_bulk_data_request_cb")]
+        internal static extern ResultType UnregisterSqlBulkRequest();
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_register_add_bulk_data_request_cb")]
+        internal static extern ResultType RegisterMapBulkRequest(MapBulkAddRequestCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_unregister_add_bulk_data_request_cb")]
+        internal static extern ResultType UnregisterMapBulkRequest();
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_result")]
+        internal static extern ResultType SendMapResult(int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_get_value_result")]
+        internal static extern ResultType SendMapGetResult(int requestID, string[] valueList, int valueCount);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_insert_result")]
+        internal static extern ResultType SendInsertResult(int requestID, long rowId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_update_result")]
+        internal static extern ResultType SendUpdateResult(int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_delete_result")]
+        internal static extern ResultType SendDeleteResult(int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_send_select_result_without_data")]
+        internal static extern ResultType SendSelectResult(int requestID, out int fd);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_error")]
+        internal static extern ResultType SendError(int requestID, string error);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_insert")]
+        internal static extern ResultType Insert(SafeDataControlHandle provider, SafeBundleHandle insertData, out int requestId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_select_with_page")]
+        internal static extern ResultType Select(SafeDataControlHandle provider, string[] columnList, int columnCount, string where, string order, int pageNumber,
+            int countPerPage, out int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_delete")]
+        internal static extern ResultType Delete(SafeDataControlHandle provider, string where, out int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_update")]
+        internal static extern ResultType Update(SafeDataControlHandle provider, SafeBundleHandle updatetData, string where, out int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_insert_bulk_data")]
+        internal static extern ResultType BulkInsert(SafeDataControlHandle provider, SafeBulkDataHandle insertData, out int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_add")]
+        internal static extern ResultType MapAdd(SafeDataControlHandle provider, string key, string value, out int requestId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_set")]
+        internal static extern ResultType MapSet(SafeDataControlHandle provider, string key, string oldValue, string newValue, out int requestId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_remove")]
+        internal static extern ResultType MapRemove(SafeDataControlHandle provider, string key, string value, out int requestId);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_get_with_page")]
+        internal static extern ResultType MapGet(SafeDataControlHandle provider, string key, out int requestId, int pageNumber,
+            int countPerPage);
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_add_bulk_data")]
+        internal static extern ResultType BulkAdd(SafeDataControlHandle provider, SafeBulkDataHandle insertData, out int requestID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_insert_statement")]
+        internal static extern string CreateInsertStatement(SafeDataControlHandle provider, SafeBundleHandle insertData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_delete_statement")]
+        internal static extern string CreateDeleteStatement(SafeDataControlHandle provider, string where);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_update_statement")]
+        internal static extern string CreateUpdateStatement(SafeDataControlHandle provider, SafeBundleHandle updateData, string where);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_get_select_page_info")]
+        internal static extern ResultType GetSelectPageInfo(int requestId, out int pageNum, out int countPerPage);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_write_socket")]
+        internal static extern unsafe ResultType WriteSelectResult(int socketFd, byte* buffer, uint nbytes, out uint bytesWrite);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_data_change_noti")]
+        internal static extern ResultType SendDataChange(IntPtr handle, ChangeType type, SafeBundleHandle data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_next")]
+        internal static extern ResultType Next(SafeCursorHandle cursor);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_last")]
+        internal static extern ResultType Last(SafeCursorHandle cursor);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_first")]
+        internal static extern ResultType First(SafeCursorHandle cursor);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_previous")]
+        internal static extern ResultType Prev(SafeCursorHandle cursor);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_count")]
+        internal static extern int GetColumnCount(SafeCursorHandle cursor);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_name")]
+        internal static extern ResultType GetColumnName(SafeCursorHandle cursor, int idx, StringBuilder name);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_item_size")]
+        internal static extern int GetItemSize(SafeCursorHandle cursor, int idx);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_item_type")]
+        internal static extern ResultType GetItemType(SafeCursorHandle cursor, int idx, out int type);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_blob_data")]
+        internal static extern ResultType GetBlob(SafeCursorHandle cursor, int idx, byte[] buffer, int size);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_int_data")]
+        internal static extern ResultType GetInt(SafeCursorHandle cursor, int idx, out int data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_int64_data")]
+        internal static extern ResultType GetInt64(SafeCursorHandle cursor, int idx, out long data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_double_data")]
+        internal static extern ResultType Getdouble(SafeCursorHandle cursor, int idx, out double data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_text_data")]
+        internal static extern unsafe ResultType GetText(SafeCursorHandle cursor, int idx, byte[] data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_create")]
+        internal static extern ResultType BulkCreate(out SafeBulkDataHandle handle);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_add")]
+        internal static extern ResultType BulkAdd(SafeBulkDataHandle handle, SafeBundleHandle data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_get_count")]
+        internal static extern ResultType BulkGetCount(SafeBulkDataHandle handle, out int count);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_destroy")]
+        internal static extern ResultType BulkFree(IntPtr handle);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_get_data")]
+        internal static extern ResultType BulkGetData(SafeBulkDataHandle handle, int idx, out IntPtr data);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_create")]
+        internal static extern ResultType BulkResultCreate(out SafeBulkResultDataHandle handle);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_add")]
+        internal static extern ResultType BulkResultAdd(SafeBulkResultDataHandle handle, SafeBundleHandle data, int result);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_count")]
+        internal static extern ResultType BulkResultGetCount(SafeBulkResultDataHandle handle, out int count);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_result_data")]
+        internal static extern ResultType BulkResultGetData(SafeBulkResultDataHandle handle, int idx, out IntPtr data, out int result);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_result_data")]
+        internal static extern ResultType BulkResultGetResult(SafeBulkResultDataHandle handle, int idx, out IntPtr data, out int result);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_destroy")]
+        internal static extern ResultType BulkResultFree(IntPtr handle);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AddCallbackResultCallback(IntPtr handle, ResultType type, int callbackID, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void DataChangeCallback(IntPtr handle, ChangeType type, IntPtr data, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_add_data_change_cb", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern ResultType AddDataChangeCallback(SafeDataControlHandle provider, DataChangeCallback callback,
+            IntPtr userData, AddCallbackResultCallback resultCallback, IntPtr resultCbUserData, out int callbackID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_remove_data_change_cb", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern ResultType RemoveDataChangeCallback(SafeDataControlHandle provider, int callbackID);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool DataChangeConsumerFilterCb(IntPtr handle, string consumerAppid, IntPtr userData);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_add_data_change_consumer_filter_cb", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern ResultType AddDataChangeConsumerFilterCallback(DataChangeConsumerFilterCb callback,
+            IntPtr userData,
+            out int callbackID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_remove_data_change_consumer_filter_cb")]
+        internal static extern int RemoveDataChangeConsumerFilterCallback(int callbackID);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_bulk_insert_result")]
+        internal static extern ResultType SendBulkInsertResult(int requestId, SafeBulkResultDataHandle result);
+
+        [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_bulk_add_result")]
+        internal static extern ResultType SendMapBulkAddResult(int requestId, SafeBulkResultDataHandle result);
+
+        internal static class UnsafeCode
+        {
+            internal static unsafe ResultType WriteResult(int socketFd, byte[] value, int nbytes, out uint bytesWrite)
+            {
+                fixed (byte* pointer = value)
+                {
+                    return WriteSelectResult(socketFd, pointer, (uint)nbytes, out bytesWrite);
+                }
+            }
+        }
+
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs b/src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..1658ec6
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string DataControl = "libdata-control.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs
new file mode 100755 (executable)
index 0000000..1e066ee
--- /dev/null
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace Tizen.Applications.DataControl.Core
+{
+    internal class CloneCursorCore : ICursor
+    {
+        internal const int MaxColumnNameSize = 1024;
+        private const string LogTag = "Tizen.Applications.DataControl";
+        private long _rowCount;
+        private int _columnCount;
+        private const int ResultNoData = -1;
+        private Interop.DataControl.SafeCursorHandle _cursor;
+        internal CloneCursorCore(Interop.DataControl.SafeCursorHandle cursor)
+        {
+            _cursor = cursor;
+            _columnCount = Interop.DataControl.GetColumnCount(cursor);
+
+            if (_columnCount == ResultNoData)
+            {
+                _rowCount = 0;
+                return;
+            }
+
+            Interop.DataControl.First(cursor);
+
+            do
+            {
+                _rowCount++;
+            }
+            while (Interop.DataControl.Next(cursor) == (int)ResultType.Success);
+            Interop.DataControl.First(cursor);
+        }
+
+        public int GetColumnCount()
+        {
+            return Interop.DataControl.GetColumnCount(_cursor);
+        }
+
+        public ColumnType GetColumnType(int index)
+        {
+            int type;
+            ResultType ret;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            ret = Interop.DataControl.GetItemType(_cursor, index, out type);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString());
+            }
+
+            return (ColumnType)type;
+        }
+
+        public string GetColumnName(int index)
+        {
+            string retStr;
+            ResultType ret;
+            StringBuilder columnName = new StringBuilder();
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            columnName.Length = MaxColumnNameSize;
+            ret = Interop.DataControl.GetColumnName(_cursor, index, columnName);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString());
+            }
+
+            retStr = columnName.ToString();
+            columnName.Clear();
+            columnName = null;
+
+            return retStr;
+        }
+
+        public long GetRowCount()
+        {
+            return _rowCount;
+        }
+
+        public bool Next()
+        {
+            ResultType type = Interop.DataControl.Next(_cursor);
+
+            if (type != ResultType.Success)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        public bool Prev()
+        {
+            ResultType type = Interop.DataControl.Prev(_cursor);
+
+            if (type != ResultType.Success)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        public bool Reset()
+        {
+            ResultType type = Interop.DataControl.First(_cursor);
+
+            if (type != ResultType.Success)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        public int GetIntValue(int index)
+        {
+            ResultType ret;
+            int value;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            ret = Interop.DataControl.GetInt(_cursor, index, out value);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString());
+            }
+
+            return value;
+        }
+
+        public Int64 GetInt64Value(int index)
+        {
+            ResultType ret;
+            Int64 value;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            ret = Interop.DataControl.GetInt64(_cursor, index, out value);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString());
+            }
+
+            return value;
+        }
+
+        public double GetDoubleValue(int index)
+        {
+            ResultType ret;
+            double value;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            ret = Interop.DataControl.Getdouble(_cursor, index, out value);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString());
+            }
+
+            return value;
+        }
+
+        public string GetStringValue(int index)
+        {
+            ResultType ret;
+            int size;
+            byte[] value;
+            string text;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            size = Interop.DataControl.GetItemSize(_cursor, index);
+            if (size < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, false, "Invalid size");
+            }
+
+            value = new byte[size + 1];
+            ret = Interop.DataControl.GetText(_cursor, index, value);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false);
+            }
+
+            text = Encoding.UTF8.GetString(value);
+
+            return text;
+        }
+
+        public byte[] GetBlobValue(int index)
+        {
+            ResultType ret;
+            int size;
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnCount)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            size = Interop.DataControl.GetItemSize(_cursor, index);
+            if (size < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, false, "Invalid size");
+            }
+
+            byte_array = new byte[size];
+            ret = Interop.DataControl.GetBlob(_cursor, index, byte_array, size);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false);
+            }
+
+            return byte_array;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj
new file mode 100644 (file)
index 0000000..6dcb040
--- /dev/null
@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.7</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Data Control API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.DataControl.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="System.Diagnostics.Process" Version="4.3.0" PrivateAssets="All" />
+    <PackageReference Include="System.Threading.Thread" Version="4.3.0" PrivateAssets="All" />
+    <PackageReference Include="Tizen" Version="1.0.5" />
+    <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.snk b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.snk
new file mode 100755 (executable)
index 0000000..af23c55
Binary files /dev/null and b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.snk differ
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs
new file mode 100755 (executable)
index 0000000..a3aa164
--- /dev/null
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// Represents BulkData class for DataControl bulk request.
+    /// </summary>
+    public class BulkData : IDisposable
+    {
+        private bool _disposed = false;
+        private Interop.DataControl.SafeBulkDataHandle _handle;
+
+        /// <summary>
+        /// Initializes BulkData class.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        public BulkData()
+        {
+            ResultType ret;
+
+            ret = Interop.DataControl.BulkCreate(out _handle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkCreate");
+            }
+
+        }
+
+        internal BulkData(Interop.DataControl.SafeBulkDataHandle handle)
+        {
+            ResultType ret;
+            int count, i;
+
+            ret = Interop.DataControl.BulkCreate(out _handle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkCreate");
+            }
+
+            ret = Interop.DataControl.BulkGetCount(handle, out count);
+            for ( i = 0; i < count; i++)
+            {
+                IntPtr bundleHandle;
+                Bundle bundle;
+
+                ret = Interop.DataControl.BulkGetData(handle, i, out bundleHandle);
+                if (ret != ResultType.Success)
+                {
+                    ErrorFactory.ThrowException(ret, true, "BulkGetData");
+                }
+
+                bundle = new Bundle(new SafeBundleHandle(bundleHandle, false));
+                ret = Interop.DataControl.BulkAdd(_handle, bundle.SafeBundleHandle);
+                if (ret != ResultType.Success)
+                {
+                    ErrorFactory.ThrowException(ret, true, "BulkAdd");
+                }
+            }
+        }
+
+        internal Interop.DataControl.SafeBulkDataHandle SafeBulkDataHandle
+        {
+            get { return _handle; }
+        }
+
+        /// <summary>
+        /// Adds bulk data.
+        /// </summary>
+        /// <param name="data">Bulk data</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public void Add(Bundle data)
+        {
+            ResultType ret;
+
+            if (data == null || data.SafeBundleHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "data");
+            }
+
+            ret = Interop.DataControl.BulkAdd(_handle, data.SafeBundleHandle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkAdd");
+            }
+        }
+
+        /// <summary>
+        /// Gets current data count.
+        /// </summary>
+        public int GetCount()
+        {
+            int count;
+            ResultType ret;
+
+            ret = Interop.DataControl.BulkGetCount(_handle, out count);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkGetCount");
+            }
+
+            return count;
+        }
+
+        /// <summary>
+        /// Returns the data at the given zero-based data index.
+        /// </summary>
+        /// <param name="index">Target data index</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public Bundle GetData(int index)
+        {
+            IntPtr bundlePtr;
+            Bundle bundle;
+            ResultType ret;
+
+            if (index < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index");
+            }
+
+            ret = Interop.DataControl.BulkGetData(_handle, index, out bundlePtr);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkGetData");
+            }
+
+            bundle = new Bundle(new SafeBundleHandle(bundlePtr, false));
+            return bundle;
+        }
+
+        /// <summary>
+        /// Releases all resources used by the BulkData class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (_handle != null && !_handle.IsInvalid)
+                {
+                    _handle.Dispose();
+                }
+
+                _disposed = true;
+            }
+        }
+
+        ~BulkData()
+        {
+            Dispose(false);
+        }
+    }
+
+    /// <summary>
+    /// Represents BulkResultData class for DataControl bulk request.
+    /// </summary>
+    public class BulkResultData : IDisposable
+    {
+        private const string LogTag = "Tizen.Applications.DataControl";
+        private bool _disposed = false;
+        private Interop.DataControl.SafeBulkResultDataHandle _handle;
+        /// <summary>
+        /// Initializes BulkResultData class.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        public BulkResultData()
+        {
+            ResultType ret;
+
+            ret = Interop.DataControl.BulkResultCreate(out _handle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true,"BulkResultCreate");
+            }
+        }
+
+        internal BulkResultData(Interop.DataControl.SafeBulkResultDataHandle handle)
+        {
+            ResultType ret;
+
+            ret = Interop.DataControl.BulkResultCreate(out _handle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true,"BulkResultCreate");
+            }
+
+            int count;
+            ret = Interop.DataControl.BulkResultGetCount(handle, out count);
+            for (int i = 0; i < count; i++)
+            {
+                IntPtr bundleHandle;
+                Bundle bundle;
+                int result;
+
+                ret = Interop.DataControl.BulkResultGetData(handle, i, out bundleHandle, out result);
+                if (ret != ResultType.Success)
+                {
+                    ErrorFactory.ThrowException(ret, true, "BulkResultGetData");
+                }
+
+                bundle = new Bundle(new SafeBundleHandle(bundleHandle, false));
+                ret = Interop.DataControl.BulkResultAdd(_handle, bundle.SafeBundleHandle, result);
+                if (ret != ResultType.Success)
+                {
+                    ErrorFactory.ThrowException(ret, true, "BulkResultAdd");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Adds bulk operation result data.
+        /// </summary>
+        /// <param name="data">Result data</param>
+        /// <param name="result">Result</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public void Add(Bundle data, int result)
+        {
+            ResultType ret;
+
+            if (data == null || data.SafeBundleHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "data");
+            }
+
+            ret = Interop.DataControl.BulkResultAdd(_handle, data.SafeBundleHandle, result);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkResultAdd");
+            }
+        }
+
+        internal Interop.DataControl.SafeBulkResultDataHandle SafeBulkDataHandle
+        {
+            get { return _handle; }
+        }
+
+        /// <summary>
+        /// Gets current result data count.
+        /// </summary>
+        public int GetCount()
+        {
+            int count;
+            ResultType ret;
+
+            ret = Interop.DataControl.BulkResultGetCount(_handle, out count);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true,"BulkResultGetCount");
+            }
+
+            return count;
+        }
+
+        /// <summary>
+        /// Returns the result data at the given zero-based data index.
+        /// </summary>
+        /// <param name="index">Target result data index</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public Bundle GetData(int index)
+        {
+            IntPtr bundlePtr;
+            Bundle bundle;
+            ResultType ret;
+            int result;
+
+            if (index < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index");
+            }
+
+            ret = Interop.DataControl.BulkResultGetData(_handle, index, out bundlePtr, out result);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkResultGetData");
+            }
+
+            bundle = new Bundle(new SafeBundleHandle(bundlePtr, false));
+            return bundle;
+        }
+
+        /// <summary>
+        /// Returns the result at the given zero-based data index.
+        /// </summary>
+        /// <param name="index">Target result index</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public int GetResult(int index)
+        {
+            IntPtr bundlePtr;
+            ResultType ret;
+            int result;
+
+            if (index < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index");
+            }
+
+            ret = Interop.DataControl.BulkResultGetData(_handle, index, out bundlePtr, out result);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, true, "BulkResultGetData");
+            }
+
+            return result;
+        }
+
+        /// <summary>
+        /// Releases all resources used by the BulkResultData class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (_handle != null && !_handle.IsInvalid)
+                {
+                    _handle.Dispose();
+                }
+
+                _disposed = true;
+            }
+        }
+
+        ~BulkResultData()
+        {
+            Dispose(false);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs
new file mode 100755 (executable)
index 0000000..ddbf6a8
--- /dev/null
@@ -0,0 +1,973 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+using System;
+using System.Collections.Generic;
+using Tizen.Applications.DataControl.Core;
+using System.Threading;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// Represents Consumer class for DataControl consumer application.
+    /// </summary>
+    public abstract class Consumer : IDisposable
+    {
+
+        private Interop.DataControl.SafeDataControlHandle _handle;
+        private string _dataID, _providerID;
+        private int _changeCallbackID = 0;
+        private const string LogTag = "Tizen.Applications.DataControl";
+        private bool _disposed = false;
+        private static Mutex _lock = new Mutex();
+        private Interop.DataControl.DataChangeCallback _dataChangeCallback;
+        private Interop.DataControl.AddCallbackResultCallback _addCallbackResultCallback;
+
+        private static class CallbackManager
+        {
+            private static IDictionary<string, Interop.DataControl.MapResponseCallbacks> _mapResponseCallbacks = new Dictionary<string, Interop.DataControl.MapResponseCallbacks>();
+            private static IDictionary<string, Interop.DataControl.MapBulkAddResponseCallback> _mapBulkResponseCallback = new Dictionary<string, Interop.DataControl.MapBulkAddResponseCallback>();
+            private static IDictionary<string, Interop.DataControl.SqlResponseCallbacks> _sqlResponseCallbacks = new Dictionary<string, Interop.DataControl.SqlResponseCallbacks>();
+            private static IDictionary<string, Interop.DataControl.SqlBulkInsertResponseCallback> _sqlBulkResponseCallback = new Dictionary<string, Interop.DataControl.SqlBulkInsertResponseCallback>();
+            private static IDictionary<int, Consumer> _reqConsumerDictionary = new Dictionary<int, Consumer>();
+            private static IDictionary<string, int> _reqProviderList = new Dictionary<string, int>();
+            private static void InsertResponse(int reqId, IntPtr provider, long insertedRowId, bool providerResult, string error, IntPtr userData)
+            {
+                Log.Debug(LogTag, $"InsertResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}, rowID : {insertedRowId.ToString()}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnInsertResult(new InsertResult(insertedRowId, providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void BulkInsertResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData)
+            {
+                BulkResultData brd;
+                Log.Debug(LogTag, $"BulkInsertResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                if (bulkResults != IntPtr.Zero)
+                {
+                    brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false));
+                }
+                else
+                {
+                    brd = new BulkResultData();
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnBulkInsertResult(new BulkInsertResult(brd, providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void SelectResponse(int reqId, IntPtr provider, IntPtr cursor, bool providerResult, string error, IntPtr userData)
+            {
+                MatrixCursor dmc;
+                Log.Debug(LogTag, $"SelectResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                if (cursor != IntPtr.Zero)
+                {
+                    try
+                    {
+                        dmc = CloneCursor(new CloneCursorCore(new Interop.DataControl.SafeCursorHandle(cursor, true)));
+                    }
+                    catch (Exception ex)
+                    {
+                        dmc = new MatrixCursor();
+                        Log.Error(LogTag, $"reqId {reqId.ToString()},  {ex.ToString()}");
+                    }
+                }
+                else
+                {
+                    dmc = new MatrixCursor();
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, cursor is null");
+                }
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnSelectResult(new SelectResult(dmc, providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void UpdateResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData)
+            {
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnUpdateResult(new UpdateResult(providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void DeleteResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData)
+            {
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnDeleteResult(new DeleteResult(providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void MapGetResponse(int reqId, IntPtr provider, string[] valueList, int valueCount, bool providerResult, string error, IntPtr userData)
+            {
+                MapGetResult mgr;
+                Log.Debug(LogTag, $"MapGetResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                if (valueList !=null)
+                {
+                    mgr = new MapGetResult(valueList, providerResult);
+                }
+                else
+                {
+                    mgr = new MapGetResult(new string[0], providerResult);
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, valueList is null");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnMapGetResult(mgr);
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void MapBulkAddResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData)
+            {
+                BulkResultData brd;
+                Log.Debug(LogTag, $"MapBulkAddResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                if (bulkResults != IntPtr.Zero)
+                {
+                    brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false));
+                }
+                else
+                {
+                    brd = new BulkResultData();
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnMapBulkAddResult(new MapBulkAddResult(brd, providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void MapAddResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData)
+            {
+                Log.Debug(LogTag, $"MapAddResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnMapAddResult(new MapAddResult(providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void MapSetResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData)
+            {
+                Log.Debug(LogTag, $"MapSetResponse {reqId.ToString()}");
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnMapSetResult(new MapSetResult(providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static void MapRemoveResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData)
+            {
+                if (!_reqConsumerDictionary.ContainsKey(reqId))
+                {
+                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
+                    return;
+                }
+
+                if (!providerResult)
+                {
+                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
+                }
+
+                Consumer consumer = _reqConsumerDictionary[reqId];
+                consumer.OnMapRemoveResult(new MapRemoveResult(providerResult));
+                _reqConsumerDictionary.Remove(reqId);
+            }
+
+            private static MatrixCursor CloneCursor(CloneCursorCore coreCursor)
+            {
+                int size = coreCursor.GetColumnCount();
+                int i;
+                string[] name = new string[size];
+                object[] newRow = new object[size];
+                ColumnType[] type = new ColumnType[size];
+
+                for (i = 0; i < size; i++)
+                {
+                    name[i] = coreCursor.GetColumnName(i);
+                    type[i] = coreCursor.GetColumnType(i);
+                }
+
+                MatrixCursor dmc = new MatrixCursor(name, type);
+
+                if (coreCursor.GetRowCount() <= 0)
+                {
+                    return dmc;
+                }
+
+                coreCursor.Reset();
+                do
+                {
+                    for (i = 0; i < size; i++)
+                    {
+                        switch (type[i])
+                        {
+                            case ColumnType.ColumnTypeInt:
+                                newRow[i] = coreCursor.GetInt64Value(i);
+                                break;
+                            case ColumnType.ColumnTypeDouble:
+                                newRow[i] = coreCursor.GetDoubleValue(i);
+                                break;
+                            case ColumnType.ColumnTypeBlob:
+                                newRow[i] = coreCursor.GetBlobValue(i);
+                                break;
+                            case ColumnType.ColumnTypeString:
+                                newRow[i] = coreCursor.GetStringValue(i);
+                                break;
+                        }
+                    }
+
+                    dmc.AddRow(newRow);
+                }
+                while (coreCursor.Next());
+
+                return dmc;
+            }
+
+            internal static void RegisterReqId(int reqId, Consumer consumer)
+            {
+                _lock.WaitOne();
+                _reqConsumerDictionary.Add(reqId, consumer);
+                _lock.ReleaseMutex();
+            }
+
+            internal static void RegisterCallback(Interop.DataControl.SafeDataControlHandle handle, string providerId)
+            {
+                ResultType ret;
+                Interop.DataControl.SqlResponseCallbacks sqlCallbacks;
+                Interop.DataControl.SqlBulkInsertResponseCallback sqlBulkCallbacks;
+                Interop.DataControl.MapResponseCallbacks mapCallbacks;
+                Interop.DataControl.MapBulkAddResponseCallback mapBulkCallbacks;
+                bool sqlRegistered = false;
+                bool mapRegistered = false;
+
+                if (_reqProviderList.ContainsKey(providerId))
+                {
+                    _reqProviderList[providerId]++;
+                    Log.Error(LogTag, "The data control is already set");
+                    return;
+                }
+
+                sqlCallbacks.Insert = new Interop.DataControl.SqlInsertResponseCallback(InsertResponse);
+                sqlCallbacks.Select = new Interop.DataControl.SqlSelectResponseCallback(SelectResponse);
+                sqlCallbacks.Update = new Interop.DataControl.SqlUpdateResponseCallback(UpdateResponse);
+                sqlCallbacks.Delete = new Interop.DataControl.SqlDeleteResponseCallback(DeleteResponse);
+                ret = Interop.DataControl.RegisterSqlResponseCallback(handle, ref sqlCallbacks, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Registering the sql callback function is failed : " + ret);
+                }
+                else
+                {
+                    _sqlResponseCallbacks.Add(providerId, sqlCallbacks);
+                    sqlRegistered = true;
+                }
+
+                sqlBulkCallbacks = new Interop.DataControl.SqlBulkInsertResponseCallback(BulkInsertResponse);
+                ret = Interop.DataControl.RegisterSqlBulkResponseCallback(handle, sqlBulkCallbacks, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Registering the sql bulk callback function is failed : " + ret);
+                }
+                else
+                {
+                    _sqlBulkResponseCallback.Add(providerId, sqlBulkCallbacks);
+                }
+
+                mapCallbacks.Add = new Interop.DataControl.MapAddResponseCallback(MapAddResponse);
+                mapCallbacks.Set = new Interop.DataControl.MapSetResponseCallback(MapSetResponse);
+                mapCallbacks.Get = new Interop.DataControl.MapGetResponseCallback(MapGetResponse);
+                mapCallbacks.Remove = new Interop.DataControl.MapRemoveResponseCallback(MapRemoveResponse);
+                ret = Interop.DataControl.RegisterMapResponse(handle, ref mapCallbacks, IntPtr.Zero);
+
+                if (ret != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Registering the map callback function is failed : " + ret);
+                }
+                else
+                {
+                    _mapResponseCallbacks.Add(providerId, mapCallbacks);
+                    mapRegistered = true;
+                }
+
+                mapBulkCallbacks = new Interop.DataControl.MapBulkAddResponseCallback(MapBulkAddResponse);
+                ret = Interop.DataControl.RegisterMapBulkResponseCallback(handle, mapBulkCallbacks, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Registering the map bulk callback function is failed : " + ret);
+                }
+                else
+                {
+                    _mapBulkResponseCallback.Add(providerId, mapBulkCallbacks);
+                }
+
+                if (!mapRegistered && !sqlRegistered)
+                {
+                    ErrorFactory.ThrowException(ret, true, "Registering the response callback function is failed");
+                }
+
+                _reqProviderList.Add(providerId, 1);
+            }
+
+            internal static void UnregisterCallback(Interop.DataControl.SafeDataControlHandle handle, string providerId)
+            {
+                int count;
+
+                _reqProviderList[providerId]--;
+                count = _reqProviderList[providerId];
+                if (count <= 0)
+                {
+                    _reqProviderList.Remove(providerId);
+
+                    _mapResponseCallbacks.Remove(providerId);
+                    Interop.DataControl.UnregisterMapResponse(handle);
+
+                    _mapBulkResponseCallback.Remove(providerId);
+                    Interop.DataControl.UnregisterMapBulkResponseCallback(handle);
+
+                    _sqlResponseCallbacks.Remove(providerId);
+                    Interop.DataControl.UnregisterSqlResponseCallback(handle);
+
+                    _sqlBulkResponseCallback.Remove(providerId);
+                    Interop.DataControl.UnregisterSqlBulkResponseCallback(handle);
+                }
+
+            }
+        }
+
+        /// <summary>
+        /// Sends insert request to provider application.
+        /// </summary>
+        /// <remarks>OnInsertResult will recieve result of this API</remarks>
+        /// <param name="insertData">Insert data</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void Insert(Bundle insertData)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (insertData == null || insertData.SafeBundleHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData");
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.Insert(_handle, insertData.SafeBundleHandle, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Insert");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends select request to provider application.
+        /// </summary>
+        /// <remarks>OnSelectResult will recieve result of this API</remarks>
+        /// <param name="columnList">Select target column list</param>
+        /// <param name="where">Where statement for select query</param>
+        /// <param name="order">Order statement for select query</param>
+        /// <param name="pageNumber">Select target page number</param>
+        /// <param name="countPerPage">Select row count per page</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void Select(string[] columnList, string where, string order, int pageNumber = 1, int countPerPage = 20)
+        {
+            int reqId, i;
+            ResultType ret;
+            if (columnList == null || columnList.Length == 0)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column_list");
+            }
+
+            for (i = 0; i < columnList.Length; i++)
+            {
+                if (string.IsNullOrEmpty(columnList[i]))
+                {
+                    ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column_list index " + i.ToString());
+                }
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.Select(_handle, columnList, columnList.Length, where, order, pageNumber, countPerPage, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Select");
+            }
+            Log.Info(LogTag, "select end. " + reqId.ToString());
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends delete request to provider application.
+        /// </summary>
+        /// <remarks>OnDeleteResult will recieve result of this API</remarks>
+        /// <param name="where">Where statement for delete query</param>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void Delete(string where)
+        {
+            int reqId;
+            ResultType ret;
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.Delete(_handle, where, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Delete");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends update request to provider application.
+        /// </summary>
+        /// <remarks>OnUpdateResult will recieve result of this API</remarks>
+        /// <param name="updateData">Update data</param>
+        /// <param name="where">Where statement for query</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void Update(Bundle updateData, string where)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (updateData == null || updateData.SafeBundleHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData");
+            }
+
+            if (string.IsNullOrEmpty(where))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "where");
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.Update(_handle, updateData.SafeBundleHandle, where, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Update");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends bulk insert request to provider application.
+        /// </summary>
+        /// <remarks>OnBulkInsertResult will recieve result of this API</remarks>
+        /// <param name="insertData">Bulk insert data</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void BulkInsert(BulkData insertData)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (insertData == null || insertData.SafeBulkDataHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData");
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.BulkInsert(_handle, insertData.SafeBulkDataHandle, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "BulkInsert");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends map add request to provider application.
+        /// </summary>
+        /// <remarks>OnMapAddResult will recieve result of this API</remarks>
+        /// <param name="key">The key of the value to add</param>
+        /// <param name="value">The value to add</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void MapAdd(string key, string value)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.MapAdd(_handle, key, value, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "MapAdd");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends map get request to provider application.
+        /// </summary>
+        /// <remarks>OnMapGetResult will recieve result of this API</remarks>
+        /// <param name="key">The key of the value list to obtain</param>
+        /// <param name="pageNumber">The page number of the value set</param>
+        /// <param name="countPerPage">The desired maximum count of the data items per page</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void MapGet(string key, int pageNumber = 1, int countPerPage = 20)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (string.IsNullOrEmpty(key) || pageNumber <= 0 || countPerPage <= 0)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.MapGet(_handle, key, out reqId, pageNumber, countPerPage);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "MapGet");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends map remove request to provider application.
+        /// </summary>
+        /// <remarks>OnMapRemoveResult will recieve result of this API</remarks>
+        /// <param name="key">The key of the value to remove</param>
+        /// <param name="value">The value to remove</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void MapRemove(string key, string value)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.MapRemove(_handle, key, value, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "MapRemove");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends map set request to provider application.
+        /// </summary>
+        /// <remarks>OnMapSetResult will recieve result of this API</remarks>
+        /// <param name="key">The key of the value to replace</param>
+        /// <param name="oldValue">The value to be replaced</param>
+        /// <param name="newValue"> The new value that replaces the existing value</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void MapSet(string key, string oldValue, string newValue)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(oldValue) || string.IsNullOrEmpty(newValue))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.MapSet(_handle, key, oldValue, newValue, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "MapSet");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        /// <summary>
+        /// Sends map bulk add request to provider application.
+        /// </summary>
+        /// <remarks>OnMapBulkAddResult will recieve result of this API</remarks>
+        /// <param name="addData">Map bulk add data</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(1MB)</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void MapBulkAdd(BulkData addData)
+        {
+            int reqId;
+            ResultType ret;
+
+            if (addData == null || addData.SafeBulkDataHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "addData");
+            }
+
+            _lock.WaitOne();
+            ret = Interop.DataControl.BulkAdd(_handle, addData.SafeBulkDataHandle, out reqId);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "BulkAdd");
+            }
+
+            CallbackManager.RegisterReqId(reqId, this);
+        }
+
+        private void DataChange(IntPtr handle, ChangeType type, IntPtr data, IntPtr userData)
+        {
+            OnDataChange(type, new Bundle(new SafeBundleHandle(data, false)));
+        }
+
+        private void DataChangeListenResult(IntPtr handle, ResultType type, int callbackId, IntPtr userData)
+        {
+            OnDataChangeListenResult(new DataChangeListenResult(type));
+        }
+
+        /// <summary>
+        /// Listen DataChange event
+        /// </summary>
+        /// <remarks>OnDataChangeListenResult will recieve result of this API</remarks>
+        /// <remarks>If success, OnDataChange will recieve DataChange event</remarks>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void DataChangeListen()
+        {
+            ResultType ret;
+            _lock.WaitOne();
+            /* Only one callback is allowed for every obejct */
+            if (_changeCallbackID > 0)
+            {
+                _lock.ReleaseMutex();
+                return;
+            }
+            _dataChangeCallback = new Interop.DataControl.DataChangeCallback(DataChange);
+            _addCallbackResultCallback = new Interop.DataControl.AddCallbackResultCallback(DataChangeListenResult);
+            ret = Interop.DataControl.AddDataChangeCallback(_handle, _dataChangeCallback, IntPtr.Zero,
+                      _addCallbackResultCallback , IntPtr.Zero, out _changeCallbackID);
+            _lock.ReleaseMutex();
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "DataChangeListen");
+            }
+        }
+
+        /// <summary>
+        /// Initializes Consumer class with providerId and dataId.
+        /// </summary>
+        /// <param name="providerId">DataControl Provider ID</param>
+        /// <param name="dataId">DataControl Data ID</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        public Consumer(string providerId, string dataId)
+        {
+            ResultType ret;
+
+            if (string.IsNullOrEmpty(providerId))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "providerId");
+            }
+
+            if (string.IsNullOrEmpty(dataId))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "dataId");
+            }
+
+            ret = Interop.DataControl.DataControlCreate(out _handle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false, "Creating data control handle is failed");
+            }
+
+            Interop.DataControl.DataControlSetProviderId(_handle, providerId);
+            Interop.DataControl.DataControlSetDataId(_handle, dataId);
+            CallbackManager.RegisterCallback(_handle, providerId);
+            _dataID = dataId;
+            _providerID = providerId;
+        }
+
+        ~Consumer()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the DataChangeListen result is received.
+        /// </summary>
+        protected virtual void OnDataChangeListenResult(DataChangeListenResult result)
+        {
+            Log.Info(LogTag, "The OnDataChangeListenResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the data change event is received.
+        /// </summary>
+        protected virtual void OnDataChange(ChangeType type, Bundle data)
+        {
+            Log.Info(LogTag, "The OnDataChange is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the select response is received.
+        /// </summary>
+        protected abstract void OnSelectResult(SelectResult result);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the insert response is received.
+        /// </summary>
+        protected abstract void OnInsertResult(InsertResult result);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the update response is received.
+        /// </summary>
+        protected abstract void OnUpdateResult(UpdateResult result);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the delete response is received.
+        /// </summary>
+        protected abstract void OnDeleteResult(DeleteResult result);
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the BulkInsert response is received.
+        /// </summary>
+        protected virtual void OnBulkInsertResult(BulkInsertResult result)
+        {
+            Log.Info(LogTag, "The OnBulkInsertResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map get response is received.
+        /// </summary>
+        protected virtual void OnMapGetResult(MapGetResult result)
+        {
+            Log.Info(LogTag, "The OnMapGetResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map add response is received.
+        /// </summary>
+        protected virtual void OnMapAddResult(MapAddResult result)
+        {
+            Log.Info(LogTag, "The OnMapAddResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map set response is received.
+        /// </summary>
+        protected virtual void OnMapSetResult(MapSetResult result)
+        {
+            Log.Info(LogTag, "The OnMapSetResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map remove response is received.
+        /// </summary>
+        protected virtual void OnMapRemoveResult(MapRemoveResult result)
+        {
+            Log.Info(LogTag, "The OnMapRemoveResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the BulkAdd response is received.
+        /// </summary>
+        protected virtual void OnMapBulkAddResult(MapBulkAddResult result)
+        {
+            Log.Info(LogTag, "The OnMapBulkAddResult is not implemented.");
+        }
+
+        /// <summary>
+        /// Releases the unmanaged resourced used by the Consumer class specifying whether to perform a normal dispose operation.
+        /// </summary>
+        /// <param name="disposing">true for a normal dispose operation; false to finalize the handle.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (_changeCallbackID > 0)
+                {
+                    Interop.DataControl.RemoveDataChangeCallback(_handle, _changeCallbackID);
+                }
+
+                CallbackManager.UnregisterCallback(_handle, _providerID);
+                _handle.Dispose();
+                _disposed = true;
+            }
+
+            if (disposing)
+            {
+                GC.SuppressFinalize(this);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the Consumer class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs
new file mode 100755 (executable)
index 0000000..a5712c9
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.CompilerServices;
+
+namespace Tizen.Applications.DataControl
+{
+    internal static class ErrorFactory
+    {
+        private const string LogTag = "Tizen.Applications.DataControl";
+
+        internal static void ThrowException(ResultType errorCode, bool ignoreType, string errorMessage = null,
+            [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
+        {
+            Log.Error(LogTag, $"{memberName}({lineNumber.ToString()}) : {filePath}");
+            if (ignoreType)
+            {
+                throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "error code : " + errorCode.ToString() :
+                     $"{errorMessage} - {errorCode}");
+            }
+
+            switch (errorCode)
+            {
+                case ResultType.Success:
+                    return;
+                case ResultType.OutOfMemory:
+                case ResultType.IoError:
+                    throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "error code : " + errorCode.ToString() :
+                        $"{errorMessage} - {errorCode}");
+                case ResultType.InvalidParameter:
+                    Log.Error(LogTag, "Invalid parameter : " + errorMessage);
+                    throw new ArgumentException(string.IsNullOrEmpty(errorMessage) ? "Invalid parameter" : "Invalid parameter : " + errorMessage);
+                case ResultType.PermissionDenied:
+                    Log.Error(LogTag, "Permission denied : " + errorMessage);
+                    throw new UnauthorizedAccessException(string.IsNullOrEmpty(errorMessage) ? "Permission denied" : "Permission denied : " + errorMessage);
+                case ResultType.MaxExceed:
+                    Log.Error(LogTag, "Too long argument : " + errorMessage);
+                    throw new ArgumentOutOfRangeException(string.IsNullOrEmpty(errorMessage) ? "Too long argument" : "Too long argument : " + errorMessage);                
+                default:
+                    Log.Error(LogTag, $"Unknown error : {errorMessage} - {errorCode}");
+                    throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "Unknown error : " + errorCode.ToString() :
+                        $"Unknown error : {errorMessage} - {errorCode}");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs
new file mode 100755 (executable)
index 0000000..4136358
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+using System;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// This interface is for DataControl cursor.
+    /// </summary>
+    public interface ICursor
+    {
+        /// <summary>
+        /// Gets a column count.
+        /// </summary>
+        int GetColumnCount();
+        /// <summary>
+        /// Gets a column type.
+        /// </summary>
+        /// <param name="index">The index of column.</param>
+        ColumnType GetColumnType(int index);
+        /// <summary>
+        /// Gets a column name.
+        /// </summary>
+        /// <param name="index">The index of column.</param>
+        string GetColumnName(int index);
+        /// <summary>
+        /// Gets the numbers of rows in the cursor.
+        /// </summary>
+        long GetRowCount();
+        /// <summary>
+        /// Gets a next row.
+        /// </summary>
+        bool Next();
+        /// <summary>
+        /// Gets a prev row.
+        /// </summary>
+        bool Prev();
+        /// <summary>
+        /// Gets a first row.
+        /// </summary>
+        bool Reset();
+        /// <summary>
+        /// / Gets an int value.
+        /// </summary>
+        /// <param name="index">The index of row.</param>
+        int GetIntValue(int index);
+        /// <summary>
+        /// / Gets an int64 value.
+        /// </summary>
+        /// <param name="index">The index of row.</param>
+        Int64 GetInt64Value(int index);
+        /// <summary>
+        /// Gets an double value.
+        /// </summary>
+        /// <param name="index">The index of row.</param>
+        double GetDoubleValue(int index);
+        /// <summary>
+        /// Gets an string value.
+        /// </summary>
+        /// <param name="index">The index of row.</param>
+        string GetStringValue(int index);
+        /// <summary>
+        /// Gets a blob value.
+        /// </summary>
+        /// <param name="index">The index of row.</param>
+        byte[] GetBlobValue(int index);
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs
new file mode 100755 (executable)
index 0000000..426416e
--- /dev/null
@@ -0,0 +1,629 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using System.Threading;
+using System.Diagnostics;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// Represents MatrixCursor class for DataControl provider's matrix cursor.
+    /// </summary>
+    public class MatrixCursor : IDisposable, ICursor
+    {
+        private const string LogTag = "Tizen.Applications.DataControl";
+        private FileStream _fs;
+        private bool _disposed = false;
+        private string _cursorPath;
+        private long _rowCount = 0;
+        private long _rowCountPosition = 0;
+        private int _currentRowIndex = 0;
+        private IList<long> _rowFieldOffset = new List<long>();
+        private string[] _columnNames;
+        private ColumnType[] _columnTypes;
+        private const int ColumnTypeNull = 5;
+
+        private byte[] GetValue(int index)
+        {
+            byte[] int_tmp = new byte[sizeof(int)];
+            byte[] ret_array;
+            ColumnType type;
+            int size, read_len;
+
+            MoveToColumn(index);
+
+            read_len = _fs.Read(int_tmp, 0, int_tmp.Length);
+            if (read_len != int_tmp.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Column Type " + index.ToString());
+            }
+
+            type = (ColumnType)BitConverter.ToInt32(int_tmp, 0);
+
+            if (type != _columnTypes[index])
+            {
+                if ((int)type == ColumnTypeNull &&
+                    (_columnTypes[index] == ColumnType.ColumnTypeBlob || _columnTypes[index] == ColumnType.ColumnTypeString))
+                {
+                    return null; /* null type */
+                }
+
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Type mismatch " + index.ToString());
+            }
+
+            read_len = _fs.Read(int_tmp, 0, int_tmp.Length);
+            if (read_len != int_tmp.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Column size " + index.ToString());
+            }
+
+            size = BitConverter.ToInt32(int_tmp, 0);
+
+            if (size < 0)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Invalid data size " + index.ToString());
+            }
+
+            ret_array = new byte[size];
+            read_len = _fs.Read(ret_array, 0, ret_array.Length);
+            if (read_len != ret_array.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Column value size " + index.ToString());
+                return null;
+            }
+
+            return ret_array;
+        }
+
+        private void MoveToColumn(int ColumnIndex)
+        {
+            int i, tmp_position;
+            byte[] int_tmp = new byte[sizeof(int)];
+            int read_len;
+            long seek_len;
+
+            seek_len = _fs.Seek(_rowFieldOffset[_currentRowIndex], SeekOrigin.Begin);
+            if (seek_len != _rowFieldOffset[_currentRowIndex])
+            {
+                ErrorFactory.ThrowException(ResultType.IoError, true, "Row index " + _currentRowIndex.ToString());
+            }
+
+            for (i = 0; i < ColumnIndex; i++)
+            {
+                /* type(int) size(int) value */
+                switch (_columnTypes[i])
+                {
+                    case ColumnType.ColumnTypeInt:
+                        tmp_position = sizeof(int) * 2 + sizeof(Int64);
+                        _fs.Seek(tmp_position, SeekOrigin.Current);
+                        break;
+                    case ColumnType.ColumnTypeDouble:
+                        tmp_position = sizeof(int) * 2 + sizeof(double);
+                        _fs.Seek(tmp_position, SeekOrigin.Current);
+                        break;
+                    case ColumnType.ColumnTypeString:
+                        tmp_position = sizeof(int);
+                        _fs.Seek(tmp_position, SeekOrigin.Current);
+                        read_len = _fs.Read(int_tmp, 0, int_tmp.Length);
+                        if (read_len != int_tmp.Length)
+                        {
+                            ErrorFactory.ThrowException(ResultType.IoError, true, "Column Index " + ColumnIndex.ToString());
+                        }
+
+                        tmp_position = BitConverter.ToInt32(int_tmp, 0);
+
+                        if (tmp_position > 0)
+                        {
+                            _fs.Seek(tmp_position, SeekOrigin.Current);
+                        }
+
+                        break;
+                    case ColumnType.ColumnTypeBlob:
+                        tmp_position = sizeof(int);
+                        _fs.Seek(tmp_position, SeekOrigin.Current);
+
+                        read_len = _fs.Read(int_tmp, 0, int_tmp.Length);
+                        if (read_len != int_tmp.Length)
+                        {
+                            ErrorFactory.ThrowException(ResultType.IoError, true, "Column Index " + ColumnIndex.ToString());
+                        }
+
+                        tmp_position = BitConverter.ToInt32(int_tmp, 0);
+
+                        if (tmp_position > 0)
+                        {
+                            _fs.Seek(tmp_position, SeekOrigin.Current);
+                        }
+
+                        break;
+                }
+            }
+
+        }
+
+        internal FileStream GetFileStream()
+        {
+            return _fs;
+        }
+
+        /// <summary>
+        /// Gets column count of MatrixCursor.
+        /// </summary>
+        public int GetColumnCount()
+        {
+            return _columnTypes.Length;
+        }
+
+        /// <summary>
+        /// Returns the column type at the given zero-based column index.
+        /// </summary>
+        /// <param name="index">Target column index</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public ColumnType GetColumnType(int index)
+        {
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            return _columnTypes[index];
+        }
+
+        /// <summary>
+        /// Returns the column name at the given zero-based column index.
+        /// </summary>
+        /// <param name="index">Target column index</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public string GetColumnName(int index)
+        {
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            return _columnNames[index];
+        }
+
+        /// <summary>
+        /// Gets MatrixCursor's row count.
+        /// </summary>
+        public long GetRowCount()
+        {
+            return _rowCount;
+        }
+
+        /// <summary>
+        /// Move the MatrixCursor to the next row.
+        /// </summary>
+        public bool Next()
+        {
+            if (_currentRowIndex >= _rowCount - 1)
+            {
+                return false;
+            }
+
+            _currentRowIndex++;
+            return true;
+        }
+
+        /// <summary>
+        /// Move the MatrixCursor to the previous row.
+        /// </summary>
+        public bool Prev()
+        {
+            if (_currentRowIndex <= 0)
+            {
+                return false;
+            }
+
+            _currentRowIndex--;
+            return true;
+        }
+
+        /// <summary>
+        /// Move the MatrixCursor to the first row.
+        /// </summary>
+        public bool Reset()
+        {
+            _currentRowIndex = 0;
+            return true;
+        }
+
+        /// <summary>
+        /// Returns the value of the requested column as a int.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public int GetIntValue(int index)
+        {
+            int ret;
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            byte_array = GetValue(index);
+            if (byte_array == null)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+            ret = BitConverter.ToInt32(byte_array, 0);
+
+            return ret;
+        }
+
+        /// <summary>
+        /// Returns the value of the requested column as a int64.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public Int64 GetInt64Value(int index)
+        {
+            Int64 ret;
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            byte_array = GetValue(index);
+            if (byte_array == null)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+            ret = BitConverter.ToInt64(byte_array, 0);
+
+            return ret;
+        }
+
+        /// <summary>
+        /// Returns the value of the requested column as a double.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public double GetDoubleValue(int index)
+        {
+            double ret;
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            byte_array = GetValue(index);
+            if (byte_array == null)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+            ret = BitConverter.ToDouble(byte_array, 0);
+
+            return ret;
+        }
+
+        /// <summary>
+        /// Returns the value of the requested column as a string.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public string GetStringValue(int index)
+        {
+            string ret;
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            byte_array = GetValue(index);
+
+            if (byte_array == null)
+            {
+                return null;
+            }
+
+            ret = Encoding.UTF8.GetString(byte_array).TrimEnd('\0');
+            return ret;
+
+        }
+
+        /// <summary>
+        /// Returns the value of the requested column as a blob.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public byte[] GetBlobValue(int index)
+        {
+            byte[] byte_array;
+
+            if (index < 0 || index >= _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            byte_array = GetValue(index);
+            return byte_array;
+        }
+
+        private static class FileManager
+        {
+            private static readonly string DATACONTROL_DIRECTORY = "/tmp/";
+            private static Dictionary<int, int> fileTable = new Dictionary<int, int>();
+            public static string OpenFileStream(int threadID)
+            {
+                string path;
+                int index;
+
+                if (threadID < 0)
+                {
+                    Log.Error(LogTag, "threadID is " + threadID.ToString());
+                    return null;
+                }
+
+                if (fileTable.ContainsKey(threadID) == false)
+                {
+                    fileTable.Add(threadID, 0);
+                }
+
+                index = fileTable[threadID];
+                index++;
+                fileTable[threadID] = index;
+
+                path = DATACONTROL_DIRECTORY + Application.Current.ApplicationInfo.ApplicationId + "_" + Process.GetCurrentProcess().Id.ToString() + "_" + threadID.ToString() + "_" + index.ToString();
+
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// Initializes MatrixCursor class with columnNames and columnTypes.
+        /// </summary>
+        /// <param name="columnNames">MatrixCursor's column name list</param>
+        /// <param name="columnTypes">MatrixCursor's column type list</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        ///  <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        public MatrixCursor(string[] columnNames, ColumnType[] columnTypes)
+        {
+            byte[] byte_tmp, length_tmp, string_tmp;
+            int i, total_len_of_column_names = 0;
+
+            if (columnNames == null || columnTypes == null ||
+                (columnNames.Length != columnTypes.Length) || columnNames.Length < 1)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            for (i = 0; i < columnNames.Length; i++)
+            {
+                if (string.IsNullOrEmpty(columnNames[i]))
+                {
+                    ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "columnNames index " + i.ToString());
+                }
+            }
+
+            for (i = 0; i < columnTypes.Length; i++)
+            {
+                if ( columnTypes[i] < ColumnType.ColumnTypeInt || columnTypes[i] > ColumnType.ColumnTypeBlob)
+                {
+                    ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "columnTypes index" + i.ToString());
+                }
+            }
+
+            _columnNames = columnNames;
+            _columnTypes = columnTypes;
+
+            _cursorPath = FileManager.OpenFileStream(Thread.CurrentThread.ManagedThreadId);
+            if (_cursorPath == null)
+            {
+                Log.Error(LogTag, "Unable to create a cursor file : " + _cursorPath);
+                ErrorFactory.ThrowException(ResultType.IoError, true);
+            }
+
+            _fs = new FileStream(_cursorPath, FileMode.Create);
+            /* column count */
+            byte_tmp = BitConverter.GetBytes(columnNames.Length);
+            _fs.Write(byte_tmp, 0, byte_tmp.Length);
+
+            /* column type */
+            for (i = 0; i < columnTypes.Length; i++)
+            {
+                byte_tmp = BitConverter.GetBytes((int)_columnTypes[i]);
+                _fs.Write(byte_tmp, 0, byte_tmp.Length);
+            }
+
+            /* column name */
+            for (i = 0; i < columnTypes.Length; i++)
+            {
+                string_tmp = Encoding.UTF8.GetBytes(columnNames[i]);
+                byte_tmp = new byte[string_tmp.Length + 1];/*insert null */
+
+                string_tmp.CopyTo(byte_tmp, 0);
+
+                length_tmp = BitConverter.GetBytes(byte_tmp.Length);
+                total_len_of_column_names += length_tmp.Length;
+
+                _fs.Write(length_tmp, 0, length_tmp.Length);
+                _fs.Write(byte_tmp, 0, byte_tmp.Length);
+            }
+
+            /* total length of column names */
+            byte_tmp = BitConverter.GetBytes(total_len_of_column_names);
+            _fs.Write(byte_tmp, 0, byte_tmp.Length);
+
+            _rowCountPosition = _fs.Position;
+            /* row count */
+            byte_tmp = BitConverter.GetBytes(_rowCount);
+            _fs.Write(byte_tmp, 0, byte_tmp.Length);
+            _fs.Flush();
+        }
+
+        internal MatrixCursor()
+        {
+            _columnNames = new string[0];
+            _columnTypes = new ColumnType[0];
+            _fs = null;
+            _cursorPath = null;
+        }
+
+        /// <summary>
+        /// Adds a new row to the end with the given column values.
+        /// </summary>
+        /// <param name="columnValues">New column values</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public void AddRow(object[] columnValues)
+        {
+            int i, size = 0;
+            byte[] type_array, length_array, value_array = null, string_array, byte_tmp;
+
+            if (columnValues == null || columnValues.Length <= 0 || columnValues.Length != _columnTypes.Length)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false);
+            }
+
+            using (MemoryStream ms = new MemoryStream())
+            {
+                for (i = 0; i < _columnTypes.Length; i++)
+                {
+                    type_array = BitConverter.GetBytes((int)_columnTypes[i]);
+                    switch (_columnTypes[i])
+                    {
+                        case ColumnType.ColumnTypeInt:
+                            if (!(columnValues[i] is Int64) && !(columnValues[i] is Int32))
+                            {
+                                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index "  + i.ToString());
+                            }
+
+                            value_array = BitConverter.GetBytes(Convert.ToUInt64(columnValues[i]));
+                            size = value_array.Length;
+                            break;
+                        case ColumnType.ColumnTypeDouble:
+                            if (!(columnValues[i] is Double))
+                            {
+                                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString());
+                            }
+
+                            value_array = BitConverter.GetBytes(Convert.ToDouble(columnValues[i]));
+                            size = value_array.Length;
+                            break;
+                        case ColumnType.ColumnTypeString:
+                            if (columnValues[i] == null)
+                            {
+                                type_array = BitConverter.GetBytes(ColumnTypeNull);
+                                size = 0;
+                                break;
+                            }
+
+                            if (!(columnValues[i] is string))
+                            {
+                                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString());
+                            }
+
+                            string_array = Encoding.UTF8.GetBytes(Convert.ToString(columnValues[i]));
+                            value_array = new byte[string_array.Length + 1];/*insert null */
+                            string_array.CopyTo(value_array, 0);
+                            size = value_array.Length;
+                            break;
+
+                        case ColumnType.ColumnTypeBlob:
+                            if (columnValues[i] == null)
+                            {
+                                type_array = BitConverter.GetBytes(ColumnTypeNull);
+                                size = 0;
+                                break;
+                            }
+
+                            if (!(columnValues[i] is byte[]))
+                            {
+                                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString());
+                            }
+
+                            value_array = (byte[])columnValues[i];
+                            size = value_array.Length;
+                            break;
+                    }
+
+                    ms.Write(type_array, 0, type_array.Length);
+
+                    length_array = BitConverter.GetBytes(size);
+                    ms.Write(length_array, 0, length_array.Length);
+                    if (size > 0)
+                    {
+                        ms.Write(value_array, 0, value_array.Length);
+                    }
+                }
+
+                /* update row count */
+                _rowCount++;
+                byte_tmp = BitConverter.GetBytes(_rowCount);
+                _fs.Seek(_rowCountPosition, SeekOrigin.Begin);
+                _fs.Write(byte_tmp, 0, byte_tmp.Length);
+
+                _fs.Seek(0, SeekOrigin.End);
+
+                _rowFieldOffset.Add(_fs.Position);
+                ms.WriteTo(_fs);/* row data */
+                _fs.Flush();
+
+                Log.Debug(LogTag, "_fs pos = " + _fs.Position.ToString());
+                Log.Debug(LogTag, "_fs len = " + _fs.Length.ToString());
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the MatrixCursor class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                if (!string.IsNullOrEmpty(_cursorPath))
+                {
+                    FileInfo fi = new FileInfo(_cursorPath);
+
+                    if (_fs != null)
+                    {
+                        _fs.Dispose();
+                    }
+
+                    if (fi.Exists)
+                    {
+                        fi.Delete();
+                    }
+                }
+
+                _disposed = true;
+            }
+
+            if (disposing)
+            {
+                GC.SuppressFinalize(this);
+            }
+        }
+
+        ~MatrixCursor()
+        {
+            Dispose(false);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs
new file mode 100755 (executable)
index 0000000..72a1142
--- /dev/null
@@ -0,0 +1,1091 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+using System;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using Tizen.Applications.DataControl;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// Represents Provider class for DataControl provider application.
+    /// </summary>
+    public abstract class Provider : IDisposable
+    {
+        private const string LogTag = "Tizen.Applications.DataControl";
+        private static IDictionary<string, Provider> _providerDict = new Dictionary<string, Provider>();
+        private static Interop.DataControl.SqlRequestCallbacks _sqlRequestCallbacks;
+        private static Interop.DataControl.MapRequestCallbacks _mapRequestCallbacks;
+        private IntPtr _nativeHandle;
+        private static Interop.DataControl.DataChangeConsumerFilterCb _filterCallback;
+        private static int _filterCallbackID;
+        private static bool _filterRegistered;
+        private static Interop.DataControl.SqlBulkInsertRequestCallback _sqlBulkCallback;
+        private static Interop.DataControl.MapBulkAddRequestCallback _mapBulkCallback;
+        private static Mutex _lock = new Mutex();
+        private bool _disposed = false;
+        private bool _isRunning = false;
+
+        /// <summary>
+        /// Gets the data ID
+        /// </summary>
+        public string DataID
+        {
+            get;
+            private set;
+        }
+
+        private static bool DataChangeListenFilter(IntPtr handlePtr, string consumerAppid, IntPtr userData)
+        {
+            Provider provider;
+            DataChangeListenResult result;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return false;
+            }
+
+            result = provider.OnDataChangeListenRequest(consumerAppid);
+            if (result == null || result.Result != ResultType.Success)
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+
+        private enum OperationType : short
+        {
+            Select,
+            Update,
+            Insert,
+            Delete
+        }
+
+        private static string CreateSelectQuery(IntPtr handlePtr, string[] columnList, int columnCount, string where, string order, int pageNum, int countPerPage)
+        {
+            Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false);
+            string query = "SELECT";
+            string dataId;
+            if (columnList == null)
+            {
+                query += " * ";
+            }
+            else
+            {
+                for (int i = 0; i < columnCount; i++)
+                {
+                    if (i != 0)
+                    {
+                        query += ",";
+                    }
+
+                    query += " " + columnList[i];
+                }
+            }
+
+            Interop.DataControl.DataControlGetDataId(handle, out dataId);
+            query += " FROM " + dataId;
+            if (where != null)
+            {
+                query += " WHERE " + where;
+            }
+
+            if (order != null)
+            {
+                query += " ORDER BY " + order;
+            }
+
+            if (pageNum != 0)
+            {
+                query += " LIMIT " + countPerPage + " OFFSET " + (countPerPage * (pageNum - 1));
+            }
+            handle.Dispose();
+            return query;
+        }
+
+        private static void InsertRequest(int requestId, IntPtr handlePtr, IntPtr insertData, IntPtr userData)
+        {
+            Provider provider;
+            InsertResult result;
+            SafeBundleHandle sbh = new SafeBundleHandle(insertData, false);
+            string query = GetQuery(handlePtr, sbh, null, OperationType.Update);
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return;
+            }
+
+            result = provider.OnInsert(query, new Bundle(sbh));
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendInsertResult(requestId, result.RowID);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendInsertResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"InsertResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void BulkInsertRequest(int requestId, IntPtr handlePtr, IntPtr bulk_data, IntPtr userData)
+        {
+            Provider provider;
+            BulkInsertResult result;
+            BulkData bulkData = new BulkData(new Interop.DataControl.SafeBulkDataHandle(bulk_data, false));
+            Interop.DataControl.SafeBulkDataHandle sbdh = bulkData.SafeBulkDataHandle;
+            IntPtr bundleHandel;
+            ResultType ret;
+
+            int count = bulkData.GetCount();
+            List<string> queryList = new List<string>();
+
+            for (int i = 0; i < count; i++)
+            {
+                Interop.DataControl.BulkGetData(sbdh, i, out bundleHandel);
+                queryList.Add(GetQuery(handlePtr, new SafeBundleHandle(bundleHandel, false), null, OperationType.Insert));
+            }
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return;
+            }
+
+            result = provider.OnBulkInsert(queryList, bulkData);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendBulkInsertResult(requestId, result.BulkResultData.SafeBulkDataHandle);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendBulkInsertResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+
+                if (result.BulkResultData != null)
+                {
+                    result.BulkResultData.Dispose();
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"BulkInsertResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void SendNativeProtocol(int socketFd, ICursor cursor, int requestId)
+        {
+            uint write_len;
+            int DATACONTROL_RESULT_NO_DATA = -1;
+            int COLUMN_TYPE_NULL = 5;
+            int column_count, i, rowcount, size = 0, total_len_of_column_names = 0;
+            byte[] type_array, length_array, string_array, int_tmp, value_array = null;
+            string txt;
+            ResultType result;
+            MemoryStream ms;
+
+            if (cursor.Reset() == false)
+            {
+                Log.Error(LogTag, "Reset is failed  :  " + requestId.ToString());
+                return;
+            }
+
+            if (cursor.GetRowCount() <= 0)
+            {
+                Log.Error(LogTag, "The DB does not have another row : " + requestId.ToString());
+                int_tmp = BitConverter.GetBytes(DATACONTROL_RESULT_NO_DATA);
+                result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, int_tmp, int_tmp.Length, out write_len);
+                return;
+            }
+
+            /* 1. column count */
+            column_count = cursor.GetColumnCount();
+            int_tmp = BitConverter.GetBytes(column_count);
+            result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, int_tmp, int_tmp.Length, out write_len);
+            if (result != ResultType.Success)
+            {
+                Log.Error(LogTag, "Writing a column_count to a file descriptor is failed.");
+                return;
+            }
+
+            Log.Info(LogTag, "Writing a column_count " + column_count.ToString());
+
+            /* 2.column type x column_count */
+            for (i = 0; i < column_count; i++)
+            {
+                type_array = BitConverter.GetBytes((int)cursor.GetColumnType(i));
+                result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, type_array, type_array.Length, out write_len);
+                if (result != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Writing a type to a file descriptor is failed.");
+                    return;
+                }
+
+                Log.Info(LogTag, "Writing a column_type " + cursor.GetColumnType(i).ToString());
+            }
+
+            /* 3. column name x column_count */
+            for (i = 0; i < column_count; i++)
+            {
+                Log.Info(LogTag, "Writing a name " + cursor.GetColumnName(i));
+
+                total_len_of_column_names += cursor.GetColumnName(i).Length;
+                string_array = Encoding.UTF8.GetBytes(cursor.GetColumnName(i));
+                value_array = new byte[string_array.Length + 1];/*insert null */
+                string_array.CopyTo(value_array, 0);
+                length_array = BitConverter.GetBytes(value_array.Length);
+
+                result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len);
+                if (result != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Writing a type to a file descriptor is failed.");
+                    return;
+                }
+
+                result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, value_array, value_array.Length, out write_len);
+                if (result != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Writing a type to a file descriptor is failed.");
+                    return;
+                }
+
+            }
+
+            /* 4. total length of column names */
+            length_array = BitConverter.GetBytes(total_len_of_column_names);
+            result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len);
+            if (result != ResultType.Success)
+            {
+                Log.Error(LogTag, "Writing a total_len_of_column_names to a file descriptor is failed");
+                return;
+            }
+
+            Log.Info(LogTag, "Writing  total length of column namese " + total_len_of_column_names.ToString());
+
+            /* 5. row count */
+            length_array = BitConverter.GetBytes(cursor.GetRowCount());
+            Log.Error(LogTag, "=========================== select rowcount " + cursor.GetRowCount().ToString());
+            result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len);
+            if (result != ResultType.Success)
+            {
+                Log.Error(LogTag, "Writing a row count to a file descriptor is failed");
+                return;
+            }
+
+            Log.Error(LogTag, "Writing a row count " + cursor.GetRowCount().ToString());
+
+            rowcount = 0;
+            do
+            {
+                ms = new MemoryStream();
+
+                for (i = 0; i < column_count; i++)
+                {
+                    type_array = BitConverter.GetBytes((int)cursor.GetColumnType(i));
+                    switch (cursor.GetColumnType(i))
+                    {
+                        case ColumnType.ColumnTypeInt:
+                            value_array = BitConverter.GetBytes(cursor.GetInt64Value(i));
+                            size = value_array.Length;
+                            break;
+
+                        case ColumnType.ColumnTypeDouble:
+                            value_array = BitConverter.GetBytes(cursor.GetDoubleValue(i));
+                            size = value_array.Length;
+                            break;
+
+                        case ColumnType.ColumnTypeString:
+                            txt = cursor.GetStringValue(i);
+                            if (txt == null)
+                            {
+                                type_array = BitConverter.GetBytes(COLUMN_TYPE_NULL);
+                                size = 0;
+                                break;
+                            }
+
+                            string_array = Encoding.UTF8.GetBytes(txt);
+                            value_array = new byte[string_array.Length + 1];/*insert null */
+                            string_array.CopyTo(value_array, 0);
+                            size = value_array.Length;
+                            break;
+
+                        case ColumnType.ColumnTypeBlob:
+                            int_tmp = cursor.GetBlobValue(i);
+                            if (int_tmp == null)
+                            {
+                                type_array = BitConverter.GetBytes(COLUMN_TYPE_NULL);
+                                size = 0;
+                                break;
+                            }
+
+                            value_array = int_tmp;
+                            size = value_array.Length;
+                            break;
+                    }
+
+                    ms.Write(type_array, 0, type_array.Length);
+
+                    length_array = BitConverter.GetBytes(size);
+                    ms.Write(length_array, 0, length_array.Length);
+                    if (size > 0)
+                    {
+                        ms.Write(value_array, 0, value_array.Length);
+                    }
+                }
+
+                value_array = ms.ToArray();
+
+                result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, value_array, value_array.Length, out write_len);
+                if (result != ResultType.Success)
+                {
+                    Log.Error(LogTag, "Writing a row to a file descriptor is failed");
+                    ms.Dispose();
+                    return;
+                }
+
+                ms.Dispose();
+                Log.Info(LogTag, "row_count ~~~~ ", rowcount.ToString());
+
+            }
+            while (cursor.Next());
+        }
+
+        private static void SelectRequest(int requestId,
+            IntPtr handlePtr, IntPtr columnList, int columnCount, string where, string order, IntPtr userData)
+        {
+            Provider provider;
+            SelectResult result;
+            int pageNum = 0;
+            int countPerPage = 0;
+            int MAX_WRITE_SIZE = 1024;  /* 1kbyte */
+            string query = null;
+            int socketFd, write_size, i;
+            uint write_len;
+            ResultType ret;
+            string[] _columnList = new string[columnCount];
+            byte[] buffer;
+
+            unsafe
+            {
+                byte** _sbyte_columnList = (byte**)columnList;
+
+                for (i = 0; i < columnCount; i++)
+                {
+                    _columnList[i] = Marshal.PtrToStringAnsi((IntPtr)_sbyte_columnList[i]);
+                }
+            }
+
+            Interop.DataControl.GetSelectPageInfo(requestId, out pageNum, out countPerPage);
+            query = CreateSelectQuery(handlePtr, _columnList, _columnList.Length, where, order, pageNum, countPerPage);
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return;
+            }
+
+            result = provider.OnSelect(query, where, _columnList, _columnList.Length, order, pageNum, countPerPage);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    Interop.DataControl.SendSelectResult(requestId, out socketFd);
+
+                    MatrixCursor mc = result.ResultCursor as MatrixCursor;
+
+                    if (mc == null)
+                    {
+                        SendNativeProtocol(socketFd, result.ResultCursor, requestId);
+                    }
+                    else
+                    {
+                        FileStream fs = mc.GetFileStream();
+                        fs.Seek(0, SeekOrigin.Begin);
+
+                        buffer = new byte[MAX_WRITE_SIZE];
+
+                        do
+                        {
+                            write_size = fs.Read(buffer, 0, MAX_WRITE_SIZE);
+
+                            if (write_size > 0)
+                            {
+                                ret = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, buffer, write_size, out write_len);
+                                if (ret != ResultType.Success)
+                                {
+                                    Log.Error(LogTag, "Writing a row to a file descriptor is failed");
+                                    mc.Dispose();
+                                    return;
+                                }
+                            }
+                        }
+                        while (write_size > 0);
+                        mc.Dispose();
+                    }
+
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"SelectResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void UpdateRequest(int requestId,
+            IntPtr handlePtr, IntPtr updateData, string where, IntPtr userData)
+        {
+            Provider provider;
+            UpdateResult result;
+            SafeBundleHandle sbh = new SafeBundleHandle(updateData, false);
+            string query = GetQuery(handlePtr, sbh, where, OperationType.Update);
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return;
+            }
+
+            result = provider.OnUpdate(query, where, new Bundle(sbh));
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendUpdateResult(requestId);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendUpdateResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"UpdateResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void DeleteRequest(int requestId,
+            IntPtr handlePtr, string where, IntPtr userData)
+        {
+            Provider provider;
+            DeleteResult result;
+            string query = GetQuery(handlePtr, null, where, OperationType.Delete);
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist ");
+                return;
+            }
+
+            result = provider.OnDelete(query, where);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                   ret = Interop.DataControl.SendDeleteResult(requestId);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendDeleteResult fail " + ret.ToString());
+                    }
+
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"DeleteResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void MapAddRequest(int requestId, IntPtr handlePtr, string key, string value, IntPtr userData)
+        {
+            Provider provider;
+            MapAddResult result;
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist");
+                return;
+            }
+
+            result = provider.OnMapAdd(key, value);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendMapResult(requestId);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendMapResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"MapAddResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void MapSetRequest(int requestId, IntPtr handlePtr, string key, string oldValue, string newValue, IntPtr userData)
+        {
+            Provider provider;
+            MapSetResult result;
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist");
+                return;
+            }
+
+            result = provider.OnMapSet(key, oldValue, newValue);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendMapResult(requestId);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendMapResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"MapSetResult is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void MapRemoveRequest(int requestId, IntPtr handlePtr, string key, string value, IntPtr userData)
+        {
+            Provider provider;
+            MapRemoveResult result;
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist");
+                return;
+            }
+
+            result = provider.OnMapRemove(key, value);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendMapResult(requestId);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendMapResult fail " + ret.ToString());
+                    }
+
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestId, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"MapRemoveRequest is null : {requestId.ToString()}");
+            }
+        }
+
+        private static void MapGetRequest(int requestID, IntPtr handlePtr, string key, IntPtr userData)
+        {
+            Provider provider;
+            MapGetResult result;
+            ResultType ret;
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist");
+                return;
+            }
+
+            result = provider.OnMapGet(key);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    int valueCount = 0;
+                    if (result.ValueList != null)
+                        valueCount = result.ValueList.Length;
+                    ret = Interop.DataControl.SendMapGetResult(requestID, result.ValueList, valueCount);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendMapGetResult fail " + ret.ToString());
+                    }
+
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestID, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"MapRemoveRequest is null : {requestID.ToString()}");
+            }
+        }
+
+        private static void MapBulkAddRequest(int requestID, IntPtr handlePtr, IntPtr bulkDataPtr, IntPtr userData)
+        {
+            Provider provider;
+            MapBulkAddResult result;
+            BulkData bulkData = new BulkData(new Interop.DataControl.SafeBulkDataHandle(bulkDataPtr, false));
+            Interop.DataControl.SafeBulkDataHandle sbdh = bulkData.SafeBulkDataHandle;
+            IntPtr bundleHandel;
+            int count = bulkData.GetCount();
+            List<string> queryList = new List<string>();
+            ResultType ret;
+
+            for (int i = 0; i < count; i++)
+            {
+                Interop.DataControl.BulkGetData(sbdh, i, out bundleHandel);
+                queryList.Add(GetQuery(handlePtr, new SafeBundleHandle(bundleHandel, false), null, OperationType.Insert));
+            }
+
+            provider = GetProvider(handlePtr);
+            if (provider == null)
+            {
+                Log.Error(LogTag, "Provider not exist");
+                return;
+            }
+
+            result = provider.OnMapBulkAdd(bulkData);
+            if (result != null)
+            {
+                if (result.Result)
+                {
+                    ret = Interop.DataControl.SendMapBulkAddResult(requestID, result.BulkResultData.SafeBulkDataHandle);
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendMapBulkAddResult fail " + ret.ToString());
+                    }
+                }
+                else
+                {
+                    ret = Interop.DataControl.SendError(requestID, result.Result.ToString());
+                    if (ret != ResultType.Success)
+                    {
+                        Log.Error(LogTag, "SendError fail " + ret.ToString());
+                    }
+                }
+
+                if (result.BulkResultData != null)
+                {
+                    result.BulkResultData.Dispose();
+                }
+            }
+            else
+            {
+                Log.Info(LogTag, $"MapBulkAddRequest is null : {requestID.ToString()}");
+            }
+        }
+
+        private static string GetQuery(IntPtr handlePtr, SafeBundleHandle data, string where, OperationType type)
+        {
+            Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false);
+            string query = null;
+
+            switch (type)
+            {
+                case OperationType.Select:
+                    break;
+                case OperationType.Update:
+                    query = Interop.DataControl.CreateUpdateStatement(handle, data, where);
+                    break;
+                case OperationType.Delete:
+                    query = Interop.DataControl.CreateDeleteStatement(handle, where);
+                    break;
+                case OperationType.Insert:
+                    query = Interop.DataControl.CreateInsertStatement(handle, data);
+                    break;
+                default:
+                    break;
+            }
+            handle.Dispose();
+
+            return query;
+        }
+
+        private static Provider GetProvider(IntPtr handlePtr)
+        {
+            Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false);
+            Provider provider = null;
+            string dataID;
+
+            Interop.DataControl.DataControlGetDataId(handle, out dataID);
+            if (dataID != null && _providerDict.ContainsKey(dataID))
+            {
+                provider = _providerDict[dataID];
+                provider._nativeHandle = handlePtr;
+                Log.Info(LogTag, "DataID :" + dataID + ", hash code : " + provider.GetHashCode().ToString());
+            }
+            handle.Dispose();
+
+            return provider;
+        }
+
+        /// <summary>
+        /// Sends a data change notification to consumer applications which have successfully added a data change listen.
+        /// </summary>
+        /// <param name="type">Changed data type</param>
+        /// <param name="changedData">Customized information about changed data</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        public void SendDataChange(ChangeType type, Bundle changedData)
+        {
+            ResultType ret;
+
+            if (changedData == null || changedData.SafeBundleHandle.IsInvalid)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "changedData");
+            }
+
+            if (this._nativeHandle == IntPtr.Zero)
+            {
+                return;
+            }
+
+            ret = Interop.DataControl.SendDataChange(this._nativeHandle, type, changedData.SafeBundleHandle);
+            if (ret != ResultType.Success)
+            {
+                ErrorFactory.ThrowException(ret, false);
+            }
+        }
+
+        /// <summary>
+        /// Initializes Provider class with dataID.
+        /// </summary>
+        /// <param name="dataID">DataControl Data ID</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public Provider(string dataID)
+        {
+            if (string.IsNullOrEmpty(dataID))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "dataID");
+            }
+
+            DataID = dataID;
+        }
+
+        /// <summary>
+        /// Starts Provider service.
+        /// </summary>
+        /// <remarks>Only one Provider service can be ran for each process</remarks>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/datasharing</privilege>
+        public void Run()
+        {
+            ResultType ret;
+            _lock.WaitOne();
+            if (_providerDict.ContainsKey(DataID))
+            {
+                _lock.ReleaseMutex();
+                ErrorFactory.ThrowException((ResultType)1, true, "The provider is already running");
+                return;
+            }
+
+            if (_providerDict.Count == 0)
+            {
+                Log.Debug(LogTag, "Provider create");
+
+                _sqlRequestCallbacks.Insert = new Interop.DataControl.SqlInsertRequestCallback(InsertRequest);
+                _sqlRequestCallbacks.Select = new Interop.DataControl.SqlSelectRequestCallback(SelectRequest);
+                _sqlRequestCallbacks.Update = new Interop.DataControl.SqlUpdateRequestCallback(UpdateRequest);
+                _sqlRequestCallbacks.Delete = new Interop.DataControl.SqlDeleteRequestCallback(DeleteRequest);
+
+                ret = Interop.DataControl.RegisterSqlRequest(ref _sqlRequestCallbacks, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    _lock.ReleaseMutex();
+                    ErrorFactory.ThrowException(ret, false);
+                }
+
+                _sqlBulkCallback = new Interop.DataControl.SqlBulkInsertRequestCallback(BulkInsertRequest);
+                ret = Interop.DataControl.RegisterSqlBulkRequest(_sqlBulkCallback, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    _lock.ReleaseMutex();
+                    ErrorFactory.ThrowException(ret, false);
+                }
+
+                _mapRequestCallbacks.Add = new Interop.DataControl.MapAddRequestCallback(MapAddRequest);
+                _mapRequestCallbacks.Remove = new Interop.DataControl.MapRemoveRequestCallback(MapRemoveRequest);
+                _mapRequestCallbacks.Set = new Interop.DataControl.MapSetRequestCallback(MapSetRequest);
+                _mapRequestCallbacks.Get = new Interop.DataControl.MapGetRequestCallback(MapGetRequest);
+                ret = Interop.DataControl.RegisterMapRequest(ref _mapRequestCallbacks, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    _lock.ReleaseMutex();
+                    ErrorFactory.ThrowException(ret, false);
+                }
+
+                _mapBulkCallback = new Interop.DataControl.MapBulkAddRequestCallback(MapBulkAddRequest);
+                ret = Interop.DataControl.RegisterMapBulkRequest(_mapBulkCallback, IntPtr.Zero);
+                if (ret != ResultType.Success)
+                {
+                    _lock.ReleaseMutex();
+                    ErrorFactory.ThrowException(ret, false);
+                }
+
+                if (_filterRegistered == false)
+                {
+                    if (_filterCallback == null)
+                        _filterCallback = new Interop.DataControl.DataChangeConsumerFilterCb(DataChangeListenFilter);
+
+                    ret = Interop.DataControl.AddDataChangeConsumerFilterCallback(
+                         _filterCallback,
+                         IntPtr.Zero, out _filterCallbackID);
+
+                    if (ret != ResultType.Success)
+                    {
+                        _lock.ReleaseMutex();
+                        ErrorFactory.ThrowException(ret, false);
+                    }
+                }
+
+                _filterRegistered = true;
+            }
+
+            _providerDict.Add(DataID, this);
+            Log.Info(LogTag, "DataID :" + DataID + ", hash code : " + this.GetHashCode().ToString());
+            _isRunning = true;
+            _lock.ReleaseMutex();
+        }
+
+        /// <summary>
+        /// Stop Provider service.
+        /// </summary>
+        public void Stop()
+        {
+            if (_isRunning == true)
+            {
+                Log.Info(LogTag, "DataID :" + DataID);
+                _isRunning = false;
+                _providerDict.Remove(DataID);
+            }
+        }
+
+        ~Provider()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the select request is received.
+        /// </summary>
+        protected abstract SelectResult OnSelect(string query, string where, string[] columList, int columnCount, string order, int pageNum, int countPerPage);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the insert request is received.
+        /// </summary>
+        protected abstract InsertResult OnInsert(string query, Bundle insertData);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the update request is received.
+        /// </summary>
+        protected abstract UpdateResult OnUpdate(string query, string where, Bundle updateData);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the delete request is received.
+        /// </summary>
+        protected abstract DeleteResult OnDelete(string query, string where);
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the bulk insert request is received.
+        /// </summary>
+        protected virtual BulkInsertResult OnBulkInsert(IEnumerable<string> query, BulkData bulkInsertData)
+        {
+            Log.Info(LogTag, "The OnBulkInsert is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map get request is received.
+        /// </summary>
+        protected virtual MapGetResult OnMapGet(string key)
+        {
+            Log.Info(LogTag, "The OnMapGet is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the map add request is received.
+        /// </summary>
+        protected virtual MapAddResult OnMapAdd(string key, string value)
+        {
+            Log.Info(LogTag, "The OnMapAdd is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the update request is received.
+        /// </summary>
+        protected virtual MapSetResult OnMapSet(string key, string oldValue, string newValue)
+        {
+            Log.Info(LogTag, "The OnMapSet is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the delete request is received.
+        /// </summary>
+        protected virtual MapRemoveResult OnMapRemove(string key, string value)
+        {
+            Log.Info(LogTag, "The OnMapRemove is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the bulk add request is received.
+        /// </summary>
+        protected virtual MapBulkAddResult OnMapBulkAdd(BulkData bulkAddData)
+        {
+            Log.Info(LogTag, "The OnMapBulkAdd is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the data change listen request is received.
+        /// </summary>
+        protected virtual DataChangeListenResult OnDataChangeListenRequest(string requestAppID)
+        {
+            Log.Info(LogTag, "The OnDataChangeListenRequest is not implemented.");
+            return null;
+        }
+
+        /// <summary>
+        /// Releases the unmanaged resourced used by the Provider class specifying whether to perform a normal dispose operation.
+        /// </summary>
+        /// <param name="disposing">true for a normal dispose operation; false to finalize the handle.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposed)
+            {
+                Stop();
+                _disposed = true;
+            }
+            if (disposing)
+            {
+                GC.SuppressFinalize(this);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the Provider class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs
new file mode 100755 (executable)
index 0000000..81f63a5
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications.DataControl
+{
+    /// <summary>
+    /// This class is for containing insert operation result.
+    /// </summary>
+    public class InsertResult
+    {
+        /// <summary>
+        /// Gets the insert data's row id.
+        /// </summary>
+        public long RowID
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Gets the insert operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes InsertResult class with columnNames and columnTypes.
+        /// </summary>
+        /// <param name="rowID">Inserted row ID</param>
+        /// <param name="result">Insert request result</param>
+        public InsertResult(long rowID, bool result)
+        {
+            RowID = rowID;
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing bulk insert operation result.
+    /// </summary>
+    public class BulkInsertResult
+    {
+        /// <summary>
+        /// Gets the bulk insert operation result data.
+        /// </summary>
+        public BulkResultData BulkResultData
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Gets the bulk insert operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes InsertResult class with bulkResultData and result.
+        /// </summary>
+        /// <param name="bulkResultData">Bulk insert request result data</param>
+        /// <param name="result">Bulk insert request result</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public BulkInsertResult(BulkResultData bulkResultData, bool result)
+        {
+            if (result == true && (bulkResultData == null || bulkResultData.SafeBulkDataHandle.IsInvalid))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "bulkResultData");
+            }
+
+            BulkResultData = bulkResultData;
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing update operation result.
+    /// </summary>
+    public class UpdateResult
+    {
+        /// <summary>
+        /// Gets the update operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes UpdateResult class with result.
+        /// </summary>
+        /// <param name="result">Update request result</param>
+        public UpdateResult(bool result)
+        {
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing delete operation result.
+    /// </summary>
+    public class DeleteResult
+    {
+        /// <summary>
+        /// Gets the delete operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes DeleteResult class with result.
+        /// </summary>
+        /// <param name="result">Delete request result</param>
+        public DeleteResult(bool result)
+        {
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing select operation result.
+    /// </summary>
+    public class SelectResult
+    {
+        /// <summary>
+        /// Gets the select operation result cursor.
+        /// </summary>
+        public ICursor ResultCursor
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// Gets the select operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes SelectResult class with cursor and result.
+        /// </summary>
+        /// <param name="cursor">Cursor with selected data</param>
+        /// <param name="result">Select request result</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public SelectResult(ICursor cursor, bool result)
+        {
+            int i;
+
+            if (result == true && cursor == null)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "cursor");
+            }
+
+            if (result == true && (cursor is MatrixCursor) == false)
+            {
+                if (cursor.GetColumnCount() <= 0)
+                {
+                    ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column count");
+                }
+
+                for (i = 0; i < cursor.GetColumnCount(); i++)
+                {
+                    if (string.IsNullOrEmpty(cursor.GetColumnName(i)))
+                    {
+                        ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column name index " + i.ToString());
+                    }
+
+                    if (cursor.GetColumnType(i) < ColumnType.ColumnTypeInt || cursor.GetColumnType(i) > ColumnType.ColumnTypeBlob)
+                    {
+                        ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column type index" + i.ToString());
+                    }
+                }
+            }
+
+            ResultCursor = cursor;
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing MapAdd operation result.
+    /// </summary>
+    public class MapAddResult
+    {
+
+        /// <summary>
+        /// Gets the MapAdd operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes MapAddResult class with result.
+        /// </summary>
+        /// <param name="result">MapAdd request result</param>
+        public MapAddResult(bool result)
+        {
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing MapBulkAdd operation result.
+    /// </summary>
+    public class MapBulkAddResult
+    {
+        /// <summary>
+        /// Gets the MapBulkAdd operation result data.
+        /// </summary>
+        public BulkResultData BulkResultData
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Gets the MapBulkAdd operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes MapBulkAddResult class with bulkResultData and result.
+        /// </summary>
+        /// <param name="bulkResultData">MapBulkAdd request result data</param>
+        /// <param name="result">MapBulkAdd request result</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public MapBulkAddResult(BulkResultData bulkResultData, bool result)
+        {
+            if (result == true && (bulkResultData == null || bulkResultData.SafeBulkDataHandle.IsInvalid))
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "bulkResultData");
+            }
+
+            BulkResultData = bulkResultData;
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing MapSet operation result.
+    /// </summary>
+    public class MapSetResult
+    {
+        /// <summary>
+        /// Gets the MapSet operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes MapSetResult class with result.
+        /// </summary>
+        /// <param name="result">MapSet request result</param>
+        public MapSetResult(bool result)
+        {
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing MapRemove operation result.
+    /// </summary>
+    public class MapRemoveResult
+    {
+        /// <summary>
+        /// Gets the MapRemove operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes MapRemoveResult class with result.
+        /// </summary>
+        /// <param name="result">MapRemove request result</param>
+        public MapRemoveResult(bool result)
+        {
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing MapGet operation result.
+    /// </summary>
+    public class MapGetResult
+    {
+        /// <summary>
+        /// Gets the result value list of the MapGet operation.
+        /// </summary>
+        public string[] ValueList
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// Gets the MapGet operation result.
+        /// </summary>
+        public bool Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes MapGetResult class with data and result.
+        /// </summary>
+        /// <param name="valueLIst">MapGet request result data</param>
+        /// <param name="result">MapGet request result</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parmaeter.</exception>
+        public MapGetResult(string[] valueLIst, bool result)
+        {
+            if (result == true && valueLIst == null)
+            {
+                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "valueLIst");
+            }
+
+            ValueList = valueLIst;
+            Result = result;
+        }
+    }
+
+    /// <summary>
+    /// This class is for containing DataChangeListen operation result.
+    /// </summary>
+    public class DataChangeListenResult
+    {
+        /// <summary>
+        /// Gets the DataChangeListen operation result.
+        /// </summary>
+        public ResultType Result
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Initializes DataChangeListenResult class with result.
+        /// </summary>
+        /// <param name="result">DataChangeListen request result</param>
+        public DataChangeListenResult(ResultType result)
+        {
+            Result = result;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs
new file mode 100755 (executable)
index 0000000..09d25a6
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications.DataControl
+{
+
+    /// <summary>
+    /// Enumeration for DataControl column type
+    /// </summary>
+    public enum ColumnType : short
+    {
+        /// <summary>
+        /// Value representing DataControl operation Success
+        /// </summary>
+        ColumnTypeInt = 1,
+        /// <summary>
+        /// Value representing DataControl operation Success
+        /// </summary>
+        ColumnTypeDouble = 2,
+        /// <summary>
+        /// Value representing DataControl operation Success
+        /// </summary>
+        ColumnTypeString = 3,
+        /// <summary>
+        /// Value representing DataControl operation Success
+        /// </summary>
+        ColumnTypeBlob = 4
+    }
+
+    /// <summary>
+    /// Enumeration for DataControl column type
+    /// </summary>
+    public enum ChangeType : short
+    {
+        /// <summary>
+        /// Value representing DataControl provider data changed by update
+        /// </summary>
+        Update,
+        /// <summary>
+        /// Value representing DataControl provider data changed by insert
+        /// </summary>
+        Insert,
+        /// <summary>
+        /// Value representing DataControl provider data changed by delete
+        /// </summary>
+        Delete,
+        /// <summary>
+        /// Value representing DataControl provider data changed by map add
+        /// </summary>
+        MapAdd,
+        /// <summary>
+        /// Value representing DataControl provider data changed by map remove
+        /// </summary>
+        MapRemove,
+        /// <summary>
+        /// Value representing DataControl provider data changed by map set
+        /// </summary>
+        MapSet,
+    }
+
+    /// <summary>
+    /// Enumeration for DataControl result type
+    /// </summary>
+    public enum ResultType : int
+    {
+        /// <summary>
+        /// Value representing DataControl operation success
+        /// </summary>
+        Success = Interop.DataControl.NativeResultType.Success,
+        /// <summary>
+        /// Value representing DataControl operation cause out of memory error
+        /// </summary>
+        OutOfMemory = Interop.DataControl.NativeResultType.OutOfMemory,
+        /// <summary>
+        /// Value representing DataControl operation cause IO error
+        /// </summary>
+        IoError = Interop.DataControl.NativeResultType.IoError,
+        /// <summary>
+        /// Value representing DataControl operation cause Invalid parameter error
+        /// </summary>
+        InvalidParameter = Interop.DataControl.NativeResultType.InvalidParameter,
+        /// <summary>
+        /// Value representing DataControl operation cause permission denied error
+        /// </summary>
+        PermissionDenied = Interop.DataControl.NativeResultType.PermissionDenied,
+        /// <summary>
+        /// Value representing DataControl operation cause max exceed error
+        /// </summary>
+        MaxExceed = Interop.DataControl.NativeResultType.MaxExceed,
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs b/src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..2b7e4da
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string MessagePort = "libmessage-port.so.1";
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs b/src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs
new file mode 100755 (executable)
index 0000000..bcbbc63
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class MessagePort
+    {
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_register_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int RegisterPort(string local_port, message_port_message_cb callback, IntPtr userData);
+
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_register_trusted_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int RegisterTrustedPort(string trusted_local_port, message_port_message_cb callback, IntPtr userData);
+
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_unregister_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UnregisterPort(int local_port_id);
+
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_unregister_trusted_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int UnregisterTrustedPort(int trusted_local_port_id);
+
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_send_message_with_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SendMessageWithLocalPort(string remote_app_id, string remote_port, SafeBundleHandle message, int local_port_id);
+
+        [DllImport(Libraries.MessagePort, EntryPoint = "message_port_send_trusted_message_with_local_port", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int SendTrustedMessageWithLocalPort(string remote_app_id, string remote_port, SafeBundleHandle message, int local_port_id);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void message_port_message_cb(int local_port_id, string remote_app_id, string remote_port, bool trusted_remote_port, IntPtr message, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj b/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj
new file mode 100755 (executable)
index 0000000..fb42a2b
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.8</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.MessagePort.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.snk b/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.snk differ
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs
new file mode 100755 (executable)
index 0000000..26632e4
--- /dev/null
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using Tizen.Applications;
+
+namespace Tizen.Applications.Messages
+{
+    /// <summary>
+    /// The Message Port API provides functions to send and receive messages between applications.
+    /// </summary>
+    /// <remarks>
+    /// The Message Port API provides functions for passing messages between applications. An application should register its own local port to receive messages from remote applications.
+    /// If a remote application sends a message, the registered callback function of the local port is called.
+    /// The trusted message-port API allows communications between applications that are signed by the same developer(author) certificate.
+    /// </remarks>
+    public class MessagePort : IDisposable
+    {
+        private static readonly object s_lock = new object();
+        private static readonly HashSet<string> s_portMap = new HashSet<string>();
+
+        // The name of the local message port
+        private readonly string _portName = null;
+
+        // If true the message port is a trusted port, otherwise false it is not
+        private readonly bool _trusted = false;
+
+        // The local message port ID
+        private int _portId = 0;
+
+        // If true the message port is listening, otherwise false it is not
+        private bool _listening = false;
+
+        private Interop.MessagePort.message_port_message_cb _messageCallBack;
+
+        /// <summary>
+        /// Initializes the instance of the MessagePort class.
+        /// </summary>
+        /// <param name="portName">The name of the local message port</param>
+        /// <param name="trusted">If true is the trusted message port of application, otherwise false</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when portName is null or empty</exception>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// </code>
+        public MessagePort(string portName, bool trusted)
+        {
+            if (String.IsNullOrEmpty(portName))
+            {
+                MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidParameter, "Invalid PortName", "PortName");
+            }
+            _portName = portName;
+            _trusted = trusted;
+        }
+
+        /// <summary>
+        /// Destructor of the MessagePort class.
+        /// </summary>
+        ~MessagePort()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Called when a message is received.
+        /// </summary>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// messagePort.MessageReceived += MessageReceivedCallback;
+        /// static void MessageReceivedCallback(object sender, MessageReceivedEventArgs e)
+        /// {
+        ///     Console.WriteLine("Message Received ");
+        ///     if (e.Remote.AppId != null) {
+        ///         Console.WriteLine("from :"+e.Remote.AppId);
+        ///     }
+        /// }
+        /// </code>
+        public event EventHandler<MessageReceivedEventArgs> MessageReceived;
+
+        /// <summary>
+        /// The name of the local message port
+        /// </summary>
+        public string PortName
+        {
+            get
+            {
+                return _portName;
+            }
+        }
+        /// <summary>
+        /// If true the message port is a trusted port, otherwise false it is not
+        /// </summary>
+        public bool Trusted
+        {
+            get
+            {
+                return _trusted;
+            }
+        }
+
+        /// <summary>
+        /// If true the message port is listening, otherwise false it is not
+        /// </summary>
+        public bool Listening
+        {
+            get
+            {
+                return _listening;
+            }
+        }
+
+        /// <summary>
+        /// Register the local message port.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when portName is already used, when there is an invalid parameter, when out of memory, when there is an I/O error</exception>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// messagePort.MessageReceived += MessageReceivedCallback;
+        /// messagePort.Listen();
+        /// </code>
+        public void Listen()
+        {
+            lock (s_lock)
+            {
+                if (s_portMap.Contains(_portName))
+                {
+                    throw new InvalidOperationException(_portName + " is already used");
+                }
+                _messageCallBack = (int localPortId, string remoteAppId, string remotePortName, bool trusted, IntPtr message, IntPtr userData) =>
+                {
+                    MessageReceivedEventArgs args = new MessageReceivedEventArgs()
+                    {
+                        Message = new Bundle(new SafeBundleHandle(message, false))
+                    };
+
+                    if (!String.IsNullOrEmpty(remotePortName) && !String.IsNullOrEmpty(remoteAppId))
+                    {
+                        args.Remote = new RemoteValues()
+                        {
+                            AppId = remoteAppId,
+                            PortName = remotePortName,
+                            Trusted = trusted
+                        };
+                    }
+                    MessageReceived?.Invoke(this, args);
+                };
+
+                _portId = _trusted ?
+                            Interop.MessagePort.RegisterTrustedPort(_portName, _messageCallBack, IntPtr.Zero) :
+                            Interop.MessagePort.RegisterPort(_portName, _messageCallBack, IntPtr.Zero);
+
+                if (_portId <= 0)
+                    throw new InvalidOperationException("Can't Listening with " + _portName);
+
+                s_portMap.Add(_portName);
+                _listening = true;
+            }
+        }
+
+        /// <summary>
+        /// Unregisters the local message port.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when messageport is already stopped, when there is an invalid parameter, when the port is not found, when out of memory, when there is an I/O error</exception>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// messagePort.MessageReceived += MessageReceivedCallback;
+        /// messagePort.Listen();
+        /// using (var message = new Tizen.Application.Bundle())
+        /// {
+        ///     message.AddItem("message", "a_string");
+        ///     messagePort.Send(message, "ReceiverAppID", "ReceiverPort");
+        /// }
+        /// messageProt.StopListening();
+        /// </code>
+        public void StopListening()
+        {
+            if (!_listening)
+            {
+                throw new InvalidOperationException("Already stopped");
+            }
+
+            int ret = _trusted ?
+                        Interop.MessagePort.UnregisterTrustedPort(_portId) :
+                        Interop.MessagePort.UnregisterPort(_portId);
+
+            if (ret != (int)MessagePortError.None)
+            {
+                MessagePortErrorFactory.ThrowException(ret);
+            }
+
+            lock (s_lock)
+            {
+                s_portMap.Remove(_portName);
+            }
+            _portId = 0;
+            _listening = false;
+        }
+
+        /// <summary>
+        /// Sends a untrusted message to the message port of a remote application.
+        /// </summary>
+        /// <param name="message">The message to be passed to the remote application, the recommended message size is under 4KB</param>
+        /// <param name="remoteAppId">The ID of the remote application</param>
+        /// <param name="remotePortName">The name of the remote message port</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when there is an invalid parameter, when the port is not found, when out of memory, when there is an I/O error</exception>
+        /// <exception cref="System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB)</exception>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// messagePort.MessageReceived += MessageReceivedCallback;
+        /// messagePort.Listen();
+        /// using (var message = new Tizen.Application.Bundle())
+        /// {
+        ///     message.AddItem("message", "a_string");
+        ///     messagePort.Send(message, "ReceiverAppID", "ReceiverPort");
+        /// }
+        /// </code>
+        public void Send(Bundle message, string remoteAppId, string remotePortName)
+        {
+            Send(message, remoteAppId, remotePortName, false);
+        }
+
+        /// <summary>
+        /// Sends a message to the message port of a remote application.
+        /// </summary>
+        /// <param name="message">The message to be passed to the remote application, the recommended message size is under 4KB</param>
+        /// <param name="remoteAppId">The ID of the remote application</param>
+        /// <param name="remotePortName">The name of the remote message port</param>
+        /// <param name="trusted">If true the trusted message port of remote application otherwise false</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when there is an invalid parameter, when the port is not found, when out of memory, when there is an I/O error</exception>
+        /// <exception cref="System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB)</exception>
+        /// <code>
+        /// MessagePort messagePort = new MessagePort("SenderPort", true);
+        /// messagePort.MessageReceived += MessageReceivedCallback;
+        /// messagePort.Listen();
+        /// using (var message = new Tizen.Application.Bundle())
+        /// {
+        ///     message.AddItem("message", "a_string");
+        ///     messagePort.Send(message, "ReceiverAppID", "ReceiverPort", true);
+        /// }
+        /// </code>
+        public void Send(Bundle message, string remoteAppId, string remotePortName, bool trusted)
+        {
+            if (!_listening)
+            {
+                throw new InvalidOperationException("Should start listen before send");
+            }
+            if (message == null)
+            {
+                throw new ArgumentNullException("message");
+            }
+            int ret = trusted ?
+                        Interop.MessagePort.SendTrustedMessageWithLocalPort(remoteAppId, remotePortName, message.SafeBundleHandle, _portId) :
+                        Interop.MessagePort.SendMessageWithLocalPort(remoteAppId, remotePortName, message.SafeBundleHandle, _portId);
+
+            if (ret != (int)MessagePortError.None)
+            {
+                if (ret == (int)MessagePortError.MaxExceeded)
+                {
+                    MessagePortErrorFactory.ThrowException(ret, "Message has exceeded the maximum limit(4KB)", "Message");
+                }
+                MessagePortErrorFactory.ThrowException(ret, "Can't send message");
+            }
+        }
+
+        /// <summary>
+        /// Releases the unmanaged resourced used by the MessagePort class specifying whether to perform a normal dispose operation.
+        /// </summary>
+        /// <param name="disposing">true for a normal dispose operation; false to finalize the handle.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_listening)
+            {
+                try
+                {
+                    StopListening();
+                }
+                catch (Exception e)
+                {
+                    Log.Warn(GetType().Namespace, "Exception in Dispose :" + e.Message);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the MessagePort class.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs
new file mode 100755 (executable)
index 0000000..949d067
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications.Messages
+{
+    internal enum MessagePortError
+    {
+        None = ErrorCode.None,
+        IOError = ErrorCode.IoError,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        InvalidOperation = ErrorCode.InvalidOperation,
+        PortNotFound = -0x01130000 | 0x01,
+        CertificateNotMatch = -0x01130000 | 0x02,
+        MaxExceeded = -0x01130000 | 0x03,
+        ResourceUnavailable = -0x01130000 | 0x04
+    }
+
+    internal static class MessagePortErrorFactory
+    {
+        internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null)
+        {
+            MessagePortError err = (MessagePortError)errorCode;
+            if (String.IsNullOrEmpty(errorMessage))
+            {
+                errorMessage = err.ToString();
+            }
+            switch ((MessagePortError)errorCode)
+            {
+                case MessagePortError.IOError:
+                case MessagePortError.OutOfMemory:
+                case MessagePortError.InvalidOperation:
+                case MessagePortError.PortNotFound:
+                case MessagePortError.ResourceUnavailable: throw new InvalidOperationException(errorMessage);
+                case MessagePortError.InvalidParameter:
+                case MessagePortError.CertificateNotMatch: throw new ArgumentException(errorMessage, paramName);
+                case MessagePortError.MaxExceeded: throw new ArgumentOutOfRangeException(paramName, errorMessage);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs
new file mode 100755 (executable)
index 0000000..cfe1762
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+using System;
+
+namespace Tizen.Applications.Messages
+{
+    /// <summary>
+    /// An extended EventArgs class which contains remote message port information and message
+    /// </summary>
+    public class MessageReceivedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Contains AppId, Port Name, Trusted
+        /// </summary>
+        public RemoteValues Remote { get; internal set; }
+
+        /// <summary>
+        /// The message passed from the remote application
+        /// </summary>
+        public Bundle Message { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs
new file mode 100755 (executable)
index 0000000..db853d3
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Messages
+{
+    /// <summary>
+    /// Contains AppId, Port Name, Trusted
+    /// </summary>
+    public class RemoteValues
+    {
+        /// <summary>
+        /// The ID of the remote application that sent this message
+        /// </summary>
+        public string AppId { get; set; }
+
+        /// <summary>
+        /// The name of the remote message port
+        /// </summary>
+        public string PortName { get; set; }
+
+        /// <summary>
+        /// If true the remote port is a trusted port, otherwise if false it is not
+        /// </summary>
+        public bool Trusted { get; set; }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..d5edebd
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Notification = "libnotification.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs b/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs
new file mode 100755 (executable)
index 0000000..e865ab1
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+using Tizen.Applications.Notifications;
+
+internal static partial class Interop
+{
+    internal static class Notification
+    {
+        [DllImport(Libraries.Notification, EntryPoint = "notification_create")]
+        internal static extern IntPtr Create(NotificationType type);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_free")]
+        internal static extern NotificationError Destroy(IntPtr handle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_text")]
+        internal static extern NotificationError GetTextReferenceType(NotificationSafeHandle handle, NotificationText type, out IntPtr text);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_text")]
+        internal static extern NotificationError SetText(NotificationSafeHandle handle, NotificationText type, string text, string key, int args);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_image")]
+        internal static extern NotificationError GetImageReferenceType(NotificationSafeHandle handle, NotificationImage type, out IntPtr path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_image")]
+        internal static extern NotificationError SetImage(NotificationSafeHandle handle, NotificationImage type, string path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_time")]
+        internal static extern NotificationError GetTime(NotificationSafeHandle handle, out int time);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_time")]
+        internal static extern NotificationError SetTime(NotificationSafeHandle handle, int time);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_insert_time")]
+        internal static extern NotificationError GetInsertTime(NotificationSafeHandle handle, out long time);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_sound")]
+        internal static extern NotificationError GetSoundReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_sound")]
+        internal static extern NotificationError SetSound(NotificationSafeHandle handle, AccessoryOption type, string path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_vibration")]
+        internal static extern NotificationError GetVibrationReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_vibration")]
+        internal static extern NotificationError SetVibration(NotificationSafeHandle handle, AccessoryOption type, string path);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_led")]
+        internal static extern NotificationError GetLed(NotificationSafeHandle handle, out AccessoryOption type, out int color);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_led")]
+        internal static extern NotificationError SetLed(NotificationSafeHandle handle, AccessoryOption type, int color);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_led_time_period")]
+        internal static extern NotificationError GetLedTimePeriod(NotificationSafeHandle handle, out int onMillisecond, out int offMillisecond);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_led_time_period")]
+        internal static extern NotificationError SetLedTimePeriod(NotificationSafeHandle handle, int onMillisecond, int offMillisecond);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_launch_option")]
+        internal static extern NotificationError GetAppControl(NotificationSafeHandle handle, LaunchOption type, out SafeAppControlHandle apphandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_launch_option")]
+        internal static extern NotificationError SetAppControl(NotificationSafeHandle handle, LaunchOption type, SafeAppControlHandle appHandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_event_handler")]
+        internal static extern NotificationError GetEventHandler(NotificationSafeHandle handle, int type, out SafeAppControlHandle appHandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_event_handler")]
+        internal static extern NotificationError SetEventHandler(NotificationSafeHandle handle, int type, SafeAppControlHandle appHandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_property")]
+        internal static extern NotificationError GetProperties(NotificationSafeHandle handle, out int flags);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_property")]
+        internal static extern NotificationError SetProperties(NotificationSafeHandle handle, int flags);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_display_applist")]
+        internal static extern NotificationError GetApplist(NotificationSafeHandle handle, out int flags);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_display_applist")]
+        internal static extern NotificationError SetApplist(NotificationSafeHandle handle, int flags);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_size")]
+        internal static extern NotificationError GetProgressSize(NotificationSafeHandle handle, out double size);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_size")]
+        internal static extern NotificationError SetProgressSize(NotificationSafeHandle handle, double size);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_progress")]
+        internal static extern NotificationError GetProgress(NotificationSafeHandle handle, out double progress);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_progress")]
+        internal static extern NotificationError SetProgress(NotificationSafeHandle handle, double progress);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_layout")]
+        internal static extern NotificationError GetLayout(NotificationSafeHandle handle, out NotificationLayout layout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_layout")]
+        internal static extern NotificationError SetLayout(NotificationSafeHandle handle, NotificationLayout layout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_type")]
+        internal static extern NotificationError GetType(NotificationSafeHandle handle, out NotificationType type);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_update")]
+        internal static extern NotificationError Update(NotificationSafeHandle handle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_delete")]
+        internal static extern NotificationError Delete(NotificationSafeHandle handle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_delete_all")]
+        internal static extern NotificationError DeleteAll(int type);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_post")]
+        internal static extern NotificationError Post(NotificationSafeHandle handle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_pkgname")]
+        internal static extern NotificationError GetPackageName(NotificationSafeHandle handle, out IntPtr name);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_event_handler")]
+        internal static extern NotificationError AddButtonAction(NotificationSafeHandle handle, ButtonIndex type, SafeAppControlHandle appcontrol);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_remove_button")]
+        internal static extern NotificationError RemoveButton(NotificationSafeHandle handle, ButtonIndex index);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_tag")]
+        internal static extern NotificationError SetTag(NotificationSafeHandle handle, string tag);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_tag")]
+        internal static extern NotificationError GetTagReferenceType(NotificationSafeHandle handle, out IntPtr tag);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_load_by_tag")]
+        internal static extern IntPtr Load(string text);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_id")]
+        internal static extern NotificationError GetID(NotificationSafeHandle handle, out int groupID, out int privID);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_priv_id")]
+        internal static extern NotificationError SetID(NotificationSafeHandle handle, int privID);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_save_as_template")]
+        internal static extern NotificationError SaveTemplate(NotificationSafeHandle handle, string name);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_create_from_template")]
+        internal static extern IntPtr LoadTemplate(string name);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_noti_block_state")]
+        internal static extern NotificationError GetBlockState(out NotificationBlockState status);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_auto_remove")]
+        internal static extern NotificationError SetAutoRemove(NotificationSafeHandle handle, bool autoRemove);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_auto_remove")]
+        internal static extern NotificationError GetAutoRemove(NotificationSafeHandle handle, out bool autoRemove);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_ongoing_value_type")]
+        internal static extern NotificationError SetProgressType(NotificationSafeHandle handle, ProgressCategory category);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_value_type")]
+        internal static extern NotificationError GetProgressType(NotificationSafeHandle handle, out ProgressCategory category);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_ongoing_flag")]
+        internal static extern NotificationError SetOngoingFlag(NotificationSafeHandle handle, bool flag);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_flag")]
+        internal static extern NotificationError GetProgressFlag(NotificationSafeHandle handle, bool flag);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_flag")]
+        internal static extern NotificationError GetProgressFlag(NotificationSafeHandle handle, out bool flag);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_text_input")]
+        internal static extern NotificationError SetPlaceHolderLength(NotificationSafeHandle handle, int length);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_text_input_max_length")]
+        internal static extern NotificationError GetPlaceHolderLength(NotificationSafeHandle handle, out int length);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_hide_timeout")]
+        internal static extern NotificationError GetHideTime(NotificationSafeHandle handle, out int timeout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_hide_timeout")]
+        internal static extern NotificationError SetHideTime(NotificationSafeHandle handle, int timeout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_delete_timeout")]
+        internal static extern NotificationError GetDeleteTime(NotificationSafeHandle handle, out int timeout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_delete_timeout")]
+        internal static extern NotificationError SetDeleteTime(NotificationSafeHandle handle, int timeout);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_extention_data")]
+        internal static extern NotificationError SetExtentionData(NotificationSafeHandle handle, string key, SafeBundleHandle bundleHandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_extention_data")]
+        internal static extern NotificationError GetExtentionData(NotificationSafeHandle handle, string key, out SafeBundleHandle bundleHandle);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_args")]
+        internal static extern NotificationError GetExtentionBundle(NotificationSafeHandle handle, out IntPtr args, out IntPtr group_args);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_get_default_button")]
+        internal static extern NotificationError GetDefaultButton(NotificationSafeHandle handle, out int index);
+
+        [DllImport(Libraries.Notification, EntryPoint = "notification_set_default_button")]
+        internal static extern NotificationError SetDefaultButton(NotificationSafeHandle handle, int index);
+
+        internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text)
+        {
+            NotificationError ret;
+            IntPtr ptr;
+            ret = GetTextReferenceType(handle, type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                text = null;
+            }
+            else
+            {
+                text = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return ret;
+        }
+
+        internal static NotificationError GetImage(NotificationSafeHandle handle, NotificationImage type, out string path)
+        {
+            NotificationError ret;
+            IntPtr ptr;
+            ret = GetImageReferenceType(handle, type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                path = null;
+            }
+            else
+            {
+                path = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return ret;
+        }
+
+        internal static NotificationError GetSound(NotificationSafeHandle handle, out AccessoryOption type, out string path)
+        {
+            NotificationError ret;
+            IntPtr ptr;
+            ret = GetSoundReferenceType(handle, out type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                path = null;
+            }
+            else
+            {
+                path = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return ret;
+        }
+
+        internal static NotificationError GetVibration(NotificationSafeHandle handle, out AccessoryOption type, out string path)
+        {
+            NotificationError ret;
+            IntPtr ptr;
+            ret = GetVibrationReferenceType(handle, out type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                path = null;
+            }
+            else
+            {
+                path = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return ret;
+        }
+
+        internal static NotificationError GetTag(NotificationSafeHandle handle, out string tag)
+        {
+            NotificationError ret;
+            IntPtr ptr;
+            ret = GetTagReferenceType(handle, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                tag = null;
+            }
+            else
+            {
+                tag = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return ret;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj b/src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj
new file mode 100755 (executable)
index 0000000..06a99e5
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.9</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Notification.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.snk b/src/Tizen.Applications.Notification/Tizen.Applications.Notification.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Notification/Tizen.Applications.Notification.snk differ
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs
new file mode 100755 (executable)
index 0000000..ec7202a
--- /dev/null
@@ -0,0 +1,505 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+    using System.Collections.Generic;
+    using System.ComponentModel;
+
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification : IDisposable
+    {
+        internal static readonly string LogTag = "Tizen.Applications.Notification";
+
+        private NotificationSafeHandle safeHandle;
+        private bool disposed = false;
+
+        private IDictionary<string, StyleBase> styleDictionary;
+        private IDictionary<string, Bundle> extenderDictionary;
+        private int count = 0;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="Notification"/> class.
+        /// </summary>
+        public Notification()
+        {
+            styleDictionary = new Dictionary<string, StyleBase>();
+            extenderDictionary = new Dictionary<string, Bundle>();
+        }
+
+        /// <summary>
+        /// Gets or sets Tag of Notification.
+        /// </summary>
+        public string Tag { get; set; } = string.Empty;
+
+        /// <summary>
+        /// Gets or sets Title of Notification.
+        /// </summary>
+        public string Title { get; set; } = string.Empty;
+
+        /// <summary>
+        /// Gets or sets icon of Notification.
+        /// </summary>
+        public string Icon { get; set; } = string.Empty;
+
+        /// <summary>
+        /// Gets or sets sub icon of Notification.
+        /// This SubIcon is displayed in Icon you set.
+        /// </summary>
+        public string SubIcon { get; set; } = string.Empty;
+
+        /// <summary>
+        /// Gets or sets content of Notification.
+        /// </summary>
+        public string Content { get; set; } = string.Empty;
+
+        /// <summary>
+        /// Gets or sets a value indicating whether TimeStamp of Notification is Visible or not.
+        /// Default to true.
+        /// </summary>
+        public bool IsTimeStampVisible { get; set; } = true;
+
+        /// <summary>
+        /// Gets or sets TimeStamp of Notification.
+        /// </summary>
+        /// <remarks>
+        /// If you don't set TimeStamp, It will be set value that time when the notification is posted.
+        /// TimeStamp requires NotificationManager.Post() to be called.
+        /// If you set IsVisibleTimeStamp property is false, TimeStamp is not Visible in Notification.
+        /// </remarks>
+        public DateTime TimeStamp { get; set; }
+
+        /// <summary>
+        /// Gets or sets Action which is invoked when notification is clicked
+        /// </summary>
+        /// <remarks>
+        /// If you set it to null, the already set AppControl will be removed and nothing will happen when you click on notification.
+        /// </remarks>
+        /// <seealso cref="Tizen.Applications.AppControl"></seealso>
+        public AppControl Action { get; set; }
+
+        /// <summary>
+        /// Gets or sets Count which is displayed at the right side of notification.
+        /// </summary>
+        /// <remarks>
+        /// You must set only positive number.
+        /// If you set count to negative number, This property throw exception.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public int Count
+        {
+            get
+            {
+                return count;
+            }
+
+            set
+            {
+                if (value < 0)
+                {
+                    Log.Error(LogTag, "Count value is negative");
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The Count must be a positive integer.");
+                }
+
+                count = value;
+            }
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsOngoing { get; set; } = false;
+
+        /// <summary>
+        /// Gets or sets property
+        /// </summary>
+        /// <seealso cref="Tizen.Applications.Notifications.NotificationProperty"></seealso>
+        public NotificationProperty Property { get; set; } = NotificationProperty.None;
+
+        /// <summary>
+        /// Gets or sets <see cref="Notification.ProgressType"/> object for display at notification
+        /// </summary>
+        /// <seealso cref="Tizen.Applications.Notifications.Notification.ProgressType"></seealso>
+        public ProgressType Progress { get; set; }
+
+        /// <summary>
+        /// Gets or sets <see cref="Notification.AccessorySet"/> which is included vibration, led and sound option to be applied at Notification.
+        /// </summary>
+        /// <remarks>
+        /// If you set it to null, the already set AccessorySet will be initialized.
+        /// </remarks>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "Notification",
+        ///     Content = "Hello Tizen",
+        ///     Icon = "Icon path",
+        ///     Count = 3
+        /// };
+        ///
+        /// Notification.AccessorySet accessory = new Notification.AccessorySet
+        /// {
+        ///     SoundOption = AccessoryOption.Custom,
+        ///     SoundPath = "Sound File Path",
+        ///     IsVibration = true,
+        ///     LedOption = AccessoryOption.Custom,
+        ///     LedOnMs = 100;
+        ///     LedOffMs = 50;
+        ///     LedColor = Color.Lime
+        /// };
+        ///
+        /// notification.Accessory = accessory;
+        ///
+        /// NotificationManager.Post(notification);
+        /// </code>
+        /// </example>
+        public AccessorySet Accessory { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether notification is displayed on default viewer.
+        /// If you set false and add style, you can see only style notification.
+        /// </summary>
+        public bool IsDisplay { get; set; } = true;
+
+        /// <summary>
+        /// Gets or sets NotificationSafeHandle
+        /// </summary>
+        internal NotificationSafeHandle Handle
+        {
+            get
+            {
+                return safeHandle;
+            }
+
+            set
+            {
+                if (value == null)
+                {
+                    Log.Error(LogTag, "Invalid argument NotificationSafeHandle");
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to set NotificationSafeHandle");
+                }
+
+                safeHandle = value;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets Private ID
+        /// </summary>
+        internal int PrivID { get; set; } = -1;
+
+        /// <summary>
+        /// Method to add various style to be applied to notification.
+        /// </summary>
+        /// <remarks>
+        /// The user always see about valid notification style. If you add style which is not supported in platform,
+        /// this method has no effect.
+        /// </remarks>
+        /// <param name="style">The style to be applied to notification</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "Notification",
+        ///     Content = "Hello Tizen",
+        ///     Icon = "Icon path",
+        ///     Count = 3
+        /// };
+        ///
+        /// Notification.LockStyle lockStyle = new Notification.LockStyle
+        /// {
+        ///     IconPath = "Icon path",
+        ///     ThumbnailPath = "Thumbnail Path"
+        /// };
+        ///
+        /// notification.AddStyle(lockStyle);
+        ///
+        /// NotificationManager.Post(notification);
+        /// </code>
+        /// </example>
+        public void AddStyle(StyleBase style)
+        {
+            if (style == null)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+
+            if (styleDictionary.ContainsKey(style.Key) == true)
+            {
+                Log.Info(LogTag, "The Style is existed, so extender data is replaced");
+                styleDictionary.Remove(style.Key);
+                styleDictionary.Add(style.Key, style);
+            }
+            else
+            {
+                styleDictionary.Add(style.Key, style);
+            }
+        }
+
+        /// <summary>
+        /// Method to remove style you already added.
+        /// </summary>
+        /// <typeparam name="T">Type of notification style to be queried</typeparam>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public void RemoveStyle<T>() where T : Notification.StyleBase, new()
+        {
+            T type = new T();
+
+            if (styleDictionary.ContainsKey(type.Key))
+            {
+                styleDictionary.Remove(type.Key);
+            }
+            else
+            {
+                Log.Error(LogTag, "Sytle Can't be removed, there is no style matched input key");
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+        }
+
+        /// <summary>
+        /// Method to get style you already added.
+        /// </summary>
+        /// <typeparam name="T">Type of notification style to be queried</typeparam>
+        /// <returns>
+        /// The Notification.Style object associated with the given style
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public T GetStyle<T>() where T : Notification.StyleBase, new()
+        {
+            T type = new T();
+            StyleBase style = null;
+
+            styleDictionary.TryGetValue(type.Key, out style);
+
+            if (style == null)
+            {
+                Log.Error(LogTag, "Invalid Style");
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+            else
+            {
+                return style as T;
+            }
+        }
+
+        /// <summary>
+        /// Method to set extender data to add extra data
+        /// </summary>
+        /// <remarks>
+        /// The type of extra data is Bundle.
+        /// </remarks>
+        /// <param name="key">The key of the extra data you want to add.</param>
+        /// <param name="value">The value you want to add.</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "Notification",
+        ///     Content = "Hello Tizen",
+        ///     Icon = "Icon path",
+        /// };
+        ///
+        /// Bundle bundle = new Bundle();
+        /// bundle.AddItem("key", "value");
+        ///
+        /// notification.SetExtender("firstKey", bundle);
+        /// </code>
+        /// </example>
+        public void SetExtender(string key, Bundle value)
+        {
+            if (value == null || value.SafeBundleHandle.IsInvalid || string.IsNullOrEmpty(key))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+
+            if (extenderDictionary.ContainsKey(key) == true)
+            {
+                Log.Info(LogTag, "The key is existed, so extender data is replaced");
+                extenderDictionary.Remove(key);
+                extenderDictionary.Add(key, value);
+            }
+            else
+            {
+                extenderDictionary.Add(key, value);
+            }
+        }
+
+        /// <summary>
+        /// Method to remove extender you already added.
+        /// </summary>
+        /// <remarks>
+        /// The type of extra data is Bundle.
+        /// </remarks>
+        /// <param name="key">The key of the extra data to add.</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public void RemoveExtender(string key)
+        {
+            if (string.IsNullOrEmpty(key))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+
+            if (extenderDictionary.ContainsKey(key))
+            {
+                extenderDictionary.Remove(key);
+            }
+            else
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+        }
+
+        /// <summary>
+        /// Method to get extender data you already set
+        /// </summary>
+        /// <param name="key">The key of the extra data to get.</param>
+        /// <returns>Bundle Object that include extender data</returns>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public Bundle GetExtender(string key)
+        {
+            if (string.IsNullOrEmpty(key))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+
+            Bundle bundle;
+            if (extenderDictionary.TryGetValue(key, out bundle) == false)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered : " + key);
+            }
+
+            return bundle;
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal void Dispose(bool disposing)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (disposing)
+            {
+                Handle.Dispose();
+            }
+
+            disposed = true;
+        }
+
+        internal IDictionary<string, StyleBase> GetStyleDictionary()
+        {
+            return styleDictionary;
+        }
+
+        internal IDictionary<string, Bundle> GetExtenderDictionary()
+        {
+            return extenderDictionary;
+        }
+
+        internal StyleBase GetStyle(string key)
+        {
+            if (string.IsNullOrEmpty(key))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "Key is null or empty");
+            }
+
+            StyleBase style = null;
+            bool ret = styleDictionary.TryGetValue(key, out style);
+            if (ret == false)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The Style object matched input key is not existed");
+            }
+
+            return style;
+        }
+
+        internal void Make()
+        {
+            NotificationBinder.BindObject(this);
+
+            foreach (string key in GetExtenderDictionary().Keys)
+            {
+                Log.Info(LogTag, "Start to bind Notification.ExtenderData to SafeHandle");
+                Interop.Notification.SetExtentionData(Handle, key, extenderDictionary[key].SafeBundleHandle);
+            }
+
+            foreach (Notification.StyleBase style in styleDictionary.Values)
+            {
+                Log.Info(LogTag, "Start to bind Notification.Style to SafeHandle [" + style.Key + "]");
+                style.Make(this);
+            }
+
+            if (Accessory != null)
+            {
+                Log.Info(LogTag, "Start to bind Notification.AccessetSet to SafeHandle");
+                Accessory.Make(this);
+            }
+
+            if (Progress != null)
+            {
+                Log.Info(LogTag, "Start to bind Notification.Progress to SafeHandle");
+                Progress.Make(this);
+            }
+        }
+
+        internal Notification Build()
+        {
+            IntPtr extention = IntPtr.Zero;
+            IntPtr extentionBundlePtr = IntPtr.Zero;
+
+            NotificationBinder.BindSafeHandle(this);
+
+            Interop.Notification.GetExtentionBundle(Handle, out extention, out extentionBundlePtr);
+
+            if (extention != IntPtr.Zero)
+            {
+                Bundle bundle = new Bundle(new SafeBundleHandle(extention, false));
+                foreach (string key in bundle.Keys)
+                {
+                    SafeBundleHandle sbh;
+                    Interop.Notification.GetExtentionData(Handle, key, out sbh);
+                    extenderDictionary.Add(key, new Bundle(sbh));
+                }
+            }
+
+            ProgressBinder.BindSafeHandle(this);
+            AccessorySetBinder.BindSafeHandle(this);
+            IndicatorBinder.BindSafeHandle(this);
+            ActiveBinder.BindSafeHandle(this);
+            LockBinder.BindSafehandle(this);
+
+            return this;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs
new file mode 100755 (executable)
index 0000000..ec7958d
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using Tizen.Common;
+
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for Notification AccessorySet which is included vibration, led, sound option
+        /// </summary>
+        public sealed class AccessorySet : MakerBase
+        {
+            /// <summary>
+            /// Gets or sets the sound option. Default to AccessoryOption.Off.
+            /// </summary>
+            /// <remarks>
+            /// If you set AccessoryOption.Custom and not set SoundPath, then turn on the default sound.
+            /// </remarks>
+            public AccessoryOption SoundOption { get; set; } = AccessoryOption.Off;
+
+            /// <summary>
+            /// Gets or sets the sound path, It will play on the sound file you set.
+            /// </summary>
+            public string SoundPath { get; set; }
+
+            /// <summary>
+            /// Gets or sets a value indicating whether vibration is operated. Default to false.
+            /// </summary>
+            public bool CanVibrate { get; set; } = false;
+
+            /// <summary>
+            /// Gets or sets the led option. Default to AccessoryOption.Off.
+            /// </summary>
+            /// <remarks>
+            /// If you set AccessoryOption.Custom and not set LedColor, then turn on the LED with default color.
+            /// </remarks>
+            public AccessoryOption LedOption { get; set; } = AccessoryOption.Off;
+
+            /// <summary>
+            /// Gets or sets the led on time period that you would like the LED on the device to blink. as well as the rate
+            /// </summary>
+            /// <remarks>
+            /// Default value of LedOnMillisecond is 0.
+            /// The rate is specified in terms of the number of Milliseconds to be on.
+            /// You should always set LedOnMillisecond with LedOffMillisecond. Otherwise, it may not operate normally.
+            /// </remarks>
+            public int LedOnMillisecond { get; set; }
+
+            /// <summary>
+            /// Gets or sets the led on time period that you would like the LED on the device to blink. as well as the rate.
+            /// </summary>
+            /// <remarks>
+            /// The rate is specified in terms of the number of Milliseconds to be off.
+            /// You should always set LedOffMillisecond with LedOnMillisecond. Otherwise, it may not operate normally.
+            /// </remarks>
+            public int LedOffMillisecond { get; set; }
+
+            /// <summary>
+            /// Gets or sets the led color that you would like the LED on the device to blink.
+            /// </summary>
+            /// <remarks>
+            /// If you want to set LedColor, you should always set LedOption is AccessoryOption.Custom. Otherwise, it may operate default led color.
+            /// </remarks>
+            public Color LedColor { get; set; }
+
+            internal override void Make(Notification notification)
+            {
+                AccessorySetBinder.BindObject(notification);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs
new file mode 100755 (executable)
index 0000000..91e2282
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using Tizen.Common;
+
+    internal static class AccessorySetBinder
+    {
+        internal static void BindObject(Notification notification)
+        {
+            BindLedToHandle(notification);
+            BindSoundToHandle(notification);
+            BindVibrationToHandle(notification);
+        }
+
+        internal static void BindSafeHandle(Notification notification)
+        {
+            Notification.AccessorySet accessory = new Notification.AccessorySet();
+            BindHandleToLed(notification, accessory);
+            BindHandleToSound(notification, accessory);
+            BindHandleToVibration(notification, accessory);
+            notification.Accessory = accessory;
+        }
+
+        private static void BindLedToHandle(Notification notification)
+        {
+            NotificationError ret = NotificationError.None;
+            Notification.AccessorySet accessory = notification.Accessory;
+
+            ret = Interop.Notification.SetLed(notification.Handle, accessory.LedOption, 0);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set led");
+            }
+
+            ret = Interop.Notification.SetLedTimePeriod(notification.Handle, accessory.LedOnMillisecond, accessory.LedOffMillisecond);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set led period");
+            }
+
+            if (notification.Accessory.LedOption == AccessoryOption.Custom)
+            {
+                Color color = accessory.LedColor;
+                ret = Interop.Notification.SetLed(notification.Handle, AccessoryOption.Custom, color.GetArgb());
+                if (ret != NotificationError.None)
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to set led color");
+                }
+            }
+        }
+
+        private static void BindVibrationToHandle(Notification notification)
+        {
+            Notification.AccessorySet accessory = notification.Accessory;
+            if (accessory.CanVibrate == false)
+            {
+                Interop.Notification.SetVibration(notification.Handle, AccessoryOption.Off, null);
+            }
+            else
+            {
+                Interop.Notification.SetVibration(notification.Handle, AccessoryOption.On, null);
+            }
+        }
+
+        private static void BindSoundToHandle(Notification notification)
+        {
+            Notification.AccessorySet accessory = notification.Accessory;
+
+            if (accessory.SoundOption == AccessoryOption.Custom && string.IsNullOrEmpty(accessory.SoundPath))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "If the option is set to Custom, the path must also be set.");
+            }
+
+            NotificationError ret = Interop.Notification.SetSound(notification.Handle, accessory.SoundOption, accessory.SoundPath);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set sound");
+            }
+        }
+
+        private static void BindHandleToLed(Notification notification, Notification.AccessorySet accessory)
+        {
+            AccessoryOption type;
+            int argb;
+            Interop.Notification.GetLed(notification.Handle, out type, out argb);
+
+            accessory.LedOption = type;
+            if (type == AccessoryOption.Custom)
+            {
+                accessory.LedColor = new Color(argb >> 16 & 255, argb >> 8 & 255, argb >> 0 & 255, argb >> 24 & 255);
+            }
+
+            int onMillisecond, offMillisecond;
+            Interop.Notification.GetLedTimePeriod(notification.Handle, out onMillisecond, out offMillisecond);
+            accessory.LedOnMillisecond = onMillisecond;
+            accessory.LedOffMillisecond = offMillisecond;
+        }
+
+        private static void BindHandleToSound(Notification notification, Notification.AccessorySet accessory)
+        {
+            AccessoryOption type;
+            string path;
+
+            Interop.Notification.GetSound(notification.Handle, out type, out path);
+
+            accessory.SoundOption = type;
+            if (type == AccessoryOption.Custom)
+            {
+                accessory.SoundPath = path;
+            }
+        }
+
+        private static void BindHandleToVibration(Notification notification, Notification.AccessorySet accessory)
+        {
+            AccessoryOption type;
+            string path;
+
+            Interop.Notification.GetVibration(notification.Handle, out type, out path);
+            if (type == AccessoryOption.Off)
+            {
+                accessory.CanVibrate = false;
+            }
+            else
+            {
+                accessory.CanVibrate = true;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs
new file mode 100755 (executable)
index 0000000..d7b9d7f
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System.Collections.Generic;
+
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for generating Active style notification
+        /// </summary>
+        public sealed class ActiveStyle : StyleBase
+        {
+            private IDictionary<ButtonIndex, ButtonAction> buttonDictionary;
+            private int hideTimeout = 0;
+            private int deleteTimeout = 0;
+
+            /// <summary>
+            /// Initializes a new instance of the <see cref="ActiveStyle"/> class.
+            /// </summary>
+            public ActiveStyle()
+            {
+                buttonDictionary = new Dictionary<ButtonIndex, ButtonAction>();
+            }
+
+            /// <summary>
+            /// Gets or sets an absolute path for an image file to display on the background of active notification
+            /// </summary>
+            public string BackgroundImage { get; set; }
+
+            /// <summary>
+            /// Gets or sets a value indicating whether the active notification is removed automatically. Default value is true.
+            /// </summary>
+            /// <remarks>
+            /// IsAutoRemove option lets the active notification be removed several seconds after it shows.
+            /// When 'IsAutoRemove' is set as false, the active notification will not be removed as long as the user removes
+            /// the active notification or the app which posted the active notification removes the active notification.
+            /// </remarks>>
+            public bool IsAutoRemove { get; set; } = true;
+
+            /// <summary>
+            /// Gets or sets the default button to display highlight on the active notification
+            /// </summary>
+            /// <remarks>
+            /// The default button for display highlight is only reflected on Tizen TV.
+            /// If you use this Property on other profile, this value have no effect
+            /// </remarks>
+            public ButtonIndex DefaultButton { get; set; } = ButtonIndex.None;
+
+            /// <summary>
+            /// Gets or sets a ReplyAction to this active notification style.
+            /// </summary>
+            /// <remarks>
+            /// When you add a ReplyAction to the ActiveStyle, the notification UI will show a ReplyAction with button.
+            /// If you set null parameter, ReplyAction is disappeared.
+            /// </remarks>
+            /// <example>
+            /// <code>
+            ///
+            /// ButtonAction button = new ButtonAction
+            /// {
+            ///     Index = ButtonIndex.First,
+            ///     Text = "Yes"
+            ///     Action = new AppControl{ ApplicationId = "org.tizen.app" };
+            /// };
+            ///
+            /// ReplyAction reply = new ReplyAction
+            /// {
+            ///     ParentIndex = ButtonIndex.First;
+            ///     PlaceHolderText = "Please write your reply."
+            ///     ReplyMax = 160,
+            ///     Button = new ButtonAction
+            ///     {
+            ///         Text = "Yes",
+            ///         ImagePath = "image path"
+            ///         Action = new AppControl{ ApplicationId = "org.tizen.app" };
+            ///     };
+            /// };
+            ///
+            /// ActiveStyle active = new ActiveStyle
+            /// {
+            ///     AutoRemove = true,
+            ///     BackgroundImage = "image path",
+            ///     ReplyAction = reply
+            /// };
+            ///
+            /// active.AddButtonAction(button);
+            /// </code>
+            /// </example>
+            public ReplyAction ReplyAction { get; set; }
+
+            /// <summary>
+            /// Gets the key of ActiveStyle
+            /// </summary>
+            internal override string Key
+            {
+                get
+                {
+                    return "Active";
+                }
+            }
+
+            /// <summary>
+            /// Method to set times to hide or delete notification.
+            /// </summary>
+            /// <remarks>
+            /// The time settings for hiding and deleting are only reflected on Tizen TV.
+            /// If you use this API on other profile, this time settings have no effect
+            /// </remarks>
+            /// <param name="hideTime">The value in second when the notification can be hidden from the notification viewer after notification is posted</param>
+            /// <param name="deleteTime">The value in second when the notification can be deleted from the notification list in setting application after notification is posted</param>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            public void SetRemoveTime(int hideTime, int deleteTime)
+            {
+                if (hideTime < 0 || deleteTime < 0)
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument");
+                }
+
+                hideTimeout = hideTime;
+                deleteTimeout = deleteTime;
+            }
+
+            /// <summary>
+            /// Method to get times to hide or delete notification.
+            /// </summary>
+            /// <param name="hideTime">The value in second when the notification can be hidden from the notification viewer after notification is posted</param>
+            /// <param name="deleteTime">The value in second when the notification can be deleted from the notification list in setting application after notification is posted</param>
+            public void GetRemoveTime(out int hideTime, out int deleteTime)
+            {
+                hideTime = hideTimeout;
+                deleteTime = deleteTimeout;
+            }
+
+            /// <summary>
+            /// Method to add a button to the active notification style.
+            /// Buttons are displayed on the notification.
+            /// </summary>
+            /// <remarks>
+            /// If you add button that has same index, the button is replaced to latest adding button.
+            /// If you don't set an index on ButtonAction, the index is set sequentially from zero.
+            /// </remarks>
+            /// <param name="button">An ButtonAction for appear to the notification</param>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            /// <example>
+            /// <code>
+            ///
+            /// ButtonAction button = new ButtonAction
+            /// {
+            ///     Index = 0,
+            ///     Text = "Yes"
+            ///     Action = new AppControl{ ApplicationId = "org.tizen.app" };
+            /// };
+            ///
+            /// ActiveStyle active = new ActiveStyle
+            /// {
+            ///     IsAutoRemove = true,
+            ///     BackgroundImage = "image path",
+            /// };
+            ///
+            /// active.AddButtonAction(button);
+            ///
+            /// </code>
+            /// </example>
+            public void AddButtonAction(ButtonAction button)
+            {
+                if (button == null)
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid ButtonAction object");
+                }
+
+                if (button.Index == ButtonIndex.None)
+                {
+                    button.Index = (ButtonIndex)buttonDictionary.Count;
+                    buttonDictionary.Add(button.Index, button);
+                }
+                else if (button.Index >= ButtonIndex.First)
+                {
+                    if (buttonDictionary.ContainsKey(button.Index))
+                    {
+                        buttonDictionary.Remove(button.Index);
+                    }
+
+                    buttonDictionary.Add(button.Index, button);
+                }
+            }
+
+            /// <summary>
+            /// Remove the ButtonAction you already add.
+            /// </summary>
+            /// <param name="index">The index to remove a button</param>
+            /// <returns>true if the element is successfully found and removed; otherwise, false</returns>
+            public bool RemoveButtonAction(ButtonIndex index)
+            {
+                bool ret = buttonDictionary.Remove(index);
+
+                if (ret == false)
+                {
+                    Log.Debug(Notification.LogTag, "Invalid key, there is no button matched input index");
+                }
+                else
+                {
+                    Log.Debug(Notification.LogTag, "The button was removed.");
+                }
+
+                return ret;
+            }
+
+            /// <summary>
+            /// Gets the ButtonAction of the active notification.
+            /// </summary>
+            /// <param name="index">The index to get a button you already add</param>
+            /// <returns>The ButtonAction object which is you already add</returns>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            public ButtonAction GetButtonAction(ButtonIndex index)
+            {
+                ButtonAction button = null;
+
+                if (buttonDictionary.ContainsKey(index) == true)
+                {
+                    buttonDictionary.TryGetValue(index, out button);
+                }
+                else
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value is not existed.");
+                }
+
+                return button;
+            }
+
+            internal ICollection<ButtonAction> GetButtonAction()
+            {
+                return buttonDictionary.Values;
+            }
+
+            internal override void Make(Notification notification)
+            {
+                ActiveBinder.BindObject(notification);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs
new file mode 100755 (executable)
index 0000000..2d7eb4b
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+
+    internal static class NotificationBinder
+    {
+        private static readonly int DoNotShowTimeStamp = -1;
+
+        internal static void BindObject(Notification notification)
+        {
+            BindNotificationSafeHandle(notification);
+            BindNotificationText(notification);
+            BindNotificationTime(notification);
+
+            Interop.Notification.SetID(notification.Handle, notification.PrivID);
+
+            if (notification.IsDisplay)
+            {
+                Interop.Notification.SetApplist(notification.Handle, (int)NotificationDisplayApplist.Tray);
+            }
+            else
+            {
+                Interop.Notification.SetApplist(notification.Handle, 0);
+            }
+
+            if (notification.IsOngoing == true)
+            {
+                Log.Info(Notification.LogTag, "Start to set IsOngoing to SafeHandle");
+                Interop.Notification.SetLayout(notification.Handle, NotificationLayout.Ongoing);
+                Interop.Notification.SetOngoingFlag(notification.Handle, true);
+            }
+
+            if (string.IsNullOrEmpty(notification.Tag) != true)
+            {
+                Interop.Notification.SetTag(notification.Handle, notification.Tag);
+            }
+
+            if (notification.Action != null && notification.Action.SafeAppControlHandle.IsInvalid == false)
+            {
+                Interop.Notification.SetAppControl(notification.Handle, LaunchOption.AppControl, notification.Action.SafeAppControlHandle);
+            }
+
+            Interop.Notification.SetProperties(notification.Handle, (int)notification.Property);
+        }
+
+        internal static void BindSafeHandle(Notification notification)
+        {
+            int privID, groupID;
+            Interop.Notification.GetID(notification.Handle, out groupID, out privID);
+            notification.PrivID = privID;
+
+            NotificationLayout layout;
+            Interop.Notification.GetLayout(notification.Handle, out layout);
+            NotificationType type;
+            Interop.Notification.GetType(notification.Handle, out type);
+            if (layout == NotificationLayout.Ongoing && type == NotificationType.Ongoing)
+            {
+                notification.IsOngoing = true;
+            }
+
+            int appList;
+            Interop.Notification.GetApplist(notification.Handle, out appList);
+            if ((appList & (int)NotificationDisplayApplist.Tray) == 0)
+            {
+                notification.IsDisplay = false;
+            }
+
+            BindSafeHandleText(notification);
+            BindSafeHandleTime(notification);
+            BindSafeHandleTag(notification);
+            BindSafeHandleAction(notification);
+        }
+
+        private static void BindNotificationSafeHandle(Notification notification)
+        {
+            IntPtr ptr;
+            NotificationError ret;
+
+            if (notification.Handle != null && notification.Handle.IsInvalid == false)
+            {
+                notification.Handle.Dispose();
+            }
+
+            if (notification.IsOngoing == true || notification.Progress != null)
+            {
+                ptr = Interop.Notification.Create(NotificationType.Ongoing);
+            }
+            else
+            {
+                ptr = Interop.Notification.Create(NotificationType.Basic);
+            }
+
+            if (ptr == IntPtr.Zero)
+            {
+                ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+                throw NotificationErrorFactory.GetException(ret, "Unable to create IntPtr Notification");
+            }
+
+            notification.Handle = new NotificationSafeHandle(ptr, true);
+        }
+
+        private static void BindNotificationText(Notification notification)
+        {
+            Interop.Notification.SetText(notification.Handle, NotificationText.Title, notification.Title, null, -1);
+            Interop.Notification.SetText(notification.Handle, NotificationText.Content, notification.Content, null, -1);
+            Interop.Notification.SetImage(notification.Handle, NotificationImage.Icon, notification.Icon);
+            Interop.Notification.SetImage(notification.Handle, NotificationImage.SubIcon, notification.SubIcon);
+            Interop.Notification.SetText(notification.Handle, NotificationText.EventCount, notification.Count.ToString(), null, -1);
+        }
+
+        private static void BindNotificationTime(Notification notification)
+        {
+            if (notification.IsTimeStampVisible == true)
+            {
+                if (notification.TimeStamp != DateTime.MinValue)
+                {
+                    TimeSpan datatime = notification.TimeStamp.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+                    Interop.Notification.SetTime(notification.Handle, (int)datatime.TotalSeconds);
+                }
+            }
+            else
+            {
+                Interop.Notification.SetTime(notification.Handle, DoNotShowTimeStamp);
+            }
+        }
+
+        private static void BindSafeHandleText(Notification notification)
+        {
+            string text;
+            Interop.Notification.GetText(notification.Handle, NotificationText.Title, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                notification.Title = text;
+            }
+
+            Interop.Notification.GetText(notification.Handle, NotificationText.Content, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                notification.Content = text;
+            }
+
+            string path;
+            Interop.Notification.GetImage(notification.Handle, NotificationImage.Icon, out path);
+            if (string.IsNullOrEmpty(path) == false)
+            {
+                notification.Icon = path;
+            }
+
+            Interop.Notification.GetImage(notification.Handle, NotificationImage.SubIcon, out path);
+            if (string.IsNullOrEmpty(path) == false)
+            {
+                notification.SubIcon = path;
+            }
+
+            Interop.Notification.GetText(notification.Handle, NotificationText.EventCount, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                try
+                {
+                    notification.Count = int.Parse(text);
+                }
+                catch (Exception ex)
+                {
+                    Log.Error(Notification.LogTag, ex.ToString());
+                }
+            }
+        }
+
+        private static void BindSafeHandleTime(Notification notification)
+        {
+            int time;
+
+            Interop.Notification.GetTime(notification.Handle, out time);
+
+            if (time == DoNotShowTimeStamp)
+            {
+                notification.IsTimeStampVisible = false;
+            }
+            else
+            {
+                notification.IsTimeStampVisible = true;
+
+                if (time != 0)
+                {
+                    notification.TimeStamp = (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local)).AddSeconds(time).ToLocalTime();
+                }
+            }
+        }
+
+        private static void BindSafeHandleTag(Notification notification)
+        {
+            string text;
+            Interop.Notification.GetTag(notification.Handle, out text);
+            if (string.IsNullOrEmpty(text) != true)
+            {
+                notification.Tag = text;
+            }
+        }
+
+        private static void BindSafeHandleProperty(Notification notification)
+        {
+            int property;
+            Interop.Notification.GetProperties(notification.Handle, out property);
+            notification.Property = (NotificationProperty)property;
+        }
+
+        private static void BindSafeHandleAction(Notification notification)
+        {
+            SafeAppControlHandle appcontrol = null;
+            Interop.Notification.GetAppControl(notification.Handle, LaunchOption.AppControl, out appcontrol);
+            if (appcontrol != null && appcontrol.IsInvalid == false)
+            {
+                notification.Action = new AppControl(appcontrol);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs
new file mode 100755 (executable)
index 0000000..c4c2ed5
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class to help you set button on Active style of Notification
+        /// </summary>
+        /// <remarks>
+        /// It must include a Text, an Index, an ImagePath, and an Action to be invoked when user select the button.
+        /// </remarks>>
+        public sealed class ButtonAction : MakerBase
+        {
+            /// <summary>
+            /// Gets or sets the index of Button which is appeared at Notification.
+            /// </summary>
+            public ButtonIndex Index { get; set; } = ButtonIndex.None;
+
+            /// <summary>
+            /// Gets or sets the text describing the button
+            /// </summary>
+            public string Text { get; set; }
+
+            /// <summary>
+            /// Gets or sets the image path that represent the button
+            /// </summary>
+            public string ImagePath { get; set; }
+
+            /// <summary>
+            /// Gets or sets the action which is invoked when button is clicked
+            /// </summary>
+            /// <value>
+            /// If you don't set Action, nothing happens when button is clicked.
+            /// </value>
+            /// <example>
+            /// <code>
+            /// ButtonAction button = new ButtonAction
+            /// {
+            ///     Index = ButtonIndex.First,
+            ///     text = "Yes",
+            ///     ImagePath = "image path",
+            ///     Action = new AppControl{ ApplicationId = "org.tizen.app" };
+            /// };
+            /// </code>
+            /// </example>
+            /// <seealso cref="Tizen.Applications.AppControl"></seealso>
+            public AppControl Action { get; set; }
+
+            internal override void Make(Notification notification)
+            {
+                int enumIndex = (int)NotificationText.FirstButton + (int)Index;
+
+                Interop.Notification.SetText(notification.Handle, (NotificationText)enumIndex, Text, null, -1);
+                enumIndex = (int)NotificationImage.FirstButton + (int)Index;
+                Interop.Notification.SetImage(notification.Handle, (NotificationImage)enumIndex, ImagePath);
+                if (Action != null && Action.SafeAppControlHandle.IsInvalid == false)
+                {
+                    Interop.Notification.SetEventHandler(notification.Handle, (int)Index, Action.SafeAppControlHandle);
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs
new file mode 100755 (executable)
index 0000000..7cb41d9
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+
+    /// <summary>
+    /// Enumeration for Progress category
+    /// </summary>
+    public enum ProgressCategory
+    {
+        /// <summary>
+        /// Value for percent type
+        /// </summary>
+        Percent,
+
+        /// <summary>
+        /// Value for time type
+        /// </summary>
+        Time,
+
+        /// <summary>
+        /// Value for pending type which is not updated progress current value
+        /// </summary>
+        PendingBar
+    }
+
+    /// <summary>
+    /// Enumeration for Accessory option
+    /// </summary>
+    public enum AccessoryOption
+    {
+        /// <summary>
+        /// Value for off accessory option
+        /// </summary>
+        Off = -1,
+
+        /// <summary>
+        /// Value for on accessory option
+        /// </summary>
+        On,
+
+        /// <summary>
+        /// Value for custom accessory option
+        /// </summary>
+        Custom
+    }
+
+    /// <summary>
+    /// Enumeration for Button Index
+    /// </summary>
+    public enum ButtonIndex
+    {
+        /// <summary>
+        /// Value for default button index
+        /// </summary>
+        None = -1,
+
+        /// <summary>
+        /// Value for first button index
+        /// </summary>
+        First,
+
+        /// <summary>
+        /// Value for second button index
+        /// </summary>
+        Second,
+
+        /// <summary>
+        /// Value for third button index
+        /// </summary>
+        Third
+    }
+
+    /// <summary>
+    /// Enumeration for notification particular property
+    /// </summary>
+    [Flags]
+    public enum NotificationProperty
+    {
+        /// <summary>
+        /// Value for adjust nothing
+        /// </summary>
+        None = 0x00,
+
+        /// <summary>
+        /// Value for display only SIM card inserted
+        /// </summary>
+        DisplayOnlySimmode = 0x01,
+
+        /// <summary>
+        /// Value for disable application launch when it selected
+        /// </summary>
+        DisableAppLaunch = 0x02,
+
+        /// <summary>
+        /// Value for disable auto delete when it selected
+        /// </summary>
+        DisableAutoDelete = 0x04,
+
+        /// <summary>
+        /// Value for deleted when device is rebooted even though notification is not set Ongoing
+        /// </summary>
+        VolatileDisplay = 0x100
+    }
+
+    /// <summary>
+    /// Enumeration for block state
+    /// </summary>
+    public enum NotificationBlockState
+    {
+        /// <summary>
+        /// Value to check the app is allowed to post notification
+        /// </summary>
+        Allowed = 0,
+
+        /// <summary>
+        /// Value to check the app is not allowed to post any notification
+        /// </summary>
+        Blocked,
+
+        /// <summary>
+        /// Value to check do not disturb mode which is user set
+        /// </summary>
+        DoNotDisturb
+    }
+
+    internal enum NotificationType
+    {
+        None = -1,
+        Basic = 0,
+        Ongoing,
+    }
+
+    internal enum NotificationEventType
+    {
+        FirstButton = 0,
+        SecondButton,
+        ThirdButton,
+        ClickOnIcon = 6,
+        ClockOnThumbnail = 7,
+        ClickOnTextInputButton = 8
+    }
+
+    internal enum NotificationLayout
+    {
+        None = 0,
+        SingleEvent = 1,
+        Thumbnail = 3,
+        Ongoing = 4,
+        Progress = 5,
+        Extension = 6
+    }
+
+    internal enum NotificationText
+    {
+        Title = 0,
+        Content,
+        EventCount = 3,
+        FirstMainText,
+        FirstSubText,
+        SecondMainText,
+        SecondSubText,
+        FirstButton = 13,
+        SeceondButton = 14,
+        ThirdButton = 15,
+        PlaceHolder = 19,
+        InputButton = 20,
+    }
+
+    internal enum NotificationImage
+    {
+        Icon = 0,
+        IconForIndicator,
+        IconForLock,
+        Thumbnail,
+        ThumbnailForLock,
+        SubIcon,
+        Background,
+        FirstButton = 12,
+        SecondButton,
+        ThirdButton,
+        TextInputButton = 18,
+    }
+
+    internal enum LaunchOption
+    {
+        AppControl = 1
+    }
+
+    [Flags]
+    internal enum NotificationDisplayApplist
+    {
+        Tray = 0x00000001,
+        Ticker = 0x00000002,
+        Lock = 0x00000004,
+        Indicator = 0x00000008,
+        Active = 0x00000010,
+        All = 0x0000000f,
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs
new file mode 100755 (executable)
index 0000000..12f92f3
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+    using System.Runtime.CompilerServices;
+
+    internal enum NotificationError
+    {
+        None = Tizen.Internals.Errors.ErrorCode.None,
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+        IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+        DbError = -0x01140000 | 0x01,
+        AlreadyExists = -0x01140000 | 0x02,
+        DBusError = -0x01140000 | 0x03,
+        DoesnotExist = -0x01140000 | 0x04,
+        ServiceError = -0x01140000 | 0x05,
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+        InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation
+    }
+
+    internal static class NotificationErrorFactory
+    {
+        internal static Exception GetException(NotificationError ret, string msg, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
+        {
+            Log.Error(Notification.LogTag, memberName + " : " + lineNumber);
+
+            switch (ret)
+            {
+                case NotificationError.InvalidParameter:
+                    Log.Error(Notification.LogTag, msg);
+                    return new ArgumentException(ret + " error occurred.");
+                case NotificationError.PermissionDenied:
+                    throw new UnauthorizedAccessException("Permission denied (http://tizen.org/privilege/notification)");
+                default:
+                    Log.Error(Notification.LogTag, msg);
+                    return new InvalidOperationException(ret + " error occurred.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs
new file mode 100755 (executable)
index 0000000..7e87c84
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for generating Indicator style notification
+        /// </summary>
+        public sealed class IndicatorStyle : StyleBase
+        {
+            /// <summary>
+            /// Gets or sets an absolute path for an image file.
+            /// If you set IconPath, you can see the icon on the right side of indicator.
+            /// </summary>
+            public string IconPath { get; set; }
+
+            /// <summary>
+            /// Gets or sets a sub text for displaying Indicator style
+            /// </summary>
+            public string SubText { get; set; }
+
+            /// <summary>
+            /// Gets the key of IndicatorStyle
+            /// </summary>
+            internal override string Key
+            {
+                get
+                {
+                    return "Indicator";
+                }
+            }
+
+            internal override void Make(Notification notification)
+            {
+                IndicatorBinder.BindObject(notification);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs
new file mode 100755 (executable)
index 0000000..78029a7
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for generating Lock style notification
+        /// </summary>
+        public sealed class LockStyle : StyleBase
+        {
+            /// <summary>
+            /// Gets or sets an absolute path for an image file to display on the icon of Lock style
+            /// </summary>
+            public string IconPath { get; set; }
+
+            /// <summary>
+            /// Gets or sets an absolute path for a thumbnail image file to display on Lock style
+            /// </summary>
+            public string ThumbnailPath { get; set; }
+
+            /// <summary>
+            /// Gets the key of LockStyle
+            /// </summary>
+            internal override string Key
+            {
+                get
+                {
+                    return "Lock";
+                }
+            }
+
+            internal override void Make(Notification notification)
+            {
+                LockBinder.BindObject(notification);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs
new file mode 100755 (executable)
index 0000000..859a81f
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System.ComponentModel;
+
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        /// An object that help notification make to SafeHandle.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public abstract class MakerBase
+        {
+            internal abstract void Make(Notification notification);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs
new file mode 100755 (executable)
index 0000000..1a890f3
--- /dev/null
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+    using System.ComponentModel;
+
+    /// <summary>
+    /// NotificationManager class to post, update, delete and get Notification.
+    /// </summary>
+    public static class NotificationManager
+    {
+        /// <summary>
+        /// Posts a new Notification.
+        /// </summary>
+        /// <param name="notification">Notification to post</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        ///
+        /// Notification.AccessorySet accessory = new Notification.AccessorySet
+        /// {
+        ///     SoundOption = AccessoryOption.On,
+        ///     CanVibrate = true
+        /// };
+        /// notification.Accessory = accessory;
+        ///
+        ///     // do something
+        ///
+        /// NotificationManager.Post(notification);
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Post(Notification notification)
+        {
+            if (notification == null)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+            }
+
+            notification.Make();
+
+            NotificationError ret = Interop.Notification.Post(notification.Handle);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "post notification failed");
+            }
+
+            int priv_id, group_id;
+            Interop.Notification.GetID(notification.Handle, out group_id, out priv_id);
+            notification.PrivID = priv_id;
+        }
+
+        /// <summary>
+        /// Updates a posted Notification.
+        /// </summary>
+        /// <param name="notification">Notification to update</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// string tag = "first tag";
+        ///
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = tag
+        /// };
+        ///
+        /// Notification.AccessorySet accessory = new Notification.AccessorySet
+        /// {
+        ///     LedOption = AccessoryOption.On,
+        ///     VibrationOption = AccessoryOption.Custom,
+        ///     VibrationPath = "vibration absolute path"
+        /// }
+        /// notification.Accessory = accessory;
+        ///
+        /// NotificationManager.Post(notification);
+        ///
+        ///     // do something
+        ///
+        /// Notification loadNotification = NotificationManager.Load(tag);
+        ///
+        /// loadNotification.Progress = new ProgressType(ProgressCategory.Percent, 0.0. 100.0);
+        ///
+        /// Thread thread = new Thread(new ParameterizedThreadStart(UpdateProgress));
+        /// thread.IsBackground = true;
+        /// thread.Start(notification);
+        ///
+        ///   ...
+        ///
+        /// static void UpdateProgress(Object obj)
+        /// {
+        ///     Notification notification = (Notification)obj;
+        ///
+        ///     for (double current = 1.0; current &lt;= 100.0; current = current + 1.0)
+        ///     {
+        ///         notification.Progress.ProgressCurrent = current;
+        ///         NotificationManager.Update(notification);
+        ///         Thread.Sleep(300);
+        ///     }
+        /// }
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        /// <pre>
+        /// Post method should be called on the Notification object.
+        /// </pre>
+        public static void Update(Notification notification)
+        {
+            if (notification == null || notification.Handle == null || notification.Handle.IsInvalid)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+            }
+
+            notification.Make();
+            NotificationError ret = Interop.Notification.Update(notification.Handle);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "update notification failed");
+            }
+        }
+
+        /// <summary>
+        /// Deletes a posted Notification.
+        /// </summary>
+        /// <param name="notification">Notification to remove</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        /// NotificationManager.Post(notification);
+        ///
+        ///     // do something
+        ///
+        /// NotificationManager.Delete(notification);
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        /// <pre>
+        /// Post method should be called on the Notification object.
+        /// </pre>
+        public static void Delete(Notification notification)
+        {
+            if (notification == null || notification.Handle == null || notification.Handle.IsInvalid)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+            }
+
+            NotificationError ret = Interop.Notification.Delete(notification.Handle);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "delete notification failed");
+            }
+        }
+
+        /// <summary>
+        /// Removes all posted Notification of calling application.
+        /// </summary>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// Notification firstNotification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        /// NotificationManager.Post(firstNotification);
+        ///
+        /// Notification secondNotification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "second notification"
+        /// };
+        /// NotificationManager.Post(secondNotification);
+        /// NotificationManager.DeleteAll();
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void DeleteAll()
+        {
+            NotificationError ret;
+
+            ret = Interop.Notification.DeleteAll((int)NotificationType.Basic);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "delete all notifications failed of Noti type");
+            }
+
+            ret = Interop.Notification.DeleteAll((int)NotificationType.Ongoing);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "delete all notifications failed of Ongoing type");
+            }
+        }
+
+        /// <summary>
+        /// Searches for a posted notification which has the inputted tag and isn't deleted not yet.
+        /// </summary>
+        /// <remarks>
+        /// Load method should be called only for notifications which have been posted using NotificationManager.Post method.
+        /// If two or more notifications share the same tag, the notification posted most recently is returned.
+        /// </remarks>
+        /// <param name="tag">Tag used to query</param>
+        /// <returns>Notification Object with inputted tag</returns>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid or when the tag does not exist</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        /// NotificationManager.Post(notification);
+        ///
+        ///     // do someting
+        ///
+        /// Notification loadNotification = NotificationManager.Load("first notification");
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Notification Load(string tag)
+        {
+            IntPtr ptr = IntPtr.Zero;
+
+            if (string.IsNullOrEmpty(tag))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+            }
+
+            ptr = Interop.Notification.Load(tag);
+
+            if (ptr == IntPtr.Zero)
+            {
+                NotificationError ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+                Log.Error(Notification.LogTag, "unable to load Notification : " + ret.ToString());
+                if (ret == NotificationError.DbError)
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "the tag does not exist");
+                }
+                else
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to load Notification");
+                }
+            }
+
+            Notification notification = new Notification
+            {
+                Handle = new NotificationSafeHandle(ptr, true)
+            }.Build();
+
+            return notification;
+        }
+
+        /// <summary>
+        /// Saves a notification template to the notification database
+        /// </summary>
+        /// <param name="notification">Notification to save as template</param>
+        /// <param name="name">Template name</param>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when can't save as template</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        ///
+        /// Notification.Accessory accessory = new Notification.Accessory
+        /// {
+        ///     LedOption = AccessoryOption.On,
+        ///     VibrationOption = AccessoryOption.Custom,
+        ///     VibrationPath = "vibration absolute path"
+        /// }
+        /// notification.setAccessory(accessory);
+        ///
+        ///     // do something
+        ///
+        /// NotificationManager.Post(notification);
+        ///
+        /// Notification.LockStyle style = new Notification.LockStyle
+        /// {
+        ///     IconPath = "icon path",
+        ///     ThumbnailPath = "Thumbnail path"
+        /// }
+        /// notification.AddStyle(style);
+        /// NotificationManager.SaveTemplate(notification, "firstTemplate");
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void SaveTemplate(Notification notification, string name)
+        {
+            if (notification == null || string.IsNullOrEmpty(name))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to save template");
+            }
+
+            notification.Make();
+
+            NotificationError ret = Interop.Notification.SaveTemplate(notification.Handle, name);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "save as template failed");
+            }
+        }
+
+        /// <summary>
+        /// Loads a notification template from the notification database
+        /// </summary>
+        /// <param name="name">Template name</param>
+        /// <returns>Notification Object with inputted template name</returns>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid or when no template with input name exists</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <example>
+        /// <code>
+        /// Notification notification = new Notification
+        /// {
+        ///     Title = "title",
+        ///     Content = "content",
+        ///     Icon = "absolute icon path",
+        ///     Tag = "first notification"
+        /// };
+        ///
+        /// Notification.Accessory accessory = new Notification.Accessory
+        /// {
+        ///     LedOption = AccessoryOption.On,
+        ///     VibrationOption = AccessoryOption.Custom,
+        ///     VibrationPath = "vibration absolute path"
+        /// }
+        /// notification.setAccessory(accessory);
+        ///
+        ///     // do something
+        ///
+        /// NotificationManager.Post(notification);
+        ///
+        /// Notification.LockStyle style = new Notification.LockStyle
+        /// {
+        ///     IconPath = "icon path",
+        ///     ThumbnailPath = "Thumbnail path"
+        /// }
+        /// notification.AddStyle(style);
+        /// NotificationManager.SaveTemplate(notification, "firstTemplate");
+        /// Notification notificationTemplate = NotificationManager.LoadTemplate("firstTemplate");
+        /// </code>
+        /// </example>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static Notification LoadTemplate(string name)
+        {
+            IntPtr handle = IntPtr.Zero;
+
+            if (string.IsNullOrEmpty(name))
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to load template");
+            }
+
+            handle = Interop.Notification.LoadTemplate(name);
+            if (handle == IntPtr.Zero)
+            {
+                NotificationError ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+                if (ret == NotificationError.DbError)
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "the name does not exist");
+                }
+                else
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to create Notification from template");
+                }
+            }
+
+            Notification notification = new Notification
+            {
+                Handle = new NotificationSafeHandle(handle, true)
+            }.Build();
+
+            return notification;
+        }
+
+        /// <summary>
+        /// Gets notification block state.
+        /// </summary>
+        /// <remarks>
+        /// The user can set the notification block state in settings.
+        /// The block state indicates whether or not notifications can be posted.
+        /// Additionally only notifications to the notification panel are allowed in "Do not disturb mode".
+        /// Sound, Vibrate and Active notifications are blocked.
+        /// </remarks>
+        /// <returns>NotificationBlockState is state if notification is posted</returns>
+        /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static NotificationBlockState GetBlockState()
+        {
+            NotificationBlockState state;
+            NotificationError ret;
+
+            ret = Interop.Notification.GetBlockState(out state);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "GetBlockState failed");
+            }
+
+            Log.Info(Notification.LogTag, "Current block state is " + state.ToString());
+            return state;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static NotificationSafeHandle MakeNotificationSafeHandle(Notification notification)
+        {
+            if (notification == null)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid notification object");
+            }
+
+            notification.Make();
+
+            return notification.Handle;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static Notification MakeNotification(NotificationSafeHandle handle)
+        {
+            if (handle == null || handle.IsInvalid == true)
+            {
+                throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "handle is invalid or null");
+            }
+
+            Notification notification = new Notification { Handle = handle }.Build();
+
+            return notification;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs
new file mode 100755 (executable)
index 0000000..3630755
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for displaying progress notification
+        ///  You must initialize progress category, current, max value when you create object.
+        /// </summary>
+        public sealed class ProgressType : MakerBase
+        {
+            private double progressCurrent;
+            private double progressMax;
+
+            /// <summary>
+            /// Initializes a new instance of the <see cref="ProgressType"/> class.
+            /// You must initialize category, current, max value of progress.
+            /// </summary>
+            /// <param name="category">The category of progress that appeared on Notification</param>
+            /// <param name="current">The current value of the progress</param>
+            /// <param name="max">The max value of the progress</param>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            public ProgressType(ProgressCategory category, double current, double max)
+            {
+                if (IsNegativeNumber(current))
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The current must be a positive integer.");
+                }
+
+                if (IsNegativeNumber(max))
+                {
+                    throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The max must be a positive integer.");
+                }
+
+                Category = category;
+                ProgressCurrent = current;
+                ProgressMax = max;
+            }
+
+            /// <summary>
+            /// Gets or sets category of ProgressType.
+            /// </summary>
+            /// <seealso cref="Tizen.Applications.Notifications.ProgressCategory"></seealso>
+            public ProgressCategory Category { get; set; }
+
+            /// <summary>
+            /// Gets or sets current value of ProgressType
+            /// </summary>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            public double ProgressCurrent
+            {
+                get
+                {
+                    return progressCurrent;
+                }
+
+                set
+                {
+                    if (IsNegativeNumber(value))
+                    {
+                        throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer.");
+                    }
+
+                    progressCurrent = value;
+                }
+            }
+
+            /// <summary>
+            /// Gets or sets max value of ProgressType
+            /// </summary>
+            /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+            public double ProgressMax
+            {
+                get
+                {
+                    return progressMax;
+                }
+
+                set
+                {
+                    if (IsNegativeNumber(value))
+                    {
+                        throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer.");
+                    }
+
+                    progressMax = value;
+                }
+            }
+
+            internal override void Make(Notification notification)
+            {
+                ProgressBinder.BindObject(notification);
+            }
+
+            private bool IsNegativeNumber(double number)
+            {
+                return number < 0;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs
new file mode 100755 (executable)
index 0000000..6afd5c5
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    internal static class ProgressBinder
+    {
+        internal static void BindObject(Notification notification)
+        {
+            double current, max;
+
+            Notification.ProgressType progress = notification.Progress;
+
+            if (progress.Category == ProgressCategory.PendingBar)
+            {
+                Interop.Notification.SetProgressType(notification.Handle, ProgressCategory.Percent);
+                current = 0;
+                max = 0;
+            }
+            else if (progress.Category == ProgressCategory.Percent)
+            {
+                Interop.Notification.SetProgressType(notification.Handle, progress.Category);
+                current = progress.ProgressCurrent / 100;
+                max = progress.ProgressMax;
+            }
+            else
+            {
+                Interop.Notification.SetProgressType(notification.Handle, progress.Category);
+                current = progress.ProgressCurrent;
+                max = progress.ProgressMax;
+            }
+
+            Interop.Notification.SetProgress(notification.Handle, current);
+            Interop.Notification.SetProgressSize(notification.Handle, max);
+            Interop.Notification.SetLayout(notification.Handle, NotificationLayout.Progress);
+            Interop.Notification.SetOngoingFlag(notification.Handle, true);
+        }
+
+        internal static void BindSafeHandle(Notification notification)
+        {
+            NotificationLayout layout;
+            Interop.Notification.GetLayout(notification.Handle, out layout);
+
+            if (layout == NotificationLayout.Progress)
+            {
+                ProgressCategory category;
+                double current, max;
+
+                Interop.Notification.GetProgressType(notification.Handle, out category);
+                Interop.Notification.GetProgress(notification.Handle, out current);
+                Interop.Notification.GetProgressSize(notification.Handle, out max);
+
+                if (category == ProgressCategory.Percent)
+                {
+                    current *= 100;
+                }
+
+                notification.Progress = new Notification.ProgressType(category, current, max);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs
new file mode 100755 (executable)
index 0000000..f3bc10a
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        ///  Class for displaying direct-reply at notification.
+        ///  You must set a ReplyMax and Button. Otherwise user can't send written text to application which is set by AppControl.
+        /// </summary>
+        public sealed class ReplyAction : MakerBase
+        {
+            /// <summary>
+            /// Gets or sets the Index of Button which is appeared at Notification.
+            /// If you set ParentIndex, ReplyAction is displayed when button matched with ParentIndex click by the user.
+            /// If you don't set ParentIndex, appeared to notification directly.
+            /// </summary>
+            public ButtonIndex ParentIndex { get; set; } = ButtonIndex.None;
+
+            /// <summary>
+            /// Gets or sets the PlaceHolderText of ReplyAction which is appeared at Notification.
+            /// If you set PlaceHolderText, it is displayed to placeholder in notification.
+            /// </summary>
+            public string PlaceHolderText { get; set; }
+
+            /// <summary>
+            /// Gets or sets the ReplyMax of ReplyAction which is appeared at Notification.
+            /// You must set a ReplyMax. Otherwise user don't write text to placeholder in notification.
+            /// </summary>
+            /// <value>
+            /// Default value is 160.
+            /// </value>
+            public int ReplyMax { get; set; } = 160;
+
+            /// <summary>
+            /// Gets or sets the Button which is appeared to ReplyAction in Notification.
+            /// You must set a Button. Otherwise user can't send written text to application which is set by AppControl.
+            /// </summary>
+            /// <remarks>
+            /// If you set it to null, the already set ButtonAction will be removed.
+            /// </remarks>
+            /// <example>
+            /// <code>
+            /// ReplyAction button = new ReplyAction
+            /// {
+            ///     ParentIndex = ButtonIndex.Second;
+            ///     PlaceHolderText = "Please write your reply."
+            ///     ReplyMax = 160,
+            ///     Button = new ButtonAction
+            ///     {
+            ///         text = "Yes",
+            ///         ImagePath = "image path",
+            ///         Action = new AppControl{ ApplicationId = "org.tizen.app" };
+            ///     };
+            /// };
+            /// </code>
+            /// </example>
+            public ButtonAction Button { get; set; }
+
+            internal override void Make(Notification notification)
+            {
+                string replyKey = "__PARENT_INDEX__";
+
+                if (Button != null)
+                {
+                    Interop.Notification.SetText(notification.Handle, NotificationText.InputButton, Button.Text, null, -1);
+                    Interop.Notification.SetImage(notification.Handle, NotificationImage.TextInputButton, Button.ImagePath);
+
+                    if (this.Button.Action != null && this.Button.Action.SafeAppControlHandle.IsInvalid == false)
+                    {
+                        Interop.Notification.SetEventHandler(notification.Handle, (int)NotificationEventType.ClickOnTextInputButton, this.Button.Action.SafeAppControlHandle);
+
+                        if (this.ParentIndex != ButtonIndex.None)
+                        {
+                            Interop.Notification.SetEventHandler(notification.Handle, (int)this.ParentIndex, this.Button.Action.SafeAppControlHandle);
+                        }
+                    }
+                }
+
+                Bundle bundle = new Bundle();
+                bundle.AddItem(replyKey, ((int)this.ParentIndex).ToString());
+                Interop.Notification.SetExtentionData(notification.Handle, replyKey, bundle.SafeBundleHandle);
+
+                Interop.Notification.SetPlaceHolderLength(notification.Handle, this.ReplyMax);
+                Interop.Notification.SetText(notification.Handle, NotificationText.PlaceHolder, PlaceHolderText, null, -1);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs
new file mode 100755 (executable)
index 0000000..28ce60a
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+    using System.ComponentModel;
+    using System.Runtime.InteropServices;
+
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public sealed class NotificationSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public NotificationSafeHandle()
+            : base(IntPtr.Zero, true)
+        {
+        }
+
+        internal NotificationSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.Notification.Destroy(this.handle);
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs
new file mode 100755 (executable)
index 0000000..84ec3a7
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    /// <summary>
+    /// Class containing common properties and methods of Notifications
+    /// </summary>
+    /// <remarks>
+    /// A notification is a message that is displayed on the notification area.
+    /// It is created to notify information to the user through the application.
+    /// This class helps you to provide method and property for creating notification object.
+    /// </remarks>
+    public sealed partial class Notification
+    {
+        /// <summary>
+        /// An object that can apply a rich notification style to a Notification object.
+        /// If the platform does not provide rich notification styles in this class have no effect.
+        /// </summary>
+        public abstract class StyleBase : MakerBase
+        {
+            internal abstract string Key { get; }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs
new file mode 100755 (executable)
index 0000000..587c6ef
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.Notifications
+{
+    using System;
+
+    internal static class IndicatorBinder
+    {
+        internal static void BindObject(Notification notification)
+        {
+            int flag;
+            NotificationError ret = NotificationError.None;
+            Notification.IndicatorStyle style = (Notification.IndicatorStyle)notification.GetStyle("Indicator");
+            Interop.Notification.GetApplist(notification.Handle, out flag);
+
+            if (string.IsNullOrEmpty(style.SubText) == false)
+            {
+                ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1);
+                if (ret != NotificationError.None)
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to set indicator text");
+                }
+                flag |= (int)NotificationDisplayApplist.Ticker;
+            }
+
+            if (string.IsNullOrEmpty(style.IconPath) == false)
+            {
+                ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath);
+                if (ret != NotificationError.None)
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to set indicator image");
+                }
+                flag |= (int)NotificationDisplayApplist.Indicator;
+            }
+            Interop.Notification.SetApplist(notification.Handle, flag);
+        }
+
+        internal static void BindSafeHandle(Notification notification)
+        {
+            int appList;
+            Interop.Notification.GetApplist(notification.Handle, out appList);
+            if ((appList & (int)NotificationDisplayApplist.Ticker) != 0 || (appList & (int)NotificationDisplayApplist.Indicator) != 0)
+            {
+                string path, text;
+                Notification.IndicatorStyle indicator = new Notification.IndicatorStyle();
+                Interop.Notification.GetImage(notification.Handle, NotificationImage.IconForIndicator, out path);
+                indicator.IconPath = path;
+                Interop.Notification.GetText(notification.Handle, NotificationText.FirstMainText, out text);
+                indicator.SubText = text;
+
+                notification.AddStyle(indicator);
+            }
+        }
+    }
+
+    internal static class ActiveBinder
+    {
+        internal static void BindObject(Notification notification)
+        {
+            int flag;
+            NotificationError ret = NotificationError.None;
+            Notification.ActiveStyle style = (Notification.ActiveStyle)notification.GetStyle("Active");
+
+            Interop.Notification.SetAutoRemove(notification.Handle, style.IsAutoRemove);
+            if (style.IsAutoRemove == true)
+            {
+                int hidetime;
+                int deletetime;
+                style.GetRemoveTime(out hidetime, out deletetime);
+
+                Interop.Notification.SetHideTime(notification.Handle, hidetime);
+                try
+                {
+                    Interop.Notification.SetDeleteTime(notification.Handle, deletetime);
+                }
+                catch (TypeLoadException)
+                {
+                    // To support in API version 3.0
+                    style.SetRemoveTime(hidetime, 60);
+                }
+            }
+
+            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.Background, style?.BackgroundImage);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set background Image");
+            }
+
+            if (style.DefaultButton != ButtonIndex.None)
+            {
+                Interop.Notification.SetDefaultButton(notification.Handle, (int)style.DefaultButton + 1);
+            }
+
+            Interop.Notification.GetApplist(notification.Handle, out flag);
+            Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Active);
+
+            foreach (Notification.ButtonAction button in style.GetButtonAction())
+            {
+                button.Make(notification);
+            }
+
+            if (style.ReplyAction != null)
+            {
+                style.ReplyAction.Make(notification);
+            }
+        }
+
+        internal static void BindSafeHandle(Notification notification)
+        {
+            int appList;
+            Interop.Notification.GetApplist(notification.Handle, out appList);
+
+            if ((appList & (int)NotificationDisplayApplist.Active) != 0)
+            {
+                Notification.ActiveStyle active = new Notification.ActiveStyle();
+                bool isExisted = false;
+                bool autoRemove;
+                string path, text;
+                SafeAppControlHandle appcontrol = null;
+                string replyKey = "__PARENT_INDEX__";
+
+                for (int i = (int)ButtonIndex.First; i <= (int)ButtonIndex.Third; i++)
+                {
+                    appcontrol = null;
+
+                    Interop.Notification.GetImage(notification.Handle, NotificationImage.FirstButton + i, out path);
+                    Interop.Notification.GetText(notification.Handle, NotificationText.FirstButton + i, out text);
+                    Interop.Notification.GetEventHandler(notification.Handle, i, out appcontrol);
+
+                    if (string.IsNullOrEmpty(path) == false || string.IsNullOrEmpty(text) == false
+                        || (appcontrol != null && appcontrol.IsInvalid == false))
+                    {
+                        Notification.ButtonAction button = new Notification.ButtonAction();
+                        if (appcontrol != null && appcontrol.IsInvalid == false)
+                        {
+                            button.Action = new AppControl(appcontrol);
+                        }
+
+                        button.ImagePath = path;
+                        button.Text = text;
+                        button.Index = (ButtonIndex)i;
+                        active.AddButtonAction(button);
+                        isExisted = true;
+                    }
+                }
+
+                Interop.Notification.GetAutoRemove(notification.Handle, out autoRemove);
+                active.IsAutoRemove = autoRemove;
+                if (autoRemove)
+                {
+                    int hidetime, deletetime;
+                    Interop.Notification.GetHideTime(notification.Handle, out hidetime);
+                    try
+                    {
+                        Interop.Notification.GetDeleteTime(notification.Handle, out deletetime);
+                    }
+                    catch (TypeLoadException)
+                    {
+                        // To support in API version 3.0
+                        deletetime = 60;
+                    }
+
+                    active.SetRemoveTime(hidetime, deletetime);
+                }
+
+                Interop.Notification.GetImage(notification.Handle, NotificationImage.Background, out path);
+                if (string.IsNullOrEmpty(path) == false)
+                {
+                    isExisted = true;
+                    active.BackgroundImage = path;
+                }
+
+                int defaultIndex;
+                Interop.Notification.GetDefaultButton(notification.Handle, out defaultIndex);
+                active.DefaultButton = (ButtonIndex)(defaultIndex - 1);
+
+                appcontrol = null;
+                Interop.Notification.GetImage(notification.Handle, NotificationImage.TextInputButton, out path);
+                Interop.Notification.GetText(notification.Handle, NotificationText.InputButton, out text);
+                Interop.Notification.GetEventHandler(notification.Handle, (int)NotificationEventType.ClickOnTextInputButton, out appcontrol);
+
+                if (string.IsNullOrEmpty(path) == false || string.IsNullOrEmpty(text) == false
+                    || (appcontrol != null && appcontrol.IsInvalid == false))
+                {
+                    Notification.ReplyAction reply = new Notification.ReplyAction();
+                    Notification.ButtonAction button = new Notification.ButtonAction();
+                    if (appcontrol != null && appcontrol.IsInvalid == false)
+                    {
+                        button.Action = new AppControl(appcontrol);
+                    }
+
+                    button.ImagePath = path;
+                    button.Text = text;
+                    reply.Button = button;
+
+                    Interop.Notification.GetText(notification.Handle, NotificationText.PlaceHolder, out text);
+                    reply.PlaceHolderText = text;
+
+                    int holderLength;
+                    Interop.Notification.GetPlaceHolderLength(notification.Handle, out holderLength);
+                    reply.ReplyMax = holderLength;
+
+                    isExisted = true;
+
+                    try
+                    {
+                        SafeBundleHandle bundleHandle;
+                        Interop.Notification.GetExtentionData(notification.Handle, replyKey, out bundleHandle);
+                        Bundle bundle = new Bundle(bundleHandle);
+                        reply.ParentIndex = (ButtonIndex)int.Parse(bundle.GetItem(replyKey).ToString());
+                    }
+                    catch (Exception ex)
+                    {
+                        Log.Error(Notification.LogTag, ex.ToString());
+                    }
+
+                    active.ReplyAction = reply;
+                }
+
+                if (isExisted)
+                {
+                    notification.AddStyle(active);
+                }
+            }
+        }
+    }
+
+    internal static class LockBinder
+    {
+        internal static void BindObject(Notification notification)
+        {
+            int flag;
+            NotificationError ret = NotificationError.None;
+            Notification.LockStyle style = (Notification.LockStyle)notification.GetStyle("Lock");
+
+            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForLock, style.IconPath);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set lock icon");
+            }
+
+            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.ThumbnailForLock, style.ThumbnailPath);
+            if (ret != NotificationError.None)
+            {
+                throw NotificationErrorFactory.GetException(ret, "unable to set lock thumbnail");
+            }
+
+            Interop.Notification.GetApplist(notification.Handle, out flag);
+            Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Lock);
+        }
+
+        internal static void BindSafehandle(Notification notification)
+        {
+            int applist;
+            Interop.Notification.GetApplist(notification.Handle, out applist);
+
+            if ((applist & (int)NotificationDisplayApplist.Lock) != 0)
+            {
+                string path;
+                Notification.LockStyle lockStyle = new Notification.LockStyle();
+
+                Interop.Notification.GetImage(notification.Handle, NotificationImage.IconForLock, out path);
+                lockStyle.IconPath = path;
+
+                Interop.Notification.GetImage(notification.Handle, NotificationImage.ThumbnailForLock, out path);
+                lockStyle.ThumbnailPath = path;
+
+                notification.AddStyle(lockStyle);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs b/src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..75347d4
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string NotificationEventListener = "libnotification.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs b/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs
new file mode 100755 (executable)
index 0000000..1e8b413
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+using Tizen.Applications;
+using Tizen.Applications.NotificationEventListener;
+
+internal static partial class Interop
+{
+    internal static class NotificationEventListener
+    {
+        internal delegate void ChangedCallback(IntPtr userData, NotificationType type, IntPtr operationList, int num);
+
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            DbError = -0x01140000 | 0x01,
+            AlreadyExists = -0x01140000 | 0x02,
+            DBusError = -0x01140000 | 0x03,
+            DoesnotExist = -0x01140000 | 0x04,
+            ServiceError = -0x01140000 | 0x05,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation
+        }
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_free")]
+        internal static extern ErrorCode Destroy(IntPtr handle);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_id")]
+        internal static extern ErrorCode GetID(NotificationSafeHandle handle, out int groupId, out int privateId);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_pkgname")]
+        internal static extern ErrorCode GetAppIdReferenceType(NotificationSafeHandle handle, out IntPtr appid);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_text")]
+        internal static extern ErrorCode GetTextReferenceType(NotificationSafeHandle handle, NotificationText type, out IntPtr text);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_image")]
+        internal static extern ErrorCode GetImageReferenceType(NotificationSafeHandle handle, NotificationImage type, out IntPtr text);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_insert_time")]
+        internal static extern ErrorCode GetInsertTime(NotificationSafeHandle handle, out int time);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_time")]
+        internal static extern ErrorCode GetTime(NotificationSafeHandle handle, out int time);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_sound")]
+        internal static extern ErrorCode GetSoundReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_vibration")]
+        internal static extern ErrorCode GetVibrationReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_led")]
+        internal static extern ErrorCode GetLed(NotificationSafeHandle handle, out AccessoryOption type, out int color);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_led_time_period")]
+        internal static extern ErrorCode GetLedTime(NotificationSafeHandle handle, out int onMilliSeconds, out int offMilliSeconds);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_tag")]
+        internal static extern ErrorCode GetTagReferenceType(NotificationSafeHandle handle, out IntPtr tag);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_display_applist")]
+        internal static extern ErrorCode GetStyleList(NotificationSafeHandle handle, out int styleList);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_auto_remove")]
+        internal static extern ErrorCode GetAutoRemove(NotificationSafeHandle handle, out bool autoRemove);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_text_input_max_length")]
+        internal static extern ErrorCode GetPlaceHolderLength(NotificationSafeHandle handle, out int max);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_launch_option")]
+        internal static extern ErrorCode GetAppControl(NotificationSafeHandle handle, LaunchOption type, out SafeAppControlHandle appControlHandle);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_event_handler")]
+        internal static extern ErrorCode GetEventHandler(NotificationSafeHandle handle, int type, out SafeAppControlHandle appControlHandle);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_register_detailed_changed_cb")]
+        internal static extern ErrorCode SetChangedCallback(ChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_unregister_detailed_changed_cb")]
+        internal static extern ErrorCode UnsetChangedCallback(ChangedCallback callback);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_op_get_data")]
+        internal static extern ErrorCode GetOperationData(IntPtr operationList, NotificationOperationDataType type, out IntPtr userData);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_list_get_data")]
+        internal static extern IntPtr GetData(IntPtr notificationList);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_list_get_next")]
+        internal static extern IntPtr GetNext(IntPtr notificationList);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_delete_by_priv_id")]
+        internal static extern ErrorCode Delete(string appId, NotificationType type, int uniqueNumber);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_clear")]
+        internal static extern ErrorCode DeleteAll(int type);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_list")]
+        internal static extern ErrorCode GetList(NotificationType type, int count, out IntPtr notification);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_send_event_by_priv_id")]
+        internal static extern ErrorCode SendEvent(int uniqueNumber, int evnetType);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_layout")]
+        internal static extern ErrorCode GetLayout(NotificationSafeHandle handle, out NotificationLayout type);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_type")]
+        internal static extern ErrorCode GetType(NotificationSafeHandle handle, out NotificationType type);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_ongoing_value_type")]
+        internal static extern ErrorCode GetOngoingType(NotificationSafeHandle handle, out ProgressCategory category);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_size")]
+        internal static extern ErrorCode GetProgressSize(NotificationSafeHandle handle, out double value);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_progress")]
+        internal static extern ErrorCode GetProgress(NotificationSafeHandle handle, out double value);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_property")]
+        internal static extern ErrorCode GetProperties(NotificationSafeHandle handle, out int flags);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_extention_data")]
+        internal static extern ErrorCode GetExtender(NotificationSafeHandle handle, string key, out SafeBundleHandle value);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_clone")]
+        internal static extern ErrorCode GetClone(IntPtr handle, out IntPtr value);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_free_list")]
+        internal static extern ErrorCode NotificationListFree(IntPtr list);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_args")]
+        internal static extern ErrorCode GetExtentionBundle(NotificationSafeHandle handle, out IntPtr args, out IntPtr groupArgs);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_hide_timeout")]
+        internal static extern ErrorCode GetHideTimeout(NotificationSafeHandle handle, out int timeout);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_delete_timeout")]
+        internal static extern ErrorCode GetDeleteTimeout(NotificationSafeHandle handle, out int timeout);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_event_flag")]
+        internal static extern ErrorCode GetEventFlag(NotificationSafeHandle handle, out bool eventFlag);
+
+        [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_default_button")]
+        internal static extern ErrorCode GetDefaultButton(NotificationSafeHandle handle, out int index);
+
+        internal static ErrorCode GetAppId(NotificationSafeHandle handle, out string appid)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetAppIdReferenceType(handle, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                appid = null;
+            }
+            else
+            {
+                appid = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal static ErrorCode GetText(NotificationSafeHandle handle, NotificationText type, out string text)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetTextReferenceType(handle, type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                text = null;
+            }
+            else
+            {
+                text = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal static ErrorCode GetImage(NotificationSafeHandle handle, NotificationImage type, out string text)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetImageReferenceType(handle, type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                text = null;
+            }
+            else
+            {
+                text = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal static ErrorCode GetSound(NotificationSafeHandle handle, out AccessoryOption type, out string path)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetSoundReferenceType(handle, out type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                path = null;
+            }
+            else
+            {
+                path = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal static ErrorCode GetVibration(NotificationSafeHandle handle, out AccessoryOption type, out string path)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetVibrationReferenceType(handle, out type, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                path = null;
+            }
+            else
+            {
+                path = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal static ErrorCode GetTag(NotificationSafeHandle handle, out string tag)
+        {
+            ErrorCode err;
+            IntPtr ptr;
+            err = GetTagReferenceType(handle, out ptr);
+
+            if (ptr == IntPtr.Zero)
+            {
+                tag = null;
+            }
+            else
+            {
+                tag = Marshal.PtrToStringAnsi(ptr);
+            }
+
+            return err;
+        }
+
+        internal sealed class NotificationSafeHandle : SafeHandle
+        {
+            public NotificationSafeHandle()
+                : base(IntPtr.Zero, true)
+            {
+            }
+
+            internal NotificationSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+            {
+                SetHandle(existingHandle);
+            }
+
+            public override bool IsInvalid
+            {
+                get { return this.handle == IntPtr.Zero; }
+            }
+
+            protected override bool ReleaseHandle()
+            {
+                NotificationEventListener.Destroy(this.handle);
+                this.SetHandle(IntPtr.Zero);
+                return true;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj
new file mode 100755 (executable)
index 0000000..475c4f8
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.9</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.NotificationEventListener.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.snk b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.snk
new file mode 100644 (file)
index 0000000..5a8de8a
Binary files /dev/null and b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.snk differ
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs
new file mode 100755 (executable)
index 0000000..30dd573
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    internal static class NotificationAccessoryAgsBinder
+    {
+        internal static void BindObject(NotificationEventArgs eventargs)
+        {
+            AccessoryOption type;
+            int color;
+            string path;
+
+            NotificationEventArgs.AccessoryArgs accessory = new NotificationEventArgs.AccessoryArgs();
+
+            Interop.NotificationEventListener.GetLed(eventargs.Handle, out type, out color);
+            accessory.LedOption = type;
+            if (type != AccessoryOption.Off)
+            {
+                int on, off;
+
+                Interop.NotificationEventListener.GetLedTime(eventargs.Handle, out on, out off);
+                accessory.LedOnMillisecond = on;
+                accessory.LedOffMillisecond = off;
+
+                if (type == AccessoryOption.Custom)
+                {
+                    accessory.LedColor = new Common.Color(color >> 16 & 255, color >> 8 & 255, color >> 0 & 255, color >> 24 & 255);
+                }
+            }
+
+            Interop.NotificationEventListener.GetSound(eventargs.Handle, out type, out path);
+            accessory.SoundOption = type;
+            if (type == AccessoryOption.Custom)
+            {
+                accessory.SoundPath = path;
+            }
+
+            Interop.NotificationEventListener.GetVibration(eventargs.Handle, out type, out path);
+            if (type == AccessoryOption.Off)
+            {
+                accessory.CanVibrate = false;
+            }
+            else
+            {
+                accessory.CanVibrate = true;
+            }
+
+            eventargs.Accessory = accessory;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs
new file mode 100755 (executable)
index 0000000..e252015
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    internal static class NotificationButtonActionArgBinder
+    {
+        internal static void BindObject(NotificationEventArgs eventargs, int index)
+        {
+            string text;
+            bool isExisted = false;
+            SafeAppControlHandle appcontrol = null;
+            NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs();
+
+            button.Index = (ButtonIndex)index;
+
+            Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Button_1 + index, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                isExisted = true;
+                button.ImagePath = text;
+            }
+
+            Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstButton + index, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                isExisted = true;
+                button.Text = text;
+            }
+
+            Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, index, out appcontrol);
+
+            if (appcontrol != null && appcontrol.IsInvalid == false)
+            {
+                button.Action = new AppControl(appcontrol);
+                isExisted = true;
+            }
+
+            if (isExisted)
+            {
+                (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Button.Add(button);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs
new file mode 100755 (executable)
index 0000000..5d05883
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+    /// <summary>
+    /// This class provides the property to get information about the deleted notification.
+    /// </summary>
+    public class NotificationDeleteEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Gets the unique number of the Notification.
+        /// </summary>
+        public int UniqueNumber { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs
new file mode 100755 (executable)
index 0000000..35108cd
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    internal static class NotificationDeleteEventArgsBinder
+    {
+        internal static NotificationDeleteEventArgs BindObject(int uniqueNumber)
+        {
+            NotificationDeleteEventArgs deleteargs = new NotificationDeleteEventArgs();
+
+            deleteargs.UniqueNumber = uniqueNumber;
+
+            return deleteargs;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs
new file mode 100755 (executable)
index 0000000..9f348f6
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+    using System.Collections.Generic;
+    using System.ComponentModel;
+
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs : EventArgs
+    {
+        private const string LogTag = "Tizen.Applications.NotificationEventListener";
+
+        internal IDictionary<string, StyleArgs> Style;
+        internal IDictionary<string, Bundle> Extender;
+        internal Interop.NotificationEventListener.NotificationSafeHandle Handle;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="NotificationEventArgs"/> class.
+        /// </summary>
+        public NotificationEventArgs()
+        {
+            Style = new Dictionary<string, StyleArgs>();
+            Extender = new Dictionary<string, Bundle>();
+        }
+
+        /// <summary>
+        /// Gets the unique id of Notification.
+        /// </summary>
+        public int UniqueNumber { get; internal set; }
+
+        /// <summary>
+        /// Gets the appId of Notification.
+        /// </summary>
+        public string AppID { get; internal set; }
+
+        /// <summary>
+        /// Gets the title of Notification.
+        /// </summary>
+        public string Title { get; internal set; }
+
+        /// <summary>
+        /// Gets the content text of Notification.
+        /// </summary>
+        public string Content { get; internal set; }
+
+        /// <summary>
+        /// Gets the icon's path of Notification.
+        /// </summary>
+        public string Icon { get; internal set; }
+
+        /// <summary>
+        /// Gets the sub icon path of Notification.
+        /// </summary>
+        public string SubIcon { get; internal set; }
+
+        /// <summary>
+        /// Gets the Timestamp of notification is visible or not.
+        /// </summary>
+        public bool IsTimeStampVisible { get; internal set; }
+
+        /// <summary>
+        /// Gets TimeStamp of Notification.
+        /// </summary>
+        /// <remarks>
+        /// If IsTimeStampVisible property is set false, this TimeStamp property is meanless.
+        /// </remarks>
+        public DateTime TimeStamp { get; internal set; }
+
+        /// <summary>
+        /// Gets the count which is displayed at the right side of notification.
+        /// </summary>
+        public int Count { get; internal set; }
+
+        /// <summary>
+        /// Gets the Tag of notification.
+        /// </summary>
+        public string Tag { get; internal set; }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsOngoing { get; internal set; } = false;
+
+        /// <summary>
+        /// Gets a value that determines whether notification is displayed on the default viewer.
+        /// If IsDisplay property set false and add style, you can see only style notification.
+        /// </summary>
+        public bool IsDisplay { get; internal set; } = true;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool HasEventFlag { get; internal set; } = false;
+
+        /// <summary>
+        /// Gets the AppControl which is invoked when notification is clicked.
+        /// </summary>
+        public AppControl Action { get; internal set; }
+
+        /// <summary>
+        /// Gets the object of the progress notification.
+        /// </summary>
+        public ProgressArgs Progress { get; internal set; }
+
+        /// <summary>
+        /// Gets the AccessoryArgs which has option of Sound, Vibration, LED.
+        /// </summary>
+        public AccessoryArgs Accessory { get; internal set; }
+
+        /// <summary>
+        /// Gets the key for extender.
+        /// </summary>
+        public ICollection<string> ExtenderKey
+        {
+            get
+            {
+                return Extender.Keys;
+            }
+        }
+
+        /// <summary>
+        /// Gets the property.
+        /// </summary>
+        public NotificationProperty Property { get; internal set; }
+
+        /// <summary>
+        /// Gets the styleArgs of active, lock, indicator, bigpicture.
+        /// </summary>
+        /// <typeparam name="T">Type of notification style to be queried</typeparam>
+        /// <returns>The NotificationEventListener.StyleArgs object associated with the given style</returns>
+        /// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
+        public T GetStyle<T>() where T : StyleArgs, new()
+        {
+            T type = new T();
+            StyleArgs style = null;
+
+            Style.TryGetValue(type.Key, out style);
+
+            if (style == null)
+            {
+                Log.Error(LogTag, "Invalid Style");
+                throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered");
+            }
+            else
+            {
+                return style as T;
+            }
+        }
+
+        /// <summary>
+        /// Gets the ExtenderArgs.
+        /// </summary>
+        /// <param name="key">The key that specifies which extender</param>
+        /// <returns>Returns the bundle for key</returns>
+        public Bundle GetExtender(string key)
+        {
+            Bundle bundle;
+
+            if (string.IsNullOrEmpty(key))
+            {
+                throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered");
+            }
+
+            if (Extender.TryGetValue(key, out bundle) == false)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered : " + key);
+            }
+
+            return bundle;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs
new file mode 100755 (executable)
index 0000000..b09398c
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using Tizen.Common;
+
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        /// Class to get infomation about Notification accessory.
+        /// </summary>
+        public class AccessoryArgs
+        {
+            /// <summary>
+            /// Gets the sound option.
+            /// </summary>
+            public AccessoryOption SoundOption { get; internal set; }
+
+            /// <summary>
+            /// Gets the sound path.
+            /// </summary>
+            public string SoundPath { get; internal set; }
+
+            /// <summary>
+            /// Gets the vibration option.
+            /// </summary>
+            public bool CanVibrate { get; internal set; }
+
+            /// <summary>
+            /// Gets the led option.
+            /// </summary>
+            public AccessoryOption LedOption { get; internal set; }
+
+            /// <summary>
+            /// Gets led on time period that you would like the LED on the device to blink. as well as the rate.
+            /// </summary>
+            /// <value>
+            /// Default value of LedOnMilliseconds is 0.
+            /// The rate is specified in terms of the number of milliseconds to be on.
+            /// </value>
+            public int LedOnMillisecond { get; internal set; }
+
+            /// <summary>
+            /// Gets led on time period that you would like the LED on the device to blink. as well as the rate.
+            /// </summary>
+            /// <value>
+            /// Default value of LedOffMillisecond is 0.
+            /// The rate is specified in terms of the number of millisecond to be off.
+            /// </value>
+            public int LedOffMillisecond { get; internal set; }
+
+            /// <summary>
+            /// Gets led color that you would like the LED on the device to blink.
+            /// </summary>
+            public Color LedColor { get; internal set; }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs
new file mode 100755 (executable)
index 0000000..7495ffc
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System.Collections.Generic;
+
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        /// Class to get infomation about Notification Active style.
+        /// </summary>
+        public class ActiveStyleArgs : StyleArgs
+        {
+            /// <summary>
+            /// Initializes a new instance of the <see cref="ActiveStyleArgs"/> class.
+            /// </summary>
+            public ActiveStyleArgs()
+            {
+                Button = new List<ButtonActionArgs>();
+            }
+
+            /// <summary>
+            /// Gets the IsAutoRemove option of the active notification.
+            /// IsAutoRemove option lets the active notification be removed several seconds after it shows.
+            /// </summary>
+            /// <value>
+            /// When 'IsAutoRemove' is set as false, the active notification will not be removed as long as the user removes
+            /// the active notification or the app which posted the active notification removes the active notification.
+            /// </value>
+            public bool IsAutoRemove { get; internal set; }
+
+            /// <summary>
+            /// Gets an absolute path for an image file to display on the background of active notification.
+            /// </summary>
+            public string BackgroundImage { get; internal set; }
+
+            /// <summary>
+            /// Gets the default button to display highlight on the active notification
+            /// </summary>
+            public ButtonIndex DefaultButton { get; internal set; }
+
+            /// <summary>
+            /// Gets timeout value in second when the notification can be hidden from the viewer.
+            /// </summary>
+            public int HideTimeout { get; internal set; }
+
+            /// <summary>
+            /// Gets timeout value in second when the notification can be deleted from the viewer.
+            /// </summary>
+            public int DeleteTimeout { get; internal set; }
+
+            /// <summary>
+            /// Gets a button to this active notification style.
+            /// Buttons are displayed in the notification content.
+            /// </summary>
+            public IList<ButtonActionArgs> Button { get; internal set; }
+
+            /// <summary>
+            /// Gets a ReplyAction to this active notification style.
+            /// </summary>
+            public ReplyActionArgs Reply { get; internal set; }
+
+            internal override string Key
+            {
+                get
+                {
+                    return "Active";
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs
new file mode 100755 (executable)
index 0000000..e38f331
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+
+    internal static class NotificationEventArgsBinder
+    {
+        private const string LogTag = "Tizen.Applications.NotificationEventListener";
+
+        internal static NotificationEventArgs BindObject(IntPtr notification, bool data)
+        {
+            Interop.NotificationEventListener.ErrorCode err;
+            int time;
+            int uniqueNumber = -1;
+            int groupNumber = -1;
+            int property;
+            int doNotShowTimeStamp = -1;
+            int displayList;
+            bool eventFlag = false;
+            NotificationLayout layout;
+            NotificationType type;
+            string text;
+            IntPtr extention = IntPtr.Zero;
+            IntPtr dummy = IntPtr.Zero;
+            SafeAppControlHandle appcontrol = null;
+
+            NotificationEventArgs eventargs = new NotificationEventArgs();
+
+            eventargs.Handle = new Interop.NotificationEventListener.NotificationSafeHandle(notification, data);
+
+            err = Interop.NotificationEventListener.GetID(eventargs.Handle, out groupNumber, out uniqueNumber);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Error(LogTag, "unable to get UniqueNumber");
+            }
+
+            eventargs.UniqueNumber = uniqueNumber;
+
+            Interop.NotificationEventListener.GetAppId(eventargs.Handle, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.AppID = text;
+            }
+
+            Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.Title, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.Title = text;
+            }
+
+            Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.Content, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.Content = text;
+            }
+
+            Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Icon, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.Icon = text;
+            }
+
+            Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.SubIcon, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.SubIcon = text;
+            }
+
+            err = Interop.NotificationEventListener.GetTime(eventargs.Handle, out time);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get TimeStamp");
+            }
+
+            if (time == doNotShowTimeStamp)
+            {
+                eventargs.IsTimeStampVisible = false;
+            }
+            else
+            {
+                eventargs.IsTimeStampVisible = true;
+
+                if (time == 0)
+                {
+                    err = Interop.NotificationEventListener.GetInsertTime(eventargs.Handle, out time);
+                    if (err != Interop.NotificationEventListener.ErrorCode.None)
+                    {
+                        Log.Info(LogTag, "unable to get InsertTime");
+                    }
+                }
+
+                eventargs.TimeStamp = (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(time).ToLocalTime();
+            }
+
+            err = Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.EventCount, out text);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get Event Count");
+            }
+
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                try
+                {
+                    eventargs.Count = int.Parse(text);
+                }
+                catch (Exception ex)
+                {
+                    Log.Error(LogTag, ex.ToString());
+                }
+            }
+
+            err = Interop.NotificationEventListener.GetAppControl(eventargs.Handle, LaunchOption.AppControl, out appcontrol);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get Action");
+            }
+
+            if (appcontrol != null && appcontrol.IsInvalid == false)
+            {
+                eventargs.Action = new AppControl(appcontrol);
+            }
+
+            Interop.NotificationEventListener.GetTag(eventargs.Handle, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                eventargs.Tag = text;
+            }
+
+            err = Interop.NotificationEventListener.GetProperties(eventargs.Handle, out property);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get Property");
+            }
+            else
+            {
+                eventargs.Property = (NotificationProperty)property;
+            }
+
+            Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out displayList);
+            if ((displayList & (int)NotificationDisplayApplist.Tray) == 0)
+            {
+                eventargs.IsDisplay = false;
+            }
+
+            err = Interop.NotificationEventListener.GetExtentionBundle(eventargs.Handle, out extention, out dummy);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get Extender");
+            }
+
+            if (extention != IntPtr.Zero)
+            {
+                Bundle bundle = new Bundle(new SafeBundleHandle(extention, false));
+                foreach (string key in bundle.Keys)
+                {
+                    SafeBundleHandle sbh;
+                    Interop.NotificationEventListener.GetExtender(eventargs.Handle, key, out sbh);
+                    eventargs.Extender.Add(key, new Bundle(sbh));
+                }
+            }
+
+            err = Interop.NotificationEventListener.GetLayout(eventargs.Handle, out layout);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get layout");
+            }
+
+            err = Interop.NotificationEventListener.GetType(eventargs.Handle, out type);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get type");
+            }
+
+            if (layout == NotificationLayout.OngoingEvent && type == NotificationType.Ongoing)
+            {
+                eventargs.IsOngoing = true;
+            }
+
+            err = Interop.NotificationEventListener.GetEventFlag(eventargs.Handle, out eventFlag);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Info(LogTag, "unable to get event flag");
+            }
+
+            eventargs.HasEventFlag = eventFlag;
+
+            NotificationAccessoryAgsBinder.BindObject(eventargs);
+            NotificationStyleArgBinder.BindObject(eventargs);
+            NotificationProgressArgBinder.BindObject(eventargs);
+
+            return eventargs;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs
new file mode 100755 (executable)
index 0000000..2e39158
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        ///  Class to get infomation about Notification ButtonAction.
+        /// </summary>
+        public class ButtonActionArgs
+        {
+            /// <summary>
+            /// Gets the Index of the Button which is appeared at Notification.
+            /// </summary>
+            public ButtonIndex Index { get; internal set; }
+
+            /// <summary>
+            /// Gets the text that describes the button.
+            /// </summary>
+            public string Text { get; internal set; }
+
+            /// <summary>
+            /// Gets the image's path that represent the button.
+            /// </summary>
+            public string ImagePath { get; internal set; }
+
+            /// <summary>
+            /// Gets the AppControl that is invoked when the button is clicked.
+            /// </summary>
+            public AppControl Action { get; internal set; }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs
new file mode 100755 (executable)
index 0000000..348a016
--- /dev/null
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+    using System.ComponentModel;
+
+    /// <summary>
+    /// Enumeration for Progress category
+    /// </summary>
+    public enum ProgressCategory
+    {
+        /// <summary>
+        /// Value for percent type
+        /// </summary>
+        Percent,
+
+        /// <summary>
+        /// Value for time type
+        /// </summary>
+        Time,
+
+        /// <summary>
+        /// Value for pending type which is not updated progress current value
+        /// </summary>
+        PendingBar
+    }
+
+    /// <summary>
+    /// Enumeration for Accessory option
+    /// </summary>
+    public enum AccessoryOption
+    {
+        /// <summary>
+        /// Value for off accessory option
+        /// </summary>
+        Off = -1,
+
+        /// <summary>
+        /// Value for on accessory option
+        /// </summary>
+        On,
+
+        /// <summary>
+        /// Value for custom accessory option
+        /// </summary>
+        Custom
+    }
+
+    /// <summary>
+    /// Enumeration for Button Index
+    /// </summary>
+    public enum ButtonIndex
+    {
+        /// <summary>
+        /// Value for default button index
+        /// </summary>
+        None = -1,
+
+        /// <summary>
+        /// Value for first button index
+        /// </summary>
+        First,
+
+        /// <summary>
+        /// Value for second button index
+        /// </summary>
+        Second,
+
+        /// <summary>
+        /// Value for third button index
+        /// </summary>
+        Third
+    }
+
+    /// <summary>
+    /// Enumeration for notification particular property
+    /// </summary>
+    [Flags]
+    public enum NotificationProperty
+    {
+        /// <summary>
+        /// Value for adjust nothing
+        /// </summary>
+        None = 0x00,
+
+        /// <summary>
+        /// Value for display only SIM card inserted
+        /// </summary>
+        DisplayOnlySimMode = 0x01,
+
+        /// <summary>
+        /// Value for disable application launch when it selected
+        /// </summary>
+        DisableAppLaunch = 0x02,
+
+        /// <summary>
+        /// Value for disable auto delete when it selected
+        /// </summary>
+        DisableAutoDelete = 0x04,
+
+        /// <summary>
+        /// Value for deleted when device is rebooted even though notification is not set OngoingType
+        /// </summary>
+        VolatileDisplay = 0x100,
+    }
+
+    /// <summary>
+    /// Enumeration for event type on notification.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum UserEventType
+    {
+        /// <summary>
+        /// Event type : Click on button 1
+        /// </summary>
+        ClickOnButton1 = 0,
+
+        /// <summary>
+        /// Event type : Click on button 2
+        /// </summary>
+        ClickOnButton2,
+
+        /// <summary>
+        /// Event type : Click on button 3
+        /// </summary>
+        ClickOnButton3,
+
+        /// <summary>
+        /// Event type : Click on text_input button
+        /// </summary>
+        ClickOnReplyButton = 8,
+
+        /// <summary>
+        /// Event type : Hidden by user
+        /// </summary>
+        HiddenByUser = 100,
+
+        /// <summary>
+        /// Event type : Deleted by timer
+        /// </summary>
+        HiddenByTimeout = 101,
+
+        /// <summary>
+        /// Event type : Clicked by user
+        /// </summary>
+        ClickOnNotification = 200,
+
+        /// <summary>
+        /// Event type : Deleted by user
+        /// </summary>
+        DeleteNotification = 201,
+    }
+
+    /// <summary>
+    /// Enumeration for notification type.
+    /// </summary>
+    internal enum NotificationType
+    {
+        /// <summary>
+        /// Notification type
+        /// </summary>
+        Notification = 0,
+
+        /// <summary>
+        /// Ongoing type
+        /// </summary>
+        Ongoing,
+    }
+
+    /// <summary>
+    /// Enumeration for notification text type.
+    /// </summary>
+    internal enum NotificationText
+    {
+        /// <summary>
+        /// Title
+        /// </summary>
+        Title = 0,
+
+        /// <summary>
+        /// Content
+        /// </summary>
+        Content,
+
+        /// <summary>
+        /// Text to display event count
+        /// </summary>
+        EventCount = 3,
+
+        /// <summary>
+        /// Box contents 1
+        /// </summary>
+        FirstMainText,
+
+        /// <summary>
+        /// Box contents 1-1
+        /// </summary>
+        FirstSubText,
+
+        /// <summary>
+        /// Box contents 2
+        /// </summary>
+        SecondMainText,
+
+        /// <summary>
+        /// Box contents 2-1
+        /// </summary>
+        SecondSubText,
+
+        /// <summary>
+        /// Text on button 1
+        /// </summary>
+        FirstButton = 13,
+
+        /// <summary>
+        /// Text on button 2
+        /// </summary>
+        SecondButton,
+
+        /// <summary>
+        /// Text on button 3
+        /// </summary>
+        ThirdButton,
+
+        /// <summary>
+        /// Guide text on the message reply box
+        /// </summary>
+        PlaceHolder = 19,
+
+        /// <summary>
+        /// Text on button the on message reply box
+        /// </summary>
+        InputButton = 20,
+    }
+
+    /// <summary>
+    /// Enumeration for image type.
+    /// </summary>
+    internal enum NotificationImage
+    {
+        /// <summary>
+        /// Icon
+        /// </summary>
+        Icon = 0,
+
+        /// <summary>
+        /// Indicator icon
+        /// </summary>
+        Indicator,
+
+        /// <summary>
+        ///  Lock screen icon
+        /// </summary>
+        Lockscreen,
+
+        /// <summary>
+        /// Thumbnail
+        /// </summary>
+        Thumbnail,
+
+        /// <summary>
+        /// Lock screen thumbnail
+        /// </summary>
+        ThumbnailLockscreen,
+
+        /// <summary>
+        /// Icon
+        /// </summary>
+        SubIcon,
+
+        /// <summary>
+        /// image displayed on background
+        /// </summary>
+        Background,
+
+        /// <summary>
+        /// Image for button 1
+        /// </summary>
+        Button_1 = 12,
+
+        /// <summary>
+        /// Image for button 2
+        /// </summary>
+        Button_2,
+
+        /// <summary>
+        /// Image for button 3
+        /// </summary>
+        Button_3,
+
+        /// <summary>
+        /// Image for message reply
+        /// </summary>
+        TextInputButton = 18,
+    }
+
+    /// <summary>
+    /// Enumeration for notification layout type.
+    /// </summary>
+    internal enum NotificationLayout
+    {
+        /// <summary>
+        /// Default
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// Layout for notification. Used to inform single event
+        /// </summary>
+        SingleEvent = 1,
+
+        /// <summary>
+        /// Layout for notification. Used to display images
+        /// </summary>
+        Thumbnail = 3,
+
+        /// <summary>
+        /// Layout for ongoing notification. Used to display text message
+        /// </summary>
+        OngoingEvent = 4,
+
+        /// <summary>
+        /// Layout for ongoing notification. Used to display progress
+        /// </summary>
+        OngoingProgress = 5,
+    }
+
+    /// <summary>
+    /// Enumeration for notification launch option type.
+    /// </summary>
+    internal enum LaunchOption
+    {
+        /// <summary>
+        /// Launching with app control
+        /// </summary>
+        AppControl = 1
+    }
+
+    /// <summary>
+    /// Enumeration for notification operation data code.
+    /// </summary>
+    internal enum NotificationOperationDataType
+    {
+        /// <summary>
+        /// Default
+        /// </summary>
+        Min = 0,
+
+        /// <summary>
+        /// Operation type
+        /// </summary>
+        Type,
+
+        /// <summary>
+        /// Private ID
+        /// </summary>
+        UniqueNumber,
+
+        /// <summary>
+        /// Notification handler
+        /// </summary>
+        Notification,
+
+        /// <summary>
+        /// Reserved
+        /// </summary>
+        ExtraInformation1,
+
+        /// <summary>
+        /// Reserved
+        /// </summary>
+        ExtraInformation2,
+    }
+
+    /// <summary>
+    /// Enumeration for notification operation code.
+    /// </summary>
+    internal enum NotificationOperationType
+    {
+        /// <summary>
+        /// Default
+        /// </summary>
+        None = 0,
+
+        /// <summary>
+        /// Notification inserted
+        /// </summary>
+        Insert,
+
+        /// <summary>
+        /// Notification updated
+        /// </summary>
+        Update,
+
+        /// <summary>
+        /// Notification deleted
+        /// </summary>
+        Delete,
+    }
+
+    /// <summary>
+    /// Enumeration for event type on notification.
+    /// </summary>
+    internal enum ClickEventType
+    {
+        /// <summary>
+        /// Event type : Click on button 1
+        /// </summary>
+        FirstButton = 0,
+
+        /// <summary>
+        /// Event type : Click on button 2
+        /// </summary>
+        SecondButton = 1,
+
+        /// <summary>
+        /// Event type : Click on button 3
+        /// </summary>
+        ThirdButton = 2,
+
+        /// <summary>
+        /// Event type : Click on icon
+        /// </summary>
+        Icon = 6,
+
+        /// <summary>
+        /// Event type : Click on thumbnail
+        /// </summary>
+        Thumbnail = 7,
+
+        /// <summary>
+        /// Event type : Click on text_input button
+        /// </summary>
+        InputButton = 8,
+    }
+
+    /// <summary>
+    /// Enumeration for display application list.
+    /// </summary>
+    [Flags]
+    internal enum NotificationDisplayApplist
+    {
+        /// <summary>
+        /// Notification Tray(Quickpanel)
+        /// </summary>
+        Tray = 0x00000001,
+
+        /// <summary>
+        /// Ticker notification
+        /// </summary>
+        Ticker = 0x00000002,
+
+        /// <summary>
+        /// Lock screen
+        /// </summary>
+        Lock = 0x00000004,
+
+        /// <summary>
+        /// Indicator
+        /// </summary>
+        Indicator = 0x00000008,
+
+        /// <summary>
+        /// Active notification
+        /// </summary>
+        Active = 0x00000010,
+
+        /// <summary>
+        /// All display application except active notification
+        /// </summary>
+        All = 0x0000000f,
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs
new file mode 100755 (executable)
index 0000000..bc04cf1
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        ///  Class to generate the Indicator style notification.
+        /// </summary>
+        public class IndicatorStyleArgs : StyleArgs
+        {
+            /// <summary>
+            /// Gets the path of the image file to display on the icon of Indicator style.
+            /// </summary>
+            public string IconPath { get; internal set; }
+
+            /// <summary>
+            /// Gets the sub text to display Indicator style.
+            /// </summary>
+            public string SubText { get; internal set; }
+
+            internal override string Key
+            {
+                get
+                {
+                    return "Indicator";
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs
new file mode 100755 (executable)
index 0000000..62ca496
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        ///  Class to get infomation about Notification Lock style.
+        /// </summary>
+        public class LockStyleArgs : StyleArgs
+        {
+            /// <summary>
+            /// Gets the path of the image file to display on the icon of Lock style.
+            /// </summary>
+            public string IconPath { get; internal set; }
+
+            /// <summary>
+            /// Gets the path of the thumbnail image file to display on the icon of Lock style.
+            /// </summary>
+            public string Thumbnail { get; internal set; }
+
+            internal override string Key
+            {
+                get
+                {
+                    return "Lock";
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs
new file mode 100755 (executable)
index 0000000..ed01380
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        ///  Class to get infomation about Progress Notification.
+        /// </summary>
+        public class ProgressArgs
+        {
+            /// <summary>
+            /// Gets category of ProgressType.
+            /// </summary>
+            public ProgressCategory Category { get; internal set; }
+
+            /// <summary>
+            /// Gets current value of ProgressType.
+            /// </summary>
+            public double Current { get; internal set; }
+
+            /// <summary>
+            /// Gets max value of ProgressType.
+            /// </summary>
+            public double Max { get; internal set; }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs
new file mode 100755 (executable)
index 0000000..d96ebf0
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        /// <summary>
+        ///  Class to get infomation about Notification ReplyAction.
+        /// </summary>
+        public class ReplyActionArgs
+        {
+            /// <summary>
+            /// Gets Index of Button which is appeared at Notification.
+            /// If there is no ParentIndex, the ReplyAction should be displayed directly on the active notification.
+            /// </summary>
+            public ButtonIndex ParentIndex { get; internal set; } = ButtonIndex.None;
+
+            /// <summary>
+            /// Gets the PlaceHolderText of ReplyAction which is appeared at Notification.
+            /// It will be displayed to the text input box on the active notification.
+            /// </summary>
+            public string PlaceHolderText { get; internal set; }
+
+            /// <summary>
+            /// Gets a max length of text input.
+            /// </summary>
+            public int ReplyMax { get; internal set; }
+
+            /// <summary>
+            /// Gets the button displayed in the replyaction.
+            /// </summary>
+            public ButtonActionArgs Button { get; internal set; }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs
new file mode 100755 (executable)
index 0000000..5ba07c7
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    /// <summary>
+    /// This class provides the methods and properties to get information about the posted or updated notification.
+    /// </summary>
+    public partial class NotificationEventArgs
+    {
+        public abstract class StyleArgs
+        {
+            internal abstract string Key { get; }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs
new file mode 100755 (executable)
index 0000000..8a6bbcb
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+    using System.Runtime.CompilerServices;
+
+    internal static class NotificationEventListenerErrorFactory
+    {
+        private const string LogTag = "Tizen.Applications.NotificationEventListener";
+
+        internal static Exception GetException(
+            Interop.NotificationEventListener.ErrorCode err,
+            string msg,
+            [CallerMemberName] string memberName = "",
+            [CallerFilePath] string filePath = "",
+            [CallerLineNumber] int lineNumber = 0)
+        {
+            Log.Error(LogTag, memberName + " : " + lineNumber);
+            switch (err)
+            {
+                case Interop.NotificationEventListener.ErrorCode.InvalidParameter:
+                    Log.Error(LogTag, msg);
+                    return new ArgumentException(err + " error occurred.");
+                case Interop.NotificationEventListener.ErrorCode.PermissionDenied:
+                    Log.Error(LogTag, msg);
+                    return new UnauthorizedAccessException(err + "Permission denied.");
+                default:
+                    Log.Error(LogTag, msg);
+                    return new InvalidOperationException(err + " error occurred.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs
new file mode 100755 (executable)
index 0000000..5f02395
--- /dev/null
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+    using System.Collections.Generic;
+    using System.ComponentModel;
+    using System.Runtime.InteropServices;
+
+    /// <summary>
+    /// This class provides a way to register callback function for some notification events.
+    /// </summary>
+    /// <remarks>
+    /// The event listener can use this class to get a list of notification or to clear notifications.
+    /// </remarks>
+    public partial class NotificationListenerManager
+    {
+        private const string LogTag = "Tizen.Applications.NotificationEventListener";
+
+        private static event EventHandler<NotificationEventArgs> AddEventHandler;
+
+        private static event EventHandler<NotificationEventArgs> UpdateEventHandler;
+
+        private static event EventHandler<NotificationDeleteEventArgs> DeleteEventHandler;
+
+        private static Interop.NotificationEventListener.ChangedCallback callback;
+
+        [StructLayout(LayoutKind.Sequential)]
+        private struct NotificationOperation
+        {
+            NotificationOperationType type;
+            int uniqueNumber;
+            int extraInformation1;
+            int extraInformation2;
+            IntPtr notification;
+        }
+
+        private static int GetEventHandleLength()
+        {
+            int length = 0;
+
+            length += (DeleteEventHandler == null) ? 0 : DeleteEventHandler.GetInvocationList().Length;
+            length += (UpdateEventHandler == null) ? 0 : UpdateEventHandler.GetInvocationList().Length;
+            length += (AddEventHandler == null) ? 0 : AddEventHandler.GetInvocationList().Length;
+
+            return length;
+        }
+
+        /// <summary>
+        /// Registers a callback for notification insert event.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static event EventHandler<NotificationEventArgs> NotificationAddEventHandler
+        {
+            add
+            {
+                if (callback == null)
+                {
+                    callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent);
+                }
+
+                if (GetEventHandleLength() == 0)
+                {
+                    Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero);
+                    if (err != (int)Interop.NotificationEventListener.ErrorCode.None)
+                    {
+                        throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback");
+                    }
+                }
+
+                AddEventHandler += value;
+            }
+
+            remove
+            {
+                if (AddEventHandler != null && AddEventHandler.GetInvocationList().Length > 0)
+                {
+                    AddEventHandler -= value;
+
+                    if (GetEventHandleLength() == 0)
+                    {
+                        Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback);
+                        if (err != (int)Interop.NotificationEventListener.ErrorCode.None)
+                        {
+                            throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback");
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Registers a callback for notification update event.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static event EventHandler<NotificationEventArgs> NotificationUpdateEventHandler
+        {
+            add
+            {
+                if (callback == null)
+                {
+                    callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent);
+                }
+
+                if (GetEventHandleLength() == 0)
+                {
+                    Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero);
+                    if (err != Interop.NotificationEventListener.ErrorCode.None)
+                    {
+                        throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback");
+                    }
+                }
+
+                UpdateEventHandler += value;
+            }
+
+            remove
+            {
+                if (UpdateEventHandler != null && UpdateEventHandler.GetInvocationList().Length > 0)
+                {
+                    UpdateEventHandler -= value;
+
+                    if (GetEventHandleLength() == 0)
+                    {
+                        Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback);
+                        if (err != Interop.NotificationEventListener.ErrorCode.None)
+                        {
+                            throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback");
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Registers a callback for notification delete event.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static event EventHandler<NotificationDeleteEventArgs> NotificationDeleteEventHandler
+        {
+            add
+            {
+                if (callback == null)
+                {
+                    callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent);
+                }
+
+                if (GetEventHandleLength() == 0)
+                {
+                    Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero);
+                    if (err != Interop.NotificationEventListener.ErrorCode.None)
+                    {
+                        throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback");
+                    }
+                }
+
+                DeleteEventHandler += value;
+            }
+
+            remove
+            {
+                if (DeleteEventHandler != null && DeleteEventHandler.GetInvocationList().Length > 0)
+                {
+                    DeleteEventHandler -= value;
+
+                    if (GetEventHandleLength() == 0)
+                    {
+                        Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback);
+                        if (err != Interop.NotificationEventListener.ErrorCode.None)
+                        {
+                            throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback");
+                        }
+                    }
+                }
+            }
+        }
+
+        private static void ChangedEvent(IntPtr userData, NotificationType type, IntPtr operationList, int num)
+        {
+            IntPtr operationType;
+            IntPtr uniqueNumber;
+            IntPtr notification;
+
+            NotificationEventArgs eventargs;
+            NotificationDeleteEventArgs deleteargs;
+
+            for (int i = 0; i < num; i++)
+            {
+                uniqueNumber = IntPtr.Zero;
+                operationType = IntPtr.Zero;
+                notification = IntPtr.Zero;
+
+                Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf<NotificationOperation>()), NotificationOperationDataType.Type, out operationType);
+                Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf<NotificationOperation>()), NotificationOperationDataType.UniqueNumber, out uniqueNumber);
+                Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf<NotificationOperation>()), NotificationOperationDataType.Notification, out notification);
+
+                if (operationType == IntPtr.Zero)
+                {
+                    Log.Error(LogTag, "unable to get operationType");
+                    continue;
+                }
+
+                Log.Info(LogTag, "type : " + ((int)operationType).ToString());
+                Log.Info(LogTag, "Add : " + (AddEventHandler == null ? "0" : AddEventHandler.GetInvocationList().Length.ToString()));
+                Log.Info(LogTag, "update: " + (UpdateEventHandler == null ? "0" : UpdateEventHandler.GetInvocationList().Length.ToString()));
+                Log.Info(LogTag, "delete : " + (DeleteEventHandler == null ? "0" : DeleteEventHandler.GetInvocationList().Length.ToString()));
+
+                switch ((int)operationType)
+                {
+                    case (int)NotificationOperationType.Insert:
+                        if (notification != IntPtr.Zero)
+                        {
+                            try
+                            {
+                                eventargs = NotificationEventArgsBinder.BindObject(notification, false);
+                                AddEventHandler?.Invoke(null, eventargs);
+                            }
+                            catch (Exception e)
+                            {
+                                Log.Error(LogTag, e.Message);
+                            }
+                        }
+
+                        break;
+
+                    case (int)NotificationOperationType.Update:
+                        if (notification != IntPtr.Zero)
+                        {
+                            try
+                            {
+                                eventargs = NotificationEventArgsBinder.BindObject(notification, false);
+                                UpdateEventHandler?.Invoke(null, eventargs);
+                            }
+                            catch (Exception e)
+                            {
+                                Log.Error(LogTag, e.Message);
+                            }
+                        }
+
+                        break;
+
+                    case (int)NotificationOperationType.Delete:
+                        if (uniqueNumber != IntPtr.Zero)
+                        {
+                            try
+                            {
+                                deleteargs = NotificationDeleteEventArgsBinder.BindObject((int)uniqueNumber);
+                                DeleteEventHandler?.Invoke(null, deleteargs);
+                            }
+                            catch (Exception e)
+                            {
+                                Log.Error(LogTag, e.Message);
+                            }
+                        }
+
+                        break;
+
+                    default:
+                        Log.Info(LogTag, "Event : " + (int)operationType);
+                        break;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Deletes a Notification with appId and uniqueNumber.
+        /// </summary>
+        /// <param name="appId">The name of the application you want to delete.</param>
+        /// <param name="uniqueNumber">The unique number of the notification.</param>
+        /// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void Delete(string appId, int uniqueNumber)
+        {
+            Interop.NotificationEventListener.ErrorCode err;
+
+            if (string.IsNullOrEmpty(appId) || uniqueNumber < 0)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter");
+            }
+
+            err = Interop.NotificationEventListener.Delete(appId, 0, uniqueNumber);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "unable to delete");
+            }
+        }
+
+        /// <summary>
+        /// Deletes all Notification.
+        /// </summary>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static void DeleteAll()
+        {
+            Interop.NotificationEventListener.ErrorCode err;
+
+            err = Interop.NotificationEventListener.DeleteAll((int)NotificationType.Notification);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "delete all notifications failed of Noti type");
+            }
+
+            err = Interop.NotificationEventListener.DeleteAll((int)NotificationType.Ongoing);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "delete all notifications failed of Ongoing type");
+            }
+        }
+
+        /// <summary>
+        /// Returns the notification list handle.
+        /// </summary>
+        /// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
+        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+        /// <privilege>http://tizen.org/privilege/notification</privilege>
+        public static IList<NotificationEventArgs> GetList()
+        {
+            Interop.NotificationEventListener.ErrorCode err;
+            IntPtr notificationList = IntPtr.Zero;
+            IntPtr currentList = IntPtr.Zero;
+            IList<NotificationEventArgs> list = new List<NotificationEventArgs>();
+
+            err = Interop.NotificationEventListener.GetList(NotificationType.Notification, -1, out notificationList);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list");
+            }
+
+            if (notificationList != IntPtr.Zero)
+            {
+                currentList = notificationList;
+                while (currentList != IntPtr.Zero)
+                {
+                    IntPtr notification;
+                    NotificationEventArgs eventargs = new NotificationEventArgs();
+
+                    notification = Interop.NotificationEventListener.GetData(currentList);
+
+                    eventargs = NotificationEventArgsBinder.BindObject(notification, false);
+
+                    list.Add(eventargs);
+
+                    currentList = Interop.NotificationEventListener.GetNext(currentList);
+                }
+
+                Interop.NotificationEventListener.NotificationListFree(notificationList);
+                notificationList = IntPtr.Zero;
+            }
+
+            err = Interop.NotificationEventListener.GetList(NotificationType.Ongoing, -1, out notificationList);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list");
+            }
+
+            if (notificationList != IntPtr.Zero)
+            {
+                currentList = notificationList;
+                while (currentList != IntPtr.Zero)
+                {
+                    IntPtr notification;
+                    NotificationEventArgs eventargs = new NotificationEventArgs();
+
+                    notification = Interop.NotificationEventListener.GetData(currentList);
+
+                    eventargs = NotificationEventArgsBinder.BindObject(notification, false);
+
+                    list.Add(eventargs);
+
+                    currentList = Interop.NotificationEventListener.GetNext(currentList);
+                }
+
+                Interop.NotificationEventListener.NotificationListFree(notificationList);
+            }
+
+            return list;
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void SendEvent(int uniqueNumber, UserEventType type)
+        {
+            Interop.NotificationEventListener.ErrorCode err;
+
+            err = Interop.NotificationEventListener.SendEvent(uniqueNumber, (int)type);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                throw NotificationEventListenerErrorFactory.GetException(err, "failed to send event");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs
new file mode 100755 (executable)
index 0000000..8611503
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    internal static class NotificationProgressArgBinder
+    {
+        internal static void BindObject(NotificationEventArgs eventargs)
+        {
+            NotificationLayout layout;
+            Interop.NotificationEventListener.GetLayout(eventargs.Handle, out layout);
+
+            if (layout == NotificationLayout.OngoingProgress)
+            {
+                ProgressCategory category;
+                double current, max;
+
+                Interop.NotificationEventListener.GetOngoingType(eventargs.Handle, out category);
+                Interop.NotificationEventListener.GetProgress(eventargs.Handle, out current);
+                Interop.NotificationEventListener.GetProgressSize(eventargs.Handle, out max);
+
+                if (category == ProgressCategory.Percent)
+                {
+                    current *= 100;
+
+                    if (current == 0 && max == 0)
+                        category = ProgressCategory.PendingBar;
+                }
+
+                eventargs.Progress = new NotificationEventArgs.ProgressArgs();
+                eventargs.Progress.Current = current;
+                eventargs.Progress.Max = max;
+                eventargs.Progress.Category = category;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs
new file mode 100755 (executable)
index 0000000..a851009
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+
+    internal static class NotificationReplyActionArgBinder
+    {
+        private const string LogTag = "Tizen.Applications.NotificationEventListener";
+
+        internal static void BindObject(NotificationEventArgs eventargs)
+        {
+            string text;
+            int max;
+            bool isExisted = false;
+            SafeAppControlHandle appcontrol = null;
+            Bundle bundle;
+            NotificationEventArgs.ReplyActionArgs reply = new NotificationEventArgs.ReplyActionArgs();
+            NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs();
+            string replyKey = "__PARENT_INDEX__";
+
+            Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.TextInputButton, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                isExisted = true;
+                button.ImagePath = text;
+            }
+
+            Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.InputButton, out text);
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                isExisted = true;
+                button.Text = text;
+            }
+
+            Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, (int)ClickEventType.InputButton, out appcontrol);
+
+            if (appcontrol != null && appcontrol.IsInvalid == false)
+            {
+                button.Action = new AppControl(appcontrol);
+                isExisted = true;
+            }
+
+            reply.Button = button;
+
+            Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.PlaceHolder, out text);
+
+            if (string.IsNullOrEmpty(text) == false)
+            {
+                isExisted = true;
+                reply.PlaceHolderText = text;
+            }
+
+            Interop.NotificationEventListener.GetPlaceHolderLength(eventargs.Handle, out max);
+            reply.ReplyMax = max;
+            if (max > 0)
+            {
+                isExisted = true;
+            }
+
+            if (eventargs.Extender.TryGetValue(replyKey, out bundle))
+            {
+                if (bundle.Contains(replyKey))
+                {
+                    string parentIndex;
+                    if (bundle.TryGetItem(replyKey, out parentIndex))
+                    {
+                        try
+                        {
+                            reply.ParentIndex = (ButtonIndex)int.Parse(parentIndex);
+                            isExisted = true;
+                        }
+                        catch (Exception ex)
+                        {
+                            Log.Error(LogTag, "unable to get ParentIndex " + ex.Message);
+                        }
+                    }
+                }
+            }
+
+            if (isExisted)
+            {
+                (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Reply = reply;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs
new file mode 100755 (executable)
index 0000000..f45e4aa
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications.NotificationEventListener
+{
+    using System;
+
+    internal static class NotificationStyleArgBinder
+    {
+        internal static void BindObject(NotificationEventArgs eventargs)
+        {
+            bool autoRemove;
+            string path;
+            int styleList;
+            int timeout;
+
+            Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out styleList);
+
+            if ((styleList & (int)NotificationDisplayApplist.Active) != 0)
+            {
+                NotificationEventArgs.ActiveStyleArgs activeStyle = new NotificationEventArgs.ActiveStyleArgs();
+                eventargs.Style.Add(activeStyle.Key, activeStyle);
+
+                for (int i = (int)ClickEventType.FirstButton; i <= (int)ClickEventType.ThirdButton; i++)
+                {
+                    NotificationButtonActionArgBinder.BindObject(eventargs, i);
+                }
+
+                Interop.NotificationEventListener.GetAutoRemove(eventargs.Handle, out autoRemove);
+                activeStyle.IsAutoRemove = autoRemove;
+
+                Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Background, out path);
+                activeStyle.BackgroundImage = path;
+
+                int index;
+                Interop.NotificationEventListener.GetDefaultButton(eventargs.Handle, out index);
+                activeStyle.DefaultButton = (ButtonIndex)(index - 1);
+
+                Interop.NotificationEventListener.GetHideTimeout(eventargs.Handle, out timeout);
+                activeStyle.HideTimeout = timeout;
+
+                try
+                {
+                    Interop.NotificationEventListener.GetDeleteTimeout(eventargs.Handle, out timeout);
+                }
+                catch (TypeLoadException)
+                {
+                    //To support in API version 3.0
+                    timeout = 60;
+                }
+                activeStyle.DeleteTimeout = timeout;
+
+                NotificationReplyActionArgBinder.BindObject(eventargs);
+            }
+
+            if ((styleList & (int)NotificationDisplayApplist.Lock) != 0)
+            {
+                NotificationEventArgs.LockStyleArgs lockStyle = new NotificationEventArgs.LockStyleArgs();
+                eventargs.Style.Add(lockStyle.Key, lockStyle);
+
+                Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Lockscreen, out path);
+                lockStyle.IconPath = path;
+
+                Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.ThumbnailLockscreen, out path);
+                lockStyle.Thumbnail = path;
+            }
+
+            if ((styleList & (int)NotificationDisplayApplist.Ticker) != 0 || (styleList & (int)NotificationDisplayApplist.Indicator) != 0)
+            {
+                NotificationEventArgs.IndicatorStyleArgs indicatorStyle = new NotificationEventArgs.IndicatorStyleArgs();
+                eventargs.Style.Add(indicatorStyle.Key, indicatorStyle);
+
+                Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Indicator, out path);
+                indicatorStyle.IconPath = path;
+
+                Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstMainText, out path);
+                indicatorStyle.SubText = path;
+            }
+       }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..83cbc6e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string PackageManager = "libcapi-appfw-package-manager.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs
new file mode 100644 (file)
index 0000000..67de930
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using ErrorCode = Interop.PackageManager.ErrorCode;
+using StorageType = Interop.PackageManager.StorageType;
+using CertCompareResultType = Interop.PackageManager.CertCompareResultType;
+
+internal static partial class Interop
+{
+    internal static partial class Package
+    {
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool PackageInfoAppInfoCallback(AppType appType, string appId, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool PackageInfoCertificateInfoCallback(IntPtr handle, CertificateType certType, string certValue, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool PackageInfoPrivilegeInfoCallback(string privilege, IntPtr userData);
+
+        // Any change here might require changes in Tizen.Applications.AppType enum
+        internal enum AppType
+        {
+            All = 0,
+            Ui = 1,
+            Service = 2
+        }
+
+        internal enum CertificateType
+        {
+            AuthorRootCertificate = 0,
+            AuthorIntermediateCertificate = 1,
+            AuthorSignerCertificate = 2,
+            DistributorRootCertificate = 3,
+            DistributorIntermediateCertificate = 4,
+            DistributorSignerCertificate = 5,
+            Distributor2RootCertificate = 6,
+            Distributor2IntermediateCertificate = 7,
+            Distributor2SignerCertificate = 8
+        }
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_app_from_package")]
+        internal static extern ErrorCode PackageInfoForeachAppInfo(IntPtr handle, AppType appType, PackageInfoAppInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_cert_info")]
+        internal static extern ErrorCode PackageInfoForeachCertificateInfo(IntPtr handle, PackageInfoCertificateInfoCallback callback, IntPtr user_data);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_privilege_info")]
+        internal static extern ErrorCode PackageInfoForeachPrivilegeInfo(IntPtr handle, PackageInfoPrivilegeInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_create")]
+        internal static extern ErrorCode PackageInfoCreate(string packageId, out IntPtr handle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_destroy")]
+        internal static extern ErrorCode PackageInfoDestroy(IntPtr handle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_package")]
+        internal static extern ErrorCode PackageInfoGetPackage(IntPtr handle, out string packageId);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_label")]
+        internal static extern ErrorCode PackageInfoGetLabel(IntPtr handle, out string label);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_icon")]
+        internal static extern ErrorCode PackageInfoGetIconPath(IntPtr handle, out string path);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_version")]
+        internal static extern ErrorCode PackageInfoGetVersion(IntPtr handle, out string version);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_type")]
+        internal static extern ErrorCode PackageInfoGetType(IntPtr handle, out string type);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_installed_storage")]
+        internal static extern ErrorCode PackageInfoGetInstalledStorage(IntPtr handle, out StorageType storage);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_root_path")]
+        internal static extern ErrorCode PackageInfoGetRootPath(IntPtr handle, out string path);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_tep_name")]
+        internal static extern ErrorCode PackageInfoGetTepName(IntPtr handle, out string name);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_system_package")]
+        internal static extern ErrorCode PackageInfoIsSystemPackage(IntPtr handle, out bool system);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_removable_package")]
+        internal static extern ErrorCode PackageInfoIsRemovablePackage(IntPtr handle, out bool removable);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_preload_package")]
+        internal static extern ErrorCode PackageInfoIsPreloadPackage(IntPtr handle, out bool preload);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_accessible")]
+        internal static extern ErrorCode PackageInfoIsAccessible(IntPtr handle, out bool accessible);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_installed_time")]
+        internal static extern ErrorCode PackageInfoGetInstalledTime(IntPtr handle, out int installedTime);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_package_cert_info")]
+        internal static extern ErrorCode PackageCompareCertInfo(string lhsPackageId, string rhsPackageId, out CertCompareResultType result);
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs
new file mode 100755 (executable)
index 0000000..92ad54e
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class PackageManager
+    {
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void PackageManagerEventCallback(string type, string packageId, EventType eventType, PackageEventState eventState, int progress, ErrorCode error, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool PackageManagerPackageInfoCallback(IntPtr handle, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void PackageManagerSizeInfoCallback(string packageId, IntPtr sizeInfoHandle, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void PackageManagerTotalSizeInfoCallback(IntPtr sizeInfoHandle, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void PackageManagerRequestEventCallback(int requestId, string type, string packageId, EventType eventType, PackageEventState eventState, int progress, ErrorCode error, IntPtr userData);
+
+        // Any change here might require changes in Tizen.Applications.PackageManagerEventError enum
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            NoSuchPackage = -0x01150000 | 0x71,
+            SystemError = -0x01150000 | 0x72,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied
+        }
+
+        // Any change here might require changes in Tizen.Applications.PackageEventState enum
+        internal enum PackageEventState
+        {
+            Started = 0,
+            Processing = 1,
+            Completed = 2,
+            Failed = 3
+        }
+
+        [Flags]
+        internal enum EventStatus
+        {
+            All = 0x00,
+            Install = 0x01,
+            Uninstall = 0x02,
+            Upgrade = 0x04,
+            Move = 0x08,
+            ClearData = 0x10,
+            Progress = 0x20,
+        }
+
+        internal enum EventType
+        {
+            Install = 0,
+            Uninstall = 1,
+            Update = 2,
+            Move = 3,
+            ClearData = 4
+        }
+
+        internal enum CertCompareResultType
+        {
+            Match = 0,
+            Mismatch,
+            LhsNoCert,
+            RhsNoCert,
+            BothNoCert
+        }
+
+        internal enum PackageManagerPermissionType
+        {
+            Normal = 0,
+            Signature,
+            Privilege
+        }
+
+        // Any change here might require changes in Tizen.Applications.StorageType enum
+        internal enum StorageType
+        {
+            Internal = 0,
+            External = 1
+        }
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_create")]
+        internal static extern ErrorCode PackageManagerCreate(out SafePackageManagerHandle managerHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_destroy")]
+        internal static extern ErrorCode PackageManagerDestroy(IntPtr managerHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_set_event_status")]
+        internal static extern ErrorCode PackageManagerSetEvenStatus(SafePackageManagerHandle managerHandle, EventStatus eventStatus);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_set_event_cb")]
+        internal static extern ErrorCode PackageManagerSetEvent(SafePackageManagerHandle managerHandle, PackageManagerEventCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_unset_event_cb")]
+        internal static extern ErrorCode PackageManagerUnsetEvent(SafePackageManagerHandle managerHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_foreach_package_info")]
+        internal static extern ErrorCode PackageManagerForeachPackageInfo(PackageManagerPackageInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_size_info")]
+        internal static extern ErrorCode PackageManagerGetSizeInfo(string packageId, PackageManagerSizeInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_total_package_size_info")]
+        internal static extern ErrorCode PackageManagerGetTotalSizeInfo(PackageManagerTotalSizeInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_id_by_app_id")]
+        internal static extern ErrorCode PackageManageGetPackageIdByAppId(string app_id, out string package_id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_info")]
+        internal static extern ErrorCode PackageManagerGetPackageInfo(string packageId, out IntPtr packageInfoHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_cache_dir")]
+        internal static extern ErrorCode PackageManagerClearCacheDir(string packageId);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_all_cache_dir")]
+        internal static extern ErrorCode PackageManagerClearAllCacheDir();
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_data_dir")]
+        internal static extern ErrorCode PackageManagerClearDataDir(string packageId);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_create")]
+        internal static extern ErrorCode PackageManagerFilterCreate(out IntPtr handle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_destroy")]
+        internal static extern ErrorCode PackageManagerFilterDestroy(IntPtr handle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_add_bool")]
+        internal static extern ErrorCode PackageManagerFilterAdd(IntPtr handle, string property, bool value);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_foreach_package_info")]
+        internal static extern ErrorCode PackageManagerFilterForeachPackageInfo(IntPtr handle, PackageManagerPackageInfoCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_data_size")]
+        internal static extern ErrorCode PackageSizeInfoGetDataSize(IntPtr handle, out long dataSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_cache_size")]
+        internal static extern ErrorCode PackageSizeInfoGetCacheSize(IntPtr handle, out long cacheSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_app_size")]
+        internal static extern ErrorCode PackageSizeInfoGetAppSize(IntPtr handle, out long appSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_data_size")]
+        internal static extern ErrorCode PackageSizeInfoGetExtDataSize(IntPtr handle, out long extDataSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_cache_size")]
+        internal static extern ErrorCode PackageSizeInfoGetExtCacheSize(IntPtr handle, out long extCacheSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_app_size")]
+        internal static extern ErrorCode PackageSizeInfoGetExtAppSize(IntPtr handle, out long extAppSize);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_create")]
+        internal static extern ErrorCode PackageManagerRequestCreate(out SafePackageManagerRequestHandle requestHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_destroy")]
+        internal static extern ErrorCode PackageManagerRequestDestroy(IntPtr requestHandle);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_set_type")]
+        internal static extern ErrorCode PackageManagerRequestSetType(SafePackageManagerRequestHandle requestHandle, string type);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_set_tep")]
+        internal static extern ErrorCode PackageManagerRequestSetTepPath(SafePackageManagerRequestHandle requestHandle, string tepPath);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_install")]
+        internal static extern ErrorCode PackageManagerRequestInstall(SafePackageManagerRequestHandle requestHandle, string path, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_mount_install")]
+        internal static extern ErrorCode PackageManagerRequestMountInstall(SafePackageManagerRequestHandle requestHandle, string path, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_uninstall")]
+        internal static extern ErrorCode PackageManagerRequestUninstall(SafePackageManagerRequestHandle requestHandle, string name, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_move")]
+        internal static extern ErrorCode PackageManagerRequestMove(SafePackageManagerRequestHandle requestHandle, string name, StorageType moveToStorageType);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_package_cert_info")]
+        internal static extern ErrorCode PackageManagerCompareCertInfo(string lhsPackageId, string rhsPackageId, out CertCompareResultType CompareResult);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_app_cert_info")]
+        internal static extern ErrorCode PackageManagerCompareCertInfoByApplicationId(string lhsPackageId, string rhsPackageId, out CertCompareResultType CompareResult);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_is_preload_package_by_app_id")]
+        internal static extern ErrorCode PackageManagerIsPreloadPackageByApplicationId(string ApplicationId, out bool IsPreload);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_permission_type")]
+        internal static extern ErrorCode PackageManagerGetPermissionType(string ApplicationId, out PackageManagerPermissionType PermissionType);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_generate_license_request")]
+        internal static extern ErrorCode PackageManagerDrmGenerateLicenseRequest(string responseData, out string requestData, out string licenseUrl);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_register_license")]
+        internal static extern ErrorCode PackageManagerDrmRegisterLicense(string responseData);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_decrypt_package")]
+        internal static extern ErrorCode PackageManagerDrmDecryptPackage(string drmFilePath, string decryptedFilePath);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_install_with_cb")]
+        internal static extern ErrorCode PackageManagerRequestInstallWithCB(SafePackageManagerRequestHandle requestHandle, string path, PackageManagerRequestEventCallback callback, IntPtr userData, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_mount_install_with_cb")]
+        internal static extern ErrorCode PackageManagerRequestMountInstallWithCB(SafePackageManagerRequestHandle requestHandle, string path, PackageManagerRequestEventCallback callback, IntPtr userData, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_uninstall_with_cb")]
+        internal static extern ErrorCode PackageManagerRequestUninstallWithCB(SafePackageManagerRequestHandle requestHandle, string name, PackageManagerRequestEventCallback callback, IntPtr userData, out int id);
+
+        [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_move_with_cb")]
+        internal static extern ErrorCode PackageManagerRequestMoveWithCB(SafePackageManagerRequestHandle requestHandle, string name, StorageType moveToStorageType, PackageManagerRequestEventCallback callback, IntPtr userData, out int id);
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj b/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj
new file mode 100755 (executable)
index 0000000..9ae2f92
--- /dev/null
@@ -0,0 +1,19 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.9</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.PackageManager.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+    <GenerateReferenceAssembly>True</GenerateReferenceAssembly>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.snk b/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.snk differ
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs
new file mode 100644 (file)
index 0000000..cd1512b
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for certificate compare result type.
+    /// </summary>
+    public enum CertCompareResultType
+    {
+        /// <summary>
+        /// Certificates are matched.
+        /// </summary>
+        Match = Interop.PackageManager.CertCompareResultType.Match,
+        /// <summary>
+        /// Certificates are not matched.
+        /// </summary>
+        Mismatch = Interop.PackageManager.CertCompareResultType.Mismatch,
+        /// <summary>
+        /// First package doesn't have certificate.
+        /// </summary>
+        LhsNoCert = Interop.PackageManager.CertCompareResultType.LhsNoCert,
+        /// <summary>
+        /// Second package doesn't have certificate.
+        /// </summary>
+        RhsNoCert = Interop.PackageManager.CertCompareResultType.RhsNoCert,
+        /// <summary>
+        /// Certificates of both packages are not exist.
+        /// </summary>
+        BothNoCert = Interop.PackageManager.CertCompareResultType.BothNoCert
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs
new file mode 100755 (executable)
index 0000000..b9d5858
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for certification type.
+    /// </summary>
+    public enum CertificateType
+    {
+        /// <summary>
+        /// Author Certificate.
+        /// </summary>
+        Author,
+        /// <summary>
+        /// Distributor Certificate.
+        /// </summary>
+        Distributor,
+        /// <summary>
+        /// Distributor2 Certificate.
+        /// </summary>
+        Distributor2,
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs
new file mode 100755 (executable)
index 0000000..da643db
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for installation mode.
+    /// </summary>
+    public enum InstallationMode
+    {
+        /// <summary>
+        /// Normal Mode.
+        /// </summary>
+        Normal,
+        /// <summary>
+        /// Mount Mode.
+        /// </summary>
+        Mount
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs
new file mode 100755 (executable)
index 0000000..3dcd619
--- /dev/null
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provide methods and properties to get information about packages.
+    /// </summary>
+    public class Package
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        private string _id = string.Empty;
+        private string _label = string.Empty;
+        private string _iconPath = string.Empty;
+        private string _version = string.Empty;
+        private PackageType _type;
+        private Interop.PackageManager.StorageType _installedStorageType;
+        private string _rootPath = string.Empty;
+        private string _expansionPackageName = string.Empty;
+        private bool _isSystemPackage;
+        private bool _isRemovable;
+        private bool _isPreloaded;
+        private bool _isAccessible;
+        private IReadOnlyDictionary<CertificateType, PackageCertificate> _certificates;
+        private List<string> _privileges;
+        private int _installedTime;
+
+        private Package(string pkgId)
+        {
+            _id = pkgId;
+        }
+
+        /// <summary>
+        /// Package ID.
+        /// </summary>
+        public string Id { get { return _id; } }
+
+        /// <summary>
+        /// Label of the package.
+        /// </summary>
+        public string Label { get { return _label; } }
+
+        /// <summary>
+        /// Absolute path to the icon image.
+        /// </summary>
+        public string IconPath { get { return _iconPath; } }
+
+        /// <summary>
+        /// Version of the package.
+        /// </summary>
+        public string Version { get { return _version; } }
+
+        /// <summary>
+        /// Type of the package.
+        /// </summary>
+        public PackageType PackageType { get { return _type; } }
+
+        /// <summary>
+        /// Installed storage type for the package.
+        /// </summary>
+        public StorageType InstalledStorageType { get { return (StorageType)_installedStorageType; } }
+
+        /// <summary>
+        /// Root path for the package.
+        /// </summary>
+        public string RootPath { get { return _rootPath; } }
+
+        /// <summary>
+        /// Expansion package name for the package.
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public string TizenExpansionPackageName { get { return _expansionPackageName; } }
+
+        /// <summary>
+        /// Checks whether the package is system package.
+        /// </summary>
+        public bool IsSystemPackage { get { return _isSystemPackage; } }
+
+        /// <summary>
+        /// Checks whether the package is removable.
+        /// </summary>
+        public bool IsRemovable { get { return _isRemovable; } }
+
+        /// <summary>
+        /// Checks whether the package is preloaded.
+        /// </summary>
+        public bool IsPreloaded { get { return _isPreloaded; } }
+
+        /// <summary>
+        /// Checks whether the current package is accessible.
+        /// </summary>
+        public bool IsAccessible { get { return _isAccessible; } }
+
+        /// <summary>
+        /// Certificate information for the package
+        /// </summary>
+        public IReadOnlyDictionary<CertificateType, PackageCertificate> Certificates { get { return _certificates; } }
+
+        /// <summary>
+        /// Requested privilege for the package
+        /// </summary>
+        public IEnumerable<string> Privileges { get { return _privileges; } }
+
+        /// <summary>
+        /// Installed time of the package.
+        /// </summary>
+        public int InstalledTime { get { return _installedTime; } }
+
+        /// <summary>
+        /// Retrieves all application IDs of this package.
+        /// </summary>
+        /// <returns>Returns a dictionary containing all application info for given application type.</returns>
+        public IEnumerable<ApplicationInfo> GetApplications()
+        {
+            return GetApplications(ApplicationType.All);
+        }
+
+        /// <summary>
+        /// Retrieves all application IDs of this package.
+        /// </summary>
+        /// <param name="type">Optional: AppType enum value</param>
+        /// <returns>Returns a dictionary containing all application info for given application type.</returns>
+        public IEnumerable<ApplicationInfo> GetApplications(ApplicationType type)
+        {
+            List<ApplicationInfo> appInfoList = new List<ApplicationInfo>();
+            Interop.Package.PackageInfoAppInfoCallback cb = (Interop.Package.AppType appType, string appId, IntPtr userData) =>
+            {
+                appInfoList.Add(new ApplicationInfo(appId));
+                return true;
+            };
+
+            IntPtr packageInfoHandle;
+            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoCreate(Id, out packageInfoHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to create native handle for package info of {0}. err = {1}", Id, err));
+            }
+
+            err = Interop.Package.PackageInfoForeachAppInfo(packageInfoHandle, (Interop.Package.AppType)type, cb, IntPtr.Zero);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to application info of {0}. err = {1}", Id, err));
+            }
+
+            err = Interop.Package.PackageInfoDestroy(packageInfoHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to destroy native handle for package info of {0}. err = {1}", Id, err));
+            }
+            return appInfoList;
+        }
+
+        /// <summary>
+        /// Gets size information for this package.
+        /// </summary>
+        /// <returns>package size information</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public async Task<PackageSizeInformation> GetSizeInformationAsync()
+        {
+            TaskCompletionSource<PackageSizeInformation> tcs = new TaskCompletionSource<PackageSizeInformation>();
+            Interop.PackageManager.PackageManagerSizeInfoCallback sizeInfoCb = (pkgId, sizeInfoHandle, userData) =>
+            {
+                if (sizeInfoHandle != IntPtr.Zero && Id == pkgId)
+                {
+                    var pkgSizeInfo = PackageSizeInformation.GetPackageSizeInformation(sizeInfoHandle);
+                    tcs.TrySetResult(pkgSizeInfo);
+                }
+            };
+
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerGetSizeInfo(Id, sizeInfoCb, IntPtr.Zero);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                tcs.TrySetException(PackageManagerErrorFactory.GetException(err, "Failed to get total package size info of " + Id));
+            }
+            return await tcs.Task.ConfigureAwait(false);
+        }
+
+        /// <summary>
+        /// Compare certificate information with given package id.
+        /// </summary>
+        /// <param name="packageId">Id of the package</param>
+        /// <returns>Certificate comparison result</returns>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        public CertCompareResultType CompareCertInfo(string packageId)
+        {
+            Interop.PackageManager.CertCompareResultType compareResult;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfo(Id, packageId, out compareResult);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to compare package cert info");
+            }
+
+            return (CertCompareResultType)compareResult;
+        }
+
+        // This method assumes that given arguments are already validated and have valid values.
+        internal static Package CreatePackage(IntPtr handle, string pkgId)
+        {
+            Package package = new Package(pkgId);
+
+            var err = Interop.PackageManager.ErrorCode.None;
+            err = Interop.Package.PackageInfoGetLabel(handle, out package._label);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get package label of " + pkgId);
+            }
+            err = Interop.Package.PackageInfoGetIconPath(handle, out package._iconPath);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get package icon path of " + pkgId);
+            }
+            err = Interop.Package.PackageInfoGetVersion(handle, out package._version);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get package version of " + pkgId);
+            }
+
+            string type;
+            Interop.Package.PackageInfoGetType(handle, out type);
+            if (Enum.TryParse(type, true, out package._type) == false)
+            {
+                Log.Warn(LogTag, "Failed to get package type of " + pkgId);
+            }
+            err = Interop.Package.PackageInfoGetRootPath(handle, out package._rootPath);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get package root directory of " + pkgId);
+            }
+            err = Interop.Package.PackageInfoGetTepName(handle, out package._expansionPackageName);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get expansion package name of " + pkgId);
+                package._expansionPackageName = string.Empty;
+            }
+
+            err = Interop.Package.PackageInfoGetInstalledStorage(handle, out package._installedStorageType);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get installed storage type of " + pkgId);
+            }
+            Interop.Package.PackageInfoIsSystemPackage(handle, out package._isSystemPackage);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is system package or not");
+            }
+            Interop.Package.PackageInfoIsRemovablePackage(handle, out package._isRemovable);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is removable or not");
+            }
+            Interop.Package.PackageInfoIsPreloadPackage(handle, out package._isPreloaded);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is preloaded or not");
+            }
+            Interop.Package.PackageInfoIsAccessible(handle, out package._isAccessible);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is accessible or not");
+            }
+            try
+            {
+                Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime);
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get installed time of " + pkgId);
+                }
+            }
+            catch (TypeLoadException)
+            {
+                // To support in API vesion 3.0
+                package._installedTime = 0;
+            }
+
+            package._certificates = PackageCertificate.GetPackageCertificates(handle);
+            package._privileges = GetPackagePrivilegeInformation(handle);
+            return package;
+        }
+
+        internal static Package GetPackage(string packageId)
+        {
+            IntPtr packageInfoHandle;
+            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoCreate(packageId, out packageInfoHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, string.Format("Failed to create native handle for package info of {0}", packageId));
+            }
+
+            Package package = CreatePackage(packageInfoHandle, packageId);
+
+            err = Interop.Package.PackageInfoDestroy(packageInfoHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to destroy native handle for package info of {0}. err = {1}", packageId, err));
+            }
+            return package;
+        }
+
+        internal static Package GetPackage(IntPtr packageInfoHandle)
+        {
+            String packageId;
+            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoGetPackage(packageInfoHandle, out packageId);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to get package id for given package handle.");
+            }
+            return CreatePackage(packageInfoHandle, packageId);
+        }
+
+        private static List<string> GetPackagePrivilegeInformation(IntPtr packageInfoHandle)
+        {
+            List<string> privileges = new List<string>();
+            Interop.Package.PackageInfoPrivilegeInfoCallback privilegeInfoCb = (privilege, userData) =>
+            {
+                privileges.Add(privilege);
+                return true;
+            };
+
+            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachPrivilegeInfo(packageInfoHandle, privilegeInfoCb, IntPtr.Zero);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get privilage info. err = {0}", err));
+            }
+            return privileges;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs
new file mode 100755 (executable)
index 0000000..914d21a
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provides information about package certification.
+    /// </summary>
+    public class PackageCertificate
+    {
+        private const string LogTag = "Tizen.Applications";
+
+        private readonly string _root;
+        private readonly string _intermediate;
+        private readonly string _signer;
+
+        internal PackageCertificate(string root, string intermediate, string signer)
+        {
+            _root = root;
+            _intermediate = intermediate;
+            _signer = signer;
+        }
+
+        /// <summary>
+        /// Root certificate
+        /// </summary>
+        public string Root { get { return _root;  } }
+
+        /// <summary>
+        /// Intermediate certificate
+        /// </summary>
+        public string Intermediate { get { return _intermediate; } }
+
+        /// <summary>
+        /// Signer certificate
+        /// </summary>
+        public string Signer { get { return _signer; } }
+
+        internal static IReadOnlyDictionary<CertificateType, PackageCertificate> GetPackageCertificates(IntPtr packageInfoHandle)
+        {
+            Dictionary<Interop.Package.CertificateType, string> nativeCertificates = new Dictionary<Interop.Package.CertificateType, string>();
+            Interop.Package.PackageInfoCertificateInfoCallback certificateInfoCb = (handle, certType, certValue, userData) =>
+            {
+                if (certValue == null) certValue = string.Empty;
+                nativeCertificates.Add(certType, certValue);
+                return true;
+            };
+
+            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachCertificateInfo(packageInfoHandle, certificateInfoCb, IntPtr.Zero);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get certificate info. err = {0}", err));
+            }
+
+            Dictionary<CertificateType, PackageCertificate> certificates = new Dictionary<CertificateType, PackageCertificate>();
+            string authorRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorRootCertificate);
+            string authorIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorIntermediateCertificate);
+            string aurthorSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorSignerCertificate);
+            certificates.Add(CertificateType.Author, new PackageCertificate(authorRootCertificate, authorIntermediateCertificate, aurthorSignerCertificate));
+
+            string distRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorRootCertificate);
+            string distIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorIntermediateCertificate);
+            string distSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorSignerCertificate);
+            certificates.Add(CertificateType.Distributor, new PackageCertificate(distRootCertificate, distIntermediateCertificate, distSignerCertificate));
+
+            string dist2RootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2RootCertificate);
+            string dist2IntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2RootCertificate);
+            string dist2SignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2RootCertificate);
+            certificates.Add(CertificateType.Distributor2, new PackageCertificate(dist2RootCertificate, dist2IntermediateCertificate, dist2SignerCertificate));
+
+            return certificates;
+        }
+
+        private static string GetValue(IDictionary<Interop.Package.CertificateType, string> dict, Interop.Package.CertificateType key)
+        {
+            string value;
+            dict.TryGetValue(key, out value);
+            return value;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs
new file mode 100644 (file)
index 0000000..cb45bbb
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class provide methods and properties for DRM operation
+    /// </summary>
+    public class PackageDrm
+    {
+        private string _responseData;
+        private string _requestData;
+        private string _licenseUrl;
+        private PackageDrm(string responseData, string requestData, string licenseUrl)
+        {
+            _responseData = responseData;
+            _requestData = requestData;
+            _licenseUrl = licenseUrl;
+        }
+
+        /// <summary>
+        /// Returns response data
+        /// </summary>
+        /// <returns>Returns response data which is given when GenerateLicenseRequest has invoked</returns>
+        public string ResponseData { get { return _responseData; } }
+
+        /// <summary>
+        /// Returns request data
+        /// </summary>
+        /// <returns>Returns request data which is generated when GenerateLicenseRequest has invoked</returns>
+        public string RequestData { get { return _requestData; } }
+
+        /// <summary>
+        /// Returns license URL
+        /// </summary>
+        /// <returns>Returns license URL which is generated when GenerateLicenseRequest has invoked</returns>
+        public string LicenseUrl { get { return _licenseUrl; } }
+
+        internal static PackageDrm CreateDrmRequest(string responseData, string requestData, string licenseUrl)
+        {
+            PackageDrm packageDrm = new PackageDrm(responseData, requestData, licenseUrl);
+            return packageDrm;
+        }
+
+        internal static PackageDrm GenerateLicenseRequest(string responseData)
+        {
+            string requestData;
+            string licenseUrl;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmGenerateLicenseRequest(responseData, out requestData, out licenseUrl);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to generate license request");
+            }
+
+            PackageDrm packageDrm = CreateDrmRequest(responseData, requestData, licenseUrl);
+            return packageDrm;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs
new file mode 100755 (executable)
index 0000000..827a87f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for package manager event state.
+    /// </summary>
+    public enum PackageEventState
+    {
+        /// <summary>
+        /// Processing started
+        /// </summary>
+        Started = Interop.PackageManager.PackageEventState.Started,
+        /// <summary>
+        /// Processing state.
+        /// </summary>
+        Processing = Interop.PackageManager.PackageEventState.Processing,
+        /// <summary>
+        /// Processing Completed.
+        /// </summary>
+        Completed = Interop.PackageManager.PackageEventState.Completed,
+        /// <summary>
+        /// Processing Failed.
+        /// </summary>
+        Failed = Interop.PackageManager.PackageEventState.Failed
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs
new file mode 100755 (executable)
index 0000000..15d1f1b
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for package manager event type.
+    /// </summary>
+    public enum PackageEventType
+    {
+        /// <summary>
+        /// Install event.
+        /// </summary>
+        Install = Interop.PackageManager.EventType.Install,
+        /// <summary>
+        /// Uninstall event.
+        /// </summary>
+        Uninstall = Interop.PackageManager.EventType.Uninstall,
+        /// <summary>
+        /// Update event.
+        /// </summary>
+        Update = Interop.PackageManager.EventType.Update,
+        /// <summary>
+        /// Move event.
+        /// </summary>
+        Move = Interop.PackageManager.EventType.Move,
+        /// <summary>
+        /// ClearData event.
+        /// </summary>
+        ClearData = Interop.PackageManager.EventType.ClearData
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs
new file mode 100755 (executable)
index 0000000..8ebff43
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System.Collections.Generic;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class is a parameter of PackageManager::GetPackages method.
+    /// </summary>
+    public class PackageFilter
+    {
+        private IDictionary<string, bool> _filter;
+
+        /// <summary>
+        /// Default constructor with empty filter list. All installed applications will satisfy this filter unless updated with more specific filters.
+        /// </summary>
+        public PackageFilter()
+        {
+            _filter = new Dictionary<string, bool>();
+        }
+
+        /// <summary>
+        /// Constructor with specific filters. Using this will filter out installed packages which do not meet the criteria of the filters.
+        /// </summary>
+        public PackageFilter(IDictionary<string, bool> filter)
+        {
+            _filter = filter;
+        }
+
+        /// <summary>
+        /// Filters to be used in the GetPackages method.
+        /// </summary>
+        public IDictionary<string, bool> Filters
+        {
+            get
+            {
+                return _filter;
+            }
+        }
+
+        /// <summary>
+        /// This class contains possible keys for filter to be used in the GetPackages method.
+        /// </summary>
+        public static class Keys
+        {
+            /// <summary>
+            /// Key of the boolean property for filtering whether the package is removable
+            /// </summary>
+            public const string Removable = "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE";
+            /// <summary>
+            /// Key of the boolean property for filtering whether the package is readonly.
+            /// </summary>
+            public const string ReadOnly = "PMINFO_PKGINFO_PROP_PACKAGE_READONLY";
+            /// <summary>
+            /// Key of the boolean property for filtering whether the package supports disabling.
+            /// </summary>
+            public const string SupportsDisable = "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE";
+            /// <summary>
+            /// Key of the boolean property for filtering whether the package is disabled.
+            /// </summary>
+            public const string Disable = "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE";
+            /// <summary>
+            /// Key of the boolean property for filtering whether the package is preloaded.
+            /// </summary>
+            public const string Preload = "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD";
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs
new file mode 100755 (executable)
index 0000000..b7f37ef
--- /dev/null
@@ -0,0 +1,1152 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.IO;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// PackageManager class. This class has the methods and events of the PackageManager.
+    /// </summary>
+    /// <remarks>
+    /// The package manager is one of the core modules of Tizen application framework, and responsible for getting their information.
+    /// You can also retrieve information related to the packages that are installed on the device.
+    /// </remarks>
+    public static class PackageManager
+    {
+        private const string LogTag = "Tizen.Applications.PackageManager";
+
+        private static SafePackageManagerHandle s_handle = new SafePackageManagerHandle();
+        private static Interop.PackageManager.EventStatus s_eventStatus = Interop.PackageManager.EventStatus.All;
+        private static event EventHandler<PackageManagerEventArgs> s_installEventHandler;
+        private static event EventHandler<PackageManagerEventArgs> s_uninstallEventHandler;
+        private static event EventHandler<PackageManagerEventArgs> s_updateEventHandler;
+        private static event EventHandler<PackageManagerEventArgs> s_moveEventHandler;
+        private static event EventHandler<PackageManagerEventArgs> s_clearDataEventHandler;
+
+        private static Interop.PackageManager.PackageManagerEventCallback s_packageManagerEventCallback;
+
+        /// <summary>
+        /// Event Callback Method for the request.
+        /// </summary>
+        /// <param name="type">Type of the package which was requested</param>
+        /// <param name="packageId">ID of the package which was requested</param>
+        /// <param name="eventType">Event type of the request</param>
+        /// <param name="eventState">Current event state of the request</param>
+        /// <param name="progress">Progress for the request being processed by the package manager (in percent)</param>
+        public delegate void RequestEventCallback(string type, string packageId, PackageEventType eventType, PackageEventState eventState, int progress);
+
+        private static Dictionary<int, RequestEventCallback> RequestCallbacks = new Dictionary<int, RequestEventCallback>();
+        private static Dictionary<int, SafePackageManagerRequestHandle> RequestHandles = new Dictionary<int, SafePackageManagerRequestHandle>();
+
+        private delegate Interop.PackageManager.ErrorCode InstallMethodWithCallback(SafePackageManagerRequestHandle requestHandle, string pkgPath, Interop.PackageManager.PackageManagerRequestEventCallback requestCallback, IntPtr userData, out int requestID);
+        private delegate Interop.PackageManager.ErrorCode InstallMethod(SafePackageManagerRequestHandle requestHandle, string pkgPath, out int requestID);
+
+        /// <summary>
+        /// InstallProgressChanged event. This event is occurred when a package is getting installed and the progress of the request to the package manager changes.
+        /// </summary>
+        public static event EventHandler<PackageManagerEventArgs> InstallProgressChanged
+        {
+            add
+            {
+                SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Install);
+                RegisterPackageManagerEventIfNeeded();
+                s_installEventHandler += value;
+            }
+            remove
+            {
+                s_installEventHandler -= value;
+                UnregisterPackageManagerEventIfNeeded();
+                UnsetPackageManagerEventStatus();
+            }
+        }
+
+        /// <summary>
+        /// UninstallProgressChanged event. This event is occurred when a package is getting uninstalled and the progress of the request to the package manager changes.
+        /// </summary>
+        public static event EventHandler<PackageManagerEventArgs> UninstallProgressChanged
+        {
+            add
+            {
+                SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Uninstall);
+                RegisterPackageManagerEventIfNeeded();
+                s_uninstallEventHandler += value;
+            }
+            remove
+            {
+                s_uninstallEventHandler -= value;
+                UnregisterPackageManagerEventIfNeeded();
+                UnsetPackageManagerEventStatus();
+            }
+        }
+
+        /// <summary>
+        /// UpdateProgressChanged event. This event is occurred when a package is getting updated and the progress of the request to the package manager changes.
+        /// </summary>
+        public static event EventHandler<PackageManagerEventArgs> UpdateProgressChanged
+        {
+            add
+            {
+                SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Upgrade);
+                RegisterPackageManagerEventIfNeeded();
+                s_updateEventHandler += value;
+            }
+            remove
+            {
+                s_updateEventHandler -= value;
+                UnregisterPackageManagerEventIfNeeded();
+                UnsetPackageManagerEventStatus();
+            }
+        }
+
+        /// <summary>
+        /// MoveProgressChanged event. This event is occurred when a package is getting moved and the progress of the request to the package manager changes.
+        /// </summary>
+        public static event EventHandler<PackageManagerEventArgs> MoveProgressChanged
+        {
+            add
+            {
+                SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Move);
+                RegisterPackageManagerEventIfNeeded();
+                s_moveEventHandler += value;
+            }
+            remove
+            {
+                s_moveEventHandler -= value;
+                UnregisterPackageManagerEventIfNeeded();
+                UnsetPackageManagerEventStatus();
+            }
+        }
+
+        /// <summary>
+        /// ClearDataProgressChanged event. This event is occurred when data directories are cleared in the given package.
+        /// </summary>
+        public static event EventHandler<PackageManagerEventArgs> ClearDataProgressChanged
+        {
+            add
+            {
+                SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.ClearData);
+                RegisterPackageManagerEventIfNeeded();
+                s_clearDataEventHandler += value;
+            }
+            remove
+            {
+                s_clearDataEventHandler -= value;
+                UnregisterPackageManagerEventIfNeeded();
+                UnsetPackageManagerEventStatus();
+            }
+        }
+
+        private static SafePackageManagerHandle Handle
+        {
+            get
+            {
+                if (s_handle.IsInvalid)
+                {
+                    var err = Interop.PackageManager.PackageManagerCreate(out s_handle);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to create package manager handle. err = {0}", err));
+                    }
+                }
+                return s_handle;
+            }
+        }
+
+        private static Interop.PackageManager.PackageManagerRequestEventCallback internalRequestEventCallback = (id, packageType, packageId, eventType, eventState, progress, error, userData) =>
+        {
+            if (RequestCallbacks.ContainsKey(id))
+            {
+                try
+                {
+                    RequestCallbacks[id](packageType, packageId, (PackageEventType)eventType, (PackageEventState)eventState, progress);
+                    if (eventState == Interop.PackageManager.PackageEventState.Completed || eventState == Interop.PackageManager.PackageEventState.Failed)
+                    {
+                        Log.Debug(LogTag, string.Format("release request handle for id : {0}", id));
+                        RequestHandles[id].Dispose();
+                        RequestHandles.Remove(id);
+                        RequestCallbacks.Remove(id);
+                    }
+                }
+                catch (Exception e)
+                {
+                    Log.Warn(LogTag, e.Message);
+                    RequestHandles[id].Dispose();
+                    RequestHandles.Remove(id);
+                    RequestCallbacks.Remove(id);
+                }
+            }
+        };
+
+        /// <summary>
+        /// Gets the package ID for the given app ID.
+        /// </summary>
+        /// <param name="applicationId">The ID of the application</param>
+        /// <returns>Returns the ID of the package. Empty string if App ID does not exist</returns>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public static string GetPackageIdByApplicationId(string applicationId)
+        {
+            string packageId;
+            var err = Interop.PackageManager.PackageManageGetPackageIdByAppId(applicationId, out packageId);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get package Id of {0}. err = {1}", applicationId, err));
+                if (err != Interop.PackageManager.ErrorCode.InvalidParameter)
+                {
+                    throw PackageManagerErrorFactory.GetException(err, "Failed to get package Id");
+                }
+            }
+            return packageId;
+        }
+
+        /// <summary>
+        /// Gets the package information for the given package.
+        /// </summary>
+        /// <param name="packageId">The ID of the package</param>
+        /// <returns>Returns the package information for the given package ID.</returns>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public static Package GetPackage(string packageId)
+        {
+            return Package.GetPackage(packageId);
+        }
+
+        /// <summary>
+        /// Clears the application's internal and external cache directory.
+        /// </summary>
+        /// <param name="packageId">Id of the package</param>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+        /// <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+        public static void ClearCacheDirectory(string packageId)
+        {
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerClearCacheDir(packageId);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to clear cache directory for {0}. err = {1}", packageId, err));
+                throw PackageManagerErrorFactory.GetException(err, "Failed to clear cache directory");
+            }
+        }
+
+        /// <summary>
+        /// Clears all application's internal and external cache directory.
+        /// </summary>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static void ClearAllCacheDirectory()
+        {
+            var err = Interop.PackageManager.PackageManagerClearAllCacheDir();
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to clear all cache directories. err = {0}", err));
+                throw PackageManagerErrorFactory.GetException(err, "Failed to clear all cache directories");
+            }
+        }
+
+        /// <summary>
+        /// Clears the application's internal and external data directories
+        /// </summary>
+        /// <remarks>
+        /// All files under data, shared/data and shared/trusted in the internal storage are removed.
+        /// And, If external storeage exists, then all files under data and shared/trusted in the external storage are removed.
+        /// </remarks>
+        /// <param name="packageId">Id of the package</param>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static void ClearDataDirectory(string packageId)
+        {
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerClearDataDir(packageId);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to clear data directory for {0}. err = {1}", packageId, err));
+                throw PackageManagerErrorFactory.GetException(err, "Failed to clear data directory");
+            }
+        }
+
+        /// <summary>
+        /// Retrieves package information of all installed packages.
+        /// </summary>
+        /// <returns>Returns the list of packages.</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public static IEnumerable<Package> GetPackages()
+        {
+            return GetPackages(null);
+        }
+
+        /// <summary>
+        /// Retrieves package information of all installed packages satisfying filter conditions.
+        /// </summary>
+        /// <param name="filter">Optional - package filters</param>
+        /// <returns>Returns the list of packages.</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public static IEnumerable<Package> GetPackages(PackageFilter filter)
+        {
+            List<Package> packageList = new List<Package>();
+
+            IntPtr filterHandle;
+            var err = Interop.PackageManager.PackageManagerFilterCreate(out filterHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to create package filter handle. err = {0}", err));
+                return packageList;
+            }
+
+            if (filter != null && filter.Filters != null)
+            {
+                foreach (KeyValuePair<string, bool> entry in filter?.Filters)
+                {
+                    err = Interop.PackageManager.PackageManagerFilterAdd(filterHandle, entry.Key, entry.Value);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to configure package filter. err = {0}", err));
+                        break;
+                    }
+                }
+            }
+
+            if (err == Interop.PackageManager.ErrorCode.None)
+            {
+                Interop.PackageManager.PackageManagerPackageInfoCallback cb = (handle, userData) =>
+                {
+                    packageList.Add(Package.GetPackage(handle));
+                    return true;
+                };
+
+                err = Interop.PackageManager.PackageManagerFilterForeachPackageInfo(filterHandle, cb, IntPtr.Zero);
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, string.Format("Failed to get package Informations. err = {0}", err));
+                }
+            }
+
+            err = Interop.PackageManager.PackageManagerFilterDestroy(filterHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to destroy package filter handle. err = {0}", err));
+            }
+            return packageList;
+        }
+
+        /// <summary>
+        /// Gets the total package size information.
+        /// </summary>
+        /// <returns>Returns the total package size information asynchronously.</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        public static async Task<PackageSizeInformation> GetTotalSizeInformationAsync()
+        {
+            TaskCompletionSource<PackageSizeInformation> tcs = new TaskCompletionSource<PackageSizeInformation>();
+            Interop.PackageManager.PackageManagerTotalSizeInfoCallback cb = (handle, userData) =>
+            {
+                if (handle != IntPtr.Zero)
+                {
+                    tcs.TrySetResult(PackageSizeInformation.GetPackageSizeInformation(handle));
+                }
+            };
+
+            var err = Interop.PackageManager.PackageManagerGetTotalSizeInfo(cb, IntPtr.Zero);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                tcs.TrySetException(PackageManagerErrorFactory.GetException(err, "Failed to get total package size info"));
+            }
+            return await tcs.Task.ConfigureAwait(false);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, null, PackageType.UNKNOWN, null, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="eventCallback">The event callback will be invoked only for the current request</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, null, PackageType.UNKNOWN, eventCallback, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="type">Package type for the package to be installed</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, null, type, null, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="expansionPackagePath">Absolute path for the expansion package to be installed</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, string expansionPackagePath, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, expansionPackagePath, PackageType.UNKNOWN, null, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="type">Package type for the package to be installed</param>
+        /// <param name="eventCallback">The event callback will be invoked only for the current request</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, PackageType type, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, null, type, eventCallback, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="expansionPackagePath">Absolute path for the expansion package to be installed</param>
+        /// <param name="eventCallback">The event callback will be invoked only for the current request</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, string expansionPackagePath, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, expansionPackagePath, PackageType.UNKNOWN, eventCallback, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="expansionPackagePath">Absolute path for the expansion package to be installed</param>
+        /// <param name="type">Package type for the package to be installed</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, string expansionPackagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal)
+        {
+            return Install(packagePath, expansionPackagePath, type, null, installMode);
+        }
+
+        /// <summary>
+        /// Installs package located at the given path
+        /// </summary>
+        /// <param name="packagePath">Absolute path for the package to be installed</param>
+        /// <param name="expansionPackagePath">Absolute path for the expansion package to be installed</param>
+        /// <param name="type">Package type for the package to be installed</param>
+        /// <param name="eventCallback">The event callback will be invoked only for the current request</param>
+        /// <param name="installMode">Optional parameter to indicate special installation mode</param>
+        /// <returns>Returns true if installtion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of installation is seccessful.
+        /// To check the result of installation, the caller should check the progress using InstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Install(string packagePath, string expansionPackagePath, PackageType type, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
+        {
+            SafePackageManagerRequestHandle RequestHandle;
+            var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in creating package manager request handle. err = {1}", packagePath, err));
+                return false;
+            }
+
+            try
+            {
+                if (type != PackageType.UNKNOWN)
+                {
+                    err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower());
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in setting request package type. err = {1}", packagePath, err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                }
+
+                if (!string.IsNullOrEmpty(expansionPackagePath))
+                {
+                    err = Interop.PackageManager.PackageManagerRequestSetTepPath(RequestHandle, expansionPackagePath);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in setting request package mode. err = {1}", packagePath, err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                }
+
+                int requestId;
+                if (eventCallback != null)
+                {
+                    InstallMethodWithCallback install;
+                    if (installMode == InstallationMode.Mount)
+                    {
+                        install = Interop.PackageManager.PackageManagerRequestMountInstallWithCB;
+                    }
+                    else
+                    {
+                        install = Interop.PackageManager.PackageManagerRequestInstallWithCB;
+                    }
+                    err = install(RequestHandle, packagePath, internalRequestEventCallback, IntPtr.Zero, out requestId);
+                    if (err == Interop.PackageManager.ErrorCode.None)
+                    {
+                        RequestCallbacks.Add(requestId, eventCallback);
+                        RequestHandles.Add(requestId, RequestHandle);
+                    }
+                    else
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to install package {0}. err = {1}", packagePath, err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                }
+                else
+                {
+                    InstallMethod install;
+                    if (installMode == InstallationMode.Mount)
+                    {
+                        install = Interop.PackageManager.PackageManagerRequestMountInstall;
+                    }
+                    else
+                    {
+                        install = Interop.PackageManager.PackageManagerRequestInstall;
+                    }
+                    err = install(RequestHandle, packagePath, out requestId);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to install package {0}. err = {1}", packagePath, err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                    // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter.
+                    RequestHandle.Dispose();
+                }
+                return true;
+            }
+            catch (Exception e)
+            {
+                Log.Warn(LogTag, e.Message);
+                RequestHandle.Dispose();
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Uninstalls package with the given name.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be uninstalled</param>
+        /// <returns>Returns true if uninstallation request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of uninstallation is seccessful.
+        /// To check the result of uninstallation, the caller should check the progress using UninstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Uninstall(string packageId)
+        {
+            return Uninstall(packageId, PackageType.UNKNOWN, null);
+        }
+
+        /// <summary>
+        /// Uninstalls package with the given name.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be uninstalled</param>
+        /// <param name="type">Optional - Package type for the package to be uninstalled</param>
+        /// <returns>Returns true if uninstalltion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of uninstallation is seccessful.
+        /// To check the result of uninstallation, the caller should check the progress using UninstallProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Uninstall(string packageId, PackageType type)
+        {
+            return Uninstall(packageId, type, null);
+        }
+
+        /// <summary>
+        /// Uninstalls package with the given name.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be uninstalled</param>
+        /// <param name="eventCallback">Optional - The event callback will be invoked only for the current request</param>
+        /// <returns>Returns true if uninstalltion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of uninstallation is seccessful.
+        /// To check the result of uninstallation, the caller should check the progress using UninstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Uninstall(string packageId, RequestEventCallback eventCallback)
+        {
+            return Uninstall(packageId, PackageType.UNKNOWN, eventCallback);
+        }
+
+        /// <summary>
+        /// Uninstalls package with the given name.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be uninstalled</param>
+        /// <param name="type">Optional - Package type for the package to be uninstalled</param>
+        /// <param name="eventCallback">Optional - The event callback will be invoked only for the current request</param>
+        /// <returns>Returns true if uninstalltion request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of uninstallation is seccessful.
+        /// To check the result of uninstallation, the caller should check the progress using UninstallProgressChanged event OR eventCallback.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Uninstall(string packageId, PackageType type, RequestEventCallback eventCallback)
+        {
+            SafePackageManagerRequestHandle RequestHandle;
+            var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. Error in creating package manager request handle. err = {1}", packageId, err));
+                return false;
+            }
+
+            try
+            {
+                err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower());
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. Error in setting request package type. err = {1}", packageId, err));
+                    RequestHandle.Dispose();
+                    return false;
+                }
+
+                int requestId;
+                if (eventCallback != null)
+                {
+                    err = Interop.PackageManager.PackageManagerRequestUninstallWithCB(RequestHandle, packageId, internalRequestEventCallback, IntPtr.Zero, out requestId);
+                    if (err == Interop.PackageManager.ErrorCode.None)
+                    {
+                        RequestCallbacks.Add(requestId, eventCallback);
+                        RequestHandles.Add(requestId, RequestHandle);
+                    }
+                    else
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. err = {1}", packageId, err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                }
+                else
+                {
+                    err = Interop.PackageManager.PackageManagerRequestUninstall(RequestHandle, packageId, out requestId);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to uninstall package. err = {0}", err));
+                        RequestHandle.Dispose();
+                        return false;
+                    }
+                    // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter.
+                    RequestHandle.Dispose();
+                }
+                return true;
+            }
+            catch (Exception e)
+            {
+                Log.Warn(LogTag, e.Message);
+                RequestHandle.Dispose();
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Move package to given storage.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be moved</param>
+        /// <param name="newStorage">Storage, package should be moved to</param>
+        /// <returns>Returns true if move request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of move is seccessful.
+        /// To check the result of move, the caller should check the progress using MoveProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Move(string packageId, StorageType newStorage)
+        {
+            return Move(packageId, PackageType.UNKNOWN, newStorage, null);
+        }
+
+        /// <summary>
+        /// Move package to given storage.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be moved</param>
+        /// <param name="type">Optional - Package type for the package to be moved</param>
+        /// <param name="newStorage">Storage, package should be moved to</param>
+        /// <returns>Returns true if move request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of move is seccessful.
+        /// To check the result of move, the caller should check the progress using MoveProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Move(string packageId, PackageType type, StorageType newStorage)
+        {
+            return Move(packageId, type, newStorage, null);
+        }
+
+        /// <summary>
+        /// Move package to given storage.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be moved</param>
+        /// <param name="newStorage">Storage, package should be moved to</param>
+        /// <param name="eventCallback">Optional - The event callback will be invoked only for the current request</param>
+        /// <returns>Returns true if move request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of move is seccessful.
+        /// To check the result of move, the caller should check the progress using MoveProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Move(string packageId, StorageType newStorage, RequestEventCallback eventCallback)
+        {
+            return Move(packageId, PackageType.UNKNOWN, newStorage, eventCallback);
+        }
+
+        /// <summary>
+        /// Move package to given storage.
+        /// </summary>
+        /// <param name="packageId">Id of the package to be moved</param>
+        /// <param name="type">Optional - Package type for the package to be moved</param>
+        /// <param name="newStorage">Storage, package should be moved to</param>
+        /// <param name="eventCallback">Optional - The event callback will be invoked only for the current request</param>
+        /// <returns>Returns true if move request is successful, false otherwise.</returns>
+        /// <remarks>
+        /// The 'true' means that just the request of move is seccessful.
+        /// To check the result of move, the caller should check the progress using MoveProgressChanged event.
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        /// <privlevel>platform</privlevel>
+        public static bool Move(string packageId, PackageType type, StorageType newStorage, RequestEventCallback eventCallback)
+        {
+            SafePackageManagerRequestHandle RequestHandle;
+            var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to create package manager request handle. err = {0}", err));
+                return false;
+            }
+
+            try
+            {
+                bool result = true;
+                err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower());
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    Log.Warn(LogTag, string.Format("Failed to move package. Error in setting request package type. err = {0}", err));
+                    RequestHandle.Dispose();
+                    return false;
+                }
+
+                if (eventCallback != null)
+                {
+                    int requestId;
+                    err = Interop.PackageManager.PackageManagerRequestMoveWithCB(RequestHandle, packageId, (Interop.PackageManager.StorageType)newStorage, internalRequestEventCallback, IntPtr.Zero, out requestId);
+                    if (err == Interop.PackageManager.ErrorCode.None)
+                    {
+                        RequestCallbacks.Add(requestId, eventCallback);
+                        RequestHandles.Add(requestId, RequestHandle);
+                    }
+                    else
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to move package to requested location. err = {0}", err));
+                        RequestHandle.Dispose();
+                        result = false;
+                    }
+                }
+                else
+                {
+                    err = Interop.PackageManager.PackageManagerRequestMove(RequestHandle, packageId, (Interop.PackageManager.StorageType)newStorage);
+                    if (err != Interop.PackageManager.ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, string.Format("Failed to move package to requested location. err = {0}", err));
+                        RequestHandle.Dispose();
+                        result = false;
+                    }
+                    // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter.
+                    RequestHandle.Dispose();
+                }
+                return result;
+            }
+            catch (Exception e)
+            {
+                Log.Warn(LogTag, e.Message);
+                RequestHandle.Dispose();
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Gets permission type of package which has given application id
+        /// </summary>
+        /// <param name="applicationId">Id of the application</param>
+        /// <returns>Returns permission type.</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        public static PermissionType GetPermissionTypeByApplicationId(string applicationId)
+        {
+            Interop.PackageManager.PackageManagerPermissionType permissionType;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerGetPermissionType(applicationId, out permissionType);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to get permission type.");
+            }
+
+            return (PermissionType)permissionType;
+        }
+
+        /// <summary>
+        /// Gets package's preload attribute which contain given applicion id
+        /// </summary>
+        /// <param name="applicationId">Id of the application</param>
+        /// <returns>Returns true if package is preloaded. Otherwise return false.</returns>
+        /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+        public static bool IsPreloadPackageByApplicationId(string applicationId)
+        {
+            bool isPreloadPackage;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerIsPreloadPackageByApplicationId(applicationId, out isPreloadPackage);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to get preload info");
+            }
+
+            return isPreloadPackage;
+        }
+
+        /// <summary>
+        /// Compare certificate of two packages
+        /// </summary>
+        /// <param name="lhsPackageId">package id to compare</param>
+        /// <param name="rhsPackageId">package id to be compared</param>
+        /// <returns>Returns certificate comparison result.</returns>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        public static CertCompareResultType CompareCertInfo(string lhsPackageId, string rhsPackageId)
+        {
+            Interop.PackageManager.CertCompareResultType compareResult;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfo(lhsPackageId, rhsPackageId, out compareResult);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to compare cert info");
+            }
+
+            return (CertCompareResultType)compareResult;
+        }
+
+        /// <summary>
+        /// Compare certificate of two packages which contain each given application id
+        /// </summary>
+        /// <param name="lhsApplicationId">application id to compare</param>
+        /// <param name="rhsApplicationId">application id to be compared</param>
+        /// <returns>Returns certificate comparison result.</returns>
+        /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error</exception>
+        public static CertCompareResultType CompareCertInfoByApplicationId(string lhsApplicationId, string rhsApplicationId)
+        {
+            Interop.PackageManager.CertCompareResultType compareResult;
+            Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfoByApplicationId(lhsApplicationId, rhsApplicationId, out compareResult);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to compare cert info by application id");
+            }
+
+            return (CertCompareResultType)compareResult;
+        }
+
+        /// <summary>
+        /// Drm nested class. This class has the PackageManager's drm related methods.
+        /// </summary>
+        public static class Drm
+        {
+            /// <summary>
+            /// Generates request for getting license
+            /// </summary>
+            /// <param name="responseData">Response data string of the purchase request</param>
+            /// <returns>Returns package drm information of given response data which contains require data and license url</returns>
+            /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+            /// <privlevel>platform</privlevel>
+            /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+            /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+            /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+            /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+            public static PackageDrm GenerateLicenseRequest(string responseData)
+            {
+                return PackageDrm.GenerateLicenseRequest(responseData);
+
+            }
+
+            /// <summary>
+            /// Registers encrypted license
+            /// </summary>
+            /// <param name="responseData">The response data string of the rights request</param>
+            /// <returns>Returns true if succeed. Otherwise return false</returns>
+            /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+            /// <privlevel>platform</privlevel>
+            /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+            /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+            /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+            /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+            public static bool RegisterLicense(string responseData)
+            {
+                Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmRegisterLicense(responseData);
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    throw PackageManagerErrorFactory.GetException(err, "Failed to register drm license");
+                }
+
+                return true;
+            }
+
+            /// <summary>
+            /// Decrypts contents which is encrypted
+            /// </summary>
+            /// <param name="drmFilePath">Drm file path</param>
+            /// <param name="decryptedFilePath">Decrypted file path</param>
+            /// <returns>Returns true if succeed. Otherwise return false</returns>
+            /// <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+            /// <privlevel>platform</privlevel>
+            /// <exception cref="ArgumentException">Thrown when failed when input package ID is invalid</exception>
+            /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method</exception>
+            /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access this method</exception>
+            /// <exception cref="SystemException">Thrown when method failed due to internal system error</exception>
+            public static bool DecryptPackage(string drmFilePath, string decryptedFilePath)
+            {
+                Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmDecryptPackage(drmFilePath, decryptedFilePath);
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    throw PackageManagerErrorFactory.GetException(err, "Failed to decrypt drm package");
+                }
+
+                return true;
+            }
+        }
+
+        private static void SetPackageManagerEventStatus(Interop.PackageManager.EventStatus status)
+        {
+            if (Handle.IsInvalid) return;
+
+            Interop.PackageManager.EventStatus eventStatus = s_eventStatus;
+            eventStatus |= status;
+            if (eventStatus != Interop.PackageManager.EventStatus.All)
+                eventStatus |= Interop.PackageManager.EventStatus.Progress;
+
+            var err = Interop.PackageManager.ErrorCode.None;
+            if (s_eventStatus != eventStatus)
+            {
+                err = Interop.PackageManager.PackageManagerSetEvenStatus(Handle, eventStatus);
+                if (err == Interop.PackageManager.ErrorCode.None)
+                {
+                    s_eventStatus = eventStatus;
+                    Log.Debug(LogTag, string.Format("New Event Status flag: {0}", s_eventStatus));
+                    return;
+                }
+                Log.Debug(LogTag, string.Format("Failed to set flag for {0} event. err = {1}", eventStatus, err));
+            }
+        }
+
+        private static void UnsetPackageManagerEventStatus()
+        {
+            if (Handle.IsInvalid) return;
+
+            Interop.PackageManager.EventStatus eventStatus = Interop.PackageManager.EventStatus.All;
+            if (s_installEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Install;
+            if (s_uninstallEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Uninstall;
+            if (s_updateEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Upgrade;
+            if (s_moveEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Move;
+            if (s_clearDataEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.ClearData;
+            if (eventStatus != Interop.PackageManager.EventStatus.All)
+                eventStatus |= Interop.PackageManager.EventStatus.Progress;
+
+            var err = Interop.PackageManager.ErrorCode.None;
+            if (s_eventStatus != eventStatus)
+            {
+                err = Interop.PackageManager.PackageManagerSetEvenStatus(Handle, eventStatus);
+                if (err == Interop.PackageManager.ErrorCode.None)
+                {
+                    s_eventStatus = eventStatus;
+                    Log.Debug(LogTag, string.Format("New Event Status flag: {0}", s_eventStatus));
+                    return;
+                }
+                Log.Debug(LogTag, string.Format("Failed to set flag for {0} event. err = {1}", eventStatus, err));
+            }
+        }
+
+        private static void RegisterPackageManagerEventIfNeeded()
+        {
+            if (s_installEventHandler != null && s_uninstallEventHandler != null && s_updateEventHandler != null && s_moveEventHandler != null && s_clearDataEventHandler != null)
+            {
+                return;
+            }
+
+            var err = Interop.PackageManager.ErrorCode.None;
+            s_packageManagerEventCallback = (packageType, packageId, eventType, eventState, progress, error, user_data) =>
+            {
+                try
+                {
+                    if (eventType == Interop.PackageManager.EventType.Install)
+                    {
+                        s_installEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress));
+                    }
+                    else if (eventType == Interop.PackageManager.EventType.Uninstall)
+                    {
+                        s_uninstallEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress));
+                    }
+                    else if (eventType == Interop.PackageManager.EventType.Update)
+                    {
+                        s_updateEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress));
+                    }
+                    else if (eventType == Interop.PackageManager.EventType.Move)
+                    {
+                        s_moveEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress));
+                    }
+                    else if (eventType == Interop.PackageManager.EventType.ClearData)
+                    {
+                        s_clearDataEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress));
+                    }
+                }
+                catch (Exception e)
+                {
+                    Log.Warn(LogTag, e.Message);
+                }
+            };
+
+            if (!Handle.IsInvalid)
+            {
+                Log.Debug(LogTag, "Reset Package Event");
+                err = Interop.PackageManager.PackageManagerUnsetEvent(Handle);
+                if (err != Interop.PackageManager.ErrorCode.None)
+                {
+                    throw PackageManagerErrorFactory.GetException(err, "Failed to unregister package manager event event.");
+                }
+
+                err = Interop.PackageManager.PackageManagerSetEvent(Handle, s_packageManagerEventCallback, IntPtr.Zero);
+            }
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to register callback for package manager event. err = {0}", err));
+            }
+        }
+
+        private static void UnregisterPackageManagerEventIfNeeded()
+        {
+            if (Handle.IsInvalid || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null)
+            {
+                return;
+            }
+
+            var err = Interop.PackageManager.PackageManagerUnsetEvent(Handle);
+            if (err != Interop.PackageManager.ErrorCode.None)
+            {
+                throw PackageManagerErrorFactory.GetException(err, "Failed to unregister package manager event event.");
+            }
+        }
+    }
+
+    internal static class PackageManagerErrorFactory
+    {
+        internal static Exception GetException(Interop.PackageManager.ErrorCode err, string message)
+        {
+            string errMessage = string.Format("{0} err = {1}", message, err);
+            switch (err)
+            {
+                case Interop.PackageManager.ErrorCode.InvalidParameter:
+                case Interop.PackageManager.ErrorCode.NoSuchPackage:
+                    return new ArgumentException(errMessage);
+                case Interop.PackageManager.ErrorCode.PermissionDenied:
+                    return new UnauthorizedAccessException(errMessage);
+                case Interop.PackageManager.ErrorCode.IoError:
+                    return new global::System.IO.IOException(errMessage);
+                default:
+                    return new InvalidOperationException(errMessage);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs
new file mode 100755 (executable)
index 0000000..ba0466f
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// PackageManagerEventArgs class. This class is an event arguments of the InstallProgressChanged, UninstallProgressChanged and UpdateProgressChanged events.
+    /// </summary>
+    public class PackageManagerEventArgs : EventArgs
+    {
+        private readonly PackageType _packageType;
+        private readonly string _packageId;
+        private readonly PackageEventState _state;
+        private readonly int _progress;
+
+        internal PackageManagerEventArgs(string packageType, string packageId, PackageEventState state, int progress)
+        {
+            _packageType = PackageTypeMethods.ToPackageType(packageType);
+            _packageId = packageId;
+            _state = state;
+            _progress = progress;
+        }
+
+        /// <summary>
+        /// Type of the package to be installed, uninstalled or updated
+        /// </summary>
+        public PackageType PackageType { get { return _packageType; } }
+
+        /// <summary>
+        /// package ID to be installed, uninstalled or updated
+        /// </summary>
+        public string PackageId { get { return _packageId; } }
+
+        /// <summary>
+        /// Current state of the request to the package manager
+        /// </summary>
+        public PackageEventState State { get { return _state; } }
+
+        /// <summary>
+        /// Progress for the request being processed by the package manager (in percent).
+        /// </summary>
+        public int Progress { get { return _progress; } }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs
new file mode 100755 (executable)
index 0000000..7269f74
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class has the read only properties to get package size information.
+    /// </summary>
+    public class PackageSizeInformation
+    {
+        private long _dataSize;
+        private long _cacheSize;
+        private long _appSize;
+        private long _externalDataSize;
+        private long _externalCacheSize;
+        private long _externalAppSize;
+
+        private PackageSizeInformation() { }
+
+        /// <summary>
+        /// Data size for package.
+        /// </summary>
+        public long DataSize { get { return _dataSize; } }
+
+        /// <summary>
+        /// Cache size for package.
+        /// </summary>
+        public long CacheSize { get { return _cacheSize; } }
+
+        /// <summary>
+        /// Application size for package.
+        /// </summary>
+        public long AppSize { get { return _appSize; } }
+
+        /// <summary>
+        /// External data size for package.
+        /// </summary>
+        public long ExternalDataSize { get { return _externalDataSize; } }
+
+        /// <summary>
+        /// External cache size for package.
+        /// </summary>
+        public long ExternalCacheSize { get { return _externalCacheSize; } }
+
+        /// <summary>
+        /// External application size for package.
+        /// </summary>
+        public long ExternalAppSize { get { return _externalAppSize; } }
+
+        // This method assumes that pass handle is already validated
+        internal static PackageSizeInformation GetPackageSizeInformation(IntPtr handle)
+        {
+            var pkgSizeInfo = new PackageSizeInformation();
+            Interop.PackageManager.PackageSizeInfoGetDataSize(handle, out pkgSizeInfo._dataSize);
+            Interop.PackageManager.PackageSizeInfoGetCacheSize(handle, out pkgSizeInfo._cacheSize);
+            Interop.PackageManager.PackageSizeInfoGetAppSize(handle, out pkgSizeInfo._appSize);
+            Interop.PackageManager.PackageSizeInfoGetExtDataSize(handle, out pkgSizeInfo._externalDataSize);
+            Interop.PackageManager.PackageSizeInfoGetExtCacheSize(handle, out pkgSizeInfo._externalCacheSize);
+            Interop.PackageManager.PackageSizeInfoGetExtAppSize(handle, out pkgSizeInfo._externalAppSize);
+            return pkgSizeInfo;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs
new file mode 100755 (executable)
index 0000000..e8a0042
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for package type.
+    /// </summary>
+    public enum PackageType
+    {
+        UNKNOWN,
+        /// <summary>
+        /// Tizen native application package
+        /// </summary>
+        TPK,
+        /// <summary>
+        /// Tizen web/ hybrid application Package
+        /// </summary>
+        WGT,
+        /// <summary>
+        /// It's a special meaning type to represent the tizen application package which is installed using rpm spec.
+        /// Only some preloaded packages can have this type.
+        /// </summary>
+        RPM
+    }
+
+    internal static class PackageTypeMethods
+    {
+        internal static PackageType ToPackageType(string type)
+        {
+            if (string.IsNullOrEmpty(type))
+            {
+                throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "type can't be null or empty");
+            }
+
+            string lowerType = type.ToLower();
+            if (lowerType == "tpk")
+            {
+                return PackageType.TPK;
+            }
+            else if (lowerType == "wgt")
+            {
+                return PackageType.WGT;
+            }
+            else if (lowerType == "rpm")
+            {
+                return PackageType.RPM;
+            }
+            else
+            {
+                throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "type should be tpk or wgt");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs
new file mode 100644 (file)
index 0000000..c4a4e2f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for permission type.
+    /// </summary>
+    public enum PermissionType
+    {
+        /// <summary>
+        /// Permission is normal
+        /// </summary>
+        Normal,
+        /// <summary>
+        /// Permission is signature
+        /// </summary>
+        Signature,
+        /// <summary>
+        /// Permission is privilege
+        /// </summary>
+        Privilege
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs
new file mode 100755 (executable)
index 0000000..15e0c82
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    internal class SafePackageManagerHandle : SafeHandle
+    {
+        /// <summary>
+        /// Initializes a new instance of the SafePackageManagerHandle class.
+        /// </summary>
+        public SafePackageManagerHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        public override bool IsInvalid
+        {
+            get { return handle == IntPtr.Zero; }
+        }
+
+        /// <summary>
+        /// Executes the code required to free the SafePackageManagerHandle.
+        /// </summary>
+        /// <returns>true if the handle is released successfully</returns>
+        protected override bool ReleaseHandle()
+        {
+            Interop.PackageManager.PackageManagerDestroy(handle);
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs
new file mode 100755 (executable)
index 0000000..add74f5
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications
+{
+    internal class SafePackageManagerRequestHandle : SafeHandle
+    {
+        /// <summary>
+        /// Initializes a new instance of the SafePackageManagerRequestHandle class.
+        /// </summary>
+        public SafePackageManagerRequestHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        public override bool IsInvalid
+        {
+            get { return handle == IntPtr.Zero; }
+        }
+
+        /// <summary>
+        /// Executes the code required to free the SafePackageManagerRequestHandle.
+        /// </summary>
+        /// <returns>true if the handle is released successfully</returns>
+        protected override bool ReleaseHandle()
+        {
+            Interop.PackageManager.PackageManagerRequestDestroy(handle);
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs
new file mode 100755 (executable)
index 0000000..8246188
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for storage type.
+    /// </summary>
+    public enum StorageType
+    {
+        /// <summary>
+        /// Internal storage.
+        /// </summary>
+        Internal = Interop.PackageManager.StorageType.Internal,
+        /// <summary>
+        /// External storage.
+        /// </summary>
+        External = Interop.PackageManager.StorageType.External
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..d65c742
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Preference = "libcapi-appfw-preference.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.Preference/Interop/Interop.Preference.cs b/src/Tizen.Applications.Preference/Interop/Interop.Preference.cs
new file mode 100755 (executable)
index 0000000..dd98962
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+/// <summary>
+/// Contains Interop declarations of Preference classes.
+/// </summary>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Contains Interop declarations of Preference device API.
+    /// </summary>
+    internal static partial class Preference
+    {
+        internal delegate void ChangedCallback(string key, IntPtr userData);
+
+        internal delegate bool ItemCallback(string key, IntPtr userData);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_set_int")]
+        internal static extern int SetInt(string key, int value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_get_int")]
+        internal static extern int GetInt(string key, out int value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_set_double")]
+        internal static extern int SetDouble(string key, double value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_get_double")]
+        internal static extern int GetDouble(string key, out double value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_set_string")]
+        internal static extern int SetString(string key, string value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_get_string")]
+        internal static extern int GetString(string key, out string value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_set_boolean")]
+        internal static extern int SetBoolean(string key, bool value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_get_boolean")]
+        internal static extern int GetBoolean(string key, out bool value);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_remove")]
+        internal static extern int Remove(string key);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_is_existing")]
+        internal static extern int IsExisting(string key, out bool existing);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_remove_all")]
+        internal static extern int RemoveAll();
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_set_changed_cb")]
+        internal static extern int SetChangedCb(string key, ChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_unset_changed_cb")]
+        internal static extern int UnsetChangedCb(string key);
+
+        [DllImport(Libraries.Preference, EntryPoint = "preference_foreach_item")]
+        internal static extern int ForeachItem(ItemCallback callback, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj b/src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj
new file mode 100755 (executable)
index 0000000..2747892
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.8</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Preference.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="$(TizenVersion)" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.snk b/src/Tizen.Applications.Preference/Tizen.Applications.Preference.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Preference/Tizen.Applications.Preference.snk differ
diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs b/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs
new file mode 100755 (executable)
index 0000000..4fd6e79
--- /dev/null
@@ -0,0 +1,463 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The Preference class provides APIs to store and retrieve application specific data/preference. A preference is saved in the form of a key-value pair.
+    /// Keys are always text strings and value can be any one of four types: integer, double, string and boolean.
+    /// </summary>
+    public static class Preference
+    {
+        private const string LogTag = "Tizen.Applications";
+        private static Interop.Preference.ChangedCallback s_preferenceChangedCallback;
+        private static IDictionary<string, EventContext> s_eventMap = new Dictionary<string, EventContext>();
+
+        static Preference()
+        {
+            s_preferenceChangedCallback = (string key, IntPtr userData) =>
+            {
+                try
+                {
+                    s_eventMap[key]?.FireEvent();
+                }
+                catch (Exception e)
+                {
+                    Log.Warn(LogTag, e.Message);
+                }
+            };
+        }
+
+        /// <summary>
+        /// Retrieves all keys of the application preferences
+        /// </summary>
+        /// <value>
+        /// The list of keys
+        /// </value>
+        /// <example>
+        /// <code>
+        ///     Preference.Set("Option_enabled", true);
+        ///     Preference.Set("active_user", "Joe");
+        ///     Preference.Set("default_volume", 10);
+        ///     Preference.Set("brightness", "0.6");
+        ///     foreach(string key in Preference.Keys)
+        ///     {
+        ///         Console.WriteLine("key {0}", key);
+        ///     }
+        /// </code>
+        /// </example>
+        public static IEnumerable<string> Keys
+        {
+            get
+            {
+                var collection = new List<string>();
+                Interop.Preference.ItemCallback itemsCallback = (string key, IntPtr userData) =>
+                {
+                    collection.Add(key);
+                    return true;
+                };
+                Interop.Preference.ForeachItem(itemsCallback, IntPtr.Zero);
+                return collection;
+            }
+        }
+
+        /// <summary>
+        /// Gets the event context for the given key.
+        /// </summary>
+        /// <seealso cref="EventContext"/>
+        /// <param name="key">The preference key</param>
+        /// <returns>The event context of respective key</returns>
+        /// <exception cref="KeyNotFoundException">Thrown if the key is not found</exception>
+        /// <exception cref="ArgumentException">Thrown if the key is an invalid parameter.</exception>
+        /// <example>
+        /// <code>
+        ///     private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e)
+        ///     {
+        ///         Console.WriteLine("key {0}", e.Key);
+        ///     }
+        ///
+        ///     Preference.EventContext context = null;
+        ///     Preference.GetEventContext("active_user").TryGetTarget(out context);
+        ///     if(context != null)
+        ///     {
+        ///         context.Changed += Preference_PreferenceChanged;
+        ///     }
+        ///
+        ///     Preference.Set("active_user", "Poe");
+        ///
+        ///     Preference.GetEventContext("active_user").TryGetTarget(out context);
+        ///     if (context != null)
+        ///     {
+        ///         context.Changed -= Preference_PreferenceChanged;
+        ///     }
+        /// </code>
+        /// </example>
+        public static WeakReference<EventContext> GetEventContext(string key)
+        {
+            if (!s_eventMap.ContainsKey(key))
+            {
+                if (Contains(key))
+                {
+                    s_eventMap[key] = new EventContext(key);
+                }
+                else
+                {
+                    throw PreferenceErrorFactory.GetException((int)PreferenceErrorFactory.PreferenceError.KeyNotAvailable);
+                }
+            }
+
+            return new WeakReference<EventContext>(s_eventMap[key]);
+        }
+
+        /// <summary>
+        /// Checks whether the given key exists in the preference.
+        /// </summary>
+        /// <param name="key">The name of the key to check</param>
+        /// <returns>true if the key exists in the preference, otherwise false</returns>
+        /// <exception cref="ArgumentException">Thrown if the key is an invalid parameter.</exception>
+        /// <exception cref="IOException">Thrown when method failed due to internal IO error.</exception>
+        /// <example>
+        /// <code>
+        ///     Preference.Set("active_user", "Joe");
+        ///     bool exists = Preference.Contains("active_user");
+        ///     if (exists)
+        ///     {
+        ///         string value = Preference.Get<string>("active_user");
+        ///         Console.WriteLine("user {0}", value);
+        ///     }
+        /// </code>
+        /// </example>
+        public static bool Contains(string key)
+        {
+            bool contains;
+            int ret = Interop.Preference.IsExisting(key, out contains);
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to find key");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+
+            return contains;
+        }
+
+        /// <summary>
+        /// Sets a key-value pair representing the preference.
+        /// </summary>
+        /// <remarks>
+        /// If the key already exists in the Preference, old value will be overwritten with new value.
+        /// Data types supported for value are: integer, double, string and bool.
+        /// </remarks>
+        /// <param name="key">The name of the key to create/modigy</param>
+        /// <param name="value">The value corresponding to the key.</param>
+        /// <exception cref="ArgumentException">Thrown if the key is an invalid parameter.</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error.</exception>
+        /// <example>
+        /// <code>
+        ///     Preference.Set("Option_enabled", true);
+        ///     Preference.Set("active_user", "Joe");
+        ///     Preference.Set("default_volume", 10);
+        ///     Preference.Set("brightness", "0.6");
+        /// </code>
+        /// </example>
+        public static void Set(string key, object value)
+        {
+            int ret = 0;
+            if (value is int)
+            {
+                ret = Interop.Preference.SetInt(key, (int)value);
+                if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+                {
+                    Log.Error(LogTag, "Failed to find key");
+                    throw PreferenceErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is double)
+            {
+                ret = Interop.Preference.SetDouble(key, (double)value);
+                if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+                {
+                    Log.Error(LogTag, "Failed to find key");
+                    throw PreferenceErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is string)
+            {
+                ret = Interop.Preference.SetString(key, (string)value);
+                if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+                {
+                    Log.Error(LogTag, "Failed to find key");
+                    throw PreferenceErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is bool)
+            {
+                ret = Interop.Preference.SetBoolean(key, (bool)value);
+                if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+                {
+                    Log.Error(LogTag, "Failed to find key");
+                    throw PreferenceErrorFactory.GetException(ret);
+                }
+            }
+            else
+            {
+                Log.Error(LogTag, "Failed to Set");
+                throw new ArgumentException("Invalid parameter");
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of a preference item with the specified key.
+        /// Note that this is a generic method.
+        /// </summary>
+        /// <typeparam name="T">The generic type to return.</typeparam>
+        /// <param name="key">The key of the preference</param>
+        /// <returns>The value of the preference item if it is of the specified generic type.</returns>
+        /// <exception cref="KeyNotFoundException">Thrown if the key is not found</exception>
+        /// <exception cref="ArgumentException">Thrown if the key is an invalid parameter.</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error.</exception>
+        /// <example>
+        /// <code>
+        ///     bool exists = Preference.Contains("active_user");
+        ///     if (exists)
+        ///     {
+        ///         string value = Preference.Get<string>("active_user");
+        ///         Console.WriteLine("user {0}", value);
+        ///     }
+        /// </code>
+        /// </example>
+        public static T Get<T>(string key)
+        {
+            object result = null;
+            int ret = (int)PreferenceErrorFactory.PreferenceError.None;
+            if (typeof(T) == typeof(bool))
+            {
+                bool val;
+                ret = Interop.Preference.GetBoolean(key, out val);
+                result = val;
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val;
+                ret = Interop.Preference.GetInt(key, out val);
+                result = val;
+            }
+            else if (typeof(T) == typeof(string))
+            {
+                string val;
+                ret = Interop.Preference.GetString(key, out val);
+                result = val;
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val;
+                ret = Interop.Preference.GetDouble(key, out val);
+                result = val;
+            }
+            else
+            {
+                Log.Error(LogTag, "Failed to remove key");
+                throw new ArgumentException("Invalid parameter");
+            }
+
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to remove key");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+
+            return (result != null) ? (T)result : default(T);
+        }
+
+        /// <summary>
+        /// Removes any preference value with the given key.
+        /// </summary>
+        /// <param name="key">The key to remove</param>
+        /// <exception cref="KeyNotFoundException">Thrown if the key is not found</exception>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error.</exception>
+        /// <example>
+        /// <code>
+        ///     bool exists = Preference.Contains("active_user");
+        ///     if (exists)
+        ///     {
+        ///         string value = Preference.Remove("active_user");
+        ///     }
+        /// </code>
+        /// </example>
+        public static void Remove(string key)
+        {
+            int ret = Interop.Preference.Remove(key);
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to remove key");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Removes all key-value pairs from the preference.
+        /// </summary>
+        /// <exception cref="System.IO.IOException">Thrown when method failed due to internal IO error.</exception>
+        /// <example>
+        /// <code>
+        ///     Preference.Set("Option_enabled", true);
+        ///     Preference.Set("active_user", "Joe");
+        ///     Preference.Set("default_volume", 10);
+        ///     Preference.Set("brightness", "0.6");
+        ///     Preference.RemoveAll();
+        /// </code>
+        /// </example>
+        public static void RemoveAll()
+        {
+            int ret = Interop.Preference.RemoveAll();
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to remove all keys");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+        }
+
+        private static void AllowChangeNotifications(string key)
+        {
+            int ret = Interop.Preference.SetChangedCb(key, s_preferenceChangedCallback, IntPtr.Zero);
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to set key notification");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+        }
+
+        private static void DisallowChangeNotifications(string key)
+        {
+            int ret = Interop.Preference.UnsetChangedCb(key);
+            if (ret != (int)PreferenceErrorFactory.PreferenceError.None)
+            {
+                Log.Error(LogTag, "Failed to remove key notification");
+                throw PreferenceErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// The class manages event handlers of preference keys. The class enables having event handlers for individual preference keys.
+        /// </summary>
+        public class EventContext
+        {
+            private string _key;
+
+            internal EventContext(string key)
+            {
+                _key = key;
+            }
+
+            /// <summary>
+            /// Occurs whenever there is change in the value of preference key.
+            /// </summary>
+            /// <exception cref="System.ArgumentException">Thrown when the key does not exist or when there is an invalid parameter.</exception>
+            /// <exception cref="System.InvalidOperationException">Thrown when the Bundle instance has been disposed.</exception>
+            /// <example>
+            /// <code>
+            ///     private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e)
+            ///     {
+            ///         Console.WriteLine("key {0}", e.Key);
+            ///     }
+            ///     Preference.EventContext context = null;
+            ///     Preference.GetEventContext("active_user").TryGetTarget(out context);
+            ///     if(context != null)
+            ///     {
+            ///         context.Changed += Preference_PreferenceChanged;
+            ///     }
+            ///
+            ///     Preference.Set("active_user", "Poe");
+            ///
+            ///     Preference.GetEventContext("active_user").TryGetTarget(out context);
+            ///     if (context != null)
+            ///     {
+            ///         context.Changed -= Preference_PreferenceChanged;
+            ///     }
+            /// </code>
+            /// </example>
+            public event EventHandler<PreferenceChangedEventArgs> Changed
+            {
+                add
+                {
+                    if (_changed == null)
+                    {
+                        AllowChangeNotifications(_key);
+                    }
+
+                    _changed += value;
+                }
+
+                remove
+                {
+                    _changed -= value;
+                    if (_changed == null)
+                    {
+                        DisallowChangeNotifications(_key);
+                        s_eventMap.Remove(_key);
+                    }
+                }
+            }
+
+            private event EventHandler<PreferenceChangedEventArgs> _changed;
+
+            internal void FireEvent()
+            {
+                _changed?.Invoke(null, new PreferenceChangedEventArgs() { Key = _key });
+            }
+        }
+
+    }
+
+    internal static class PreferenceErrorFactory
+    {
+        internal enum PreferenceError
+        {
+            None = ErrorCode.None,
+            OutOfMemory = ErrorCode.OutOfMemory,
+            InvalidParameter = ErrorCode.InvalidParameter,
+            KeyNotAvailable = -0x01100000 | 0x30,
+            IoError = ErrorCode.IoError
+        }
+
+        static internal Exception GetException(int error)
+        {
+            if ((PreferenceError)error == PreferenceError.OutOfMemory)
+            {
+                return new OutOfMemoryException("Out of memory");
+            }
+            else if ((PreferenceError)error == PreferenceError.InvalidParameter)
+            {
+                return new ArgumentException("Invalid parameter");
+            }
+            else if ((PreferenceError)error == PreferenceError.KeyNotAvailable)
+            {
+                return new KeyNotFoundException("Key does not exist in the bundle");
+            }
+            else if ((PreferenceError)error == PreferenceError.IoError)
+            {
+                return new System.IO.IOException("I/O Error");
+            }
+            else
+            {
+                return new ArgumentException("Unknown error");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs b/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..5386c77
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// This class is an event arguments of the PreferenceChanged events.
+    /// </summary>
+    public class PreferenceChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The key of the preference whose value is changed.
+        /// </summary>
+        public string Key { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Applications.Service/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Service/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..145ff34
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string AppcoreAgent = "libappcore-agent.so.1";
+    }
+}
diff --git a/src/Tizen.Applications.Service/Interop/Interop.Service.cs b/src/Tizen.Applications.Service/Interop/Interop.Service.cs
new file mode 100755 (executable)
index 0000000..d4cd60d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications.CoreBackend;
+using Tizen.Internals.Errors;
+
+internal static partial class Interop
+{
+    internal static partial class Service
+    {
+        internal delegate void AppEventCallback(IntPtr handle, IntPtr data);
+
+        internal delegate bool ServiceAppCreateCallback(IntPtr userData);
+
+        internal delegate void ServiceAppTerminateCallback(IntPtr userData);
+
+        internal delegate void ServiceAppControlCallback(IntPtr appControl, IntPtr userData);
+
+        [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_main")]
+        internal static extern ErrorCode Main(int argc, string[] argv, ref ServiceAppLifecycleCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_exit")]
+        internal static extern void Exit();
+
+        [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_add_event_handler")]
+        internal static extern ErrorCode AddEventHandler(out IntPtr handle, DefaultCoreBackend.AppEventType eventType, AppEventCallback callback, IntPtr data);
+
+        [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_remove_event_handler")]
+        internal static extern ErrorCode RemoveEventHandler(IntPtr handle);
+
+        [StructLayoutAttribute(LayoutKind.Sequential)]
+        internal struct ServiceAppLifecycleCallbacks
+        {
+            public ServiceAppCreateCallback OnCreate;
+            public ServiceAppTerminateCallback OnTerminate;
+            public ServiceAppControlCallback OnAppControl;
+        }
+    }
+}
diff --git a/src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs b/src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs
new file mode 100755 (executable)
index 0000000..bc1a096
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications.CoreBackend
+{
+    internal class ServiceCoreBackend : DefaultCoreBackend
+    {
+        private Interop.Service.ServiceAppLifecycleCallbacks _callbacks;
+        private IntPtr _lowMemoryEventHandle = IntPtr.Zero;
+        private IntPtr _lowBatteryEventHandle = IntPtr.Zero;
+        private IntPtr _localeChangedEventHandle = IntPtr.Zero;
+        private IntPtr _regionChangedEventHandle = IntPtr.Zero;
+        private IntPtr _deviceOrientationChangedEventHandle = IntPtr.Zero;
+        private bool _disposedValue = false;
+        private Interop.Service.AppEventCallback _onLowMemoryNative;
+        private Interop.Service.AppEventCallback _onLowBatteryNative;
+        private Interop.Service.AppEventCallback _onLocaleChangedNative;
+        private Interop.Service.AppEventCallback _onRegionChangedNative;
+        private Interop.Service.AppEventCallback _onDeviceOrientationChangedNative;
+
+        public ServiceCoreBackend()
+        {
+            _callbacks.OnCreate = new Interop.Service.ServiceAppCreateCallback(OnCreateNative);
+            _callbacks.OnTerminate = new Interop.Service.ServiceAppTerminateCallback(OnTerminateNative);
+            _callbacks.OnAppControl = new Interop.Service.ServiceAppControlCallback(OnAppControlNative);
+
+            _onLowMemoryNative = new Interop.Service.AppEventCallback(OnLowMemoryNative);
+            _onLowBatteryNative = new Interop.Service.AppEventCallback(OnLowBatteryNative);
+            _onLocaleChangedNative = new Interop.Service.AppEventCallback(OnLocaleChangedNative);
+            _onRegionChangedNative = new Interop.Service.AppEventCallback(OnRegionChangedNative);
+            _onDeviceOrientationChangedNative = new Interop.Service.AppEventCallback(OnDeviceOrientationChangedNative);
+        }
+
+        public override void Exit()
+        {
+            Interop.Service.Exit();
+        }
+
+        public override void Run(string[] args)
+        {
+            base.Run(args);
+
+            ErrorCode err = ErrorCode.None;
+            err = Interop.Service.AddEventHandler(out _lowMemoryEventHandle, AppEventType.LowMemory, _onLowMemoryNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err);
+            }
+            err = Interop.Service.AddEventHandler(out _lowBatteryEventHandle, AppEventType.LowBattery, _onLowBatteryNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err);
+            }
+
+            err = Interop.Service.AddEventHandler(out _localeChangedEventHandle, AppEventType.LanguageChanged, _onLocaleChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err);
+            }
+
+            err = Interop.Service.AddEventHandler(out _regionChangedEventHandle, AppEventType.RegionFormatChanged, _onRegionChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err);
+            }
+
+            err = Interop.Service.AddEventHandler(out _deviceOrientationChangedEventHandle, AppEventType.DeviceOrientationChanged, _onDeviceOrientationChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for DeviceOrientationChanged event. Err = " + err);
+            }
+
+            err = Interop.Service.Main(args.Length, args, ref _callbacks, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to run the application. Err = " + err);
+            }
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                if (disposing)
+                {
+                    // Release disposable objects
+                }
+
+                if (_lowMemoryEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_lowMemoryEventHandle);
+                }
+                if (_lowBatteryEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_lowBatteryEventHandle);
+                }
+                if (_localeChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_localeChangedEventHandle);
+                }
+                if (_regionChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_regionChangedEventHandle);
+                }
+
+                if (_deviceOrientationChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_deviceOrientationChangedEventHandle);
+                }
+
+                _disposedValue = true;
+            }
+        }
+
+        private bool OnCreateNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.Created))
+            {
+                var handler = Handlers[EventType.Created] as Action;
+                handler?.Invoke();
+            }
+            return true;
+        }
+
+        private void OnTerminateNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.Terminated))
+            {
+                var handler = Handlers[EventType.Terminated] as Action;
+                handler?.Invoke();
+            }
+        }
+
+        private void OnAppControlNative(IntPtr appControlHandle, IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.AppControlReceived))
+            {
+                // Create a SafeAppControlHandle but the ownsHandle is false,
+                // because the appControlHandle will be closed by native appfw after this method automatically.
+                SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false);
+
+                var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
+                handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle)));
+            }
+        }
+
+        protected override void OnLowMemoryNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLowMemoryNative(infoHandle, data);
+        }
+
+        protected override void OnLowBatteryNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLowBatteryNative(infoHandle, data);
+        }
+
+        protected override void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLocaleChangedNative(infoHandle, data);
+        }
+
+        protected override void OnRegionChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnRegionChangedNative(infoHandle, data);
+        }
+
+        protected override void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnDeviceOrientationChangedNative(infoHandle, data);
+        }
+
+    }
+}
diff --git a/src/Tizen.Applications.Service/Tizen.Applications.Service.csproj b/src/Tizen.Applications.Service/Tizen.Applications.Service.csproj
new file mode 100755 (executable)
index 0000000..8172d00
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.8</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.Service.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.Service/Tizen.Applications.Service.snk b/src/Tizen.Applications.Service/Tizen.Applications.Service.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.Service/Tizen.Applications.Service.snk differ
diff --git a/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs b/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs
new file mode 100755 (executable)
index 0000000..d8742c1
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using Tizen.Applications.CoreBackend;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents a service application.
+    /// </summary>
+    public class ServiceApplication : CoreApplication
+    {
+        /// <summary>
+        /// Initializes ServiceApplication class.
+        /// </summary>
+        public ServiceApplication() : base(new ServiceCoreBackend())
+        {
+        }
+
+        /// <summary>
+        /// Runs the service application's main loop.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public override void Run(string[] args)
+        {
+            base.Run(args);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs b/src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..c284ac5
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string ToastMessage = "libnotification.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs b/src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs
new file mode 100755 (executable)
index 0000000..69e49db
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static class ToastMessage
+    {
+        [DllImport(Libraries.ToastMessage, EntryPoint = "notification_status_message_post")]
+        internal static extern int ToastMessagePost(string message);
+    }
+}
diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj b/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj
new file mode 100755 (executable)
index 0000000..542acf5
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.8</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.ToastMessage.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.snk b/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.snk differ
diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs b/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs
new file mode 100755 (executable)
index 0000000..fd136b1
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// The class helps you create and show ToastMessage which is a view quick message for the user
+    /// </summary>
+    public sealed class ToastMessage
+    {
+
+        /// <summary>
+        /// Gets and sets message to post ToastMessage
+        /// </summary>
+        public string Message { get; set; }
+
+        /// <summary>
+        /// Posts a message on a toast popup
+        /// </summary>
+        /// <exception cref="ArgumentNullException">Thrown when Message is null</exception>
+        /// <example>
+        /// <code>
+        /// ToastMessage toast = new ToastMessage
+        /// {
+        ///     Message = "Hello TIzen"
+        /// };
+        /// toast.Post();
+        /// </code>
+        /// </example>
+        public void Post()
+        {
+            int ret = Interop.ToastMessage.ToastMessagePost(Message);
+            if (ret != (int)ToastMessageError.None)
+            {
+                throw ToastMessageErrorFactory.GetException((ToastMessageError)ret, "post toast message failed");
+            }
+        }
+    }
+
+}
diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs b/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs
new file mode 100755 (executable)
index 0000000..cd2eebc
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Applications
+{
+    internal enum ToastMessageError
+    {
+        None = Tizen.Internals.Errors.ErrorCode.None,
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+        DBusError = -0x01140000 | 0x03,
+    }
+
+    internal class ToastMessageErrorFactory
+    {
+        private const string _logTag = "Tizen.Applications.ToastMessage";
+
+        internal static Exception GetException(ToastMessageError ret, string msg)
+        {
+            switch (ret)
+            {
+                case ToastMessageError.InvalidParameter:
+                    Log.Error(_logTag, msg);
+                    return new ArgumentException(ret + " error occurred.");
+                default:
+                    Log.Error(_logTag, msg);
+                    return new InvalidOperationException(ret + " error occurred.");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Applications.UI/Interop/Interop.Application.cs b/src/Tizen.Applications.UI/Interop/Interop.Application.cs
new file mode 100755 (executable)
index 0000000..177bfea
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications.CoreBackend;
+using Tizen.Internals.Errors;
+
+internal static partial class Interop
+{
+    internal static partial class Application
+    {
+        internal delegate void AppEventCallback(IntPtr handle, IntPtr data);
+
+        internal delegate bool AppCreateCallback(IntPtr userData);
+
+        internal delegate void AppPauseCallback(IntPtr userData);
+
+        internal delegate void AppResumeCallback(IntPtr userData);
+
+        internal delegate void AppTerminateCallback(IntPtr userData);
+
+        internal delegate void AppControlCallback(IntPtr appControl, IntPtr userData);
+
+        [DllImport(Libraries.Application, EntryPoint = "ui_app_main")]
+        internal static extern ErrorCode Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData);
+
+        [DllImport(Libraries.Application, EntryPoint = "ui_app_exit")]
+        internal static extern void Exit();
+
+        [DllImport(Libraries.Application, EntryPoint = "ui_app_add_event_handler")]
+        internal static extern ErrorCode AddEventHandler(out IntPtr handle, DefaultCoreBackend.AppEventType eventType, AppEventCallback callback, IntPtr data);
+
+        [DllImport(Libraries.Application, EntryPoint = "ui_app_remove_event_handler")]
+        internal static extern ErrorCode RemoveEventHandler(IntPtr handle);
+
+        [StructLayout(LayoutKind.Sequential)]
+        internal struct UIAppLifecycleCallbacks
+        {
+            public AppCreateCallback OnCreate;
+            public AppTerminateCallback OnTerminate;
+            public AppPauseCallback OnPause;
+            public AppResumeCallback OnResume;
+            public AppControlCallback OnAppControl;
+        }
+    }
+}
+
diff --git a/src/Tizen.Applications.UI/Interop/Interop.Libraries.cs b/src/Tizen.Applications.UI/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..03047b1
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Application = "libcapi-appfw-application.so.0";
+    }
+}
diff --git a/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs b/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs
new file mode 100755 (executable)
index 0000000..933a4e0
--- /dev/null
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+using Tizen.Internals.Errors;
+
+namespace Tizen.Applications.CoreBackend
+{
+    internal class UICoreBackend : DefaultCoreBackend
+    {
+        private Interop.Application.UIAppLifecycleCallbacks _callbacks;
+        private IntPtr _lowMemoryEventHandle = IntPtr.Zero;
+        private IntPtr _lowBatteryEventHandle = IntPtr.Zero;
+        private IntPtr _localeChangedEventHandle = IntPtr.Zero;
+        private IntPtr _regionChangedEventHandle = IntPtr.Zero;
+        private IntPtr _deviceOrientationChangedEventHandle = IntPtr.Zero;
+        private bool _disposedValue = false;
+        private Interop.Application.AppEventCallback _onLowMemoryNative;
+        private Interop.Application.AppEventCallback _onLowBatteryNative;
+        private Interop.Application.AppEventCallback _onLocaleChangedNative;
+        private Interop.Application.AppEventCallback _onRegionChangedNative;
+        private Interop.Application.AppEventCallback _onDeviceOrientationChangedNative;
+
+        public UICoreBackend()
+        {
+            _callbacks.OnCreate = new Interop.Application.AppCreateCallback(OnCreateNative);
+            _callbacks.OnTerminate = new Interop.Application.AppTerminateCallback(OnTerminateNative);
+            _callbacks.OnAppControl = new Interop.Application.AppControlCallback(OnAppControlNative);
+            _callbacks.OnResume = new Interop.Application.AppResumeCallback(OnResumeNative);
+            _callbacks.OnPause = new Interop.Application.AppPauseCallback(OnPauseNative);
+
+            _onLowMemoryNative = new Interop.Application.AppEventCallback(OnLowMemoryNative);
+            _onLowBatteryNative = new Interop.Application.AppEventCallback(OnLowBatteryNative);
+            _onLocaleChangedNative = new Interop.Application.AppEventCallback(OnLocaleChangedNative);
+            _onRegionChangedNative = new Interop.Application.AppEventCallback(OnRegionChangedNative);
+            _onDeviceOrientationChangedNative = new Interop.Application.AppEventCallback(OnDeviceOrientationChangedNative);
+        }
+
+        public override void Exit()
+        {
+            Interop.Application.Exit();
+        }
+
+        public override void Run(string[] args)
+        {
+            base.Run(args);
+
+            ErrorCode err = ErrorCode.None;
+            err = Interop.Application.AddEventHandler(out _lowMemoryEventHandle, AppEventType.LowMemory, _onLowMemoryNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err);
+            }
+            err = Interop.Application.AddEventHandler(out _lowBatteryEventHandle, AppEventType.LowBattery, _onLowBatteryNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err);
+            }
+
+            err = Interop.Application.AddEventHandler(out _localeChangedEventHandle, AppEventType.LanguageChanged, _onLocaleChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err);
+            }
+
+            err = Interop.Application.AddEventHandler(out _regionChangedEventHandle, AppEventType.RegionFormatChanged, _onRegionChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err);
+            }
+
+            err = Interop.Application.AddEventHandler(out _deviceOrientationChangedEventHandle, AppEventType.DeviceOrientationChanged, _onDeviceOrientationChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for DeviceOrientationChanged event. Err = " + err);
+            }
+
+            err = Interop.Application.Main(args.Length, args, ref _callbacks, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to run the application. Err = " + err);
+            }
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                if (disposing)
+                {
+                    // Release disposable objects
+                }
+
+                if (_lowMemoryEventHandle != IntPtr.Zero)
+                {
+                    Interop.Application.RemoveEventHandler(_lowMemoryEventHandle);
+                }
+                if (_lowBatteryEventHandle != IntPtr.Zero)
+                {
+                    Interop.Application.RemoveEventHandler(_lowBatteryEventHandle);
+                }
+                if (_localeChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Application.RemoveEventHandler(_localeChangedEventHandle);
+                }
+                if (_regionChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Application.RemoveEventHandler(_regionChangedEventHandle);
+                }
+                if (_deviceOrientationChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Application.RemoveEventHandler(_deviceOrientationChangedEventHandle);
+                }
+
+                _disposedValue = true;
+            }
+        }
+
+        private bool OnCreateNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.PreCreated))
+            {
+                var handler = Handlers[EventType.PreCreated] as Action;
+                handler?.Invoke();
+            }
+
+            if (Handlers.ContainsKey(EventType.Created))
+            {
+                var handler = Handlers[EventType.Created] as Action;
+                handler?.Invoke();
+            }
+            return true;
+        }
+
+        private void OnTerminateNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.Terminated))
+            {
+                var handler = Handlers[EventType.Terminated] as Action;
+                handler?.Invoke();
+            }
+        }
+
+        private void OnAppControlNative(IntPtr appControlHandle, IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.AppControlReceived))
+            {
+                // Create a SafeAppControlHandle but the ownsHandle is false,
+                // because the appControlHandle will be closed by native appfw after this method automatically.
+                SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false);
+
+                var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
+                handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle)));
+            }
+        }
+
+        private void OnResumeNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.Resumed))
+            {
+                var handler = Handlers[EventType.Resumed] as Action;
+                handler?.Invoke();
+            }
+        }
+
+        private void OnPauseNative(IntPtr data)
+        {
+            if (Handlers.ContainsKey(EventType.Paused))
+            {
+                var handler = Handlers[EventType.Paused] as Action;
+                handler?.Invoke();
+            }
+        }
+
+        protected override void OnLowMemoryNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLowMemoryNative(infoHandle, data);
+        }
+
+        protected override void OnLowBatteryNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLowBatteryNative(infoHandle, data);
+        }
+
+        protected override void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnLocaleChangedNative(infoHandle, data);
+        }
+
+        protected override void OnRegionChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnRegionChangedNative(infoHandle, data);
+        }
+
+        protected override void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnDeviceOrientationChangedNative(infoHandle, data);
+        }
+    }
+}
diff --git a/src/Tizen.Applications.UI/Tizen.Applications.UI.csproj b/src/Tizen.Applications.UI/Tizen.Applications.UI.csproj
new file mode 100755 (executable)
index 0000000..c293841
--- /dev/null
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="../build/build.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <Version>1.5.8</Version>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Applications.UI.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Applications.UI/Tizen.Applications.UI.snk b/src/Tizen.Applications.UI/Tizen.Applications.UI.snk
new file mode 100755 (executable)
index 0000000..7ac1b00
Binary files /dev/null and b/src/Tizen.Applications.UI/Tizen.Applications.UI.snk differ
diff --git a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs
new file mode 100755 (executable)
index 0000000..03256e7
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+using Tizen.Applications.CoreBackend;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Represents an application that have UI screen. The events for resuming and pausing are provided.
+    /// </summary>
+    public class CoreUIApplication : CoreApplication
+    {
+        /// <summary>
+        /// Initializes the CoreUIApplication class.
+        /// </summary>
+        /// <remarks>
+        /// Default backend for UI application will be used.
+        /// </remarks>
+        public CoreUIApplication() : base(new UICoreBackend())
+        {
+        }
+
+        /// <summary>
+        /// Initializes the CoreUIApplication class.
+        /// </summary>
+        /// <remarks>
+        /// If want to change the backend, use this constructor.
+        /// </remarks>
+        /// <param name="backend">The backend instance implementing ICoreBacked interface.</param>
+        public CoreUIApplication(ICoreBackend backend) : base(backend)
+        {
+        }
+
+        /// <summary>
+        /// Occurs whenever the application is resumed.
+        /// </summary>
+        public event EventHandler Resumed;
+
+        /// <summary>
+        /// Occurs whenever the application is paused.
+        /// </summary>
+        public event EventHandler Paused;
+
+        /// <summary>
+        /// Runs the UI application's main loop.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public override void Run(string[] args)
+        {
+            Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
+            Backend.AddEventHandler(EventType.Resumed, OnResume);
+            Backend.AddEventHandler(EventType.Paused, OnPause);
+            base.Run(args);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior before calling OnCreate().
+        /// </summary>
+        protected virtual void OnPreCreate()
+        {
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the application is resumed.
+        /// If base.OnResume() is not called, the event 'Resumed' will not be emitted.
+        /// </summary>
+        protected virtual void OnResume()
+        {
+            Resumed?.Invoke(this, EventArgs.Empty);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior when the application is paused.
+        /// If base.OnPause() is not called, the event 'Paused' will not be emitted.
+        /// </summary>
+        protected virtual void OnPause()
+        {
+            Paused?.Invoke(this, EventArgs.Empty);
+        }
+    }
+}
diff --git a/src/Tizen.Content.Download/Interop/Interop.Download.cs b/src/Tizen.Content.Download/Interop/Interop.Download.cs
new file mode 100755 (executable)
index 0000000..839ee63
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+internal static partial class Interop
+{
+    internal static partial class Download
+    {
+        // Request class
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void StateChangedCallback(int requestId, int state, IntPtr userData);
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void ProgressChangedCallback(int requestId, ulong receivedSize, IntPtr userData);
+
+        [DllImport(Libraries.Download, EntryPoint = "download_create")]
+        internal static extern int CreateRequest(out int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_destroy")]
+        internal static extern int DestroyRequest(int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_url")]
+        internal static extern int SetUrl(int requestId, string url);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_url")]
+        internal static extern int GetUrl(int requestId, out string url);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_network_type")]
+        internal static extern int SetNetworkType(int requestId, int networkType);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_network_type")]
+        internal static extern int GetNetworkType(int requestId, out int networkType);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_destination")]
+        internal static extern int SetDestination(int requestId, string path);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_destination")]
+        internal static extern int GetDestination(int requestId, out string path);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_file_name")]
+        internal static extern int SetFileName(int requestId, string fileName);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_file_name")]
+        internal static extern int GetFileName(int requestId, out string path);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_auto_download")]
+        internal static extern int SetAutoDownload(int requestId, bool value);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_auto_download")]
+        internal static extern int GetAutoDownload(int requestId, out bool value);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_temp_file_path")]
+        internal static extern int SetTempFilePath(int requestId, string tempPath);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_temp_path")]
+        internal static extern int GetTempFilePath(int requestId, out string tempPath);
+        [DllImport(Libraries.Download, EntryPoint = "download_add_http_header_field")]
+        internal static extern int AddHttpHeaderField(int requestId, string field, string value);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_downloaded_file_path")]
+        internal static extern int GetDownloadedPath(int requestId, out string downloadedPath);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_mime_type")]
+        internal static extern int GetMimeType(int requestId, out string mimeType);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_state")]
+        internal static extern int GetState(int requestId, out int downloadState);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_content_name")]
+        internal static extern int GetContentName(int requestId, out string contentName);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_content_size")]
+        internal static extern int GetContentSize(int requestId, out ulong size);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_http_status")]
+        internal static extern int GetHttpStatus(int requestId, out int httpStatus);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_etag")]
+        internal static extern int GetETag(int requestId, out string etag);
+        [DllImport(Libraries.Download, EntryPoint = "download_start")]
+        internal static extern int StartDownload(int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_pause")]
+        internal static extern int PauseDownload(int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_cancel")]
+        internal static extern int CancelDownload(int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_state_changed_cb")]
+        internal static extern int SetStateChangedCallback(int requestId, StateChangedCallback callback, IntPtr userData);
+        [DllImport(Libraries.Download, EntryPoint = "download_unset_state_changed_cb")]
+        internal static extern int UnsetStateChangedCallback(int requestId);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_progress_cb")]
+        internal static extern int SetProgressCallback(int requestId, ProgressChangedCallback callback, IntPtr userData);
+        [DllImport(Libraries.Download, EntryPoint = "download_unset_progress_cb")]
+        internal static extern int UnsetProgressCallback(int requestId);
+
+        // Notification class
+
+        [DllImport(Libraries.Download, EntryPoint = "download_set_notification_title")]
+        internal static extern int SetNotificationTitle(int requestId, string title);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_notification_title")]
+        internal static extern int GetNotificationTitle(int requestId, out string title);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_notification_description")]
+        internal static extern int SetNotificationDescription(int requestId, string description);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_notification_description")]
+        internal static extern int GetNotificationDescription(int requestId, out string description);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_notification_type")]
+        internal static extern int SetNotificationType(int requestId, int type);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_notification_type")]
+        internal static extern int GetNotificationType(int requestId, out int type);
+        [DllImport(Libraries.Download, EntryPoint = "download_set_notification_app_control")]
+        internal static extern int SetNotificationAppControl(int requestId, int appControlType, SafeAppControlHandle handle);
+        [DllImport(Libraries.Download, EntryPoint = "download_get_notification_app_control")]
+        internal static extern int GetNotificationAppControl(int requestId, int appControlType, out SafeAppControlHandle handle);
+    }
+}
diff --git a/src/Tizen.Content.Download/Interop/Interop.Libraries.cs b/src/Tizen.Content.Download/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..c634bfd
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Download = "libcapi-web-url-download.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download.csproj b/src/Tizen.Content.Download/Tizen.Content.Download.csproj
new file mode 100644 (file)
index 0000000..ddb4fce
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.9</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Download API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Content.Download.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download.snk b/src/Tizen.Content.Download/Tizen.Content.Download.snk
new file mode 100644 (file)
index 0000000..0bd942d
Binary files /dev/null and b/src/Tizen.Content.Download/Tizen.Content.Download.snk differ
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs b/src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs
new file mode 100755 (executable)
index 0000000..facfde5
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+namespace Tizen.Content.Download
+{
+    /// <summary>
+    /// Enumeration for download state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum DownloadState
+    {
+        /// <summary>
+        /// Unhandled exception
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        None = 0,
+        /// <summary>
+        /// Ready to download
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Ready,
+        /// <summary>
+        /// Queued to start downloading
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Queued,
+        /// <summary>
+        /// Currently downloading
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Downloading,
+        /// <summary>
+        /// Download is paused and can be resumed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Paused,
+        /// <summary>
+        /// The download is completed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Completed,
+        /// <summary>
+        /// The download failed
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Failed,
+        /// <summary>
+        /// User canceled the download request
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Canceled
+    }
+
+    /// <summary>
+    /// Enumeration for network type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum NetworkType
+    {
+        /// <summary>
+        /// Download is available through data network
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        DataNetwork = 0,
+        /// <summary>
+        /// Download is available through WiFi
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Wifi,
+        /// <summary>
+        /// Download is available through WiFi-Direct
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        WifiDirect,
+        /// <summary>
+        /// Download is available through either data network or WiFi
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        All
+    }
+
+    /// <summary>
+    /// Enumeration for notification type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum NotificationType
+    {
+        /// <summary>
+        /// Do not register notification
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        None = 0,
+        /// <summary>
+        /// Completion notification for success state and failed state
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        CompleteOnly,
+        /// <summary>
+        /// All download notifications for ongoing state, success state and failed state
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        All
+    }
+
+    internal enum NotificationAppControlType
+    {
+        Downloading = 0,
+        Completed,
+        Failed
+    }
+
+    internal static class Globals
+    {
+        internal const string LogTag = "Tizen.Content.Download";
+    }
+}
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs b/src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs
new file mode 100755 (executable)
index 0000000..b6fd77f
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Content.Download
+{
+    internal enum DownloadError
+    {
+        DownloadErrorCommonCode = -0x02A00000,
+        None = ErrorCode.None,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        NetworkUnreachable = ErrorCode.NetworkUnreachable,
+        ConnectionTimedOut = ErrorCode.ConnectionTimeout,
+        NoSpace = ErrorCode.FileNoSpaceOnDevice,
+        PermissionDenied = ErrorCode.PermissionDenied,
+        NotSupported = ErrorCode.NotSupported,
+        InvalidState = DownloadErrorCommonCode | 0x21,
+        ConnectionFailed = DownloadErrorCommonCode | 0x22,
+        InvalidUrl = DownloadErrorCommonCode | 0x24,
+        InvalidDestination = DownloadErrorCommonCode | 0x25,
+        TooManyDownloads = DownloadErrorCommonCode | 0x26,
+        QueueFull = DownloadErrorCommonCode | 0x27,
+        AlreadyCompleted = DownloadErrorCommonCode | 0x28,
+        FileAlreadyExists = DownloadErrorCommonCode | 0x29,
+        CannotResume = DownloadErrorCommonCode | 0x2a,
+        FieldNotFound = DownloadErrorCommonCode | 0x2b,
+        TooManyRedirects = DownloadErrorCommonCode | 0x30,
+        UnhandledHttpCode = DownloadErrorCommonCode | 0x31,
+        RequestTimeout = DownloadErrorCommonCode | 0x32,
+        ResponseTimeout = DownloadErrorCommonCode | 0x33,
+        SystemDown = DownloadErrorCommonCode | 0x34,
+        IdNotFound = DownloadErrorCommonCode | 0x35,
+        InvalidNetworkType = DownloadErrorCommonCode | 0x36,
+        NoData = ErrorCode.NoData,
+        IoError = ErrorCode.IoError
+    }
+
+    internal static class DownloadErrorFactory
+    {
+        internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null)
+        {
+            DownloadError err = (DownloadError)errorCode;
+            if (String.IsNullOrEmpty(errorMessage))
+            {
+                errorMessage = err.ToString();
+            }
+            switch ((DownloadError)errorCode)
+            {
+                case DownloadError.InvalidParameter:
+                case DownloadError.InvalidUrl:
+                case DownloadError.InvalidDestination:
+                case DownloadError.InvalidNetworkType: throw new ArgumentException(errorMessage, paramName);
+                case DownloadError.OutOfMemory:
+                case DownloadError.NetworkUnreachable:
+                case DownloadError.ConnectionTimedOut:
+                case DownloadError.NoSpace:
+                case DownloadError.InvalidState:
+                case DownloadError.ConnectionFailed:
+                case DownloadError.TooManyDownloads:
+                case DownloadError.QueueFull:
+                case DownloadError.AlreadyCompleted:
+                case DownloadError.FileAlreadyExists:
+                case DownloadError.CannotResume:
+                case DownloadError.FieldNotFound:
+                case DownloadError.TooManyRedirects:
+                case DownloadError.UnhandledHttpCode:
+                case DownloadError.RequestTimeout:
+                case DownloadError.ResponseTimeout:
+                case DownloadError.SystemDown:
+                case DownloadError.IdNotFound:
+                case DownloadError.NoData:
+                case DownloadError.IoError: throw new InvalidOperationException(errorMessage);
+                case DownloadError.NotSupported: throw new NotSupportedException(errorMessage);
+                case DownloadError.PermissionDenied: throw new UnauthorizedAccessException(errorMessage);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs b/src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs
new file mode 100755 (executable)
index 0000000..de162a6
--- /dev/null
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using Tizen.Applications;
+
+namespace Tizen.Content.Download
+{
+    /// <summary>
+    /// The Notification class consists of all the properties required to set notifications for download operation.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Notification
+    {
+        private int _downloadId;
+
+        internal Notification(int requestId)
+        {
+            _downloadId = requestId;
+        }
+
+        /// <summary>
+        /// Title of the notification.
+        /// If user tries to get before setting, empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string Title
+        {
+            get
+            {
+                string title;
+                int ret = Interop.Download.GetNotificationTitle(_downloadId, out title);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Notification Title, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return title;
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationTitle(_downloadId, value.ToString());
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Notification Title");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Description of the notification.
+        /// If user tries to get before setting, empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string Description
+        {
+            get
+            {
+                string description;
+                int ret = Interop.Download.GetNotificationDescription(_downloadId, out description);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Notification Description, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return description;
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationDescription(_downloadId, value.ToString());
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Notification Description");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Type of Notification.
+        /// If user tries to get before setting, default NotificationType None is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public NotificationType Type
+        {
+            get
+            {
+                int type;
+                int ret = Interop.Download.GetNotificationType(_downloadId, out type);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get NotificationType, " + (DownloadError)ret);
+                    return 0;
+                }
+                return (NotificationType)type;
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationType(_downloadId, (int)value);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set NotificationType");
+                }
+            }
+        }
+
+        /// <summary>
+        /// AppControl for an ongoing download notification.
+        /// If user tries to get before setting, null is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// When the notification message is clicked, the action is decided by the app control.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public AppControl AppControlOngoing
+        {
+            get
+            {
+                SafeAppControlHandle handle;
+                int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Downloading, out handle);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Ongoing type NotificationAppControl, " + (DownloadError)ret);
+                    return null;
+                }
+                return new AppControl(handle);
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Downloading, value.SafeAppControlHandle);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Ongoing type NotificationAppControl");
+                }
+            }
+        }
+
+        /// <summary>
+        /// AppControl for a completed download notification.
+        /// If user tries to get before setting, null is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// When the notification message is clicked, the action is decided by the app control
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public AppControl AppControlCompleted
+        {
+            get
+            {
+                SafeAppControlHandle handle;
+                int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Completed, out handle);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Complete type NotificationAppControl, " + (DownloadError)ret);
+                    return null;
+                }
+                return new AppControl(handle);
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Completed, value.SafeAppControlHandle);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Complete type NotificationAppControl");
+                }
+            }
+        }
+
+        /// <summary>
+        /// AppControl for a failed download notification.
+        /// If user tries to get before setting, null is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// When the notification message is clicked, the action is decided by the app control
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public AppControl AppControlFailed
+        {
+            get
+            {
+                SafeAppControlHandle handle;
+                int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Failed, out handle);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Fail type NotificationAppControl, " + (DownloadError)ret);
+                    return null;
+                }
+                return new AppControl(handle);
+            }
+            set
+            {
+                int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Failed, value.SafeAppControlHandle);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Fail type NotificationAppControl");
+                }
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs b/src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..3e5d169
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+
+namespace Tizen.Content.Download
+{
+    /// <summary>
+    /// An extended EventArgs class which contains the size of received data in bytes.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ProgressChangedEventArgs : EventArgs
+    {
+        private ulong _size = 0;
+
+        internal ProgressChangedEventArgs(ulong size)
+        {
+            _size = size;
+        }
+
+        /// <summary>
+        /// Received data size in bytes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public ulong ReceivedDataSize
+        {
+            get
+            {
+                return _size;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs b/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs
new file mode 100755 (executable)
index 0000000..20e2048
--- /dev/null
@@ -0,0 +1,858 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Content.Download
+{
+    /// <summary>
+    /// The Request class provides functions to create and manage a single download request.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Request : IDisposable
+    {
+        private int _downloadId;
+        private Notification _notificationProperties;
+        private IDictionary<string, string> _httpHeaders;
+        private EventHandler<StateChangedEventArgs> _downloadStateChanged;
+        private Interop.Download.StateChangedCallback _downloadStateChangedCallback;
+        private EventHandler<ProgressChangedEventArgs> _downloadProgressChanged;
+        private Interop.Download.ProgressChangedCallback _downloadProgressChangedCallback;
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Creates a Request object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="url"> URL to download</param>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public Request(string url)
+        {
+            if (String.IsNullOrEmpty(url))
+            {
+                DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty");
+            }
+            int ret = Interop.Download.CreateRequest(out _downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Request creation failed");
+            }
+            ret = Interop.Download.SetUrl(_downloadId, url);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting Url failed");
+            }
+            _notificationProperties = new Notification(_downloadId);
+            _httpHeaders = new Dictionary<string, string>();
+        }
+
+        /// <summary>
+        /// Creates a Request object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="url"> URL to download</param>
+        /// <param name="destinationPath"> Directory path where downloaded file is stored </param>
+        /// <param name="fileName"> Name of the downloaded file </param>
+        /// <param name="type"> Network type which the download request must adhere to </param>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.wifi.direct</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported.</exception>
+        public Request(string url, string destinationPath, string fileName, NetworkType type)
+        {
+            if (String.IsNullOrEmpty(url))
+            {
+                DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty");
+            }
+            int ret = Interop.Download.CreateRequest(out _downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Request creation failed");
+            }
+
+            ret = Interop.Download.SetUrl(_downloadId, url);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting Url failed");
+            }
+
+            ret = Interop.Download.SetDestination(_downloadId, destinationPath);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting DestinationPath failed");
+            }
+
+            ret = Interop.Download.SetFileName(_downloadId, fileName);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting FileName failed");
+            }
+
+            ret = Interop.Download.SetNetworkType(_downloadId, (int)type);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting NetworkType failed");
+            }
+
+            _notificationProperties = new Notification(_downloadId);
+            _httpHeaders = new Dictionary<string, string>();
+        }
+
+        /// <summary>
+        /// Creates a Request object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="url"> URL to download</param>
+        /// <param name="destinationPath"> Directory path where downloaded file is stored </param>
+        /// <param name="fileName"> Name of the downloaded file </param>
+        /// <param name="type"> Network type which the download request must adhere to </param>
+        /// <param name="httpHeaders"> HTTP header fields for download request </param>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.wifi.direct</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="NotSupportedException">Thrown when features is not supported.</exception>
+        public Request(string url, string destinationPath, string fileName, NetworkType type, IDictionary<string, string> httpHeaders)
+        {
+            if (String.IsNullOrEmpty(url))
+            {
+                DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty");
+            }
+            int ret = Interop.Download.CreateRequest(out _downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Request creation failed");
+            }
+
+            ret = Interop.Download.SetUrl(_downloadId, url);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting Url failed");
+            }
+
+            ret = Interop.Download.SetDestination(_downloadId, destinationPath);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting DestinationPath failed");
+            }
+
+            ret = Interop.Download.SetFileName(_downloadId, fileName);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting FileName failed");
+            }
+
+            ret = Interop.Download.SetNetworkType(_downloadId, (int)type);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting NetworkType failed");
+            }
+
+            _notificationProperties = new Notification(_downloadId);
+            _httpHeaders = httpHeaders;
+        }
+
+        ~Request()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Event that occurs when the download state changes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public event EventHandler<StateChangedEventArgs> StateChanged
+        {
+            add
+            {
+                if (_downloadStateChanged == null)
+                {
+                    RegisterStateChangedEvent();
+                }
+                _downloadStateChanged += value;
+            }
+            remove
+            {
+                _downloadStateChanged -= value;
+                if (_downloadStateChanged == null)
+                {
+                    UnregisterStateChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Event that occurs when the download progress changes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public event EventHandler<ProgressChangedEventArgs> ProgressChanged
+        {
+            add
+            {
+                if (_downloadProgressChanged == null)
+                {
+                    RegisterProgressChangedEvent();
+                }
+                _downloadProgressChanged += value;
+            }
+            remove
+            {
+                _downloadProgressChanged -= value;
+                if (_downloadProgressChanged == null)
+                {
+                    UnregisterProgressChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Absolute path where the file will be downloaded.
+        /// If you try to get this property value before calling Start(), an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// Returns empty string if download is not completed or if state has not yet changed to Completed or if any other error occurs.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string DownloadedPath
+        {
+            get
+            {
+                string path;
+                int ret = Interop.Download.GetDownloadedPath(_downloadId, out path);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get DownloadedPath, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// MIME type of the downloaded content.
+        /// If you try to get this property value before calling Start(), an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string MimeType
+        {
+            get
+            {
+                string mime;
+                int ret = Interop.Download.GetMimeType(_downloadId, out mime);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get MimeType, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return mime;
+            }
+        }
+
+        /// <summary>
+        /// Current state of the download.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public DownloadState State
+        {
+            get
+            {
+                int state;
+                int ret = Interop.Download.GetState(_downloadId, out state);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get DownloadState, " + (DownloadError)ret);
+                    return DownloadState.None;
+                }
+                return (DownloadState)state;
+            }
+        }
+
+        /// <summary>
+        /// The content name of the downloaded file.
+        /// This can be defined with reference of HTTP response header data. The content name can be received when HTTP response header is received.
+        /// If you try to get this property value before calling Start(), an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string ContentName
+        {
+            get
+            {
+                string name;
+                int ret = Interop.Download.GetContentName(_downloadId, out name);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get ContentName, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return name;
+            }
+        }
+
+        /// <summary>
+        /// Total size of downloaded content.
+        /// This information is received from the server. If the server does not send the total size of the content, the content size is set to zero.
+        /// If you try to get this property value before calling Start(), 0 is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public ulong ContentSize
+        {
+            get
+            {
+                ulong size;
+                int ret = Interop.Download.GetContentSize(_downloadId, out size);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get ContentSize, " + (DownloadError)ret);
+                    return 0;
+                }
+                return size;
+            }
+        }
+
+        /// <summary>
+        /// HTTP status code when a download exception occurs.
+        /// If you try to get this property value before calling Start(), 0 is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// State of download request must be DownlodState.Failed.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public int HttpStatus
+        {
+            get
+            {
+                int status;
+                int ret = Interop.Download.GetHttpStatus(_downloadId, out status);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get HttpStatus, " + (DownloadError)ret);
+                    return 0;
+                }
+                return status;
+            }
+        }
+
+        /// <summary>
+        /// ETag value from the HTTP response header when making a HTTP request for resume.
+        /// If you try to get this property value before calling Start() or if any other error occurs, an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The etag value is available or not depending on the web server. If not available, then on get of the property null is returned.
+        /// After download is started, it can get the etag value.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string ETagValue
+        {
+            get
+            {
+                string etag;
+                int ret = Interop.Download.GetETag(_downloadId, out etag);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get ETagValue, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return etag;
+            }
+        }
+
+        /// <summary>
+        /// Contains properties required for creating download notifications.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// When the notification message is clicked, the action taken by the system is decided by the app control properties of the NotificationProperties instance.
+        /// If the app control is not set, the following default operation is executed when the notification message is clicked:
+        ///  1) download completed state - the viewer application is executed according to extension name of downloaded content,
+        ///  2) download failed state and ongoing state - the client application is executed.
+        /// This property should be set before calling Start().
+        /// </remarks>
+        public Notification NotificationProperties
+        {
+            get
+            {
+                return _notificationProperties;
+            }
+        }
+
+        /// <summary>
+        /// Full path of the temporary file which stores downloaded content.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The download state must be one of the states after Downloading.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string TemporaryPath
+        {
+            get
+            {
+                string path;
+                int ret = Interop.Download.GetTempFilePath(_downloadId, out path);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get TemporaryPath, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return path;
+            }
+        }
+
+        /// <summary>
+        /// URL to download.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// Should be set before calling Start().
+        /// If you try to get this property value before setting or if any other error occurs, an empty string is returned.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string Url
+        {
+            get
+            {
+                string url;
+                int ret = Interop.Download.GetUrl(_downloadId, out url);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get Url, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return url;
+            }
+            set
+            {
+                int ret = Interop.Download.SetUrl(_downloadId, value);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set Url");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Allowed network type for downloading the file.
+        /// The file will be downloaded only under the allowed network.
+        /// If you try to get this property value before setting or if any other error occurs, default value NetworkType All is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.wifi.direct</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <remarks>
+        /// Should be set before calling Start().
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported.</exception>
+        public NetworkType AllowedNetworkType
+        {
+            get
+            {
+                int type;
+                int ret = Interop.Download.GetNetworkType(_downloadId, out type);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get AllowedNetworkType, " + (DownloadError)ret);
+                    return NetworkType.All;
+                }
+                return (NetworkType)type;
+            }
+            set
+            {
+                int ret = Interop.Download.SetNetworkType(_downloadId, (int)value);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set AllowedNetworkType");
+                }
+            }
+        }
+
+        /// <summary>
+        /// The file will be downloaded to the set destination file path. The downloaded file is saved to an auto-generated file name in the destination. If the destination is not specified, the file will be downloaded to default storage.
+        /// If you try to get this property value before setting or if any other error occurs, an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// Should be set before calling Start().
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string DestinationPath
+        {
+            get
+            {
+                string path;
+                int ret = Interop.Download.GetDestination(_downloadId, out path);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get DestinationPath, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return path;
+            }
+            set
+            {
+                int ret = Interop.Download.SetDestination(_downloadId, value.ToString());
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set DestinationPath");
+                }
+            }
+        }
+
+        /// <summary>
+        /// The file will be saved in the specified destination or default storage with the set file name. If the file name is not specified, the downloaded file will be saved with an auto-generated file name in the destination.
+        /// If you try to get this property value before setting or if any other error occurs, an empty string is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// Should be set before calling Start().
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public string FileName
+        {
+            get
+            {
+                string name;
+                int ret = Interop.Download.GetFileName(_downloadId, out name);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get FileName, " + (DownloadError)ret);
+                    return String.Empty;
+                }
+                return name;
+            }
+            set
+            {
+                int ret = Interop.Download.SetFileName(_downloadId, value.ToString());
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set FileName");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Enables or disables auto download.
+        /// If this option is enabled, the previous downloading item is restarted automatically as soon as the download daemon is restarted. The download progress continues after the client process is terminated.
+        /// If you try to get this property value before setting, default value false is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The default value is false.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public bool AutoDownload
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.Download.GetAutoDownload(_downloadId, out value);
+                if (ret != (int)DownloadError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get AutoDownload, " + (DownloadError)ret);
+                    return false;
+                }
+                return value;
+            }
+            set
+            {
+                int ret = Interop.Download.SetAutoDownload(_downloadId, value);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set AutoDownload");
+                }
+            }
+        }
+
+        /// <summary>
+        /// HTTP header field and value pairs to the download request.
+        /// HTTP header &lt;field,value&gt; pair is the &lt;key,value&gt; pair in the Dictionary HttpHeaders
+        /// The given HTTP header field will be included with the HTTP request of the download request.
+        /// If you try to get this property value before setting, an empty dictionary is returned.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// HTTP header fields should be set before calling Start().
+        /// HTTP header fields can be removed before calling Start().
+        /// </remarks>
+        public IDictionary<string, string> HttpHeaders
+        {
+            get
+            {
+                return _httpHeaders;
+            }
+        }
+
+        /// <summary>
+        /// Sets the directory path of a temporary file used in a previous download request.
+        /// This is only useful when resuming download to make HTTP request header at the client side. Otherwise, the path is ignored.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// If the etag value is not present in the download database, it is not useful to set the temporary file path.
+        /// When resuming the download request, the data is attached at the end of this temporary file.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public void SetTemporaryFilePath(string path)
+        {
+                int ret = Interop.Download.SetTempFilePath(_downloadId, path);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set TemporaryFilePath");
+                }
+        }
+
+        /// <summary>
+        /// Starts or resumes download.
+        /// Starts to download the current URL, or resumes the download if paused.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The URL is the mandatory information to start the download.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public void Start()
+        {
+            int ret = (int)DownloadError.None;
+            foreach (KeyValuePair<string, string> entry in _httpHeaders)
+            {
+                ret = Interop.Download.AddHttpHeaderField(_downloadId, entry.Key, entry.Value);
+                if (ret != (int)DownloadError.None)
+                {
+                    DownloadErrorFactory.ThrowException(ret, "Failed to set HttpHeaders");
+                }
+            }
+
+            ret = Interop.Download.StartDownload(_downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Failed to start download request");
+            }
+        }
+
+        /// <summary>
+        /// Pauses download request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The paused download request can be restarted with Start() or canceled with Cancel().
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public void Pause()
+        {
+            int ret = Interop.Download.PauseDownload(_downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Failed to pause download request");
+            }
+        }
+
+        /// <summary>
+        /// Cancels download request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// The canceled download can be restarted with Start().
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public void Cancel()
+        {
+            int ret = Interop.Download.CancelDownload(_downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Failed to cancel download request");
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the Request class.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <remarks>
+        /// After calling this method, download request related data exists in the download database for a certain period of time. Within that time, it is possible to use other APIs with this data.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Deletes the corresponding download request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/download</privilege>
+        /// <exception cref="ArgumentException">Thrown when it is failed due to an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            Interop.Download.DestroyRequest(_downloadId);
+            _disposed = true;
+        }
+
+        static private void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray)
+        {
+            managedArray = new string[size];
+            IntPtr[] IntPtrArray = new IntPtr[size];
+
+            Marshal.Copy(unmanagedArray, IntPtrArray, 0, size);
+
+            for (int iterator = 0; iterator < size; iterator++)
+            {
+                managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]);
+            }
+        }
+
+        private void RegisterStateChangedEvent()
+        {
+            _downloadStateChangedCallback = (int downloadId, int downloadState, IntPtr userData) =>
+            {
+                StateChangedEventArgs eventArgs = new StateChangedEventArgs((DownloadState)downloadState);
+                _downloadStateChanged?.Invoke(this, eventArgs);
+            };
+
+            int ret = Interop.Download.SetStateChangedCallback(_downloadId, _downloadStateChangedCallback, IntPtr.Zero);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting StateChanged callback failed");
+            }
+        }
+
+        private void UnregisterStateChangedEvent()
+        {
+            int ret = Interop.Download.UnsetStateChangedCallback(_downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Unsetting StateChanged callback failed");
+            }
+        }
+
+        private void RegisterProgressChangedEvent()
+        {
+            _downloadProgressChangedCallback = (int downloadId, ulong size, IntPtr userData) =>
+            {
+                ProgressChangedEventArgs eventArgs = new ProgressChangedEventArgs(size);
+                _downloadProgressChanged?.Invoke(this, eventArgs);
+            };
+
+            int ret = Interop.Download.SetProgressCallback(_downloadId, _downloadProgressChangedCallback, IntPtr.Zero);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Setting ProgressChanged callback failed");
+            }
+        }
+
+        private void UnregisterProgressChangedEvent()
+        {
+            int ret = Interop.Download.UnsetProgressCallback(_downloadId);
+            if (ret != (int)DownloadError.None)
+            {
+                DownloadErrorFactory.ThrowException(ret, "Unsetting ProgressChanged callback failed");
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs b/src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..e4c56e8
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+
+namespace Tizen.Content.Download
+{
+    /// <summary>
+    /// An extended EventArgs class which contains the changed download state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class StateChangedEventArgs : EventArgs
+    {
+        private DownloadState _state;
+
+        internal StateChangedEventArgs(DownloadState downloadState)
+        {
+            _state = downloadState;
+        }
+
+        /// <summary>
+        /// Present download state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public DownloadState State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Context/Interop/Interop.AppHistory.cs b/src/Tizen.Context/Interop/Interop.AppHistory.cs
new file mode 100644 (file)
index 0000000..b6cdec2
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class CtxHistory
+    {
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_query")]
+        internal static extern int Query(string uri, Int64 startTime, Int64 endTime, uint resultSize, out IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_is_supported")]
+        internal static extern int IsSupported(string subject, out bool supported);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_get_last_fully_charged_time")]
+        internal static extern int GetLastFullyChargedTime(out Int64 timestamp);
+
+    }
+    internal static partial class CtxHistoryCursor
+    {
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_destroy")]
+        internal static extern void Destroy(IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_count")]
+        internal static extern int GetCount(IntPtr cursor, out int count);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_position")]
+        internal static extern int GetPosition(IntPtr cursor, out int position);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_set_position")]
+        internal static extern int SetPosition(IntPtr cursor, int position);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_first")]
+        internal static extern int First(IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_last")]
+        internal static extern int Last(IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_next")]
+        internal static extern int Next(IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_prev")]
+        internal static extern int Prev(IntPtr cursor);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_int64")]
+        internal static extern int GetInt64(IntPtr cursor, string key, out Int64 value);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_double")]
+        internal static extern int GetDouble(IntPtr cursor, string key, out double value);
+
+        [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_string")]
+        internal static extern int GetString(IntPtr cursor, string key, out string value);
+    }
+}
diff --git a/src/Tizen.Context/Interop/Interop.Libraries.cs b/src/Tizen.Context/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..8970f55
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Library
+    {
+        public const string AppHistory = "libcontext-app-history-client.so.4";
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs
new file mode 100644 (file)
index 0000000..d990828
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Context.AppHistory
+{
+    internal enum AppHistoryError
+    {
+        None = ErrorCode.None,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        PermissionDenied = ErrorCode.PermissionDenied,
+        NotSupported = ErrorCode.NotSupported,
+        NoData = ErrorCode.NoData,
+        OperationFailed = -0x02480000 | 0x04,
+    }
+
+    internal static class AppHistoryErrorFactory
+    {
+        internal const string LogTag = "Tizen.Context.AppHistory";
+
+        internal static Exception CheckAndThrowException(AppHistoryError error, string msg)
+        {
+            switch (error)
+            {
+                case AppHistoryError.None:
+                    return null;
+                case AppHistoryError.InvalidParameter:
+                    return new ArgumentException("Invalid Parameter: " + msg);
+                case AppHistoryError.OutOfMemory:
+                    return new OutOfMemoryException("Out of Memory: " + msg);
+                case AppHistoryError.PermissionDenied:
+                    return new UnauthorizedAccessException("Permission Denied: " + msg);
+                case AppHistoryError.NotSupported:
+                    return new NotSupportedException("Not Supported: " + msg);
+                case AppHistoryError.OperationFailed:
+                    return new InvalidOperationException("Operation Failed: " + msg);
+                default:
+                    return new InvalidOperationException("Unknown Error Code: " + msg);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs
new file mode 100644 (file)
index 0000000..c25b493
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// Base class for application statistics.
+    /// </summary>
+    public abstract class AppStatistics
+    {
+        internal const string AppStatsQueryResult = "QueryResult";
+        internal const string AppStatsStartTime = "StartTime";
+        internal const string AppStatsEndTime = "EndTime";
+        internal const string AppStatsResultSize = "ResultSize";
+        internal const string AppStatsAppId = "AppId";
+        internal const int DefaultResultSize = 5;
+
+        internal string Uri;
+
+        internal AppStatistics()
+        {
+        }
+
+        internal static long ConvertDateTimeToUnixTimestamp(DateTime dateTime)
+        {
+            DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+            long unixTimestampInTicks = (dateTime.ToUniversalTime() - unixStart).Ticks;
+            return unixTimestampInTicks / TimeSpan.TicksPerSecond;
+        }
+
+        internal static DateTime ConvertUnixTimestampToDateTime(long unixTime)
+        {
+            DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
+            long unixTimeStampInTicks = unixTime * TimeSpan.TicksPerSecond;
+            return new DateTime(unixStart.Ticks + unixTimeStampInTicks, System.DateTimeKind.Utc).ToLocalTime();
+        }
+
+        internal static void CheckTimeSpan(DateTime startTime, DateTime endTime)
+        {
+            if (startTime > endTime)
+            {
+                Log.Error(AppHistoryErrorFactory.LogTag, "endTime should be greater than startTime");
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "endTime should be greater than startTime");
+            }
+        }
+
+        internal static void CheckResultSize(uint resultSize)
+        {
+            if (resultSize <= 0)
+            {
+                Log.Error(AppHistoryErrorFactory.LogTag, "resultSize should be greater than 0");
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "resultSize should be greater than 0");
+            }
+        }
+
+        internal abstract string ConvertSortOrderToString(int order);
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs
new file mode 100644 (file)
index 0000000..ed46f8c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// Base class which contains application statistics query result.
+    /// </summary>
+    public abstract class AppStatisticsData
+    {
+        internal AppStatisticsData()
+        {
+        }
+
+        /// <summary>
+        /// Gets the application id.
+        /// </summary>
+        /// <value>The application id.</value>
+        public string AppId { get; protected set; }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs
new file mode 100644 (file)
index 0000000..f820525
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// This class provides APIs to query battery consumption per application.
+    /// </summary>
+    public class BatteryStatistics : AppStatistics
+    {
+        private const string AppStatsConsumption = "TotalAmount";
+
+        /// <summary>
+        ///  The default constructor of BatteryStatistics class.
+        /// </summary>
+        /// <feature>http://tizen.org/feature/battery</feature>
+        /// <exception cref="InvalidOperationException">Thrown when method fail due to internal error.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the statistics is not supported.</exception>
+        public BatteryStatistics()
+        {
+            SortOrder = SortOrderType.ConsumptionMost;
+            Uri = ConvertSortOrderToString((int)SortOrder);
+
+            bool isSupported = false;
+            int error = Interop.CtxHistory.IsSupported(Uri, out isSupported);
+            if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri);
+            }
+
+            if (!isSupported)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.NotSupported, Uri);
+            }
+        }
+
+        /// <summary>
+        /// The constructor of BatteryStatistics class.
+        /// </summary>
+        /// <param name="order">The criteria of the battery statistics sorted by.</param>
+        /// <feature>http://tizen.org/feature/battery</feature>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when method fail due to internal error.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the statistics is not supported.</exception>
+        public BatteryStatistics(SortOrderType order)
+        {
+            SortOrder = order;
+            Uri = ConvertSortOrderToString((int)SortOrder);
+
+            if (Uri == null)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "Invalid SortOrderType");
+            }
+
+            bool isSupported = false;
+            int error = Interop.CtxHistory.IsSupported(Uri, out isSupported);
+            if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri);
+            }
+
+            if (!isSupported)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.NotSupported, Uri);
+            }
+        }
+
+        /// <summary>
+        /// Retrieves a given type of battery statistics.
+        /// </summary>
+        /// <param name="startTime">The start time of the data to be aggregated.</param>
+        /// <param name="endTime">The end time of the data to be aggregated.</param>
+        /// <returns>Battery statistics data retrieved.</returns>
+        /// <privilege>http://tizen.org/privilege/apphistory.read</privilege>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when invalid operation occurs.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the app has no privilege to retrieve app history.</exception>
+        public IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime)
+        {
+            CheckTimeSpan(startTime, endTime);
+
+            return Query(startTime, endTime, DefaultResultSize);
+        }
+
+        /// <summary>
+        /// Retrieves a given type of battery statistics.
+        /// </summary>
+        /// <param name="startTime">The start time of the data to be aggregated.</param>
+        /// <param name="endTime">The end time of the data to be aggregated.</param>
+        /// <param name="resultSize">The number of data records to be retrieved.</param>
+        /// <returns>Battery statistics data retrieved.</returns>
+        /// <privilege>http://tizen.org/privilege/apphistory.read</privilege>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when invalid operation occurs.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the app has no privilege to retrieve app history.</exception>
+        public IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime, uint resultSize)
+        {
+            CheckTimeSpan(startTime, endTime);
+            CheckResultSize(resultSize);
+
+            List<BatteryStatisticsData> result = new List<BatteryStatisticsData>();
+
+            IntPtr cursor = IntPtr.Zero;
+            int error = Interop.CtxHistory.Query(Uri, (int)ConvertDateTimeToUnixTimestamp(startTime), (int)ConvertDateTimeToUnixTimestamp(endTime), resultSize, out cursor);
+            if ((AppHistoryError)error == AppHistoryError.NoData)
+            {
+                return result.AsReadOnly();
+            }
+            else if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request query battery statistics");
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request query battery statistics");
+            }
+
+            int size;
+            error = Interop.CtxHistoryCursor.GetCount(cursor, out size);
+            Interop.CtxHistoryCursor.First(cursor);
+
+            for (int i = 0; i < size; i++)
+            {
+                result.Add(ConvertOutputToStatsData(cursor));
+                Interop.CtxHistoryCursor.Next(cursor);
+            }
+            Interop.CtxHistoryCursor.Destroy(cursor);
+
+            return result.AsReadOnly();
+        }
+
+        /// <summary>
+        /// Gets the last time when the device was fully charged.
+        /// </summary>
+        /// <returns>The last time when the device was fully charged.</returns>
+        /// <feature>http://tizen.org/feature/battery</feature>
+        /// <exception cref="NotSupportedException">Thrown when the statistics is not supported.</exception>
+        public static DateTime GetLastFullyChargedTime()
+        {
+            Int64 timestamp;
+            int error = Interop.CtxHistory.GetLastFullyChargedTime(out timestamp);
+            if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request get last fully charged time");
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request get last fully charged time");
+            }
+
+            return ConvertUnixTimestampToDateTime(timestamp);
+        }
+
+        internal override string ConvertSortOrderToString(int order)
+        {
+            switch ((SortOrderType)order)
+            {
+                case SortOrderType.ConsumptionMost:
+                    return "stats/battery/history";
+                default:
+                    return null;
+            }
+        }
+
+        private static BatteryStatisticsData ConvertOutputToStatsData(IntPtr cursor)
+        {
+            string appId;
+            double consumption;
+
+            Interop.CtxHistoryCursor.GetString(cursor, AppStatsAppId, out appId);
+            Interop.CtxHistoryCursor.GetDouble(cursor, AppStatsConsumption, out consumption);
+
+            return new BatteryStatisticsData(appId, consumption);
+        }
+
+        /// <summary>
+        /// Gets the criteria of battery statistics sorted by.
+        /// </summary>
+        /// <value>The criteria of battery statistics sorted by.</value>
+        public SortOrderType SortOrder { get; private set; }
+
+        /// <summary>
+        /// Sort order type of battery statistics.
+        /// </summary>
+        public enum SortOrderType
+        {
+            /// <summary>
+            /// Sorts apps by consumption, the most battery consuming apps appear first. (Default)
+            /// </summary>
+            ConsumptionMost = 0
+        }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs
new file mode 100644 (file)
index 0000000..9dd6e4c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// The class contains battery statistics information retrieved by BatteryStatistics.
+    /// </summary>
+    public class BatteryStatisticsData : AppStatisticsData
+    {
+        internal BatteryStatisticsData(string appId, double consumption)
+        {
+            AppId = appId;
+            Consumption = consumption;
+        }
+
+        /// <summary>
+        /// Gets how many percentage of battery capacity was used by the application.
+        /// </summary>
+        /// <value>Battery consumption used by the application.</value>
+        public double Consumption { get; private set; }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs
new file mode 100644 (file)
index 0000000..a23d820
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// This class provides APIs to query application launch history.
+    /// </summary>
+    public class UsageStatistics : AppStatistics
+    {
+        private const string AppStatsDuration = "TotalDuration";
+        private const string AppStatsLaunchCount = "TotalCount";
+        private const string AppStatsLastLaunchTime = "LastTime";
+
+        /// <summary>
+        /// The default constructor of UsageStatistics class.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when method fail due to internal error.</exception>
+        public UsageStatistics()
+        {
+            SortOrder = SortOrderType.LastLaunchTimeNewest;
+            Uri = ConvertSortOrderToString((int)SortOrder);
+
+            bool isSupported = false;
+            int error = Interop.CtxHistory.IsSupported(Uri, out isSupported);
+            if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri);
+            }
+
+            if (!isSupported)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.OperationFailed, Uri);
+            }
+        }
+
+        /// <summary>
+        /// The constructor of UsageStatistics class.
+        /// </summary>
+        /// <param name="order">The criteria of the usage statistics sorted by.</param>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when method fail due to internal error.</exception>
+        public UsageStatistics(SortOrderType order)
+        {
+            SortOrder = order;
+            Uri = ConvertSortOrderToString((int)SortOrder);
+
+            if (Uri== null)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "Invalid SortOrderType");
+            }
+
+            bool isSupported = false;
+            int error = Interop.CtxHistory.IsSupported(Uri, out isSupported);
+            if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri);
+            }
+
+            if (!isSupported)
+            {
+                throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.OperationFailed, Uri);
+            }
+        }
+
+        /// <summary>
+        /// Retrieves a given type of usage statistics.
+        /// </summary>
+        /// <param name="startTime">The start time of the data to be aggregated.</param>
+        /// <param name="endTime">The end time of the data to be aggregated.</param>
+        /// <returns>Usage statistics data retrieved.</returns>
+        /// <privilege>http://tizen.org/privilege/apphistory.read</privilege>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when invalid operation occurs.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the app has no privilege to retrieve app history.</exception>
+        public IReadOnlyList<UsageStatisticsData> Query(DateTime startTime, DateTime endTime)
+        {
+            CheckTimeSpan(startTime, endTime);
+
+            return Query(startTime, endTime, DefaultResultSize);
+        }
+
+        /// <summary>
+        /// Retrieves a given type of usage statistics.
+        /// </summary>
+        /// <param name="startTime">The start time of the data to be aggregated.</param>
+        /// <param name="endTime">The end time of the data to be aggregated.</param>
+        /// <param name="resultSize">The number of data records to be retrieved.</param>
+        /// <returns>Usage statistics data retrieved.</returns>
+        /// <privilege>http://tizen.org/privilege/apphistory.read</privilege>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when invalid operation occurs.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the app has no privilege to retrieve app history.</exception>
+        public IReadOnlyList<UsageStatisticsData> Query(DateTime startTime, DateTime endTime, uint resultSize)
+        {
+            CheckTimeSpan(startTime, endTime);
+            CheckResultSize(resultSize);
+
+            List<UsageStatisticsData> result = new List<UsageStatisticsData>();
+
+            IntPtr cursor = IntPtr.Zero;
+            int error = Interop.CtxHistory.Query(Uri, ConvertDateTimeToUnixTimestamp(startTime), ConvertDateTimeToUnixTimestamp(endTime), resultSize, out cursor);
+            if ((AppHistoryError)error == AppHistoryError.NoData)
+            {
+                return result.AsReadOnly();
+            } else if ((AppHistoryError)error != AppHistoryError.None)
+            {
+                Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request query usage statistics");
+                throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request query usage statistics");
+            }
+
+            int size;
+            error = Interop.CtxHistoryCursor.GetCount(cursor, out size);
+            Interop.CtxHistoryCursor.First(cursor);
+
+            for (int i = 0; i < size; i++)
+            {
+                result.Add(ConvertOutputToStatsData(cursor));
+                Interop.CtxHistoryCursor.Next(cursor);
+            }
+            Interop.CtxHistoryCursor.Destroy(cursor);
+
+            return result.AsReadOnly();
+        }
+
+        internal override string ConvertSortOrderToString(int order)
+        {
+            switch ((SortOrderType)order)
+            {
+                case SortOrderType.LastLaunchTimeNewest:
+                    return "stats/app/recently";
+                case SortOrderType.LaunchCountMost:
+                    return "stats/app/often";
+                default:
+                    return null;
+            }
+        }
+
+        private static UsageStatisticsData ConvertOutputToStatsData(IntPtr cursor)
+        {
+            string appId;
+            Int64 duration = 1;
+            Int64 launchCount = 1;
+            Int64 lastLaunchTime;
+
+            Interop.CtxHistoryCursor.GetString(cursor, AppStatsAppId, out appId);
+            Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsDuration, out duration);
+            Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsLaunchCount, out launchCount);
+            Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsLastLaunchTime, out lastLaunchTime);
+
+            return new UsageStatisticsData(appId, (int)duration, (int)launchCount, ConvertUnixTimestampToDateTime(lastLaunchTime));
+        }
+
+        /// <summary>
+        /// Gets the criteria of usage statistics sorted by.
+        /// </summary>
+        /// <value>The criteria of usage statistics sorted by.</value>
+        public SortOrderType SortOrder { get; private set; }
+
+        /// <summary>
+        /// Sort order type of usage statistics
+        /// </summary>
+        public enum SortOrderType
+        {
+            /// <summary>
+            /// Sorts apps by the last launch time, the most recently launched apps appear first. (Default)
+            /// </summary>
+            LastLaunchTimeNewest = 0,
+            /// <summary>
+            /// Sorts apps by the launch count of being launched, the most frequently launched apps appear first.
+            /// </summary>
+            LaunchCountMost
+        }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs
new file mode 100644 (file)
index 0000000..c090e90
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Context.AppHistory
+{
+    /// <summary>
+    /// The class contains application usage statistics information retrieved by UsageStatistics.
+    /// </summary>
+    public class UsageStatisticsData : AppStatisticsData
+    {
+        internal UsageStatisticsData(string appId, int duration, int launchCount, DateTime lastLaunchTime)
+        {
+            AppId = appId;
+            Duration = duration;
+            LaunchCount = launchCount;
+            LastLaunchTime = lastLaunchTime;
+        }
+
+        /// <summary>
+        ///  Gets the time which the application is being displayed in the foreground in seconds.
+        /// </summary>
+        /// <value>Duration which the application is used in the foreground in seconds.</value>
+        public int Duration { get; private set; }
+
+        /// <summary>
+        ///  Gets how many times the application is used in the foreground.
+        /// </summary>
+        /// <value>How many times the application is used in the foreground.</value>
+        public int LaunchCount { get; private set; }
+
+        /// <summary>
+        /// Gets the last time when the application has been used.
+        /// </summary>
+        /// <value>The last time when the application has been used.</value>
+        public DateTime LastLaunchTime { get; private set; }
+    }
+}
diff --git a/src/Tizen.Context/Tizen.Context.csproj b/src/Tizen.Context/Tizen.Context.csproj
new file mode 100644 (file)
index 0000000..5fae570
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+  <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Context APIs for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Context.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Context/Tizen.Context.snk b/src/Tizen.Context/Tizen.Context.snk
new file mode 100644 (file)
index 0000000..51400f9
Binary files /dev/null and b/src/Tizen.Context/Tizen.Context.snk differ
diff --git a/src/Tizen.Convergence/Interop/Interop.Common.cs b/src/Tizen.Convergence/Interop/Interop.Common.cs
new file mode 100755 (executable)
index 0000000..bad120b
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal abstract class TizenSafeHandle : SafeHandle
+    {
+        public abstract void Destroy();
+
+        public TizenSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        public TizenSafeHandle(IntPtr handle) : base(handle, true)
+        {
+        }
+
+        public override bool IsInvalid
+        {
+            get
+            {
+                return handle == IntPtr.Zero;
+            }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Destroy();
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs
new file mode 100755 (executable)
index 0000000..4a8a282
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen;
+using Tizen.Convergence;
+
+internal static partial class Interop
+{
+    internal static partial class Internal
+    {
+        internal static partial class ConvChannel
+        {
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_create")]
+            internal static extern int Create(out ConvChannelHandle /* conv_channel_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_destroy")]
+            internal static extern int Destroy(IntPtr /* conv_channel_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_get_string")]
+            internal static extern int GetString(ConvChannelHandle /* conv_channel_h */ handle, string key, out IntPtr value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_set_string")]
+            internal static extern int SetString(ConvChannelHandle /* conv_channel_h */ handle, string key, string value);
+        }
+
+        internal class ConvChannelHandle : TizenSafeHandle
+        {
+            private bool _ownsHandle = true;
+
+            public ConvChannelHandle(): base()
+            {
+
+            }
+
+            public ConvChannelHandle(IntPtr handle)
+                : base(handle)
+            {
+            }
+
+            public ConvChannelHandle(IntPtr handle, bool ownsHandle)
+                : base(handle)
+            {
+                _ownsHandle = ownsHandle;
+            }
+
+            public override void Destroy()
+            {
+                if (_ownsHandle && handle != IntPtr.Zero)
+                {
+                    var err = ConvChannel.Destroy(this.handle);
+                    if (err != (int)ConvErrorCode.None)
+                    {
+                        Log.Error(ErrorFactory.LogTag, "Failed to destroy conv channel handle");
+                        throw ErrorFactory.GetException(err);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs
new file mode 100755 (executable)
index 0000000..cbee849
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen;
+using Tizen.Convergence;
+
+internal static partial class Interop
+{
+    internal static partial class Internal
+    {
+        internal static partial class ConvDevice
+        {
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_device_clone")]
+            internal static extern int Clone(IntPtr /* conv_device_h */ originalHandle, out ConvDeviceHandle /* conv_device_h */ targetHandle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_device_destroy")]
+            internal static extern int Destroy(IntPtr /* conv_device_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_device_get_property_string")]
+            internal static extern int GetPropertyString(ConvDeviceHandle /* conv_device_h */ handle, string key, out IntPtr value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_device_foreach_service")]
+            internal static extern int ForeachService(ConvDeviceHandle /* conv_device_h */ handle, ConvServiceForeachCallback cb, IntPtr /* void */ userData);
+
+            [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+            internal delegate void ConvServiceForeachCallback(IntPtr serviceHandle, IntPtr /* void */ userData);
+        }
+
+        internal class ConvDeviceHandle : TizenSafeHandle
+        {
+            public ConvDeviceHandle() : base()
+            {
+
+            }
+
+            public ConvDeviceHandle(IntPtr handle)
+                : base(handle)
+            {
+            }
+
+            public override void Destroy()
+            {
+                if (handle != IntPtr.Zero)
+                {
+                    var err = ConvDevice.Destroy(this.handle);
+                    if (err != (int)ConvErrorCode.None)
+                    {
+                        Log.Error(ErrorFactory.LogTag, "Failed to destroy conv device handle");
+                        throw ErrorFactory.GetException(err);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs
new file mode 100755 (executable)
index 0000000..cfdc9e5
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen;
+using Tizen.Convergence;
+
+internal static partial class Interop
+{
+    internal static partial class Internal
+    {
+        public enum ConvDiscoveryResult
+        {
+            /// <summary>
+            /// Discovery Error
+            /// </summary>
+            Error = -1,
+            /// <summary>
+            /// Discovery Success
+            /// </summary>
+            Success = 0,
+            /// <summary>
+            /// Discovery finished
+            /// </summary>
+            Finished,
+            /// <summary>
+            /// Discovery lost
+            /// </summary>
+            Lost,
+        }
+
+        internal static partial class ConvManager
+        {
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_create")]
+            internal static extern int ConvCreate(out ConvManagerHandle /* conv_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_destroy")]
+            internal static extern int ConvDestroy(IntPtr /* conv_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_discovery_start")]
+            internal static extern int ConvDiscoveryStart(ConvManagerHandle /* conv_h */ handle, int timeoutSeconds, ConvDiscoveryCallback callback, IntPtr /* void */ userData);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_discovery_stop")]
+            internal static extern int ConvDiscoveryStop(ConvManagerHandle /* conv_h */ handle);
+
+            [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+            internal delegate void ConvDiscoveryCallback(IntPtr /* conv_device_h */ deviceHandle, ConvDiscoveryResult /* conv_discovery_result_e */ result, IntPtr /* void */ userData);
+        }
+
+        internal class ConvManagerHandle : TizenSafeHandle
+        {
+            public ConvManagerHandle() : base()
+            {
+
+            }
+
+            public ConvManagerHandle(IntPtr handle)
+                : base(handle)
+            {
+            }
+
+            public override void Destroy()
+            {
+                var err = ConvManager.ConvDestroy(this.handle);
+                if (err != (int)ConvErrorCode.None)
+                {
+                    Log.Error(ErrorFactory.LogTag, "Failed to destroy conv manager handle");
+                    throw ErrorFactory.GetException(err);
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs
new file mode 100755 (executable)
index 0000000..902e5e0
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen;
+using Tizen.Convergence;
+
+internal static partial class Interop
+{
+    internal static partial class Internal
+    {
+        internal static partial class ConvPayload
+        {
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_create")]
+            internal static extern int Create(out ConvPayloadHandle /* conv_payload_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_destroy")]
+            internal static extern int Destroy(IntPtr /* conv_payload_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_string")]
+            internal static extern int SetString(ConvPayloadHandle /* conv_payload_h */ handle, string key, string value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_string")]
+            internal static extern int GetString(ConvPayloadHandle /* conv_payload_h */ handle, string key, out IntPtr value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_byte")]
+            internal static extern int SetByte(ConvPayloadHandle /* conv_payload_h */ handle, string key, int length, byte[] value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_byte")]
+            internal static extern int GetByte(ConvPayloadHandle /* conv_payload_h */ handle, string key, out int length, out IntPtr value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_binary")]
+            internal static extern int SetBinary(ConvPayloadHandle /* conv_payload_h */ handle, int length, byte[] value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_binary")]
+            internal static extern int GetBinary(ConvPayloadHandle /* conv_payload_h */ handle, out int length, out IntPtr value);
+        }
+
+        internal class ConvPayloadHandle : TizenSafeHandle
+        {
+            private bool _ownsHandle = true;
+
+            public ConvPayloadHandle(): base()
+            {
+
+            }
+
+            public ConvPayloadHandle(IntPtr handle)
+                : base(handle)
+            {
+            }
+
+            public ConvPayloadHandle(IntPtr handle, bool ownsHandle)
+                : base(handle)
+            {
+                _ownsHandle = ownsHandle;
+            }
+
+            public override void Destroy()
+            {
+                if (_ownsHandle && handle != IntPtr.Zero)
+                {
+                    var err = ConvPayload.Destroy(this.handle);
+                    if (err != (int)ConvErrorCode.None)
+                    {
+                        Log.Error(ErrorFactory.LogTag, "Failed to destroy conv payload handle");
+                        throw ErrorFactory.GetException(err);
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs
new file mode 100755 (executable)
index 0000000..e99233a
--- /dev/null
@@ -0,0 +1,107 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen;
+using Tizen.Convergence;
+
+internal static partial class Interop
+{
+    internal static partial class Internal
+    {
+        internal enum ServiceType
+        {
+            /// <summary>
+            /// Undefined service
+            /// </summary>
+            None = -1,
+
+            /// <summary>
+            /// App-to-app communication service
+            /// </summary>
+            AppCommunication = 0,
+
+            /// <summary>
+            /// Remote app-control service
+            /// </summary>
+            RemoteAppControl,
+        }
+
+        internal static partial class ConvService
+        {
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_create")]
+            internal static extern int Create(out ConvServiceHandle /* conv_service_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_clone")]
+            internal static extern int Clone(IntPtr /* conv_service_h */ originalHandle, out ConvServiceHandle /* conv_service_h */ targetHandle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_destroy")]
+            internal static extern int Destroy(IntPtr /* conv_service_h */ handle);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_get_property_string")]
+            internal static extern int GetPropertyString(ConvServiceHandle /* conv_service_h */ handle, string key, out IntPtr value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_property_string")]
+            internal static extern int SetPropertyString(ConvServiceHandle /* conv_service_h */ handle, string key, string value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_get_type")]
+            internal static extern int GetType(IntPtr /* conv_service_h */ handle, out int /* conv_service_e */ value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_type")]
+            internal static extern int SetType(ConvServiceHandle /* conv_service_h */ handle, int /* conv_service_e */ value);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_start")]
+            internal static extern int Start(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_read")]
+            internal static extern int Read(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_publish")]
+            internal static extern int Publish(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_stop")]
+            internal static extern int Stop(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_listener_cb")]
+            internal static extern int SetListenerCb(ConvServiceHandle /* conv_service_h */ handle, ConvServiceListenerCallback callback, IntPtr /* void */ userData);
+
+            [DllImport(Libraries.Convergence, EntryPoint = "conv_service_unset_listener_cb")]
+            internal static extern int UnsetListenerCb(ConvServiceHandle /* conv_service_h */ handle);
+
+            [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+            internal delegate void ConvServiceListenerCallback(IntPtr /* conv_service_h */ serviceHandle, IntPtr channelHandle, int error, IntPtr result, IntPtr /* void */ userData);
+        }
+
+        internal class ConvServiceHandle : TizenSafeHandle
+        {
+            public ConvServiceHandle(): base()
+            {
+
+            }
+
+            public ConvServiceHandle(IntPtr handle)
+                : base(handle)
+            {
+            }
+
+            public override void Destroy()
+            {
+                if (handle != IntPtr.Zero)
+                {
+                    var err = ConvService.Destroy(this.handle);
+                    if (err != (int)ConvErrorCode.None)
+                    {
+                        Log.Error(ErrorFactory.LogTag, "Failed to destroy conv service handle");
+                        throw ErrorFactory.GetException(err);
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Convergence/Interop/Interop.Libc.cs b/src/Tizen.Convergence/Interop/Interop.Libc.cs
new file mode 100755 (executable)
index 0000000..13c7170
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+    }
+}
diff --git a/src/Tizen.Convergence/Interop/Interop.Libraries.cs b/src/Tizen.Convergence/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..072ed2f
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    /// <summary>
+    /// Wrapper class for maintaining names of dependent native libraries.
+    /// </summary>
+    internal static partial class Libraries
+    {
+        public const string Convergence = "libd2d-conv-manager.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence.csproj b/src/Tizen.Convergence/Tizen.Convergence.csproj
new file mode 100644 (file)
index 0000000..3f295ec
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  
+  <PropertyGroup>
+    <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Device to device convergence C# API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+  
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Convergence.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+  
+</Project>
diff --git a/src/Tizen.Convergence/Tizen.Convergence.snk b/src/Tizen.Convergence/Tizen.Convergence.snk
new file mode 100755 (executable)
index 0000000..d4c3b08
Binary files /dev/null and b/src/Tizen.Convergence/Tizen.Convergence.snk differ
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs
new file mode 100755 (executable)
index 0000000..64b5658
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.ComponentModel;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// The class provides APIs to support App to App communication service which relies on a remote server.
+    /// The initialization and execution of a server app (the app on the side with the Remote Server, e.g. TV) and a client app (e.g. the app on the mobile or wearable device) are slightly different.
+    /// On the server side an instance of the App Communication Service should be created and started by the app. Note, on the client side the service handle shouldn’t be created, but obtained during discovery.
+    /// For more information, refer Tizen D2D convergence specification
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalAppCommunicationService : InternalService
+    {
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        public InternalAppCommunicationService() :
+                base(Interop.Internal.ServiceType.AppCommunication)
+        {
+
+        }
+
+        internal InternalAppCommunicationService(IntPtr serviceHandle) :
+                    base(serviceHandle)
+        {
+
+        }
+
+        /// <summary>
+        /// Starts and initiates the service
+        /// </summary>
+        /// <param name="channel">Channel to specify a logical session for the service</param>
+        /// <param name="payload">Contains additional data for start request. Refer D2D Convergence specification for more information</param>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the request is not supported as per Tizen D2D convergence specification </exception>
+        /// <exception cref="ArgumentNullException">Thrown when any of the arugments are null</exception>
+        /// <seealso cref="Service.ServiceEventOccurred"> The result of the request is delivered through this event</seealso>
+        public void Start(InternalChannel channel, InternalPayload payload)
+        {
+            if (channel == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle;
+            int ret = Interop.Internal.ConvService.Start(_serviceHandle, channel._channelHandle, handle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop: Failed to start app communication service:" + ErrorFacts.GetErrorMessage(ret));
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Reads data from the channel opened on the service
+        /// </summary>
+        /// <param name="channel">Channel representing a logical session on the service</param>
+        /// <param name="payload">Contains additional data for start request. Refer D2D Convergence specification for more information</param>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the request is not supported as per Tizen D2D convergence specification </exception>
+        /// <exception cref="ArgumentNullException">Thrown when any of the arugments are null</exception>
+        /// <seealso cref="Service.ServiceEventOccurred"> The result of the request is delivered through this event</seealso>
+        public void Read(InternalChannel channel, InternalPayload payload)
+        {
+            if (channel == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle;
+            int ret = Interop.Internal.ConvService.Read(_serviceHandle, channel._channelHandle, handle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop: Failed to read app communication service:" + ErrorFacts.GetErrorMessage(ret));
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Publishes a message to the remote server application
+        /// </summary>
+        /// <param name="channel">Channel representing a logical session on the service</param>
+        /// <param name="payload">Contains additional data for start request. Refer D2D Convergence specification for more information</param>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the request is not supported as per Tizen D2D convergence specification </exception>
+        /// <exception cref="ArgumentNullException">Thrown when any of the arugments are null</exception>
+        /// <seealso cref="Service.ServiceEventOccurred"> The result of the request is delivered through this event</seealso>
+        public void Publish(InternalChannel channel, InternalPayload payload)
+        {
+            if (channel == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle;
+            int ret = Interop.Internal.ConvService.Publish(_serviceHandle, channel._channelHandle, handle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop: Failed to publish app communication service:" + ErrorFacts.GetErrorMessage(ret));
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Stops the channel opened on the remote server application
+        /// </summary>
+        /// <param name="channel">Channel representing a logical session on the service</param>
+        /// <param name="payload">Contains additional data for start request. Refer D2D Convergence specification for more information</param>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the request is not supported as per Tizen D2D convergence specification </exception>
+        /// <exception cref="ArgumentNullException">Thrown when any of the arugments are null</exception>
+        /// <seealso cref="Service.ServiceEventOccurred"> The result of the request is delivered through this event</seealso>
+        public void Stop(InternalChannel channel, InternalPayload payload)
+        {
+            if (channel == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle;
+            int ret = Interop.Internal.ConvService.Stop(_serviceHandle, channel._channelHandle, handle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Interop: Failed to start stop communication service:" + ErrorFacts.GetErrorMessage(ret));
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs
new file mode 100755 (executable)
index 0000000..72b00ec
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// The Channel class provies a logical session for communicating with AppCommunicationService.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalChannel : IDisposable
+    {
+        internal Interop.Internal.ConvChannelHandle _channelHandle;
+        internal const string ChannelUriKey = "uri";
+        internal const string ChannelIdKey = "channel_id";
+
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <param name="uri">Uri of the server side app</param>
+        /// <param name="id">Unique identifier</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Throws when the arguments passed are null</exception>
+        public InternalChannel(string uri, string id)
+        {
+            if (uri == null || id == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            int ret = Interop.Internal.ConvChannel.Create(out _channelHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create channel");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.Internal.ConvChannel.SetString(_channelHandle, ChannelUriKey, uri);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create channel");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.Internal.ConvChannel.SetString(_channelHandle, ChannelIdKey, id);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create channel");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            Uri = uri;
+            Id = id;
+        }
+
+        internal InternalChannel(IntPtr channelHandle)
+        {
+            _channelHandle = new Interop.Internal.ConvChannelHandle(channelHandle, false);
+
+            IntPtr stringPtr = IntPtr.Zero;
+            int ret = Interop.Internal.ConvChannel.GetString(_channelHandle, ChannelUriKey, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create channel");
+                throw ErrorFactory.GetException(ret);
+            }
+            Uri = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.Internal.ConvChannel.GetString(_channelHandle, ChannelIdKey, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create channel");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            Id = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+        }
+
+        /// <summary>
+        /// Uri of the server side app
+        /// </summary>
+        public string Uri { get; }
+
+        /// <summary>
+        /// Unique identifier
+        /// </summary>
+        public string Id { get; }
+
+        /// <summary>
+        /// The dispose method
+        /// </summary>
+        public void Dispose()
+        {
+            _channelHandle.Dispose();
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs
new file mode 100755 (executable)
index 0000000..0676fca
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// The class encapsulates a D2D convergence compliant device information
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalDevice : IDisposable
+    {
+        internal const string DeviceIdKey = "device_id";
+        internal const string DeviceNameKey = "device_name";
+        internal const string DeviceTypeKey = "device_type";
+        internal Interop.Internal.ConvDeviceHandle _deviceHandle;
+        internal List<InternalService> _services = new List<InternalService>();
+
+        /// <summary>
+        /// The Unique ID of the device
+        /// </summary>
+        public string Id { get;}
+
+        /// <summary>
+        /// Name of the device
+        /// </summary>
+        public string Name { get;}
+
+        /// <summary>
+        /// The profile of the device
+        /// </summary>
+        public string Type { get; }
+
+        /// <summary>
+        /// List of services supported by the device
+        /// </summary>
+        public IEnumerable<InternalService> Services
+        {
+            get
+            {
+                return _services;
+            }
+        }
+
+        internal InternalDevice(IntPtr deviceHandle)
+        {
+            int ret = Interop.Internal.ConvDevice.Clone(deviceHandle, out _deviceHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to clone device");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            IntPtr stringPtr = IntPtr.Zero;
+            ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceIdKey, out stringPtr);
+            if (ret == (int)ConvErrorCode.None)
+            {
+                Id = Marshal.PtrToStringAnsi(stringPtr);
+                Interop.Libc.Free(stringPtr);
+            }
+
+            ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceNameKey, out stringPtr);
+            if (ret == (int)ConvErrorCode.None)
+            {
+                Name = Marshal.PtrToStringAnsi(stringPtr);
+                Interop.Libc.Free(stringPtr);
+            }
+
+            ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceTypeKey, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Type = Marshal.PtrToStringAnsi(stringPtr);
+                Interop.Libc.Free(stringPtr);
+            }
+
+            Log.Debug(ErrorFactory.LogTag, "Device ID ,Name, and Type:[" + Id +"," + Name +"," + Type +"]");
+
+            Interop.Internal.ConvDevice.ConvServiceForeachCallback cb = (IntPtr serviceHandle, IntPtr userData) =>
+            {
+                    _services.Add(InternalService.GetService(serviceHandle));
+            };
+
+            ret = Interop.Internal.ConvDevice.ForeachService(_deviceHandle, cb, IntPtr.Zero);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to get device services");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// The dispose method
+        /// </summary>
+        public void Dispose()
+        {
+            _deviceHandle.Dispose();
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs
new file mode 100755 (executable)
index 0000000..aea5f89
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using Tizen;
+using System.Threading;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// DeviceFinder provides API to find all nearby Tizen D2D convergence compliant devices
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalDeviceFinder : IDisposable
+    {
+        internal Interop.Internal.ConvManagerHandle _convManagerHandle;
+
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        public InternalDeviceFinder()
+        {
+            int ret = Interop.Internal.ConvManager.ConvCreate(out _convManagerHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create conv manager handle");
+                throw ErrorFactory.GetException(ret);
+            }
+
+        }
+
+        /// <summary>
+        /// DeviceFound event is triggered when a device is found during discovery procedure
+        /// </summary>
+        public event EventHandler<InternalDeviceFoundEventArgs> DeviceFound;
+
+        /// <summary>
+        /// Starts the discovery of nearby devices
+        /// </summary>
+        /// <param name="timeOut">Seconds for discovery timeout. 0 will use default timeout value</param>
+        /// <param name="cancellationToken">Cancellation token required to cancel the current discovery</param>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the request is not supported as per Tizen D2D convergence specification </exception>
+        /// <seealso cref="DeviceFound"> Devices found are delivered through this event</seealso>
+        /// <returns>Task with discovery result</returns>
+        public async Task StartFindingAsync(int timeOut, CancellationToken cancellationToken = default(CancellationToken))
+        {
+            var task = new TaskCompletionSource<bool>();
+            Interop.Internal.ConvManager.ConvDiscoveryCallback discoveredCb = (IntPtr deviceHandle, Interop.Internal.ConvDiscoveryResult result, IntPtr userData) =>
+            {
+                Log.Debug(ErrorFactory.LogTag, "discovery callback called with result:[" + result + "]");
+                switch (result)
+                {
+                    case Interop.Internal.ConvDiscoveryResult.Success:
+                        {
+                            InternalDevice device = new InternalDevice(deviceHandle);
+                            InternalDeviceFoundEventArgs deviceFoundEventArgs = new InternalDeviceFoundEventArgs()
+                            {
+                                Device = device
+                            };
+                            DeviceFound?.Invoke(this, deviceFoundEventArgs);
+                            break;
+                        }
+                    case Interop.Internal.ConvDiscoveryResult.Error:
+                        {
+                            task.TrySetException(new InvalidOperationException("Discovery error occured"));
+                            break;
+                        }
+                    case Interop.Internal.ConvDiscoveryResult.Lost:
+                        {
+                            task.TrySetException(new InvalidOperationException("Discovery Lost"));
+                            break;
+                        }
+                    case Interop.Internal.ConvDiscoveryResult.Finished:
+                        {
+                            Log.Debug(ErrorFactory.LogTag, "discovery process finished");
+                            task.TrySetResult(true);
+                            break;
+                        }
+                }
+            };
+            int ret = Interop.Internal.ConvManager.ConvDiscoveryStart(_convManagerHandle, timeOut, discoveredCb, IntPtr.Zero);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to start finding devices");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            if (cancellationToken != CancellationToken.None)
+            {
+                cancellationToken.Register(() =>
+                {
+                    int error = Interop.Internal.ConvManager.ConvDiscoveryStop(_convManagerHandle);
+                    if (error != (int)ConvErrorCode.None)
+                    {
+                        Log.Error(ErrorFactory.LogTag, "Failed to stop finding devices" + Internals.Errors.ErrorFacts.GetErrorMessage(error));
+                        throw ErrorFactory.GetException(error);
+                    }
+                    task.TrySetCanceled();
+                });
+            }
+            await task.Task;
+        }
+
+        /// <summary>
+        /// The dispose method
+        /// </summary>
+        public void Dispose()
+        {
+            _convManagerHandle.Dispose();
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs
new file mode 100755 (executable)
index 0000000..60c3df0
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// Contains arguments for the event DeviceFound.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalDeviceFoundEventArgs : EventArgs
+    {
+        internal InternalDeviceFoundEventArgs() { }
+
+        /// <summary>
+        /// The device found
+        /// </summary>
+        public InternalDevice Device { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs
new file mode 100755 (executable)
index 0000000..8954997
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace Tizen.Convergence
+{
+    internal enum ConvErrorCode
+    {
+        None = ErrorCode.None,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        InvalidOperation = ErrorCode.InvalidOperation,
+        NoData = ErrorCode.NoData,
+        NotSupported = ErrorCode.NotSupported,
+        PermissionDenied = ErrorCode.PermissionDenied,
+    }
+
+    internal class ErrorFactory
+    {
+        internal static string LogTag = "Tizen.Convergence";
+
+        internal static Exception GetException(int error)
+        {
+            if ((ConvErrorCode)error == ConvErrorCode.OutOfMemory)
+            {
+                return new OutOfMemoryException("Out of memory");
+            }
+            else if ((ConvErrorCode)error == ConvErrorCode.InvalidParameter)
+            {
+                return new ArgumentException("Invalid parameter");
+            }
+            else if ((ConvErrorCode)error == ConvErrorCode.InvalidOperation)
+            {
+                return new InvalidOperationException("Invalid operation");
+            }
+            else if ((ConvErrorCode)error == ConvErrorCode.NotSupported)
+            {
+                return new NotSupportedException("Unsupported feature http://tizen.org/feature/convergence.d2d");
+            }
+            else if ((ConvErrorCode)error == ConvErrorCode.PermissionDenied)
+            {
+                return new UnauthorizedAccessException("Permission denied. (http://tizen.org/privilege/internet, http://tizen.org/privilege/bluetooth, http://tizen.org/privilege/d2d.datasharing)");
+            }
+            else if ((ConvErrorCode)error == ConvErrorCode.NoData)
+            {
+                return new InvalidOperationException("The payload is empty");
+            }
+            else
+            {
+                return new Exception("Unknown error");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs
new file mode 100755 (executable)
index 0000000..d5df0a8
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// Represents a payload used in Tizen D2D convergence
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalPayload : IDisposable
+    {
+        internal Interop.Internal.ConvPayloadHandle _payloadHandle;
+
+        /// <summary>
+        /// The constructor
+        /// </summary>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        public InternalPayload()
+        {
+            int ret = Interop.Internal.ConvPayload.Create(out _payloadHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create payload");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        internal InternalPayload(IntPtr payloadHandle)
+        {
+            _payloadHandle = new Interop.Internal.ConvPayloadHandle(payloadHandle, false);
+        }
+
+        /// <summary>
+        /// Adds a key-value pair to payload
+        /// </summary>
+        /// <param name="key">The key of the attribute</param>
+        /// <param name="value">The value of the attribute</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if the arguments passed are null </exception>
+        public void Set(string key, string value)
+        {
+            if(key == null || value == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            int ret = 0;
+            if (value is string)
+            {
+                ret = Interop.Internal.ConvPayload.SetString(_payloadHandle, key, value);
+                if (ret != (int)ConvErrorCode.None)
+                {
+                    Log.Error(ErrorFactory.LogTag, "Failed to add string to payload");
+                    throw ErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Adds a key-value pair to payload
+        /// </summary>
+        /// <param name="key">The key of the attribute</param>
+        /// <param name="value">The value of the attribute</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if the arguments passed are null </exception>
+        public void Set(string key, byte[] value)
+        {
+            if (key == null || value == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            int ret = 0;
+            ret = Interop.Internal.ConvPayload.SetByte(_payloadHandle, key, value.Length, value);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to add string to payload");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+
+        /// <summary>
+        /// Sets binary to payload.
+        /// </summary>
+        /// <param name="value">The binary to set</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if the arguments passed are null </exception>
+        public void Set(byte[] value)
+        {
+            if (value == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            int ret = 0;
+            ret = Interop.Internal.ConvPayload.SetBinary(_payloadHandle, value.Length, value);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to add binary to payload");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Gets the value of the key from payload
+        /// </summary>
+        /// <param name="key">The key of the attribute</param>
+        /// <param name="value">The value of the attribute</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if the arguments passed are null </exception>
+        /// <exception cref="ArgumentException">Thrown if the key is not found </exception>
+        public void Get(string key, out string value)
+        {
+            if (key == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            IntPtr stringPtr = IntPtr.Zero;
+            int ret = 0;
+            ret = Interop.Internal.ConvPayload.GetString(_payloadHandle, key, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to add string to payload");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            value = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+        }
+
+        /// <summary>
+        /// Gets the value of the key from payload
+        /// </summary>
+        /// <param name="key">The key of the attribute</param>
+        /// <param name="value">The value of the attribute</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if the arguments passed are null </exception>
+        /// <exception cref="ArgumentException">Thrown if the key is not found </exception>
+        public void Get(string key, out byte[] value)
+        {
+            if (key == null)
+            {
+                throw new ArgumentNullException();
+            }
+
+            int ret = 0;
+            IntPtr byteArrayPtr;
+            int byteArraySize;
+            ret = Interop.Internal.ConvPayload.GetByte(_payloadHandle, key, out byteArraySize, out byteArrayPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to add string to payload");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            byte[] byteArray = new byte[byteArraySize];
+            Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize);
+            value = byteArray;
+            Interop.Libc.Free(byteArrayPtr);
+        }
+
+        /// <summary>
+        /// Gets binary from payload
+        /// </summary>
+        /// <param name="value">The result value</param>
+        /// <feature>http://tizen.org/feature/convergence.d2d</feature>
+        /// <exception cref="NotSupportedException">Thrown if the required feature is not supported.</exception>
+        public void Get(out byte[] value)
+        {
+            int ret = 0;
+            IntPtr byteArrayPtr;
+            int byteArraySize;
+            ret = Interop.Internal.ConvPayload.GetBinary(_payloadHandle, out byteArraySize, out byteArrayPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to get binary from payload");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            byte[] byteArray = new byte[byteArraySize];
+            Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize);
+            value = byteArray;
+            Interop.Libc.Free(byteArrayPtr);
+        }
+
+        /// <summary>
+        /// The dispose method
+        /// </summary>
+        public void Dispose()
+        {
+            _payloadHandle.Dispose();
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalService.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalService.cs
new file mode 100755 (executable)
index 0000000..6740231
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// The class abstracts the features provided by Tizen D2D Convergence.
+    /// </summary>
+    /// <seealso cref="AppCommunicationService"/>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public abstract class InternalService : IDisposable
+    {
+        internal Interop.Internal.ConvServiceHandle _serviceHandle;
+        internal const string ServiceIdKey = "service_id";
+        internal const string ServiceVersionKey = "service_version";
+
+        private event EventHandler<InternalServiceEventOccuredEventArgs> _serviceEventOccured;
+
+        internal InternalService(Interop.Internal.ServiceType type)
+        {
+            int ret = Interop.Internal.ConvService.Create(out _serviceHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create service handle");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.Internal.ConvService.SetType(_serviceHandle, (int)type);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to create service handle");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        internal InternalService(IntPtr existingServiceHandle)
+        {
+            int ret = Interop.Internal.ConvService.Clone(existingServiceHandle, out _serviceHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to clone device");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            IntPtr stringPtr = IntPtr.Zero;
+            ret = Interop.Internal.ConvService.GetPropertyString(_serviceHandle, ServiceIdKey, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to get service Id");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            Id = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+
+            ret = Interop.Internal.ConvService.GetPropertyString(_serviceHandle, ServiceVersionKey, out stringPtr);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to get service version");
+                throw ErrorFactory.GetException(ret);
+            }
+
+            Version = Marshal.PtrToStringAnsi(stringPtr);
+            Interop.Libc.Free(stringPtr);
+        }
+
+        /// <summary>
+        /// The ID of the service
+        /// </summary>
+        public string Id { get; }
+
+        /// <summary>
+        /// The Version of the service
+        /// </summary>
+        public string Version { get; }
+
+        /// <summary>
+        /// The event handler for Service Events(Start/Publish/Read/Stop)
+        /// </summary>
+        public event EventHandler<InternalServiceEventOccuredEventArgs> ServiceEventOccurred
+        {
+            add
+            {
+                if (_serviceEventOccured == null)
+                {
+                    RegisterServiceEventListener();
+                }
+                _serviceEventOccured += value;
+            }
+            remove
+            {
+                _serviceEventOccured -= value;
+                if (_serviceEventOccured == null)
+                {
+                    UnregisterServiceEventListener();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The event handler for service error events
+        /// </summary>
+        public event EventHandler<InternalServiceErrorOccuredEventArgs> ServiceErrorOccured;
+
+        /// <summary>
+        /// The dispose method
+        /// </summary>
+        public void Dispose()
+        {
+            _serviceHandle.Dispose();
+        }
+
+        internal static InternalService GetService(IntPtr serviceHandle)
+        {
+            InternalService service = null;
+            int serviceType;
+            int ret = Interop.Internal.ConvService.GetType(serviceHandle, out serviceType);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to get service version");
+                throw ErrorFactory.GetException(ret);
+            }
+            if (serviceType == (int)Interop.Internal.ServiceType.AppCommunication)
+            {
+                service = new InternalAppCommunicationService(serviceHandle);
+            }
+
+            return service;
+        }
+
+        private void RegisterServiceEventListener()
+        {
+            int ret = Interop.Internal.ConvService.SetListenerCb(_serviceHandle, serviceEventsCb, IntPtr.Zero);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to set listener for service events");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        private void UnregisterServiceEventListener()
+        {
+            int ret = Interop.Internal.ConvService.UnsetListenerCb(_serviceHandle);
+            if (ret != (int)ConvErrorCode.None)
+            {
+                Log.Error(ErrorFactory.LogTag, "Failed to unset listener for service events");
+                throw ErrorFactory.GetException(ret);
+            }
+        }
+
+        private void serviceEventsCb(IntPtr serviceHandle, IntPtr channelHandle, int error, IntPtr resultPayloadHandle, IntPtr userData)
+        {
+            Log.Debug(ErrorFactory.LogTag, "service event occured. error code :[" + error + "]");
+
+            if (error == (int)ConvErrorCode.None)
+            {
+                var channel = (channelHandle == IntPtr.Zero) ? null : new InternalChannel(channelHandle);
+                var payload = (resultPayloadHandle == IntPtr.Zero) ? null : new InternalPayload(resultPayloadHandle);
+                _serviceEventOccured?.Invoke(this, new InternalServiceEventOccuredEventArgs()
+                {
+                    Payload = payload,
+                    Channel = channel
+                });
+            }
+            else
+            {
+                var eventArgs = new InternalServiceErrorOccuredEventArgs()
+                {
+                    Exception = ErrorFactory.GetException(error)
+                };
+                ServiceErrorOccured?.Invoke(this, eventArgs);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs
new file mode 100755 (executable)
index 0000000..104a05b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// Contains arguments for the event ServiceErrorOccured.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalServiceErrorOccuredEventArgs : EventArgs
+    {
+        internal InternalServiceErrorOccuredEventArgs() { }
+
+        /// <summary>
+        /// The exception
+        /// </summary>
+        public Exception Exception { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs
new file mode 100755 (executable)
index 0000000..e07c9e3
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.ComponentModel;
+
+namespace Tizen.Convergence
+{
+    /// <summary>
+    /// Contains arguments for ServiceEventOccured
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalServiceEventOccuredEventArgs : EventArgs
+    {
+        internal InternalServiceEventOccuredEventArgs() { }
+
+        /// <summary>
+        /// The channel on which the event occured
+        /// </summary>
+        public InternalChannel Channel { get; internal set; }
+
+        /// <summary>
+        /// The payload containing the result
+        /// </summary>
+        public InternalPayload Payload { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs b/src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..40b8453
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        internal const string Geofence = "libcapi-geofence-manager.so.0";
+        internal const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Interop/Interop.Location.cs b/src/Tizen.Location.Geofence/Interop/Interop.Location.cs
new file mode 100755 (executable)
index 0000000..89eed6a
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Location.Geofence;
+
+internal static partial class Interop
+{
+    internal static partial class Geofence
+    {
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_geopoint")]
+        internal static extern int CreateGPSFence(int placeId, double latitude, double longitude, int radius, string address, out IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_bluetooth")]
+        internal static extern int CreateBTFence(int placeId, string bssid, string ssid, out IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_wifi")]
+        internal static extern int CreateWiFiFence(int placeId, string bssid, string ssid, out IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_destroy")]
+        internal static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_type")]
+        internal static extern int FenceType(IntPtr handle, out FenceType type);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_place_id")]
+        internal static extern int FencePlaceID(IntPtr handle, out int placeId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_latitude")]
+        internal static extern int FenceLatitude(IntPtr handle, out double latitude);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_longitude")]
+        internal static extern int FenceLongitude(IntPtr handle, out double longitude);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_radius")]
+        internal static extern int FenceRadius(IntPtr handle, out int radius);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_address")]
+        internal static extern int FenceAddress(IntPtr handle, out string address);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_bssid")]
+        internal static extern int FenceBSSID(IntPtr handle, out string bssid);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_ssid")]
+        internal static extern int FenceSSID(IntPtr handle, out string ssid);
+    }
+
+    internal static partial class GeofenceStatus
+    {
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_create")]
+        internal static extern int Create(int fenceId, out IntPtr statusHandle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_destroy")]
+        internal static extern int Destroy(IntPtr statusHandle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_get_state")]
+        internal static extern int State(IntPtr statusHandle, out GeofenceState state);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_get_duration")]
+        internal static extern int Duration(IntPtr statusHandle, out int seconds);
+    }
+
+    internal static partial class GeofenceManager
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool StateChangedCallback(int fenceId, GeofenceState state, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool ProximityStateChangedCallback(int fenceId, ProximityState state, ProximityProvider provider, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool GeofenceEventCallback(int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_is_supported")]
+        internal static extern int IsSupported(out bool supported);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_create")]
+        internal static extern int Create(out IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_destroy")]
+        internal static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_start")]
+        internal static extern int Start(IntPtr handle, int fenceId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_stop")]
+        internal static extern int Stop(IntPtr handle, int fenceId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_state_changed_cb")]
+        internal static extern int SetStateChangedCB(IntPtr handle, StateChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_state_changed_cb")]
+        internal static extern int UnsetStateChangedCB(IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_proximity_state_changed_cb")]
+        internal static extern int SetProximityStateCB(IntPtr handle, ProximityStateChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_proximity_state_changed_cb")]
+        internal static extern int UnsetProximityStateCB(IntPtr handle);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_event_cb")]
+        internal static extern int SetGeofenceEventCB(IntPtr handle, GeofenceEventCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_event_cb")]
+        internal static extern int UnsetGeofenceEventCB(IntPtr handle);
+    }
+
+    internal static partial class VirtualPerimeter
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool ForEachPlaceListCallback(int placeId, string placeName, int placeIndex, int placeCount, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool ForEachFenceListCallback(int fenceId, IntPtr fenceHandle, int placeIndex, int placeCount, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_add_place")]
+        internal static extern int AddPlace(IntPtr handle, string placeName, out int placeId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_update_place")]
+        internal static extern int UpdatePlace(IntPtr handle, int placeId, string placeName);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_remove_place")]
+        internal static extern int RemovePlace(IntPtr handle, int placeId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_add_fence")]
+        internal static extern int AddFence(IntPtr handle, IntPtr fenceHandle, out int fenceId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_remove_fence")]
+        internal static extern int RemoveFence(IntPtr handle, int fenceId);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_geofence_list")]
+        internal static extern int GetForEachFenceList(IntPtr handle, ForEachFenceListCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_place_geofence_list")]
+        internal static extern int GetForEachPlaceFenceList(IntPtr handle, int placeId, ForEachFenceListCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_place_list")]
+        internal static extern int GetForEachPlaceList(IntPtr handle, ForEachPlaceListCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_get_place_name")]
+        internal static extern int GetPlaceName(IntPtr handle, int placeId, out string placeName);
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj b/src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj
new file mode 100644 (file)
index 0000000..a7c8b7f
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.5</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Geofence management APIs for Tizen.Location</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+  
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Location.Geofence.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+  
+</Project>
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.snk b/src/Tizen.Location.Geofence/Tizen.Location.Geofence.snk
new file mode 100644 (file)
index 0000000..cd1b1ad
Binary files /dev/null and b/src/Tizen.Location.Geofence/Tizen.Location.Geofence.snk differ
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs
new file mode 100755 (executable)
index 0000000..d22b94a
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Geo-fence defines a virtual perimeter for a real-world geographic area.
+    /// If you create a geofence, you can trigger some activities when a device enters(or exits) the geofences defined by you.
+    /// You can create a geofence with the information of Geopoint, Wi-Fi, or BT.
+    /// <list>
+    /// <item>Geopoint: Geofence is specified by coordinates (Latitude and Longitude) and Radius</item>
+    /// <item>WIFI: Geofence is specified by BSSID of Wi-Fi access point</item>
+    /// <item>BT: Geofence is specified by Bluetooth address</item>
+    /// </list>
+    /// Basic service set identification(BSSID) The BSSID is the MAC address of the wireless access point(WAP) generated by combining the 24 bit Organization Unique Identifier(the manufacturer's identity)
+    /// and the manufacturer's assigned 24-bit identifier for the radio chipset in the WAP.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class Fence : IDisposable
+    {
+        private bool _disposed = false;
+
+        internal IntPtr Handle
+        {
+            get;
+            set;
+        }
+
+        internal Fence(IntPtr handle)
+        {
+            Handle = handle;
+        }
+
+        ~Fence()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets the type of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public FenceType Type
+        {
+            get
+            {
+                FenceType val;
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceType(Handle, out val);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get GeofenceType");
+                }
+
+                return val;
+            }
+        }
+
+        /// <summary>
+        /// Gets the id of place.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int PlaceId
+        {
+            get
+            {
+                int result = -1;
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FencePlaceID(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get PlaceId");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Gets the longitude of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Longitude
+        {
+            get
+            {
+                double result = -1;
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceLongitude(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Longitude");
+                }
+
+                return result;
+
+            }
+        }
+
+        /// <summary>
+        /// Gets the latitude of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Latitude
+        {
+            get
+            {
+                double result = -1;
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceLatitude(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Latitude");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Gets the radius of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int Radius
+        {
+            get
+            {
+                int result = -1;
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceRadius(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Radius");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Gets the address of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public string Address
+        {
+            get
+            {
+                string result = "";
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceAddress(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Adress");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Gets the bssid of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public string Bssid
+        {
+            get
+            {
+                string result = "";
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceBSSID(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Bssid");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Gets the ssid of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public string Ssid
+        {
+            get
+            {
+                string result = "";
+                GeofenceError ret = (GeofenceError)Interop.Geofence.FenceSSID(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Ssid");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Creates a geopoint type of new geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The current place id.</param>
+        /// <param name="latitude">Specifies the value of latitude of geofence [-90.0 ~ 90.0] (degrees).</param>
+        /// <param name="longitude">Specifies the value of longitude of geofence [-180.0 ~ 180.0] (degrees).</param>
+        /// <param name="radius">Specifies the value of radius of geofence [100 ~ 500](meter).</param>
+        /// <param name="address">Specifies the value of address.</param>
+        /// <returns>Newly created geofence instance.</returns>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public static Fence CreateGPSFence(int placeId, int latitude, int longitude, int radius, string address)
+        {
+            IntPtr handle = IntPtr.Zero;
+            GeofenceError ret = (GeofenceError)Interop.Geofence.CreateGPSFence(placeId, latitude, longitude, radius,address, out handle);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from GPS Data for " + placeId);
+            }
+
+            return new Fence(handle);
+        }
+
+        /// <summary>
+        /// Creates a Wi-Fi type of new geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The current place id.</param>
+        /// <param name="bssid">Specifies the value of BSSID of Wi-Fi MAC address.</param>
+        /// <param name="ssid"> Specifies the value of SSID of Wi-Fi Device.</param>
+        /// <returns>Newly created geofence instance.</returns>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public static Fence CreateWifiFence(int placeId, string bssid, string ssid)
+        {
+            IntPtr handle = IntPtr.Zero;
+            GeofenceError ret = (GeofenceError)Interop.Geofence.CreateWiFiFence(placeId, bssid, ssid, out handle);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from Wifi Data for " + placeId);
+            }
+
+            return new Fence(handle);
+        }
+
+        /// <summary>
+        /// Creates a bluetooth type of new geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The current place id.</param>
+        /// <param name="bssid">Specifies the value of BSSID of BT MAC address.</param>
+        /// <param name="ssid"> Specifies the value of SSID of BT Device.</param>
+        /// <returns>Newly created geofence instance.</returns>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public static Fence CreateBTFence(int placeId, string bssid, string ssid)
+        {
+            IntPtr handle = IntPtr.Zero;
+            GeofenceError ret = (GeofenceError)Interop.Geofence.CreateBTFence(placeId, bssid, ssid, out handle);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from Bluetooth Data for " + placeId);
+            }
+
+            return new Fence(handle);
+        }
+
+        /// <summary>
+        /// Overloaded Dispose API for destroying the fence Handle.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (Handle != IntPtr.Zero)
+            {
+                Interop.Geofence.Destroy(Handle);
+                Handle = IntPtr.Zero;
+            }
+
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs
new file mode 100755 (executable)
index 0000000..cfda8cf
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Represents the Geofence list Item data.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class FenceData
+    {
+        internal FenceData(int fenceId, IntPtr handle, int index, int count)
+        {
+            GeofenceId = fenceId;
+            Fence = new Fence(handle);
+            Index = index;
+            Count = count;
+        }
+        /// <summary>
+        /// Geofence instance.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Fence Fence
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The geofence id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int GeofenceId
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The index number of the fences in the list.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <value>Index value starts from 1.</value>
+        public int Index
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The total number of fences that exists for the requester.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int Count
+        {
+            get;
+            internal set;
+        }
+    };
+
+    /// <summary>
+    /// Represents the Place list Item data.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class PlaceData
+    {
+        internal PlaceData(int id, string name, int index, int count)
+        {
+            PlaceId = id;
+            Name = name;
+            Index = index;
+            Count = count;
+        }
+        /// <summary>
+        /// The current place id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int PlaceId
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The current place name.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public string Name
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The index number of the places in the list.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <value>Index value starts from 1.</value>
+        public int Index
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// The total number of places that exists for the requester.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int Count
+        {
+            get;
+            internal set;
+        }
+    };
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs
new file mode 100644 (file)
index 0000000..46e5e66
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// The geofence status describes the current state and duration of a geofence.
+    /// <list>
+    /// <item>State: State is specified by current state of fence</item>
+    /// <item>Duration: Geofence is specified by duration of current state</item>
+    /// </list>
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class FenceStatus : IDisposable
+    {
+        private bool _disposed = false;
+
+        internal IntPtr Handle
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Creates a new geofence status.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public FenceStatus(int fenceId)
+        {
+            IntPtr handle;
+            GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.Create(fenceId, out handle);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence Status instance");
+            }
+
+            Handle = handle;
+        }
+
+        ~FenceStatus()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets the state of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public GeofenceState State
+        {
+            get
+            {
+                GeofenceState state;
+                GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.State(Handle, out state);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get FenceState");
+                }
+
+                return state;
+            }
+        }
+
+        /// <summary>
+        /// Gets the amount of seconds geofence is in the current state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public int Duration
+        {
+            get
+            {
+                int result = -1;
+                GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.Duration(Handle, out result);
+                if (ret != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get FenceDuration");
+                }
+
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Overloaded Dispose API for destroying the fence Handle.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (Handle != IntPtr.Zero)
+            {
+                Interop.GeofenceStatus.Destroy(Handle);
+                Handle = IntPtr.Zero;
+            }
+
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs
new file mode 100755 (executable)
index 0000000..b5be383
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Enumeration for geofence type.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum FenceType
+    {
+        /// <summary>
+        /// Geofence is specified by geospatial coordinate.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        GeoPoint = 1,
+
+        /// <summary>
+        /// Geofence is specified by Wi-Fi access point.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Wifi,
+
+        /// <summary>
+        /// Geofence is specified by Bluetooth device.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Bluetooth
+    };
+
+    /// <summary>
+    /// Enumerations for the state of geofence.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum GeofenceState
+    {
+        /// <summary>
+        /// Uncertain state of geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Uncertain = 0,
+
+        /// <summary>
+        /// Geofence In state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        In,
+
+        /// <summary>
+        /// Geofence Out state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Out
+    };
+
+    /// <summary>
+    /// Enumerations for geofence management events.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum GeofenceEventType
+    {
+        /// <summary>
+        /// Geofence is added.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        FenceAdded = 0,
+
+        /// <summary>
+        /// Geofence is removed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        FenceRemoved,
+
+        /// <summary>
+        /// Geofencing is started.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        FenceStarted,
+
+        /// <summary>
+        /// Geofencing is stopped.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        FenceStopped,
+
+        /// <summary>
+        /// Place is added.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        PlaceAdded = 0x10,
+
+        /// <summary>
+        /// Place is removed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        PlaceRemoved,
+
+        /// <summary>
+        /// Place is updated.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        PlaceUpdated,
+
+        /// <summary>
+        /// Setting for geofencing is enabled.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        SettingEnabled = 0x20,
+
+        /// <summary>
+        /// Setting for geofencing is disabled.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        SettingDisabled
+    };
+
+    /// <summary>
+    /// Enumeration for the provider of proximity.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum ProximityProvider
+    {
+        /// <summary>
+        /// Proximity is specified by geospatial coordinate.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Location = 0,
+
+        /// <summary>
+        /// Proximity is specified by Wi-Fi access point.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Wifi,
+
+        /// <summary>
+        /// Proximity is specified by Bluetooth device.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Bluetooth,
+
+        /// <summary>
+        /// Proximity is specified by Bluetooth low energy device.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        BLE,
+
+        /// <summary>
+        /// Proximity is specified by Sensor.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Sensor
+    }
+
+    /// <summary>
+    /// Enumeration for the state of proximity.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum ProximityState
+    {
+        /// <summary>
+        /// Uncertain state of proximity.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Uncertain = 0,
+
+        /// <summary>
+        /// Far state of proximity.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Far,
+
+        /// <summary>
+        /// Far state of proximity.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Near,
+
+        /// <summary>
+        /// Immediate state of proximity.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Immediate
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs
new file mode 100755 (executable)
index 0000000..e9fc3ad
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen;
+
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Enum to give the type of error occured, if any.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum GeofenceError
+    {
+        /// <summary>
+        /// Successful.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        None = Tizen.Internals.Errors.ErrorCode.None,
+
+        /// <summary>
+        /// Out of memory.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+
+        /// <summary>
+        /// Invalid parameter.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+
+        /// <summary>
+        /// Permission denied.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+
+        /// <summary>
+        /// Not Supported.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
+
+        /// <summary>
+        /// Geofence Manager is not initialized.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        NotInitialized = -0x02C00000 | 0x100 | 0x01,
+
+        /// <summary>
+        /// Invalid geofence ID.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        InvalidID = -0x02C00000 | 0x100 | 0x02,
+
+        /// <summary>
+        /// Exception occurs.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        Exception = -0x02C00000 | 0x100 | 0x03,
+
+        /// <summary>
+        /// Geofencing is already started.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        AlreadyStarted = -0x02C00000 | 0x100 | 0x04,
+
+        /// <summary>
+        /// Too many geofence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        TooManyGeofence = -0x02C00000 | 0x100 | 0x05,
+
+        /// <summary>
+        /// Error in GPS, Wi-Fi, or BT.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        IPC = -0x02C00000 | 0x100 | 0x06,
+
+        /// <summary>
+        /// DB error in the server side.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        DBFailed = -0x02C00000 | 0x100 | 0x07,
+
+        /// <summary>
+        /// Access to specified place is denied.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        PlaceAccessDenied = -0x02C00000 | 0x100 | 0x08,
+
+        /// <summary>
+        /// Access to specified geofence is denied.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        GeofenceAccessDenied = -0x02C00000 | 0x100 | 0x09
+    };
+
+    internal class GeofenceErrorFactory
+    {
+        internal const string LogTag = "Tizen.Location.Geofence";
+
+        internal static Exception CreateException(GeofenceError err, string msg)
+        {
+            Log.Info(LogTag, "Got Error " + err + " throwing Exception with msg " + msg);
+            Exception exp;
+            switch (err)
+            {
+                case GeofenceError.InvalidParameter:
+                    {
+                        exp = new ArgumentException(msg + " Invalid Parameters Provided");
+                        break;
+                    }
+
+                case GeofenceError.OutOfMemory:
+                    {
+                        exp = new OutOfMemoryException(msg + " Out Of Memory");
+                        break;
+                    }
+
+                case GeofenceError.NotInitialized:
+                    {
+                        exp = new InvalidOperationException(msg + " Not initializded");
+                        break;
+                    }
+
+                case GeofenceError.NotSupported:
+                    {
+                        exp = new NotSupportedException(msg + " Not supported");
+                        break;
+                    }
+
+                case GeofenceError.PermissionDenied:
+                // fall through
+                case GeofenceError.GeofenceAccessDenied:
+                //fall through
+                case GeofenceError.PlaceAccessDenied:
+                    {
+                        exp = new UnauthorizedAccessException(msg + " Permission Denied");
+                        break;
+                    }
+
+                case GeofenceError.DBFailed:
+                    {
+                        exp = new InvalidOperationException(msg + " DataBase Failed");
+                        break;
+                    }
+
+                default:
+                    {
+                        exp = new InvalidOperationException(msg);
+                        break;
+                    }
+            }
+
+            return exp;
+        }
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs
new file mode 100755 (executable)
index 0000000..f5ef780
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Event arguments passed when Event is triggered to notify proximity state change.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class ProximityStateEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Internal constructor.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="id">The geofence id.</param>
+        /// <param name="state">The proximity state.</param>
+        /// <param name="provider">The proximity provider.</param>
+        internal ProximityStateEventArgs(int id, ProximityState state, ProximityProvider provider)
+        {
+            GeofenceId = id;
+            State = state;
+            Provider = provider;
+        }
+
+        /// <summary>
+        /// The geofence id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int GeofenceId
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The proximity state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public ProximityState State
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The proximity provider.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public ProximityProvider Provider
+        {
+            get;
+        }
+    };
+
+    /// <summary>
+    /// Event arguments passed when Event is triggered to notify Geofence state change.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class GeofenceStateEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Internal constructor.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="fenceId">The specified geofence id.</param>
+        /// <param name="state">The geofence state.</param>
+        internal GeofenceStateEventArgs(int fenceId, GeofenceState state)
+        {
+            GeofenceId = fenceId;
+            State = state;
+        }
+
+        /// <summary>
+        /// The specified geofence id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int GeofenceId
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The geofence state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public GeofenceState State
+        {
+            get;
+        }
+    }
+
+    /// <summary>
+    /// Event arguments passed when Event occurs in geofence and place such as add, update, etc..
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class GeofenceResponseEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Internal constructor.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The place id.</param>
+        /// <param name="fenceId">The specified geofence id.</param>
+        /// <param name="error">The error code for the particular action.</param>
+        /// <param name="eventType">The result code for the particular place and geofence management.</param>
+        internal GeofenceResponseEventArgs(int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType)
+        {
+            PlaceId = placeId;
+            FenceId = fenceId;
+            ErrorCode = error;
+            EventType = eventType;
+        }
+
+        /// <summary>
+        /// The place id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int PlaceId
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The specified geofence id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public int FenceId
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The error code for the particular action.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public GeofenceError ErrorCode
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The result code for the particular place and geofence management.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public GeofenceEventType EventType
+        {
+            get;
+        }
+    };
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs
new file mode 100755 (executable)
index 0000000..ad69b02
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// This Geofence Manager API provides service related to geofence(geo-fence).
+    /// A geofence is a virtual perimeter for a real-world geographic area.
+    /// This API provides functions to set geofence with geopoint, MAC address of Wi-Fi and Bluetooth address.
+    /// And, notifications on events like changing in service status are provided.
+    /// There are two kinds of places and fences:
+    /// <list>
+    /// <item>Public places and fences that are created by MyPlace app can be used by all apps.</item>
+    /// <item>Private places and fences that are created by specified app can be used by the same app.</item>
+    /// </list>
+    /// Notifications can be received about the following events:
+    /// <list>
+    /// <item>Zone in when a device enters a specific area</item>
+    /// <item>Zone out when a device exits a specific area</item>
+    /// <item>Results and errors for each event requested to geofence module</item>
+    /// </list>
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class GeofenceManager : IDisposable
+    {
+        private bool _disposed = false;
+
+        internal IntPtr Handle
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Creates a new geofence manager.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="OutOfMemoryException">Incase of OutOfMemory condition.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public GeofenceManager()
+        {
+            IntPtr handle;
+            GeofenceError ret = (GeofenceError) Interop.GeofenceManager.Create(out handle);
+            if(ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence Manager instance");
+            }
+
+            Handle = handle;
+        }
+
+        ~GeofenceManager()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Checks whether the geofence manager is available or not.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public static bool IsSupported
+        {
+            get
+            {
+                bool ret = false;
+                GeofenceError res= (GeofenceError)Interop.GeofenceManager.IsSupported(out ret);
+                if(res != GeofenceError.None)
+                {
+                    Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get IsSupported feature for Geofence manager");
+                }
+
+                return ret;
+            }
+        }
+
+        /// <summary>
+        /// Starts the geofencing service.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="geofenceId">The specified geofence id.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <remarks>
+        /// When the location service is enabled, the StateChanged event is invoked and the service starts.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public void Start(int geofenceId)
+        {
+            GeofenceError ret = (GeofenceError)Interop.GeofenceManager.Start(Handle, geofenceId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to start service for "  + geofenceId);
+            }
+        }
+
+        /// <summary>
+        /// Stops the geofenceing service.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="geofenceId">The specified geofence id.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <remarks>
+        /// This function initiates the process of stopping the service.
+        /// You can stop and start the geofence manager as needed.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public void Stop(int geofenceId)
+        {
+            GeofenceError ret = (GeofenceError)Interop.GeofenceManager.Stop(Handle, geofenceId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to stop service for " + geofenceId);
+            }
+        }
+
+        private static readonly Interop.GeofenceManager.StateChangedCallback s_stateChangedCallback = (int fenceId, GeofenceState state, IntPtr data) =>
+         {
+             GeofenceStateEventArgs evenArgs = new GeofenceStateEventArgs(fenceId, state);
+             s_stateChanged?.Invoke(null, evenArgs);
+             return true;
+         };
+
+        private static event EventHandler<GeofenceStateEventArgs> s_stateChanged = null;
+
+        /// <summary>
+        /// Invokes when a device enters or exits the given geofence, If this event is registered.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <remarks>
+        /// Call to Start() will invoke this event.
+        /// </remarks>
+        /// <exception cref="NotSupportedException">Incase of feature Not supported.</exception>
+        public event EventHandler<GeofenceStateEventArgs> StateChanged
+        {
+            add
+            {
+                if(s_stateChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetStateChangedCB(Handle, s_stateChangedCallback, IntPtr.Zero);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to register state change callback");
+                    }
+                }
+                s_stateChanged += value;
+            }
+            remove
+            {
+                s_stateChanged -= value;
+                if (s_stateChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetStateChangedCB(Handle);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to unregister state change callback");
+                    }
+                }
+            }
+        }
+
+        private static readonly Interop.GeofenceManager.ProximityStateChangedCallback s_proximityChangedCallback = (int fenceId, ProximityState state, ProximityProvider provider, IntPtr data) =>
+        {
+            ProximityStateEventArgs evenArgs = new ProximityStateEventArgs(fenceId, state, provider);
+            s_proximityChanged?.Invoke(null, evenArgs);
+            return true;
+        };
+
+        private static event EventHandler<ProximityStateEventArgs> s_proximityChanged;
+
+        /// <summary>
+        /// Called when a proximity state of device is changed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <remarks>
+        /// Call to Start() will invoke this event.
+        /// </remarks>
+        /// <exception cref="NotSupportedException">Incase of feature Not supported.</exception>
+        public event EventHandler<ProximityStateEventArgs> ProximityChanged
+        {
+            add
+            {
+                if (s_proximityChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetProximityStateCB(Handle, s_proximityChangedCallback, IntPtr.Zero);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to register proximity change callback");
+                    }
+                    s_proximityChanged += value;
+                }
+            }
+            remove
+            {
+                s_proximityChanged -= value;
+                if (s_proximityChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetProximityStateCB(Handle);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to un register proximity change callback");
+                    }
+                }
+            }
+        }
+
+        private static readonly Interop.GeofenceManager.GeofenceEventCallback s_geofenceEventCallback = (int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType, IntPtr data) =>
+        {
+            GeofenceResponseEventArgs evenArgs = new GeofenceResponseEventArgs(placeId, fenceId, error, eventType);
+            s_geofenceEventChanged?.Invoke(null, evenArgs);
+            return true;
+        };
+
+        private static event EventHandler<GeofenceResponseEventArgs> s_geofenceEventChanged;
+
+        /// <summary>
+        /// Called when the some event occurs in geofence and place such as add, update, etc..
+        /// The events of public geofence is also received if there are public geofences.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <remarks>
+        /// Call to Start() will invoke this event.
+        /// The value of place_id or geofence_id is -1 when the place id or geofence id is not assigned.
+        /// </remarks>
+        /// <exception cref="NotSupportedException">Incase of feature Not supported.</exception>
+        public event EventHandler<GeofenceResponseEventArgs> GeofenceEventChanged
+        {
+            add
+            {
+                if (s_geofenceEventChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetGeofenceEventCB(Handle, s_geofenceEventCallback, IntPtr.Zero);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to register geofence event change callback");
+                    }
+                    s_geofenceEventChanged += value;
+                }
+            }
+            remove
+            {
+                s_geofenceEventChanged -= value;
+                if (s_geofenceEventChanged == null)
+                {
+                    GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetGeofenceEventCB(Handle);
+                    if (ret != GeofenceError.None)
+                    {
+                        throw GeofenceErrorFactory.CreateException(ret, "Failed to unregister geofence event change callback");
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Overloaded Dispose API for destroying the GeofenceManager Handle.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (Handle != IntPtr.Zero)
+            {
+                Interop.GeofenceManager.Destroy(Handle);
+                Handle = IntPtr.Zero;
+            }
+
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs
new file mode 100755 (executable)
index 0000000..440da97
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+<summary>
+The Tizen.Location.Geofence namespace provides classes for virtual perimeter.
+</summary>
+
+<remarks>
+<h2>Overview</h2>
+<para>
+This API provides functions to set geofence with geopoint, MAC address of Wi-Fi, and Bluetooth address.
+And notifications on events like changing in service status are provided.<p>
+There are two kinds of places and fences:<br/>
+- Public places and fences that are created by MyPlace app can be used by all apps.<br/>
+- Private places and fences that are created by specified app can be used by the same app.<p>
+Notifications can be received about the following events:<br/>
+- Zone in when a device enters a specific area<br/>
+- Zone out when a device exits a specific area<br/>
+- Results and errors for each event requested to geofence module<p>
+The Geofence manager has the following properties:<br/>
+- geofence type<br/>
+- status<br/>
+- 'Service state change' callback
+</para>
+
+<h2>Related Features</h2>
+<para>To guarantee that the Geofence application runs on a device with Geofence profile feature,
+declare the following feature requirements in the config file:<br/>
+http://tizen.org/feature/location<br/>
+http://tizen.org/feature/location.geofence<br/>
+http://tizen.org/feature/location.wps
+</para>
+</remarks>
+*/
+namespace Tizen.Location.Geofence {}
diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs
new file mode 100755 (executable)
index 0000000..0d5cffe
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Location.Geofence
+{
+    /// <summary>
+    /// Allows to create a virtual fence as Geofence using GeofenceManager instance.
+    /// User can manage all the geofence/place related data and events.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class VirtualPerimeter
+    {
+        private IntPtr Handle;
+
+        /// <summary>
+        /// Creates a VirtualPerimeter which can be used to create virtual fence.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="manager">GeofenceManager instance.</param>
+        /// <exception cref="ArgumentException"> Incase of invlid parameter.</exception>
+        public VirtualPerimeter(GeofenceManager manager)
+        {
+            if (manager == null)
+            {
+                throw GeofenceErrorFactory.CreateException(GeofenceError.InvalidParameter, "Invalid GeofenceManager instance");
+            }
+            else
+            {
+                Handle = manager.Handle;
+            }
+        }
+
+        /// <summary>
+        /// Creates a new place for geofencing service.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="name">A place name to be created.</param>
+        /// <returns>The place id to be newly created on success.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public int AddPlaceName(string name)
+        {
+            int placeId = 0;
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.AddPlace(Handle, name, out placeId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to add place to Geofence Manager for " + name);
+            }
+
+            return placeId;
+        }
+
+        /// <summary>
+        /// Updates the place name of a given place id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The specified place id.</param>
+        /// <param name="name">A new place name of the place id.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public void UpdatePlace(int placeId, string name)
+        {
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.UpdatePlace(Handle, placeId, name);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to update place to Geofence Manager for " + placeId);
+            }
+        }
+
+        /// <summary>
+        /// Removes the specific place for geofencing service.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The specified place id.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public void RemovePlace(int placeId)
+        {
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.RemovePlace(Handle, placeId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to remove place from Geofence Manager for " + placeId);
+            }
+        }
+
+        /// <summary>
+        /// Adds a geofence for a given geofence manager.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="fence">The Geofence instance to be added.</param>
+        /// <returns>The geofence id to be newly created on success.</returns>
+        /// <remarks> The retun value will always be a number greater than zero.</remarks>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public int AddGeofence(Fence fence)
+        {
+            int fenceId = 0;
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.AddFence(Handle, fence.Handle, out fenceId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to add fence to Geofence Manager ");
+            }
+
+            return fenceId;
+        }
+
+        /// <summary>
+        /// Removes a geofence with a given geofence id.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="fenceId">The specified geofence id.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public void RemoveGeofence(int fenceId)
+        {
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.RemoveFence(Handle, fenceId);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to remove geofence from Geofence Manager for " + fenceId);
+            }
+        }
+
+        /// <summary>
+        /// Gets the name of place.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId">The place id.</param>
+        /// <returns>The name of the place.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public string GetPlaceName(int placeId)
+        {
+            string name = "";
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetPlaceName(Handle, placeId, out name);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to get placenamefrom Geofence Manager for " + placeId);
+            }
+
+            return name;
+        }
+
+        /// <summary>
+        /// Retrieves a list of places registered in the specified geofence manager.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <returns>list of places registered as PlaceData instance list.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public IEnumerable<PlaceData> GetPlaceDataList()
+        {
+            List<PlaceData> places = new List<PlaceData>();
+            Interop.VirtualPerimeter.ForEachPlaceListCallback placeCallback = (int placeId, string name, int index, int count, IntPtr data) =>
+            {
+                if (count != 0)
+                {
+                    PlaceData place = new PlaceData(placeId, name, index, count);
+                    places.Add(place);
+                }
+                return true;
+            };
+
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachPlaceList(Handle, placeCallback, IntPtr.Zero);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to get Places list from Geofence Manager ");
+            }
+
+            return places;
+        }
+
+        /// <summary>
+        /// Retrieves a list of fences registered in the specified geofence manager.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <returns>list of FenceData instances registred for each Geofence.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public IEnumerable<FenceData> GetFenceDataList()
+        {
+            List<FenceData> fences = new List<FenceData>();
+            Interop.VirtualPerimeter.ForEachFenceListCallback callback = (int fenceId, IntPtr handle, int index, int count, IntPtr data) =>
+            {
+                if (count != 0)
+                {
+                    FenceData fence = new FenceData(fenceId, handle, index, count);
+                    fences.Add(fence);
+                }
+                return true;
+            };
+
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachFenceList(Handle, callback, IntPtr.Zero);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to get Geofence list from Geofence Manager ");
+            }
+
+            return fences;
+        }
+
+        /// <summary>
+        /// Retrieves a list of fences registered in the specified place.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="placeId"> The place id.</param>
+        /// <returns>list of FenceData instances registred for each Geofence for specified place.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Incase of Invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Incase of any System error.</exception>
+        /// <exception cref="UnauthorizedAccessException">Incase of Privileges are not defined.</exception>
+        /// <exception cref="NotSupportedException">Incase of Geofence is not supported.</exception>
+        public IEnumerable<FenceData> GetGeofenceDataListByPlaceId(int placeId)
+        {
+            List<FenceData> fences = new List<FenceData>();
+            Interop.VirtualPerimeter.ForEachFenceListCallback callback = (int fenceId, IntPtr handle, int index, int count, IntPtr data) =>
+            {
+                FenceData fence = new FenceData(fenceId, handle, index, count);
+                fences.Add(fence);
+                return true;
+            };
+
+            GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachPlaceFenceList(Handle, placeId, callback, IntPtr.Zero);
+            if (ret != GeofenceError.None)
+            {
+                throw GeofenceErrorFactory.CreateException(ret, "Failed to get Geofence list from Geofence Manager for " + placeId);
+            }
+
+            return fences;
+        }
+    }
+}
diff --git a/src/Tizen.Location/Interop/Interop.Libraries.cs b/src/Tizen.Location/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..7fd22e0
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        internal const string Location = "libcapi-location-manager.so.0";
+        internal const string Libc = "libc.so.6";
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Location/Interop/Interop.Location.cs b/src/Tizen.Location/Interop/Interop.Location.cs
new file mode 100755 (executable)
index 0000000..ad4466c
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Location;
+
+internal static partial class Interop
+{
+    internal static partial class Locator
+    {
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_create")]
+        internal static extern int Create(int locationMethod, out IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_destroy")]
+        internal static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_start")]
+        internal static extern int Start(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_stop")]
+        internal static extern int Stop(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_start_batch")]
+        internal static extern int StartBatch(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_stop_batch")]
+        internal static extern int StopBatch(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_mock_location")]
+        internal static extern int IsEnabledMock(out bool status);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_enable_mock_location")]
+        internal static extern int EnableMock(bool enable);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_mock_location")]
+        internal static extern int SetMockLocation(IntPtr handle, double latitude, double longitude, double altitude, double speed, double direction, double accuracy);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_clear_mock_location")]
+        internal static extern int ClearMock(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_get_location")]
+        internal static extern int GetLocation(IntPtr handle, out double altitude, out double latitude, out double longitude, out double climb, out double direction, out double speed, out int level, out double horizontal, out double vertical, out int timestamp);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_get_last_location")]
+        internal static extern int GetLastLocation(IntPtr handle, out double altitude, out double latitude, out double longitude, out double climb, out double direction, out double speed, out int level, out double horizontal, out double vertical, out int timestamp);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_add_boundary")]
+        internal static extern int AddBoundary(IntPtr managerHandle, IntPtr boundsHandle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_remove_boundary")]
+        internal static extern int RemoveBoundary(IntPtr managerHandle, IntPtr boundsHandle);
+    }
+
+    internal static partial class LocatorHelper
+    {
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_method")]
+        internal static extern int IsEnabled(int locationMethod, out bool status);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_is_supported_method")]
+        internal static extern bool IsSupported(int locationMethod);
+    }
+
+    internal static partial class Location
+    {
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_get_distance")]
+        internal static extern int GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, out double distance);
+    }
+
+    internal static partial class LocatorEvent
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ServiceStatechangedCallback(ServiceState state, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ZonechangedCallback(BoundaryState state, double latitude, double longitude, double altitude, int timesatmp, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void SettingchangedCallback(LocationType method, bool enable, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void LocationchangedCallback(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timeStamp, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void LocationUpdatedCallback(LocationError error, double latitude, double longitude, double altitude, int timestamp, double speed, double direction, double climb, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void LocationBatchCallback(int batch_size, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void LocationBatchGetCallback(double latitude, double longitude, double altitude, double speed, double direction, double horizontal, double vertical, int timeStamp, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_service_state_changed_cb")]
+        internal static extern int SetServiceStateChangedCallback(IntPtr handle, ServiceStatechangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_service_state_changed_cb")]
+        internal static extern int UnSetServiceStateChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_zone_changed_cb")]
+        internal static extern int SetZoneChangedCallback(IntPtr handle, ZonechangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_zone_changed_cb")]
+        internal static extern int UnSetZoneChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_setting_changed_cb")]
+        internal static extern int SetSettingChangedCallback(int method, SettingchangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_setting_changed_cb")]
+        internal static extern int UnSetSettingChangedCallback(int method);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_distance_based_location_changed_cb")]
+        internal static extern int SetDistanceBasedLocationChangedCallback(IntPtr handle, LocationchangedCallback callback, int interval, double distance, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_distance_based_location_changed_cb")]
+        internal static extern int UnSetDistanceBasedLocationChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_location_changed_cb")]
+        internal static extern int SetLocationChangedCallback(IntPtr handle, LocationchangedCallback callback, int interval, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_location_changed_cb")]
+        internal static extern int UnSetLocationChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_set_location_batch_cb")]
+        internal static extern int SetLocationBatchCallback(IntPtr handle, LocationBatchCallback callback, int batchInterval, int batchPeriod, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_location_batch_cb")]
+        internal static extern int UnSetLocationBatchCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_foreach_location_batch")]
+        internal static extern int GetLocationBatch(IntPtr handle, LocationBatchGetCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_request_single_location")]
+        internal static extern int GetSingleLocation(IntPtr handle, int timeout, LocationUpdatedCallback callback, IntPtr userData);
+    }
+
+    internal static partial class LocationBoundary
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool PolygonCoordinatesCallback(Coordinate coordinates, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_rect")]
+        internal static extern int CreateRectangularBoundary(Coordinate topLeft, Coordinate bottomLeft, out IntPtr boundsHandle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_circle")]
+        internal static extern int CreateCircleBoundary(Coordinate center, double radius, out IntPtr boundsHandle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_polygon")]
+        internal static extern int CreatePolygonBoundary(IntPtr list, int listLength, out IntPtr boundsHandle);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_get_rect_coords")]
+        internal static extern int GetRectangleCoordinates(IntPtr handle, out Coordinate topLeft, out Coordinate bottomRight);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_get_circle_coords")]
+        internal static extern int GetCircleCoordinates(IntPtr handle, out Coordinate center, out double radius);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_foreach_polygon_coords")]
+        internal static extern int GetForEachPolygonCoordinates(IntPtr handle, PolygonCoordinatesCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_contains_coordinates")]
+        internal static extern bool IsValidCoordinates(IntPtr handle, Coordinate coordinate);
+
+        [DllImport(Libraries.Location, EntryPoint = "location_bounds_destroy")]
+        internal static extern int DestroyBoundary(IntPtr handle);
+    }
+
+    internal static partial class GpsSatellite
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void SatelliteStatuschangedCallback(uint numActive, uint numInView, int timeStamp, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool SatelliteStatusinfomationCallback(uint azimuth, uint elevation, uint prn, uint snr, bool active, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "gps_status_get_nmea")]
+        internal static extern int GetNMEAData(IntPtr handle, out string nmea);
+
+        [DllImport(Libraries.Location, EntryPoint = "gps_status_get_satellite")]
+        internal static extern int GetSatelliteStatus(IntPtr handle, out uint numberOfActive, out uint numberInView, out int timestamp);
+
+        [DllImport(Libraries.Location, EntryPoint = "gps_status_set_satellite_updated_cb")]
+        internal static extern int SetSatelliteStatusChangedCallback(IntPtr handle, SatelliteStatuschangedCallback callback, int interval, IntPtr userData);
+
+        [DllImport(Libraries.Location, EntryPoint = "gps_status_unset_satellite_updated_cb")]
+        internal static extern int UnSetSatelliteStatusChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Location, EntryPoint = "gps_status_foreach_satellites_in_view")]
+        internal static extern int GetForEachSatelliteInView(IntPtr handle, SatelliteStatusinfomationCallback callback, IntPtr userData);
+    }
+
+    internal static DateTime ConvertDateTime(int timestamp)
+    {
+        DateTime dateTime = DateTime.Now;
+
+        DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc);
+        dateTime = start.ToLocalTime();
+
+        return dateTime;
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location.csproj b/src/Tizen.Location/Tizen.Location.csproj
new file mode 100644 (file)
index 0000000..9ed27fd
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.9</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Location API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Location.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Location/Tizen.Location.snk b/src/Tizen.Location/Tizen.Location.snk
new file mode 100644 (file)
index 0000000..b2dee2b
Binary files /dev/null and b/src/Tizen.Location/Tizen.Location.snk differ
diff --git a/src/Tizen.Location/Tizen.Location/GpsSatellite.cs b/src/Tizen.Location/Tizen.Location/GpsSatellite.cs
new file mode 100755 (executable)
index 0000000..b9bf58d
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// A class which contains the functionality for obtaining information about Gps satellites in range and in use.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class GpsSatellite
+    {
+        private int _interval = 1;
+        private Locator _locator;
+        private EventHandler<SatelliteStatusChangedEventArgs> _satelliteStatusChanged;
+        private IntPtr _handle = IntPtr.Zero;
+
+        private Interop.GpsSatellite.SatelliteStatuschangedCallback _satelliteStatuschangedCallback;
+        private Interop.GpsSatellite.SatelliteStatusinfomationCallback _satelliteStatusinfomationCallback;
+
+        /// <summary>
+        /// The time interval between callback updates.
+        /// Should be in the range [1~120] seconds.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public int Interval
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the Callback Interval");
+                return _interval;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the Callback Interval");
+                if (value > 0 && value <= 120)
+                {
+                    _interval = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error Setting the Callback Interval");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The NMEAData from the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public string Nmea
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting NMEAData");
+                return GetNmea();
+            }
+        }
+
+        private string GetNmea()
+        {
+            string value = null;
+            int ret = Interop.GpsSatellite.GetNMEAData(_handle, out value);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting the NMEAData," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+
+            return value;
+        }
+
+
+        /// <summary>
+        /// The Count of Active satellites.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public int ActiveCount
+        {
+            get
+            {
+                return (int)GetActiveCount();
+            }
+        }
+
+        private uint GetActiveCount()
+        {
+            Log.Info(Globals.LogTag, "Getting the ActiveCount of satellites");
+            uint numActive = 0;
+            uint numInView;
+            int timestamp;
+            int ret = Interop.GpsSatellite.GetSatelliteStatus(_handle, out numActive, out numInView, out timestamp);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return numActive;
+        }
+
+        /// <summary>
+        /// The Count of satellites in view.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public int InViewCount
+        {
+            get
+            {
+                return (int)GetInViewCount();
+            }
+        }
+
+        private uint GetInViewCount()
+        {
+            Log.Info(Globals.LogTag, "Getting the In view count of satellites");
+            uint numActive;
+            uint numInView = 0;
+            int timestamp;
+            int ret = Interop.GpsSatellite.GetSatelliteStatus(_handle, out numActive, out numInView, out timestamp);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return numInView;
+        }
+
+        /// <summary>
+        /// The list of satellites/last recorded satellites in view.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public IList<SatelliteInformation> Satellites
+        {
+            get
+            {
+                return GetSatellites();
+            }
+        }
+
+        private IList<SatelliteInformation> GetSatellites()
+        {
+            List<SatelliteInformation> satelliteList = new List<SatelliteInformation>();
+            Log.Info(Globals.LogTag, "Getting the list of satellites");
+
+            if (_satelliteStatusinfomationCallback == null)
+            {
+                _satelliteStatusinfomationCallback = (azimuth, elevation, prn, snr, active, userData) =>
+                {
+                    SatelliteInformation satellite = new SatelliteInformation(azimuth, elevation, prn, snr, active);
+                    satelliteList.Add(satellite);
+                    return true;
+                };
+            }
+
+            int ret = Interop.GpsSatellite.GetForEachSatelliteInView(_handle, _satelliteStatusinfomationCallback, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return satelliteList;
+        }
+
+        /// <summary>
+        /// The constructor of GpsSatellite class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locator"> Locator object initilized using Gps.</param>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public GpsSatellite(Locator locator)
+        {
+            Log.Info(Globals.LogTag, "Calling GpsSatellite constructor");
+            if (locator == null)
+            {
+                Log.Error(Globals.LogTag, "locator is null");
+                throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+            }
+
+            LocationType method = locator.LocationType;
+            if (method.Equals(LocationType.Gps) || method.Equals(LocationType.Hybrid))
+            {
+                _locator = locator;
+                _handle = _locator.GetHandle();
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Error constructing GpsSatellite class");
+                throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+            }
+        }
+
+        /// <summary>
+        /// (event) SatelliteStatusUpdated is raised whenever satellite information is updated.
+        /// The callback will be invoked periodically (every Interval seconds).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<SatelliteStatusChangedEventArgs> SatelliteStatusUpdated
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "SatelliteStatusUpdated Add called");
+                if (_satelliteStatusChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "SetSatelliteStatusChangeCallback called");
+                    SetSatelliteStatusChangeCallback();
+                }
+                _satelliteStatusChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "SatelliteStatusUpdated Remove called");
+                _satelliteStatusChanged -= value;
+                if (_satelliteStatusChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "UnSetSatelliteStatusChangeCallback called");
+                    UnSetSatelliteStatusChangeCallback();
+                }
+            }
+        }
+
+        private void SetSatelliteStatusChangeCallback()
+        {
+            Log.Info(Globals.LogTag, "SetSatelliteStatusChangeCallback");
+            if (_satelliteStatuschangedCallback == null)
+            {
+                _satelliteStatuschangedCallback = (numActive, numInView, timestamp, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "Inside SatelliteStatusChangedCallback");
+                    DateTime timeStamp = DateTime.Now;
+
+                    if (timestamp != 0)
+                    {
+                        DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc);
+                        timeStamp = start.ToLocalTime();
+                    }
+                    _satelliteStatusChanged?.Invoke(_handle, new SatelliteStatusChangedEventArgs(numActive, numInView, timeStamp));
+                };
+            }
+
+            GCHandle handle = GCHandle.Alloc(this);
+            int ret = Interop.GpsSatellite.SetSatelliteStatusChangedCallback(_handle, _satelliteStatuschangedCallback, _interval, GCHandle.ToIntPtr(handle));
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in setting satellite status changed callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetSatelliteStatusChangeCallback()
+        {
+            Log.Info(Globals.LogTag, "UnSetSatelliteStatusChangeCallback");
+            int ret = Interop.GpsSatellite.UnSetSatelliteStatusChangedCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Getting Unsetting satellite status changed callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+    }
+
+    /// <summary>
+    /// A class which contains the information of the Satellite under consideration.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class SatelliteInformation
+    {
+        /// <summary>
+        /// Class Constructor for SatelliteInformation class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="azimuth"> The azimuth value of the satellite in degrees.</param>
+        /// <param name="elevation"> The elevation of the satellite in meters.</param>
+        /// <param name="prn"> The Prn value of the satellite.</param>
+        /// <param name="snr"> The SNR value of the satellite in dB.</param>
+        /// <param name="active"> The flag signaling if satellite is in use.</param>
+        public SatelliteInformation(uint azimuth, uint elevation, uint prn, uint snr, bool active)
+        {
+            Azimuth = azimuth;
+            Elevation = elevation;
+            Prn = prn;
+            Snr = snr;
+            Active = active;
+        }
+
+        /// <summary>
+        /// The Azimuth information of the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="azimuth"> The azimuth value of the satellite in degrees.</param>
+        public uint Azimuth { get; private set; }
+
+        /// <summary>
+        /// The Elevation information of the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="azimuth"> The azimuth value of the satellite in degrees.</param>
+        public uint Elevation { get; private set; }
+
+        /// <summary>
+        /// The PRN of the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="azimuth"> The azimuth value of the satellite in degrees.</param>
+        public uint Prn { get; private set; }
+
+        /// <summary>
+        /// The SNR of the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public uint Snr { get; private set; }
+
+        /// <summary>
+        /// The operational status of the Satellite.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public bool Active { get; private set; }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/Location.cs b/src/Tizen.Location/Tizen.Location/Location.cs
new file mode 100755 (executable)
index 0000000..7127800
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// A class which contains the details of the location rrequested.
+    /// Includes the functionality to get the distance between locations.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class Location
+    {
+        private double _latitude;
+        private double _longitude;
+        private double _altitude;
+        private double _speed;
+        private double _direction;
+        private double _accuracy;
+        internal int _timestamp;
+
+        /// <summary>
+        /// The default constructor of Location Class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Location()
+        {
+        }
+
+        /// <summary>
+        /// The parameterized constructor of Location Class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="latitude"> Latitude component of the device co-ordinate [-90.0 ~ 90.0] (degrees).</param>
+        /// <param name="longitude"> Longitude component of the device co-ordinate[-180.0 ~ 180.0] (degrees).</param>
+        /// <param name="altitude"> Altitude value.</param>
+        /// <param name="accuracy"> Accuracy in meters.</param>
+        /// <param name="speed"> Devie Speed.</param>
+        /// <param name="direction"> Device direction with respect to north.</param>
+        /// <param name="timestamp"> Time when the measurement took place.</param>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public Location(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timestamp)
+        {
+            _latitude = latitude;
+            _longitude = longitude;
+            _altitude = altitude;
+            _speed = speed;
+            _direction = direction;
+            _accuracy = accuracy;
+            _timestamp = timestamp;
+        }
+
+        /// <summary>
+        /// The current latitude [-90.0 ~ 90.0] (degrees).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Latitude
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the latitude");
+                return _latitude;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the latitude");
+                if (value >= -90.0 && value <= 90.0)
+                {
+                    _latitude = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error setting latitude");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The current longitude [-180.0 ~ 180.0] (degrees).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Longitude
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the longitude");
+                return _longitude;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the longitude");
+                if (value >= -180.0 && value <= 180.0)
+                {
+                    _longitude = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error setting longitude");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The current altitude (meters).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Altitude
+        {
+            get
+            {
+                return _altitude;
+            }
+            set
+            {
+                _altitude = value;
+            }
+        }
+
+        /// <summary>
+        /// The Device Speed (km/h).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Speed
+        {
+            get
+            {
+                return _speed;
+            }
+            set
+            {
+                _speed = value;
+            }
+        }
+
+        /// <summary>
+        /// The direction, degrees from the north.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Direction
+        {
+            get
+            {
+                return _direction;
+            }
+            set
+            {
+                _direction = value;
+            }
+        }
+
+        /// <summary>
+        /// The accuracy.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Accuracy
+        {
+            get
+            {
+                return _accuracy;
+            }
+            set
+            {
+                _accuracy = value;
+            }
+        }
+
+        /// <summary>
+        /// The time value when the measurement was done.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public DateTime Timestamp
+        {
+            get
+            {
+                return Interop.ConvertDateTime(_timestamp);
+            }
+            internal set
+            {
+                Timestamp = value;
+            }
+
+        }
+
+        /// <summary>
+        /// Gets the distance between the two given coordinates.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="startLatitude"> The latitude of the source location [-90.0 ~ 90.0] (degrees).</param>
+        /// <param name="startLongitude"> The Longitude of the source location[-180.0 ~ 180.0] (degrees).</param>
+        /// <param name="endLatitude"> The latitude of the source location [-90.0 ~ 90.0] (degrees).</param>
+        /// <param name="endLongitude"> The longitude of the source location[-180.0 ~ 180.0] (degrees).</param>
+        /// <returns>Returns the distance between source and destination.</returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public static double GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
+        {
+            double result;
+            Log.Info(Globals.LogTag, "Calling GetDistanceBetween");
+            int ret = Interop.Location.GetDistanceBetween(startLatitude, startLongitude, endLatitude, endLongitude, out result);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting single distance information ," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Gets the distance between the current and specified location.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="location"> The location object to which distance is to be calculated.</param>
+        /// <returns>Returns the distance to the specified location.</returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public double GetDistanceTo(Location location)
+        {
+            double result;
+            Log.Info(Globals.LogTag, "Calling GetDistanceTo");
+            int ret = Interop.Location.GetDistanceBetween(this.Latitude, this.Longitude, location.Latitude, location.Longitude, out result);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error getting distance information to the specifed location," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return result;
+        }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/LocationBoundary.cs b/src/Tizen.Location/Tizen.Location/LocationBoundary.cs
new file mode 100755 (executable)
index 0000000..f66f609
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// Abstract class which provides functions related to geographic bounds information.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public abstract class LocationBoundary : IDisposable
+    {
+        internal IntPtr handle;
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Gets the location boundary type.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public BoundaryType BoundaryType{ get; internal set; }
+
+        internal LocationBoundary() { }
+        /// <summary>
+        /// The destructor of LocationBoundary class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        ~LocationBoundary()
+        {
+            Log.Info(Globals.LogTag, "The destructor of LocationBoundary class");
+            Dispose(false);
+        }
+
+        internal IntPtr GetHandle()
+        {
+            return handle;
+        }
+
+        /// <summary>
+        /// Checks if the boundary contains the specified geographical coordinates.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="coordinate"> The coordinate which needs to be checked.</param>
+        /// <returns>Returns a boolean value indicating whether or not the specified coordinate lies in the geographical area.</returns>
+        public bool BoundaryContainsCoordinates(Coordinate coordinate)
+        {
+            Log.Info(Globals.LogTag, "Checking if coordinates are contained within boundary");
+            return Interop.LocationBoundary.IsValidCoordinates(handle, coordinate);
+        }
+
+        /// <summary>
+        /// The overidden Dispose method of the IDisposable class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void Dispose()
+        {
+            Log.Info(Globals.LogTag, "Dispose");
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            Log.Info(Globals.LogTag, "Dispose");
+            if (_disposed)
+                return;
+
+            if (disposing)
+                DestroyHandle();
+
+            _disposed = true;
+        }
+
+        private void DestroyHandle()
+        {
+            Log.Info(Globals.LogTag, "DestroyBoundaryHandle");
+            int ret = Interop.LocationBoundary.DestroyBoundary(handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in DestroyBoundary handle" + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+    }
+
+    /// <summary>
+    /// Class representing a rectangular location boundary.
+    /// Inherits the Abstract LocationBoundary class.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class RectangleBoundary : LocationBoundary
+    {
+        /// <summary>
+        /// Constructor of the Rectangle boundary class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="topLeft"> The coordinate which constitute the top left handside of the rectangular boundary.</param>
+        /// <param name="bottomRight"> The coordinate which constitute the bottom right handside of the rectangular boundary.</param>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public RectangleBoundary(Coordinate topLeft, Coordinate bottomRight)
+        {
+            Log.Info(Globals.LogTag, "Calling RectangleBoundary constructor");
+            BoundaryType = BoundaryType.Rectangle;
+            IntPtr boundsHandle;
+            int ret = Interop.LocationBoundary.CreateRectangularBoundary(topLeft, bottomRight, out boundsHandle);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Creating Rectangular Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            handle = boundsHandle;
+        }
+
+        /// <summary>
+        /// Gets the Top Left handside coordinate of a rectangular boundary.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Coordinate TopLeft
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Calling to get CoordinateItem TopLeft");
+                return GetRectangleCoordinate("TopLeft");
+            }
+        }
+
+        /// <summary>
+        /// Gets the Bottom Right handside coordinate of a rectangular boundary.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Coordinate BottomRight
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Calling to get CoordinateItem BottomRight");
+                return GetRectangleCoordinate("BottomRight");
+            }
+        }
+
+        private Coordinate GetRectangleCoordinate(string tag)
+        {
+            Coordinate topLeft;
+            Coordinate bottomRight;
+
+            Interop.LocationBoundary.GetRectangleCoordinates(handle, out topLeft, out bottomRight);
+
+            if (tag.Equals("TopLeft"))
+            {
+                return topLeft;
+            }
+            else
+            {
+                return bottomRight;
+            }
+        }
+    }
+
+    /// <summary>
+    /// Class representing a circular location boundary.
+    /// Inherits the Abstract LocationBoundary class.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class CircleBoundary : LocationBoundary
+    {
+        /// <summary>
+        /// Constructor of the Circular boundary class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="coordinate"> The coordinates which constitute the center of the circular boundary.</param>
+        /// <param name="radius"> The radius value of the circular boundary.</param>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public CircleBoundary(Coordinate coordinate, double radius)
+        {
+            Log.Info(Globals.LogTag, "Calling CircleBoundary constructor");
+            BoundaryType = BoundaryType.Circle;
+            IntPtr boundsHandle;
+            int ret = Interop.LocationBoundary.CreateCircleBoundary(coordinate, radius, out boundsHandle);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Creating Circular Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            handle = boundsHandle;
+        }
+
+        /// <summary>
+        /// Gets the coordinate of the center of a circular boundary.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public Coordinate Center
+        {
+            get
+            {
+                return GetCircleCenter();
+            }
+        }
+
+        /// <summary>
+        /// Gets the radius of a circular boundary.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public double Radius
+        {
+            get
+            {
+                return GetRadius();
+            }
+        }
+
+        private Coordinate GetCircleCenter()
+        {
+            Log.Info(Globals.LogTag, "Calling to get CoordinateItem Center");
+            Coordinate center;
+            double radius;
+            int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get Circle Center," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            return center;
+        }
+
+        private double GetRadius()
+        {
+            Coordinate center;
+            double radius = 0;
+            int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get Radius," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            return radius;
+        }
+    }
+
+    /// <summary>
+    /// Class representing a polygonal location boundary.
+    /// Inherits the Abstract LocationBoundary class.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class PolygonBoundary : LocationBoundary
+    {
+        /// <summary>
+        /// Constructor of the polygon boundary class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="coordinates"> The coordinates which constitute the polgonal boundary.</param>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public PolygonBoundary(IList<Coordinate> coordinates)
+        {
+            Log.Info(Globals.LogTag, "Calling PolygonBoundary Constructor");
+            if (coordinates == null)
+            {
+                Log.Error(Globals.LogTag, "coordingtes list is null");
+                throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+            }
+
+            BoundaryType = BoundaryType.Polygon;
+            IntPtr listPointer = Marshal.AllocHGlobal(Marshal.SizeOf(coordinates[0]) * coordinates.Count);
+            IntPtr boundsHandle;
+            for (int i = 0; i < coordinates.Count; i++)
+            {
+                Marshal.StructureToPtr(coordinates[i], listPointer + i * Marshal.SizeOf(coordinates[0]), false);
+            }
+            int ret = Interop.LocationBoundary.CreatePolygonBoundary(listPointer, coordinates.Count, out boundsHandle);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Creating Polygon Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            handle = boundsHandle;
+        }
+
+        /// <summary>
+        /// Gets the list of coordinates which constitute a polygonal boundary
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public IList<Coordinate> Coordinates
+        {
+            get
+            {
+                return GetCoordinates();
+            }
+        }
+
+        private IList<Coordinate> GetCoordinates()
+        {
+            Log.Info(Globals.LogTag, "Calling to get Polygon coordinates");
+            List<Coordinate> coordinateList = new List<Coordinate>();
+            Interop.LocationBoundary.PolygonCoordinatesCallback callback = (Coordinate coordinate, IntPtr userData) =>
+            {
+                Coordinate item;
+                item.Latitude = coordinate.Latitude;
+                item.Longitude = coordinate.Longitude;
+                coordinateList.Add(item);
+                return true;
+            };
+
+            int ret = Interop.LocationBoundary.GetForEachPolygonCoordinates(handle, callback, IntPtr.Zero);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get foreach Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+            return coordinateList;
+        }
+    }
+
+    /// <summary>
+    /// The structure which represents the  co-ordinates of a geographical location.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct Coordinate
+    {
+        /// <summary>
+        /// Latitude component of the co-ordinate.
+        /// Should have a value between [-90.0 ~ 90.0] (degrees).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Latitude;
+
+        /// <summary>
+        /// Longitude component of the co-ordinate.
+        /// Should have a value between [-180.0 ~ 180.0] (degrees).
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Longitude;
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..6bfe66d
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// An extended EventArgs class which contains the changed location information.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class LocationChangedEventArgs : EventArgs
+    {
+
+        /// <summary>
+        /// Class Constructor for LocationUpdatedEventArgs class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="location"> Object of Location class.</param>
+        public LocationChangedEventArgs(Location location)
+        {
+            Location = location;
+        }
+
+        /// <summary>
+        /// Get the Location Update information.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Location Location { get; private set; }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/LocationError.cs b/src/Tizen.Location/Tizen.Location/LocationError.cs
new file mode 100755 (executable)
index 0000000..3254d8e
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Location
+{
+    internal static class LocationManagerError
+    {
+        public const int Base = -0x02C00000;
+        public const int BoundsBase = -0x02C00000 | 0x20;
+    }
+
+    /// <summary>
+    /// Location Manager error codes.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum LocationError
+    {
+        None = ErrorCode.None,/**< Successful */
+        OutOfMemory = ErrorCode.OutOfMemory,/**< Out of memory error */
+        InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */
+        AcessibilityNotallowed = ErrorCode.PermissionDenied,/**< Permission denied */
+        NotSupported = ErrorCode.NotSupported,/**< Address family not supported */
+        IncorrectMethod = LocationManagerError.Base | 0x01,/**< Location manager contains incorrect method for a given call */
+        NetworkFailed = LocationManagerError.Base | 0x02,/**< Network unavailable */
+        ServiceNotAvailable = LocationManagerError.Base | 0x03,/**< Location service is not available */
+        SettingOff = LocationManagerError.Base | 0x04,/**< GPS/WPS, or MOCK setting is not enabled */
+        SecuirtyRestricted = LocationManagerError.Base | 0x05,/**< Restricted by security system policy */
+    }
+
+    /// <summary>
+    /// Location Boundary error codes.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum LocationBoundError
+    {
+        None = ErrorCode.None,/**< Successful */
+        OutOfMemory = ErrorCode.OutOfMemory,/**< Out of memory error */
+        InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */
+        NotSupported = ErrorCode.NotSupported,/**< Not supported */
+        IncorrectType = LocationManagerError.BoundsBase | 0x01,/**< Incorrect bounds type for a given call */
+        IsAdded = LocationManagerError.BoundsBase | 0x02/**< Cannot remove bounds handle from location manager   */
+    }
+
+    internal static class LocationErrorFactory
+    {
+        internal static Exception ThrowLocationException(int errCode)
+        {
+            Log.Error(Globals.LogTag, "Throw Location Exception : " + errCode);
+            LocationError error = (LocationError)errCode;
+            switch (error)
+            {
+                case LocationError.OutOfMemory:
+                    return new InvalidOperationException("Out of memory");
+                case LocationError.InvalidParameter:
+                    return new ArgumentException("Invalid Parameter passed");
+                case LocationError.AcessibilityNotallowed:
+                    return new UnauthorizedAccessException("Accesibility not allowed");
+                case LocationError.NotSupported:
+                    return new NotSupportedException("Not supported");
+                case LocationError.IncorrectMethod:
+                    return new InvalidOperationException("Incorrect method used");
+                case LocationError.NetworkFailed:
+                    return new InvalidOperationException("Network failed");
+                case LocationError.ServiceNotAvailable:
+                    return new InvalidOperationException("Service not available");
+                case LocationError.SettingOff:
+                    return new InvalidOperationException("Current locationtype setting is off");
+                case LocationError.SecuirtyRestricted:
+                    return new InvalidOperationException("Security Restricted");
+                default:
+                    return new InvalidOperationException("Unknown Error");
+            }
+        }
+
+        internal static Exception ThrowLocationBoundaryException(int errCode)
+        {
+            LocationBoundError error = (LocationBoundError)errCode;
+            switch (error)
+            {
+                case LocationBoundError.OutOfMemory:
+                    return new InvalidOperationException("Out of memory exception");
+                case LocationBoundError.InvalidParameter:
+                    return new ArgumentException("Invalid parameter passed");
+                case LocationBoundError.NotSupported:
+                    return new NotSupportedException("Not supported");
+                case LocationBoundError.IncorrectType:
+                    return new InvalidOperationException("Incorrect type passed");
+                case LocationBoundError.IsAdded:
+                    return new InvalidOperationException("Boundary is not addded");
+                default:
+                    return new InvalidOperationException("Unknown Error");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/Locator.cs b/src/Tizen.Location/Tizen.Location/Locator.cs
new file mode 100755 (executable)
index 0000000..3c2d320
--- /dev/null
@@ -0,0 +1,965 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.Internals.Errors;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Location
+{
+    static internal class Globals
+    {
+        internal const string LogTag = "Tizen.Location";
+    }
+
+    /// <summary>
+    /// A class which contains the functionality for obtaining geographical infomation and setting boundary condition.
+    /// Notifications on events like service becoming enabled or disabled, new position data being available
+    /// and others can also be acquired.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public class Locator : IDisposable
+    {
+        private int _interval = 1;
+        private int _stayInterval = 120;
+        private int _batchInterval = 0;
+        private int _batchPeriod = 0;
+        private int _requestId = 0;
+        private double _distance = 120.0;
+        private bool _isEnableMock = false;
+        private bool _disposed = false;
+        private bool _isStarted = false;
+        private IntPtr _handle;
+        private LocationType _locationType;
+        private Location _location = null;
+        private Dictionary<IntPtr, Interop.LocatorEvent.LocationUpdatedCallback> _callback_map = new Dictionary<IntPtr, Interop.LocatorEvent.LocationUpdatedCallback>();
+
+        private Interop.LocatorEvent.ServiceStatechangedCallback _serviceStateChangedCallback;
+        private Interop.LocatorEvent.ZonechangedCallback _zoneChangedCallback;
+        private Interop.LocatorEvent.SettingchangedCallback _settingChangedCallback;
+        private Interop.LocatorEvent.LocationchangedCallback _distanceBasedLocationChangedCallback;
+        private Interop.LocatorEvent.LocationchangedCallback _locationChangedCallback;
+        private Interop.LocatorEvent.LocationBatchCallback _locationBatchCallback;
+        private Interop.LocatorEvent.LocationBatchGetCallback _locationBatchGetCallback;
+
+        private EventHandler<ZoneChangedEventArgs> _zoneChanged;
+        private EventHandler<ServiceStateChangedEventArgs> _serviceStateChanged;
+        private EventHandler<SettingChangedEventArgs> _settingChanged;
+        private EventHandler<LocationChangedEventArgs> _distanceBasedLocationChanged;
+        private EventHandler<LocationChangedEventArgs> _locationChanged;
+
+        /// <summary>
+        /// The constructor of Locator class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
+        /// <feature>http://tizen.org/feature/location</feature>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public Locator(LocationType locationType)
+        {
+            Log.Info(Globals.LogTag, "Locator Constructor");
+            int ret = Interop.Locator.Create((int)locationType, out _handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error creating Location Manager," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            _location = new Location();
+            _locationType = locationType;
+        }
+
+        /// <summary>
+        /// The destructor of Locator class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        ~Locator()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The time interval between callback updates.
+        /// Should be in the range [1~120] seconds.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public int Interval
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the Callback Interval");
+                return _interval;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the Callback Interval");
+                if (value > 0 && value <= 120)
+                {
+                    _interval = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error setting Callback Interval");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The time interval between Distance based location callback updates.
+        /// Should be in the range [1~120] seconds.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public int StayInterval
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the StayInterval");
+                return _stayInterval;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the StayInterval");
+                if (value > 0 && value <= 120)
+                {
+                    _stayInterval = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error Setting the StayInterval");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The time interval between position collection in batch mode.
+        /// Should be in the range [1~255] seconds.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public int BatchInterval
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the Batch Interval");
+                return _batchInterval;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the Batch Interval");
+                if (value > 0 && value <= 255)
+                {
+                    _batchInterval = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error setting Callback Interval");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The time interval between batch callback updates. The BatchPeriod should be greater than or equal to the BatchInterval. If BatchPeriod is zero or smaller than BatchInterval, then batch mode will not working. In addition, sometimes the period may not work as you intended, the maximum permissible value for batch_period is device specific.
+        /// Should be in the range [0~60000] seconds.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public int BatchPeriod
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the Batch Period");
+                return _batchPeriod;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the Batch Period");
+                if (value >= 0 && value <= 60000)
+                {
+                    _batchPeriod = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error setting Batch Period");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The distance between callback updates.
+        /// Should be in the range [1-120] meters.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public double Distance
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting the Distance Interval");
+                return _distance;
+            }
+            set
+            {
+                Log.Info(Globals.LogTag, "Setting the Distance Interval");
+                if (value > 0 && value <= 120)
+                {
+                    _distance = value;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "Error Setting the Distance");
+                    throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the Location object.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public Location Location
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting location details");
+                return _location;
+           }
+        }
+
+        /// <summary>
+        /// Gets the type used to obtain Location data.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public LocationType LocationType
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting LocationType");
+                return _locationType;
+            }
+        }
+
+        /// <summary>
+        /// Gets the status whether mock location is enabled or not.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public bool EnableMock
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Getting getting Mock");
+                _isEnableMock = GetEnableMock();
+                return _isEnableMock;
+            }
+            set
+            {
+                _isEnableMock = value;
+                SetEnableMock();
+            }
+        }
+
+        internal IntPtr GetHandle()
+        {
+            return _handle;
+        }
+
+        private bool GetEnableMock()
+        {
+            bool status = false;
+            int ret = Interop.Locator.IsEnabledMock(out status);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error Get Enable Mock Status," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return status;
+        }
+
+        private void SetEnableMock()
+        {
+            int ret = Interop.Locator.EnableMock(_isEnableMock);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error Set Enable Mock Status," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Starts the Location Manager which has been created using the specified method.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void Start()
+        {
+            Log.Info(Globals.LogTag, "Starting Location Manager");
+            if (_batchPeriod > 0 && _batchPeriod > _batchInterval)
+            {
+                int ret = Interop.Locator.StartBatch(_handle);
+                if (((LocationError)ret != LocationError.None))
+                {
+                    Log.Error(Globals.LogTag, "Error Starting Location Batch mode," + (LocationError)ret);
+                    throw LocationErrorFactory.ThrowLocationException(ret);
+                }
+            }
+            else
+            {
+                int ret = Interop.Locator.Start(_handle);
+                   if (((LocationError)ret != LocationError.None))
+                {
+                    Log.Error(Globals.LogTag, "Error Starting Location Manager," + (LocationError)ret);
+                    throw LocationErrorFactory.ThrowLocationException(ret);
+                }
+            }
+            _isStarted = true;
+        }
+
+        /// <summary>
+        /// Stops the Location Manager which has been activated using the specified method.
+        /// Does not destroy the manager.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void Stop()
+        {
+            Log.Info(Globals.LogTag, "Stopping Location Manager");
+            int ret = Interop.Locator.Stop(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error stopping Location Manager," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            _isStarted = false;
+       }
+
+        /// <summary>
+        /// Sets a mock location for the given location method.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="location"> The location object containing the mock location details.</param>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void SetMockLocation(Location location)
+        {
+            Log.Info(Globals.LogTag, "Setting mock location");
+            int ret = Interop.Locator.SetMockLocation(_handle, location.Latitude, location.Longitude, location.Altitude, location.Speed, location.Direction, location.Accuracy);
+            if (((LocationError)ret == LocationError.None))
+            {
+                _location.Latitude = location.Latitude;
+                _location.Longitude = location.Longitude;
+                _location.Altitude = location.Altitude;
+                _location.Speed = location.Speed;
+                _location.Direction = location.Direction;
+                _location.Accuracy = location.Accuracy;
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Error in setting up location mocking," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Clears a mock location for the given location method.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void ClearMock()
+        {
+            Log.Info(Globals.LogTag, "Clear mock location");
+            int ret = Interop.Locator.ClearMock(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in clear up location mocking," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Gets the details of the location asynchronously.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="timeout"> Timeout to stop requesting single location after(seconds).</param>
+        /// <returns> A task which contains the current location details</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public Task<Location> GetLocationAsync(int timeout)
+        {
+            var task = new TaskCompletionSource<Location>();
+            IntPtr id = IntPtr.Zero;
+            lock (_callback_map)
+            {
+                id = (IntPtr)_requestId++;
+                _callback_map[id] = (LocationError error, double latitude, double longitude, double altitude, int timestamp, double speed, double direction, double climb, IntPtr userData) =>
+                {
+                    if (error != LocationError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Error in getting up location information," + (LocationError)error);
+                    }
+                    else
+                    {
+                        Log.Info(Globals.LogTag, "Creating a current location object");
+                        _location = new Location(latitude, longitude, altitude, speed, direction, 0.0, timestamp);
+                        task.SetResult(_location);
+                    }
+                    lock (_callback_map)
+                    {
+                        _callback_map.Remove(userData);
+                    }
+                };
+            }
+
+            int ret = Interop.LocatorEvent.GetSingleLocation(_handle, timeout, _callback_map[id], id);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in setting up location mocking," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return task.Task;
+        }
+
+
+        /// <summary>
+        /// Gets the details of the location.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <returns> which contains the current location details.</returns>
+        /// <privilege>http://tizen.org/privilege/location</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public Location GetLocation()
+        {
+            double latitude = 0;
+            double longitude = 0;
+            double altitude = 0;
+            double climb = 0;
+            double speed = 0;
+            double direction = 0;
+            int level = 0;
+            double accuracy = 0;
+            double vertical = 0;
+            int timestamp = 0;
+
+            if (_isStarted)
+            {
+                Log.Info(Globals.LogTag, "Get current location information");
+                int ret = Interop.Locator.GetLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp);
+                if (((LocationError)ret != LocationError.None))
+                {
+                    Log.Error(Globals.LogTag, "Error in get current location infomation," + (LocationError)ret);
+                    throw LocationErrorFactory.ThrowLocationException(ret);
+                }
+            }
+            else
+            {
+                Log.Info(Globals.LogTag, "Get last location information");
+                int ret = Interop.Locator.GetLastLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp);
+                if (((LocationError)ret != LocationError.None))
+                {
+                    Log.Error(Globals.LogTag, "Error in get last location information," + (LocationError)ret);
+                    throw LocationErrorFactory.ThrowLocationException(ret);
+                }
+            }
+
+            Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp);
+            _location = location;
+
+            return location;
+        }
+
+
+        /// <summary>
+        /// Adds a bounds for a given locator.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locationBoundary"> The boundary object to be added to the locator.</param>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void AddBoundary(LocationBoundary locationBoundary)
+        {
+            Log.Info(Globals.LogTag, "AddBoundary called");
+
+            int ret = Interop.Locator.AddBoundary(_handle, locationBoundary.GetHandle());
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Adding Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Deletes a bounds for a given locator.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locationBoundary"> The boundary object to be removed from the locator.</param>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public void RemoveBoundary(LocationBoundary locationBoundary)
+        {
+            Log.Info(Globals.LogTag, "RemoveBoundary called");
+            int ret = Interop.Locator.RemoveBoundary(_handle, locationBoundary.GetHandle());
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Removing Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
+        }
+
+        /// <summary>
+        /// The overidden Dispose method of the IDisposable class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+                DestroyHandle();
+
+            _disposed = true;
+        }
+
+        private void DestroyHandle()
+        {
+            int ret = Interop.Locator.Destroy(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Destroy handle, " + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// (event) ServiceStateChanged Event is invoked when the location service state is changed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "ServiceStateChanged called");
+                if (_serviceStateChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetServiceStateChangedCallback");
+                    SetServiceStateChangedCallback();
+                }
+                _serviceStateChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "Callback removed");
+                _serviceStateChanged -= value;
+
+                if (_serviceStateChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function UnSetServiceStateChangedCallback");
+                    UnSetServiceStateChangedCallback();
+                }
+            }
+        }
+
+        private void SetServiceStateChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling Interop.LocatorEvent.SetServiceStateChangedCallback");
+            if (_serviceStateChangedCallback == null)
+            {
+                _serviceStateChangedCallback = (state, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "Inside ServiceStateChangedCallback");
+                    _serviceStateChanged?.Invoke(this, new ServiceStateChangedEventArgs(state));
+                };
+            }
+
+            int ret = Interop.LocatorEvent.SetServiceStateChangedCallback(_handle, _serviceStateChangedCallback, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting Service State Changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetServiceStateChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling Interop.LocatorEvent.UnSetServiceStateChangedCallback");
+            int ret = Interop.LocatorEvent.UnSetServiceStateChangedCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in UnSetting Service State Changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// (event) ZoneChanged is  invoked when the previously set boundary area is entered or left.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<ZoneChangedEventArgs> ZoneChanged
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "ZoneChanged called");
+                if (_zoneChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetZoneChangedCallback");
+                    SetZoneChangedCallback();
+                }
+                _zoneChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "Callback removed");
+                _zoneChanged -= value;
+
+                if (_zoneChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function UnSetZoneChangedCallback");
+                    UnSetZoneChangedCallback();
+                }
+            }
+        }
+
+        private void SetZoneChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Inside SetZoneChangedCallback");
+            if (_zoneChangedCallback == null)
+            {
+                _zoneChangedCallback = (state, latitude, longitude, altitude, timestamp, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "Inside ZoneChangedCallback");
+                    DateTime timeStamp = DateTime.Now;
+                    if (timestamp != 0)
+                    {
+                        DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc);
+                        timeStamp = start.ToLocalTime();
+                    }
+                    _zoneChanged?.Invoke(this, new ZoneChangedEventArgs(state, latitude, longitude, altitude, timeStamp));
+                };
+            }
+
+            int ret = Interop.LocatorEvent.SetZoneChangedCallback(_handle, _zoneChangedCallback, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting Zone Changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetZoneChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Inside UnSetZoneChangedCallback");
+            int ret = Interop.LocatorEvent.UnSetZoneChangedCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in UnSetting Zone Changed Callback," + (LocationError)ret);
+            }
+        }
+
+        /// <summary>
+        /// (event) SetttingChanged is raised when the location setting is changed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<SettingChangedEventArgs> SettingChanged
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "Adding SettingChanged EventHandler");
+                if (_settingChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetSettingChangedCallback");
+                    SetSettingChangedCallback();
+                }
+                _settingChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "Removing SettingChanged EventHandler");
+                _settingChanged -= value;
+
+                if (_settingChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function UnSetSettingChangedCallback");
+                    UnSetSettingChangedCallback();
+                }
+            }
+        }
+
+        private void SetSettingChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling SetSettingChangedCallback");
+            if (_settingChangedCallback == null)
+            {
+                _settingChangedCallback = (method, enable, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "Calling SettingChangedCallback");
+                    _settingChanged?.Invoke(this, new SettingChangedEventArgs(method, enable));
+                };
+            }
+
+            int ret = Interop.LocatorEvent.SetSettingChangedCallback((int)_locationType, _settingChangedCallback, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting Changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetSettingChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling UnSetSettingChangedCallback");
+            int ret = Interop.LocatorEvent.UnSetSettingChangedCallback((int)_locationType);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Unsetting Setting's Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        /// <summary>
+        /// (event) DistanceBasedLocationChanged is raised with updated location information.
+        /// The callback will be invoked at minimum interval or minimum distance with updated position information.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<LocationChangedEventArgs> DistanceBasedLocationChanged
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "Adding DistanceBasedLocationChanged EventHandler");
+                //if (_distanceBasedLocationChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetDistanceBasedLocationChangedCallback");
+                    SetDistanceBasedLocationChangedCallback();
+                }
+                _distanceBasedLocationChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "Removing DistanceBasedLocationChanged EventHandler");
+                _distanceBasedLocationChanged -= value;
+
+                if (_distanceBasedLocationChanged == null)
+                {
+                    Log.Info(Globals.LogTag, "Calling function UnSetDistanceBasedLocationChangedCallback");
+                    UnSetDistanceBasedLocationChangedCallback();
+                }
+            }
+        }
+
+        private void SetDistanceBasedLocationChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "SetDistanceBasedLocationChangedCallback");
+            if (_distanceBasedLocationChangedCallback == null) {
+                _distanceBasedLocationChangedCallback = (latitude, longitude, altitude, speed, direction, accuracy, timestamp, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #1");
+                    Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp);
+                    Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #2");
+                    _distanceBasedLocationChanged?.Invoke(this, new LocationChangedEventArgs(location));
+                    Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #3");
+                };
+            }
+
+            int ret = Interop.LocatorEvent.SetDistanceBasedLocationChangedCallback(_handle, _distanceBasedLocationChangedCallback, _stayInterval, _distance, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting Distance based location changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetDistanceBasedLocationChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "UnSetDistanceBasedLocationChangedCallback");
+            int ret = Interop.LocatorEvent.UnSetDistanceBasedLocationChangedCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in UnSetting Distance based location changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            _distanceBasedLocationChanged = null;
+        }
+
+        /// <summary>
+        /// (event)LocationUpdated is raised at defined intervals of time with updated location information.
+        /// The callback will be invoked periodically.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public event EventHandler<LocationChangedEventArgs> LocationChanged
+        {
+            add
+            {
+                Log.Info(Globals.LogTag, "Adding LocationChanged EventHandler");
+                if (_batchPeriod > 0 && _batchPeriod > _batchInterval)
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetLocationBatchCallback");
+                    SetLocationBatchCallback();
+                }
+                else
+                {
+                    Log.Info(Globals.LogTag, "Calling function SetLocationChangedCallback");
+                    SetLocationChangedCallback();
+                }
+                _locationChanged += value;
+            }
+            remove
+            {
+                Log.Info(Globals.LogTag, "Removing LocationChanged EventHandler");
+                _locationChanged -= value;
+
+                if (_locationChanged == null)
+                {
+                    if (_batchPeriod > 0 && _batchPeriod > _batchInterval)
+                    {
+                        Log.Info(Globals.LogTag, "Calling function UnSetLocationBatchCallback");
+                        UnSetLocationBatchCallback();
+                    }
+                    else
+                    {
+                        Log.Info(Globals.LogTag, "Calling function UnSetLocationChangedCallback");
+                        UnSetLocationChangedCallback();
+                    }
+                }
+            }
+        }
+
+        private void SetLocationChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling SetLocationChangedCallback");
+
+            if (_locationChangedCallback == null) {
+                _locationChangedCallback = (latitude, longitude, altitude, speed, direction, accuracy, timestamp, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "LocationChangedCallback has been called");
+                    Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp);
+                    _location = location;
+                    _locationChanged?.Invoke(this, new LocationChangedEventArgs(location));
+                };
+            }
+
+            int ret = Interop.LocatorEvent.SetLocationChangedCallback(_handle, _locationChangedCallback, _interval, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting location changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetLocationChangedCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling UnSetLocationChangedCallback");
+            int ret = Interop.LocatorEvent.UnSetLocationChangedCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in UnSetting location changed Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void SetLocationBatchCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling SetLocationBatchCallback");
+            int ret;
+            if (_locationBatchCallback == null) {
+                _locationBatchCallback = (batch_size, userData) =>
+                {
+                    Log.Info(Globals.LogTag, "LocationBatchCallback has been called, size : " + batch_size);
+
+                    _locationBatchGetCallback = (latitude, longitude, altitude, speed, direction, horizontal, vertical, timestamp, batchUserData) =>
+                    {
+                        Log.Info(Globals.LogTag, "GetLocationBatch has been called");
+                        Location location = new Location(latitude, longitude, altitude, speed, direction, horizontal, timestamp);
+                        _location = location;
+                        _locationChanged?.Invoke(this, new LocationChangedEventArgs(location));
+                    };
+
+                    ret = Interop.LocatorEvent.GetLocationBatch(_handle, _locationBatchGetCallback, IntPtr.Zero);
+                    if (((LocationError)ret != LocationError.None))
+                    {
+                        Log.Error(Globals.LogTag, "Error in Setting location batch Callback," + (LocationError)ret);
+                        throw LocationErrorFactory.ThrowLocationException(ret);
+                    }
+                };
+            }
+
+            ret = Interop.LocatorEvent.SetLocationBatchCallback(_handle, _locationBatchCallback, _batchInterval, _batchPeriod, IntPtr.Zero);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in Setting location batch Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+
+        private void UnSetLocationBatchCallback()
+        {
+            Log.Info(Globals.LogTag, "Calling UnSetLocationBatchCallback");
+            int ret = Interop.LocatorEvent.UnSetLocationBatchCallback(_handle);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error in UnSetting location batch Callback," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs b/src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs
new file mode 100755 (executable)
index 0000000..8f04a80
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// Enumeration for the state of the location service.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum ServiceState
+    {
+        Disabled = 0, /**<Service is disabled.*/
+        Enabled /**<Service is enabled.*/
+    }
+
+    /// <summary>
+    /// Enumeration for the type of connection used in acquiring Location data.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum LocationType
+    {
+        Hybrid = 0, /**<This method selects the best method available at the moment.*/
+        Gps, /**<This method uses Global Positioning System.*/
+        Wps, /**<This method uses WiFi Positioning System.*/
+        Passive, /**<This method uses passive mode.*/
+    }
+
+    /// <summary>
+    /// Enumeration for the created boundary type.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum BoundaryType
+    {
+        Rectangle = 0, /**<Rectangular geographical area type. */
+        Circle, /**<Rectangular geographical area type. */
+        Polygon /**<Rectangular geographical area type. */
+    }
+
+    /// <summary>
+    /// Enumeration for error code for Location manager.
+    /// </summary>
+    /// <since_tizen>3</since_tizen>
+    public enum BoundaryState
+    {
+        In = 0, /**< Boundary In (Zone In) */
+        Out /**< Boundary Out (Zone Out) */
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/LocatorHelper.cs b/src/Tizen.Location/Tizen.Location/LocatorHelper.cs
new file mode 100755 (executable)
index 0000000..5ad09ee
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    public static class LocatorHelper
+    {
+        /// <summary>
+        /// Checks if the specified geographical positioning type is supported or not.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
+        /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
+        public static bool IsSupportedType(LocationType locationType)
+        {
+            bool status = Interop.LocatorHelper.IsSupported((int)locationType);
+            Log.Info(Globals.LogTag, "Checking if the Location Manager type is supported ," + status);
+            return status;
+        }
+
+        /// <summary>
+        /// Checks if the specified geographical positioning type is enabled or not.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
+        /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public static bool IsEnabledType(LocationType locationType)
+        {
+            Log.Info(Globals.LogTag, "Checking if the Location Manager type is Enabled");
+            bool status;
+            int ret = Interop.LocatorHelper.IsEnabled((int)locationType, out status);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error Checking the Location Manager type is Enabled," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+            return status;
+        }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/NamespaceDoc.cs b/src/Tizen.Location/Tizen.Location/NamespaceDoc.cs
new file mode 100755 (executable)
index 0000000..e8ba5d4
--- /dev/null
@@ -0,0 +1,21 @@
+/**
+<summary>
+The Tizen.Location namespace provides classes for obtaining information related to geographical location.
+Notifications on events like service becoming enabled or disabled,
+new position data being available and others can also be acquired.
+</summary>
+<remarks>
+<h2>Overview</h2>
+<para>The Tizen.Location namespace provides classes for obtaining information related to geographical location.
+Notifications on events like service becoming enabled or disabled,
+new position data being available and others can also be acquired.</para>
+<h2>Related Features</h2>
+<para>To guarantee that the Location application runs on a device with location profile feature,
+declare the following feature requirements in the config file:<br/>
+http://tizen.org/feature/location<br/>
+http://tizen.org/feature/location.gps<br/>
+http://tizen.org/feature/location.wps
+</para>
+</remarks>
+*/
+namespace Tizen.Location {}
diff --git a/src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..c6f4ba4
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    public class SatelliteStatusChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Class Constructor for SatelliteStatusChangedEventArgs class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="activeCount"> The number of active satellites.</param>
+        /// <param name="inviewCount"> The number of satellites in view.</param>
+        /// <param name="timestamp"> The time at which the data has been extracted.</param>
+        public SatelliteStatusChangedEventArgs(uint activeCount, uint inviewCount, DateTime timestamp)
+        {
+            ActiveCount = activeCount;
+            InViewCount = inviewCount;
+            Timestamp = timestamp;
+        }
+
+        /// <summary>
+        /// Gets the number of active satellites.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public uint ActiveCount { get; private set; }
+
+        /// <summary>
+        /// Gets the number of satellites in view.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public uint InViewCount { get; private set; }
+
+        /// <summary>
+        /// Get the timestamp.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public DateTime Timestamp { get; private set; }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..35ff1a7
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    /// <summary>
+    /// An extended EventArgs class which contains the changed location service state.
+    /// </summary>
+    public class ServiceStateChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Class Constructor for ServiceStateChangedEventArgs class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="state"> An enumeration of type LocationServiceState.</param>
+        public ServiceStateChangedEventArgs(ServiceState state)
+        {
+            ServiceState = state;
+        }
+
+        /// <summary>
+        /// Get the Service state.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public ServiceState ServiceState { get; private set; }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..2869b69
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    public class SettingChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Class Constructor for SettingChangedEventArgs class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="method"> The positioing method used for Location information.</param>
+        /// <param name="enable"> Status of the method.</param>
+        public SettingChangedEventArgs(LocationType type, bool enable)
+        {
+            LocationType = type;
+            IsEnabled = enable;
+        }
+
+        /// <summary>
+        /// Gets the currently used location method.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public LocationType LocationType { get; private set; }
+
+        /// <summary>
+        /// Method to get the setting value changed.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public bool IsEnabled { get; private set; }
+    }
+}
diff --git a/src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..9bc05e4
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Location
+{
+    public class ZoneChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// Class Constructor for ZoneChangedEventArgs class.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="state"> An enumeration of type BoundaryState.</param>
+        /// <param name="latitude"> The latitude value[-90.0 ~ 90.0] (degrees).</param>
+        /// <param name="longitude"> The longitude value[-180.0 ~ 180.0] (degrees).</param>
+        /// <param name="altitude"> The altitude value.</param>
+        /// <param name="timestamp"> The timestamp value.</param>
+        public ZoneChangedEventArgs(BoundaryState state, double latitude, double longitude, double altitude, DateTime timestamp)
+        {
+            BoundState = state;
+            Latitude = latitude;
+            Longitude = longitude;
+            Altitude = altitude;
+            Timestamp = timestamp;
+        }
+
+        /// <summary>
+        /// Get the Boundary State.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public BoundaryState BoundState { get; private set; }
+
+        /// <summary>
+        /// Get the latitude.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Latitude { get; private set; }
+
+        /// <summary>
+        /// Get the longitude.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Longitude { get; private set; }
+
+        /// <summary>
+        /// Get the altitude.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public double Altitude { get; private set; }
+
+        /// <summary>
+        /// Method to get the timestamp.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        public DateTime Timestamp { get; private set; }
+    }
+}
diff --git a/src/Tizen.Log/Interop/Interop.Dlog.cs b/src/Tizen.Log/Interop/Interop.Dlog.cs
new file mode 100644 (file)
index 0000000..db12535
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Dlog = "libdlog.so.0";
+    }
+
+    internal static partial class Dlog
+    {
+        internal enum LogID : int
+        {
+            LOG_ID_INVALID = -1,
+            LOG_ID_MAIN,
+            LOG_ID_RADIO,
+            LOG_ID_SYSTEM,
+            LOG_ID_APPS,
+            LOG_ID_KMSG,
+            LOG_ID_MAX
+        }
+
+        internal enum LogPriority : int
+        {
+            DLOG_UNKNOWN = 0,
+            DLOG_DEFAULT,
+            DLOG_VERBOSE,
+            DLOG_DEBUG,
+            DLOG_INFO,
+            DLOG_WARN,
+            DLOG_ERROR,
+            DLOG_FATAL,
+            DLOG_SILENT,
+            DLOG_PRIO_MAX,
+        }
+
+        [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string msg);
+
+        [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+
+        [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string msg);
+
+        [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+
+    }
+}
+
diff --git a/src/Tizen.Log/Tizen.Log.csproj b/src/Tizen.Log/Tizen.Log.csproj
new file mode 100644 (file)
index 0000000..f624885
--- /dev/null
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides functions for sending log output.</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Log.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+</Project>
diff --git a/src/Tizen.Log/Tizen.Log.snk b/src/Tizen.Log/Tizen.Log.snk
new file mode 100644 (file)
index 0000000..bdf6544
Binary files /dev/null and b/src/Tizen.Log/Tizen.Log.snk differ
diff --git a/src/Tizen.Log/Tizen/Log.cs b/src/Tizen.Log/Tizen/Log.cs
new file mode 100644 (file)
index 0000000..da673e7
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.ComponentModel;
+
+namespace Tizen
+{
+    /// <summary>
+    /// Provides methods to print log messages to the Tizen logging system.
+    /// </summary>
+    public class Log
+    {
+        /// <summary>
+        /// Prints a log message with the VERBOSE priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line);
+        }
+
+        /// <summary>
+        /// Prints a log message with the DEBUG priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line);
+        }
+
+        /// <summary>
+        /// Prints a log message with the INFO priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line);
+        }
+
+        /// <summary>
+        /// Prints a log message with the WARNING priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line);
+        }
+
+        /// <summary>
+        /// Prints a log message with the ERROR priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line);
+        }
+
+        /// <summary>
+        /// Prints a log message with the FATAL priority.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="message">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of the calling position. This argument will be set automatically by the compiler.</param>
+        public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line);
+        }
+
+        static void Print(Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(priority, tag, "%s", message);
+            }
+            else
+            {
+                Uri f = new Uri("file://" + file);
+                Interop.Dlog.Print(priority, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, message);
+            }
+        }
+    }
+
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class InternalLog
+    {
+        public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+           // For internal dlog APIs, Verbose level log is disabled
+            // Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line);
+        }
+
+        public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line);
+        }
+
+        public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line);
+        }
+
+        public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line);
+        }
+
+        public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line);
+        }
+
+        public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line);
+        }
+
+        static void Print(Interop.Dlog.LogID log_id, Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.InternalPrint(log_id, priority, tag, "%s", message);
+            }
+            else
+            {
+                Uri f = new Uri("file://" + file);
+                Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, message);
+            }
+        }
+    }
+
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class SecureLog
+    {
+        public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            // For internal dlog APIs, Verbose level log is disabled
+            // Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line);
+        }
+
+        public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line);
+        }
+
+        public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line);
+        }
+
+        public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line);
+        }
+
+        public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line);
+        }
+
+        public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line);
+        }
+
+        static void Print(Interop.Dlog.LogID log_id, Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line)
+        {
+#if !DISABLE_SECURELOG
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.InternalPrint(log_id, priority, tag, "[SECURE_LOG] %s", message);
+            }
+            else
+            {
+                Uri f = new Uri("file://" + file);
+                Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > [SECURE_LOG] %s", Path.GetFileName(f.AbsolutePath), func, line, message);
+            }
+#endif
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs
new file mode 100755 (executable)
index 0000000..86ac67e
--- /dev/null
@@ -0,0 +1,597 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Network.Bluetooth;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Bluetooth
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void StateChangedCallback(int result, int state, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void NameChangedCallback(string deviceName, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void VisibilityModeChangedCallback(int result, int visibility, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void VisibilityDurationChangedCallback(int duration, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void DiscoveryStateChangedCallback(int result, BluetoothDeviceDiscoveryState state, IntPtr deviceInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool BondedDeviceCallback([MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceStruct device, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void BondCreatedCallback(int result, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceStruct device, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void BondDestroyedCallback(int result, string deviceAddress, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AuthorizationChangedCallback(int authorization, string deviceAddress, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ServiceSearchedCallback(int result, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceSdpStruct sdp, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void DeviceConnectionStateChangedCallback(bool connected, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceConnectionStruct device, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool ConnectedProfileCallback(int profile, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void DataReceivedCallback([MarshalAs(UnmanagedType.Struct)]ref SocketDataStruct socketData, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void SocketConnectionStateChangedCallback(int result, BluetoothSocketState connectionState, [MarshalAs(UnmanagedType.Struct)]ref SocketConnectionStruct socketConnection, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AudioConnectionStateChangedCallback(int result, bool connected, string deviceAddress, int profileType, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void HidConnectionStateChangedCallback(int result, bool connected, string deviceAddress, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void TargetConnectionStateChangedCallback(bool connected, string deviceAddress, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void EqualizerStateChangedCallback(int equalizer, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void RepeatModeChangedCallback(int repeat, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ShuffleModeChangedCallback(int shuffle, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ScanModeChangedCallback(int scan, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ConnectionChangedCallback(int result, bool connected, string deviceAddress, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void ClientCharacteristicValueChangedCallback(IntPtr characteristicHandle, string value, int len, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void GattClientRequestedCallback(int result, IntPtr handle, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool GattForEachCallback(int total, int index, IntPtr handle, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_initialize")]
+        internal static extern int Initialize();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_deinitialize")]
+        internal static extern int Deinitialize();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_name")]
+        internal static extern int GetName(out string name);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_name")]
+        internal static extern int SetName(string name);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_state")]
+        internal static extern int GetState(out BluetoothState isActivated);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_address")]
+        internal static extern int GetAddress(out string address);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_visibility")]
+        internal static extern int GetVisibility(out int visibility, out int duration);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_is_discovering")]
+        internal static extern int IsDiscovering(out bool isDiscovering);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_start_device_discovery")]
+        internal static extern int StartDiscovery();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_stop_device_discovery")]
+        internal static extern int StopDiscovery();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_foreach_bonded_device")]
+        internal static extern int GetBondedDevices(BondedDeviceCallback bondedDeviceCb, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_bonded_device_info")]
+        internal static extern int GetBondedDeviceByAddress(string deviceAddress, out IntPtr deviceInfo);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_free_device_info")]
+        internal static extern int FreeDeviceInfo(BluetoothDeviceStruct deviceInfo);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_is_service_used")]
+        internal static extern int IsServiceUsed(string serviceUuid, out bool used);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_local_oob_data")]
+        internal static extern int GetOobData(out IntPtr hash, out IntPtr randomizer, out int hashLen, out int randomizerLen);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_remote_oob_data")]
+        internal static extern int SetOobData(string deviceAddress, IntPtr hash, IntPtr randomizer, int hashLen, int randomizerLen);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_remove_remote_oob_data")]
+        internal static extern int RemoveOobData(string deviceAddress);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_state_changed_cb")]
+        internal static extern int SetStateChangedCallback(StateChangedCallback stateChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_state_changed_cb")]
+        internal static extern int UnsetStateChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_name_changed_cb")]
+        internal static extern int SetNameChangedCallback(NameChangedCallback nameChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_name_changed_cb")]
+        internal static extern int UnsetNameChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_visibility_mode_changed_cb")]
+        internal static extern int SetVisibilityModeChangedCallback(VisibilityModeChangedCallback visibilityChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_visibility_mode_changed_cb")]
+        internal static extern int UnsetVisibilityModeChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_visibility_duration_changed_cb")]
+        internal static extern int SetVisibilityDurationChangedCallback(VisibilityDurationChangedCallback durationChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_visibility_duration_changed_cb")]
+        internal static extern int UnsetVisibilityDurationChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_device_discovery_state_changed_cb")]
+        internal static extern int SetDiscoveryStateChangedCallback(DiscoveryStateChangedCallback discoveryChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_device_discovery_state_changed_cb")]
+        internal static extern int UnsetDiscoveryStateChangedCallback();
+
+        //Bluetooth Device
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_create_bond")]
+        internal static extern int CreateBond(string deviceAddress);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_destroy_bond")]
+        internal static extern int DestroyBond(string deviceAddress);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_cancel_bonding")]
+        internal static extern int CancelBonding();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_alias")]
+        internal static extern int SetAlias(string deviceAddress, string alias);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_authorization")]
+        internal static extern int SetAuthorization(string deviceAddress, int state);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_get_service_mask_from_uuid_list")]
+        internal static extern int GetMaskFromUuid([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] uuids, int count, out BluetoothServiceClassType serviceMask);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_start_service_search")]
+        internal static extern int StartServiceSearch(string deviceAddress);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_foreach_connected_profiles")]
+        internal static extern int GetConnectedProfiles(string deviceAddress, ConnectedProfileCallback connectedProfileCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_is_profile_connected")]
+        internal static extern int IsProfileConnected(string deviceAddress, int profile, out bool connectionStatus);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_bond_created_cb")]
+        internal static extern int SetBondCreatedCallback(BondCreatedCallback bondCreatedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_bond_created_cb")]
+        internal static extern int UnsetBondCreatedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_bond_destroyed_cb")]
+        internal static extern int SetBondDestroyedCallback(BondDestroyedCallback bondDestroyedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_bond_destroyed_cb")]
+        internal static extern int UnsetBondDestroyedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_authorization_changed_cb")]
+        internal static extern int SetAuthorizationChangedCallback(AuthorizationChangedCallback authorizationChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_authorization_changed_cb")]
+        internal static extern int UnsetAuthorizationChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_service_searched_cb")]
+        internal static extern int SetServiceSearchedCallback(ServiceSearchedCallback serviceSearchedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_service_searched_cb")]
+        internal static extern int UnsetServiceSearchedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_connection_state_changed_cb")]
+        internal static extern int SetConnectionStateChangedCallback(DeviceConnectionStateChangedCallback connectionChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_connection_state_changed_cb")]
+        internal static extern int UnsetConnectionStateChangedCallback();
+
+        // Bluetooth LE Adapter
+
+        //Callback for event
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AdapterLeScanResultChangedCallBack(int result,
+            [MarshalAs(UnmanagedType.Struct)]ref BluetoothLeScanDataStruct scanData, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void AdvertisingStateChangedCallBack(int result, IntPtr advertiserHandle,
+                            BluetoothLeAdvertisingState advertisingState, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void GattConnectionStateChangedCallBack(int result, bool connected,
+                                        string remoteAddress, IntPtr userData);
+
+        //Bluetooth Le Adapter Apis
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_start_scan")]
+        public static extern int StartScan(AdapterLeScanResultChangedCallBack callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_stop_scan")]
+        public static extern int StopScan();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_uuids")]
+        public static extern int GetScanResultServiceUuid(ref BluetoothLeScanDataStruct scanData,
+            BluetoothLePacketType packetType, ref IntPtr uuids, ref int count);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_device_name")]
+        public static extern int GetLeScanResultDeviceName(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType packetType, out string deviceName);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_tx_power_level")]
+        public static extern int GetScanResultTxPowerLevel(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType packetType, out int txPowerLevel);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_solicitation_uuids")]
+        public static extern int GetScaResultSvcSolicitationUuids(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType packetType, out IntPtr uuids, out int count);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_data_list")]
+        public static extern int GetScanResultServiceDataList(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType PacketType, out IntPtr serviceDataArray, out int count);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_free_service_data_list")]
+        public static extern int FreeServiceDataList(IntPtr serviceData, int count);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")]\r
+        public static extern int GetScanResultAppearance(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType packetType, out int appearance);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_manufacturer_data")]
+        public static extern int GetScanResultManufacturerData(ref BluetoothLeScanDataStruct scanData,
+                            BluetoothLePacketType packetType, out int manufId, out IntPtr manufData,
+                            out int manufDataLength);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_connect")]
+        internal static extern int GattConnect(string deviceAddress, bool autoConnect);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_disconnect")]
+        internal static extern int GattDisconnect(string deviceAddress);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_connection_state_changed_cb")]
+        internal static extern int SetGattConnectionStateChangedCallback(
+            GattConnectionStateChangedCallBack gattConnectionChangedCb, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_unset_connection_state_changed_cb")]
+        internal static extern int UnsetGattConnectionStateChangedCallback();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_create_advertiser")]
+        public static extern int CreateAdvertiser(out IntPtr advertiserHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_destroy_advertiser")]
+        public static extern int DestroyAdvertiser(IntPtr advertiserHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_uuid")]
+        public static extern int AddAdvertisingServiceUuid(IntPtr advertiserHandle,
+                                    BluetoothLePacketType PacketType, string uuid);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_solicitation_uuid")]
+        public static extern int AddAdvertisingServiceSolicitationUuid(IntPtr advertiserHandle,
+            BluetoothLePacketType PacketType, string uuid);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_data")]
+        public static extern int AddAdvertisingServiceData(IntPtr advertiserHandle,
+            BluetoothLePacketType PacketType, string uuid, IntPtr serviceData, int serviceDatalength);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_appearance")]
+        public static extern int SetAdvertisingAppearance(IntPtr advertiserHandle,
+                                    BluetoothLePacketType packetType, int appearance);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_manufacturer_data")]
+        public static extern int AddAdvertisingManufData(IntPtr advertiserHandle, BluetoothLePacketType packetType,
+            int manufId, IntPtr manufData, int manufacturerDataLength);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_device_name")]
+        public static extern int SetAdvertisingDeviceName(IntPtr advertiserHandle, BluetoothLePacketType packetType,
+                                                bool includeName);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_tx_power_level")]
+        public static extern int SetAdvertisingTxPowerLevel(IntPtr advertiserHandle, BluetoothLePacketType packetType,
+                                                bool includePowerLevel);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_clear_advertising_data")]
+        public static extern int ClearAdvertisingData(IntPtr advertiserHandle, BluetoothLePacketType packetType);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_start_advertising_new")]
+        public static extern int BluetoothLeStartAdvertising(IntPtr advertiserHandle,
+                                         AdvertisingStateChangedCallBack callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_stop_advertising")]
+        public static extern int BluetoothLeStopAdvertising(IntPtr advertiserHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_mode")]
+        public static extern int SetAdvertisingMode(IntPtr advertiserHandle,
+                                        BluetoothLeAdvertisingMode advertisingMode);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_connectable")]
+        public static extern int SetAdvertisingConnectable(IntPtr advertiserHandle,
+                                        bool connectable);
+
+        //Bluetooth Socket
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_create_rfcomm")]
+        internal static extern int CreateServerSocket(string serviceUuid, out int socketFd);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_destroy_rfcomm")]
+        internal static extern int DestroyServerSocket(int socketFd);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_listen_and_accept_rfcomm")]
+        internal static extern int Listen(int socketFd, int pendingConnections);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_connect_rfcomm")]
+        internal static extern int ConnectSocket(string address, string serviceUuid);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_disconnect_rfcomm")]
+        internal static extern int DisconnectSocket(int socketFd);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_send_data")]
+        internal static extern int SendData(int socketFd, string data, int dataLength);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_set_data_received_cb")]
+        internal static extern int SetDataReceivedCallback(DataReceivedCallback callback, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_unset_data_received_cb")]
+        internal static extern int UnsetDataReceivedCallback();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_set_connection_state_changed_cb")]
+        internal static extern int SetConnectionStateChangedCallback(SocketConnectionStateChangedCallback callback, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_unset_connection_state_changed_cb")]
+        internal static extern int UnsetSocketConnectionStateChangedCallback();
+
+        // Bluetooth Audio
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_initialize")]
+        internal static extern int InitializeAudio();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_deinitialize")]
+        internal static extern int DeinitializeAudio();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_connect")]
+        internal static extern int Connect(string deviceAddress, int profileType);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_disconnect")]
+        internal static extern int Disconnect(string deviceAddress, int profileType);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_set_connection_state_changed_cb")]
+        internal static extern int SetAudioConnectionStateChangedCallback(AudioConnectionStateChangedCallback audioStateChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_unset_connection_state_changed_cb")]
+        internal static extern int UnsetAudioConnectionStateChangedCallback();
+
+        //Bluetooth Hid
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_initialize")]
+        internal static extern int InitializeHid(HidConnectionStateChangedCallback hidConnectionChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_deinitialize")]
+        internal static extern int DeinitializeHid();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_connect")]
+        internal static extern int Connect(string deviceAddress);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_disconnect")]
+        internal static extern int Disconnect(string deviceAddress);
+
+        //Bluetooth Avrcp
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_initialize")]
+        internal static extern int InitializeAvrcp(TargetConnectionStateChangedCallback targetStateChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_deinitialize")]
+        internal static extern int DeinitializeAvrcp();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_equalizer_state")]
+        internal static extern int NotifyEqualizerState(int state);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_repeat_mode")]
+        internal static extern int NotifyRepeatMode(int repeat);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_shuffle_mode")]
+        internal static extern int NotifyShuffleMode(int shuffle);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_scan_mode")]
+        internal static extern int NotifyScanMode(int scan);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_player_state")]
+        internal static extern int NotifyPlayerState(int state);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_position")]
+        internal static extern int NotifyCurrentPosition(uint position);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_track")]
+        internal static extern int NotifyTrack(string title, string artist, string album, string genre, uint trackNum, uint totaltracks, uint duration);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_equalizer_state_changed_cb")]
+        internal static extern int SetEqualizerStateChangedCallback(EqualizerStateChangedCallback equalizerStateChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_equalizer_state_changed_cb")]
+        internal static extern int UnsetEqualizerStateChangedCallback();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_repeat_mode_changed_cb")]
+        internal static extern int SetRepeatModeChangedCallback(RepeatModeChangedCallback repeatModeChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_repeat_mode_changed_cb")]
+        internal static extern int UnsetRepeatModeChangedCallback();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_shuffle_mode_changed_cb")]
+        internal static extern int SetShuffleModeChangedCallback(ShuffleModeChangedCallback shuffleModeChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_shuffle_mode_changed_cb")]
+        internal static extern int UnsetShuffleModeChangedCallback();
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_scan_mode_changed_cb")]
+        internal static extern int SetScanModeChangedCallback(ScanModeChangedCallback scanModeChangedCb, IntPtr userData);
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_scan_mode_changed_cb")]
+        internal static extern int UnsetScanModeChangedCallback();
+
+        // Bluetooth GATT
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool BtGattForeachCallback(int total, int index, IntPtr gattHandle, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtGattServerReadValueRequestedCallback(string clientAddress, int requestId, IntPtr serverHandle, IntPtr gattHandle, int offset, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtGattServerWriteValueRequestedCallback(string clientAddress, int requestId, IntPtr serverHandle, IntPtr gattHandle, int offset, bool response_needed, byte[] value, int len, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtClientCharacteristicValueChangedCallback(IntPtr characteristicHandle, byte[] value, int len, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtGattServerNotificationStateChangeCallback(bool notify, IntPtr serverHandle, IntPtr characteristicHandle, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtGattServerNotificationSentCallback(int result, string clientAddress, IntPtr serverHandle, IntPtr characteristicHandle, bool completed, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void BtGattClientRequestCompletedCallback(int result, IntPtr requestHandle, IntPtr userData);
+
+        // Gatt Attribute
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_destroy")]
+        internal static extern int BtGattDestroy(IntPtr gattHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_uuid")]
+        internal static extern int BtGattGetUuid(BluetoothGattAttributeHandle gattHandle, out string uuid);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_value")]
+        internal static extern int BtGattGetValue(BluetoothGattAttributeHandle gattHandle, out IntPtr nativeValue, out int valueLength);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_value")]
+        internal static extern int BtGattSetValue(BluetoothGattAttributeHandle gattHandle, byte[] value, int valueLength);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_int_value")]
+        internal static extern int BtGattGetIntValue(BluetoothGattAttributeHandle gattHandle, int type, int offset, out int value);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_int_value")]
+        internal static extern int BtGattSetIntValue(BluetoothGattAttributeHandle gattHandle, int type, int value, int offset);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_float_value")]
+        internal static extern int BtGattGetFloatValue(BluetoothGattAttributeHandle gattHandle, int type, int offset, out float value);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_float_value")]
+        internal static extern int BtGattSetFloatValue(BluetoothGattAttributeHandle gattHandle, int type, int mantissa, int exponent, int offset);
+
+        // GATT Descriptor
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_descriptor_create")]
+        internal static extern int BtGattDescriptorCreate(string uuid, int permissions, byte[] value, int valueLength, out BluetoothGattAttributeHandle descriptorHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_descriptor_get_permissions")]
+        internal static extern int BtGattDescriptorGetPermissions(BluetoothGattAttributeHandle descriptorHandle, out int permissions);
+
+        // GATT Characteristic
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_create")]
+        internal static extern int BtGattCharacteristicCreate(string uuid, int permissions, int properties, byte[] value, int valueLength, out BluetoothGattAttributeHandle characteristicHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_permissions")]
+        internal static extern int BtGattCharacteristicGetPermissions(BluetoothGattAttributeHandle characteristicHandle, out int permissions);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_properties")]
+        internal static extern int BtGattCharacteristicGetProperties(BluetoothGattAttributeHandle characteristicHandle, out int properties);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_set_properties")]
+        internal static extern int BtGattCharacteristicSetProperties(BluetoothGattAttributeHandle characteristicHandle, int properties);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_write_type")]
+        internal static extern int BtGattCharacteristicGetWriteType(BluetoothGattAttributeHandle characteristicHandle, out int writeType);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_set_write_type")]
+        internal static extern int BtGattCharacteristicSetWriteType(BluetoothGattAttributeHandle characteristicHandle, int writeType);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_add_descriptor")]
+        internal static extern int BtGattCharacteristicAddDescriptor(BluetoothGattAttributeHandle characteristicHandle, BluetoothGattAttributeHandle descriptorHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_descriptor")]
+        internal static extern int BtGattCharacteristicGetDescriptor(BluetoothGattAttributeHandle characteristicHandle, string uuid, out BluetoothGattAttributeHandle descriptorHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_foreach_descriptors")]
+        internal static extern int BtGattCharacteristicForeachDescriptors(BluetoothGattAttributeHandle characteristicHandle, BtGattForeachCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_set_characteristic_value_changed_cb")]
+        internal static extern int BtGattClientSetCharacteristicValueChangedCallback(BluetoothGattAttributeHandle characteristicHandle, BtClientCharacteristicValueChangedCallback cb, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_unset_characteristic_value_changed_cb")]
+        internal static extern int BtGattClientUnsetCharacteristicValueChangedCallback(BluetoothGattAttributeHandle characteristicHandle);
+
+        // GATT Service
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_create")]
+        internal static extern int BtGattServiceCreate(string uuid, int type, out BluetoothGattAttributeHandle serviceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_add_characteristic")]
+        internal static extern int BtGattServiceAddCharacteristic(BluetoothGattAttributeHandle serviceHandle, BluetoothGattAttributeHandle characteristicHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_get_characteristic")]
+        internal static extern int BtGattServiceGetCharacteristic(BluetoothGattAttributeHandle serviceHandle, string uuid, out BluetoothGattAttributeHandle characteristicHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_foreach_characteristics")]
+        internal static extern int BtGattServiceForeachCharacteristics(BluetoothGattAttributeHandle serviceHandle, BtGattForeachCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_add_included_service")]
+        internal static extern int BtGattServiceAddIncludedService(BluetoothGattAttributeHandle serviceHandle, BluetoothGattAttributeHandle includedServiceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_get_included_service")]
+        internal static extern int BtGattServiceGetIncludedService(BluetoothGattAttributeHandle serviceHandle, string uuid, out BluetoothGattAttributeHandle includedServiceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_foreach_included_services")]
+        internal static extern int BtGattServiceForeachIncludedServices(BluetoothGattAttributeHandle serviceHandle, BtGattForeachCallback callback, IntPtr userData);
+
+        // GATT Client
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_destroy")]
+        internal static extern int BtGattClientDestroy(IntPtr clientHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_create")]
+        internal static extern int BtGattClientCreate(string remoteAddress, out BluetoothGattClientHandle clientHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_get_remote_address")]
+        internal static extern int BtGattClientGetRemoteAddress(BluetoothGattClientHandle clientHandle, out string remoteAddress);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_get_service")]
+        internal static extern int BtGattClientGetService(BluetoothGattClientHandle clientHandle, string uuid, out BluetoothGattAttributeHandle serviceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_foreach_services")]
+        internal static extern int BtGattClientForeachServices(BluetoothGattClientHandle clientHandle, BtGattForeachCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_read_value")]
+        internal static extern int BtGattClientReadValue(BluetoothGattAttributeHandle gattHandle, BtGattClientRequestCompletedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_write_value")]
+        internal static extern int BtGattClientWriteValue(BluetoothGattAttributeHandle gattHandle, BtGattClientRequestCompletedCallback callback, IntPtr userData);
+
+        // GATT Server
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_destroy")]
+        internal static extern int BtGattServerDestroy(IntPtr serverHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_create")]
+        internal static extern int BtGattServerCreate(out BluetoothGattServerHandle serverHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_initialize")]
+        internal static extern int BtGattServerInitialize();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_deinitialize")]
+        internal static extern int BtGattServerDeinitialize();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_read_value_requested_cb")]
+        internal static extern int BtGattServerSetReadValueRequestedCallback(BluetoothGattAttributeHandle gattHandle, BtGattServerReadValueRequestedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_write_value_requested_cb")]
+        internal static extern int BtGattServerSetWriteValueRequestedCallback(BluetoothGattAttributeHandle gattHandle, BtGattServerWriteValueRequestedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_characteristic_notification_state_change_cb")]
+        internal static extern int BtGattServeSetNotificationStateChangeCallback(BluetoothGattAttributeHandle characteristicHandle, BtGattServerNotificationStateChangeCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_start")]
+        internal static extern int BtGattServerStart();
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_register_service")]
+        internal static extern int BtGattServerRegisterService(BluetoothGattServerHandle serverHandle, BluetoothGattAttributeHandle serviceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_unregister_service")]
+        internal static extern int BtGattServerUnregisterService(BluetoothGattServerHandle serverHandle, BluetoothGattAttributeHandle serviceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_unregister_all_services")]
+        internal static extern int BtGattServerUnregisterAllServices(BluetoothGattServerHandle serverHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_get_service")]
+        internal static extern int BtGattServerGetService(BluetoothGattServerHandle serverHandle, string uuid, out BluetoothGattAttributeHandle serviceHandle);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_foreach_services")]
+        internal static extern int BtGattServerForeachServices(BluetoothGattServerHandle serverHandle, BtGattForeachCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_send_response")]
+        internal static extern int BtGattServerSendResponse(int requestId, int requestType, int offset, int status, byte[] value, int valueLen);
+
+        [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_notify_characteristic_changed_value")]
+        internal static extern int BtGattServerNotify(BluetoothGattAttributeHandle characteristicHandle, BtGattServerNotificationSentCallback callback, string clientAddress, IntPtr userData);
+    }
+}
+
+
diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs
new file mode 100644 (file)
index 0000000..576a6e2
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Glib
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool GSourceFunc(IntPtr userData);
+
+        [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint IdleAdd(GSourceFunc d, IntPtr data);
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs
new file mode 100644 (file)
index 0000000..825599e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..4aa83d4
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Bluetooth = "libcapi-network-bluetooth.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj
new file mode 100644 (file)
index 0000000..a88028a
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.9</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Bluetooth API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Network.Bluetooth.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+    <PackageReference Include="Tizen.System.Information" Version="1.0.4" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.snk b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.snk
new file mode 100644 (file)
index 0000000..f3d151d
Binary files /dev/null and b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.snk differ
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs
new file mode 100644 (file)
index 0000000..ee9aca5
--- /dev/null
@@ -0,0 +1,506 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This class is used to control the Bluetooth adapter and get the list of bonded devices.<br>
+    /// The BluetoothAdapter class is used to discover neighbouring bluetooth devices.
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    static public class BluetoothAdapter
+    {
+        /// <summary>
+        /// A property to check whether the Bluetooth is enabled.
+        /// </summary>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public bool IsBluetoothEnabled
+        {
+            get
+            {
+                return BluetoothAdapterImpl.Instance.IsBluetoothEnabled;
+            }
+        }
+
+        /// <summary>
+        /// The local adapter address.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public string Address
+        {
+            get
+            {
+                if (IsBluetoothEnabled)
+                {
+                    return BluetoothAdapterImpl.Instance.Address;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+
+        /// <summary>
+        /// The name of the local adapter.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public string Name
+        {
+            get
+            {
+                if (IsBluetoothEnabled)
+                {
+                    return BluetoothAdapterImpl.Instance.Name;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            set
+            {
+                BluetoothAdapterImpl.Instance.Name = value;
+            }
+        }
+
+        /// <summary>
+        /// The visibility mode of the Bluetooth adapter.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public VisibilityMode Visibility
+        {
+            get
+            {
+                if (IsBluetoothEnabled)
+                {
+                    return BluetoothAdapterImpl.Instance.Visibility;
+                }
+                else
+                {
+                    return VisibilityMode.NonDiscoverable;
+                }
+            }
+        }
+
+        /// <summary>
+        /// A property to check whether the device discovery process is in progress.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public bool IsDiscoveryInProgress
+        {
+            get
+            {
+                if (IsBluetoothEnabled)
+                {
+                    return BluetoothAdapterImpl.Instance.IsDiscoveryInProgress;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+
+        /// <summary>
+        /// The remaining time, in seconds, until the visibility mode is changed from TimeLimitedDiscoverable to NonDiscoverable.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public int RemainingTimeAsVisible
+        {
+            get
+            {
+                if (IsBluetoothEnabled)
+                {
+                    return BluetoothAdapterImpl.Instance.RemainingTimeAsVisible;
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+        }
+
+        /// <summary>
+        /// The StateChanged event is raised when the Bluetooth adapter state is changed.
+        /// </summary>
+        static public event EventHandler<StateChangedEventArgs> StateChanged
+        {
+            add
+            {
+                BluetoothAdapterImpl.Instance.StateChanged += value;
+            }
+            remove
+            {
+                BluetoothAdapterImpl.Instance.StateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The NameChanged event is raised when the Bluetooth adapter name is changed.
+        /// </summary>
+        static public event EventHandler<NameChangedEventArgs> NameChanged
+        {
+            add
+            {
+                BluetoothAdapterImpl.Instance.NameChanged += value;
+            }
+            remove
+            {
+                BluetoothAdapterImpl.Instance.NameChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The VisibilityModeChanged event is raised when the Bluetooth adapter visibility mode is changed.
+        /// </summary>
+        static public event EventHandler<VisibilityModeChangedEventArgs> VisibilityModeChanged
+        {
+            add
+            {
+                BluetoothAdapterImpl.Instance.VisibilityModeChanged += value;
+            }
+            remove
+            {
+                BluetoothAdapterImpl.Instance.VisibilityModeChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The VisibilityDurationChanged event is raised very second until the visibility mode is changed to NonDiscoverable.
+        /// </summary>
+        static public event EventHandler<VisibilityDurationChangedEventArgs> VisibilityDurationChanged
+        {
+            add
+            {
+                BluetoothAdapterImpl.Instance.VisibilityDurationChanged += value;
+            }
+            remove
+            {
+                BluetoothAdapterImpl.Instance.VisibilityDurationChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The DiscoveryStateChanged event is raised when the device discovery state is changed.
+        /// </summary>
+        static public event EventHandler<DiscoveryStateChangedEventArgs> DiscoveryStateChanged
+        {
+            add
+            {
+                BluetoothAdapterImpl.Instance.DiscoveryStateChanged += value;
+            }
+            remove
+            {
+                BluetoothAdapterImpl.Instance.DiscoveryStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// This event is called when the LE scan result is obtained.
+        /// </summary>
+        static public event EventHandler<AdapterLeScanResultChangedEventArgs> ScanResultChanged
+        {
+            add
+            {
+                BluetoothLeImplAdapter.Instance.AdapterLeScanResultChanged += value;
+            }
+            remove {
+                BluetoothLeImplAdapter.Instance.AdapterLeScanResultChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Starts the device discovery process.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and the device discovery process can be stopped by StopDiscovery().
+        /// If this succeeds, the DiscoveryStateChanged event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or the start discovery fails.</exception>
+        static public void StartDiscovery()
+        {
+            if (IsBluetoothEnabled)
+            {
+                BluetoothAdapterImpl.Instance.StartDiscovery();
+            }
+        }
+
+        /// <summary>
+        /// Stops the device discovery process.
+        /// </summary>
+        /// <remarks>
+        /// The device discovery process must be in progress with StartDiscovery().
+        /// If this succeeds, the DiscoveryStateChanged event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled or 
+        /// the discovery process is not is progress. </exception>
+        static public void StopDiscovery()
+        {
+            if (IsDiscoveryInProgress)
+            {
+                BluetoothAdapterImpl.Instance.StopDiscovery();
+            }
+        }
+
+        /// <summary>
+        /// Retrieves the device information of all bonded devices.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns> The list of the bonded BluetoothDeviceInfo objects.</returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or reading the Bonded devices list is failed.</exception>
+        static public IEnumerable<BluetoothDevice> GetBondedDevices()
+        {
+            if (IsBluetoothEnabled)
+            {
+                return BluetoothAdapterImpl.Instance.GetBondedDevices();
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Gets the device information of a bonded device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns> Information of the bonded BluetoothDeviceInfo object.</returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or reading the bonded device information fails.</exception>
+        static public BluetoothDevice GetBondedDevice(string address)
+        {
+            if (IsBluetoothEnabled)
+            {
+                return BluetoothAdapterImpl.Instance.GetBondedDevice(address);
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the UUID of service is used or not.
+        /// </summary>
+        /// <returns><c>true</c> if the specified serviceUuid is used, otherwise <c>false</c>.</returns>
+        /// <param name="serviceUuid">The UUID of Service.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.</exception>
+        static public bool IsServiceUsed(string serviceUuid)
+        {
+            return BluetoothAdapterImpl.Instance.IsServiceUsed(serviceUuid);
+        }
+
+        /// <summary>
+        /// Gets the hash and the randomizer value of the local OOB data object.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns>The BluetoothOobData object.</returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or the read OObData procedure is failed.</exception>
+        static public BluetoothOobData GetLocalOobData()
+        {
+            if (IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                return BluetoothAdapterImpl.Instance.GetLocalOobData();
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Sets the hash and the randmoizer value of the OOB data into the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="address">The remote device address.</param>
+        /// <param name="oobData">The BluetoothOobData object.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or the set OobData procedure is failed.</exception>
+        static public void SetRemoteOobData(string address, BluetoothOobData oobData)
+        {
+            if (IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAdapterImpl.Instance.SetRemoteOobData(address, oobData);
+            }
+        }
+
+        /// <summary>
+        /// Removes the hash and the randomizer value of the OOB data from the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="address">The remote device address.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled.
+        /// or if the Remove Oobdata procedure is failed.</exception>
+        static public void RemoveRemoteOobData(string address)
+        {
+            if (IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAdapterImpl.Instance.RemoveRemoteOobData(address);
+            }
+        }
+
+        /// <summary>
+        /// Starts the Bluetooth LE scan operation to discover BLE devices
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>The result of the operation StartLeScan.
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or the Start LE scan is failed.</exception>
+        static public void StartLeScan()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.StartScan ();
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to in start the le scan operation, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Stops the Bluetooth LE scan operation.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>The result of the operation stopLescan.
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or the Stop LE scan is failed.</exception>
+        static public void StopLeScan()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.StopScan ();
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to stop the le scan operation, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Returns the BluetoothLeAdvertiser instance.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled before calling this API.
+        /// </remarks>
+        /// <returns>The BluetoothLeAdvertiser instance.</returns>
+        static public BluetoothLeAdvertiser GetBluetoothLeAdvertiser()
+        {
+            return BluetoothLeAdvertiser.Instance;
+        }
+
+        /// <summary>
+        /// Registers a rfcomm server socket with a specific UUID.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled before calling this API.
+        /// </remarks>
+        /// <returns>The BluetoothServerSocket instance.</returns>
+        /// <param name="serviceUuid">The UUID of service to provide.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or the socket create error occurs.</exception>
+        static public BluetoothServerSocket CreateServerSocket(string serviceUuid)
+        {
+            if (IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                return BluetoothAdapterImpl.Instance.CreateServerSocket (serviceUuid);
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Removes the rfcomm server socket which was created using CreateServerSocket().
+        /// </summary>
+        /// <remarks>
+        /// The socket must be created with CreateServerSocket(). The ConnectionStateChanged event is raised after this API is called.
+        /// </remarks>
+        /// <param name="socket">The server socket instance is created using CreateServerSocket().</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or the socket destroy error occurs.</exception>
+        static public void DestroyServerSocket(BluetoothServerSocket socket)
+        {
+            if (IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAdapterImpl.Instance.DestroyServerSocket(socket);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs
new file mode 100644 (file)
index 0000000..7adcffe
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth
+{
+    static internal class Globals
+    {
+        internal const string LogTag = "Tizen.Network.Bluetooth";
+        internal static bool IsInitialize = false;
+        internal static bool IsAudioInitialize = false;
+        internal static bool IsHidInitialize = false;
+    }
+
+    internal partial class BluetoothAdapterImpl : IDisposable
+    {
+        private event EventHandler<StateChangedEventArgs> _stateChanged;
+        private event EventHandler<NameChangedEventArgs> _nameChanged;
+        private event EventHandler<VisibilityModeChangedEventArgs> _visibilityModeChanged;
+        private event EventHandler<VisibilityDurationChangedEventArgs> _visibilityDurationChanged;
+        private event EventHandler<DiscoveryStateChangedEventArgs> _discoveryStateChanged;
+
+        private Interop.Bluetooth.StateChangedCallback _stateChangedCallback;
+        private Interop.Bluetooth.NameChangedCallback _nameChangedCallback;
+        private Interop.Bluetooth.VisibilityModeChangedCallback _visibilityChangedCallback;
+        private Interop.Bluetooth.VisibilityDurationChangedCallback _visibilitydurationChangedCallback;
+        private Interop.Bluetooth.DiscoveryStateChangedCallback _discoveryStateChangedCallback;
+
+        private static readonly BluetoothAdapterImpl _instance = new BluetoothAdapterImpl();
+        private bool disposed = false;
+
+        internal event EventHandler<StateChangedEventArgs> StateChanged
+        {
+            add
+            {
+                if (_stateChanged == null)
+                {
+                    RegisterStateChangedEvent();
+                }
+                _stateChanged += value;
+            }
+            remove
+            {
+                _stateChanged -= value;
+                if (_stateChanged == null)
+                {
+                    UnregisterStateChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<NameChangedEventArgs> NameChanged
+        {
+            add
+            {
+                if (_nameChanged == null)
+                {
+                    RegisterNameChangedEvent();
+                }
+                _nameChanged += value;
+            }
+            remove
+            {
+                _nameChanged -= value;
+                if (_nameChanged == null)
+                {
+                    UnregisterNameChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<VisibilityModeChangedEventArgs> VisibilityModeChanged
+        {
+            add
+            {
+                if (_visibilityModeChanged == null)
+                {
+                    RegisterVisibilityChangedEvent();
+                }
+                _visibilityModeChanged += value;
+            }
+            remove
+            {
+                _visibilityModeChanged -= value;
+                if (_visibilityModeChanged == null)
+                {
+                    UnregisterVisibilityChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<VisibilityDurationChangedEventArgs> VisibilityDurationChanged
+        {
+            add
+            {
+                if (_visibilityDurationChanged == null)
+                {
+                    RegisterVisibilityDurationChangedEvent();
+                }
+                _visibilityDurationChanged += value;
+            }
+            remove
+            {
+                _visibilityDurationChanged -= value;
+                if (_visibilityDurationChanged == null)
+                {
+                    UnregisterVisibilityDurationChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<DiscoveryStateChangedEventArgs> DiscoveryStateChanged
+        {
+            add
+            {
+                if (_discoveryStateChanged == null)
+                {
+                    RegisterDiscoveryStateChangedEvent();
+                }
+                _discoveryStateChanged+= value;
+            }
+            remove
+            {
+                _discoveryStateChanged -= value;
+                if (_discoveryStateChanged == null)
+                {
+                    UnregisterDiscoveryStateChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterStateChangedEvent()
+        {
+            _stateChangedCallback = (int result, int state, IntPtr userData) =>
+            {
+                if (_stateChanged != null)
+                {
+                    BluetoothState st = (BluetoothState)state;
+                    BluetoothError res = (BluetoothError)result;
+                    _stateChanged(null, new StateChangedEventArgs(res,st));
+                }
+            };
+            int ret = Interop.Bluetooth.SetStateChangedCallback(_stateChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterNameChangedEvent()
+        {
+            _nameChangedCallback = (string deviceName, IntPtr userData) =>
+            {
+                if (_nameChanged != null)
+                {
+                    _nameChanged(null, new NameChangedEventArgs(deviceName));
+                }
+            };
+            int ret = Interop.Bluetooth.SetNameChangedCallback(_nameChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set name changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterNameChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetNameChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset name changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterVisibilityChangedEvent()
+        {
+            _visibilityChangedCallback = (int result, int mode, IntPtr userData) =>
+            {
+                if (_visibilityModeChanged != null)
+                {
+                    VisibilityMode visibility = (VisibilityMode)mode;
+                    BluetoothError res = (BluetoothError)result;
+                    _visibilityModeChanged(null, new VisibilityModeChangedEventArgs(res,visibility));
+                }
+            };
+            int ret = Interop.Bluetooth.SetVisibilityModeChangedCallback(_visibilityChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set visibility mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterVisibilityChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetVisibilityModeChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset visibility mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterVisibilityDurationChangedEvent()
+        {
+            _visibilitydurationChangedCallback = (int duration, IntPtr userData) =>
+            {
+                if (_visibilityDurationChanged != null)
+                {
+                    _visibilityDurationChanged(null, new VisibilityDurationChangedEventArgs(duration));
+                }
+            };
+            int ret = Interop.Bluetooth.SetVisibilityDurationChangedCallback(_visibilitydurationChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set visibility duration changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterVisibilityDurationChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetVisibilityDurationChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset visiiblity duration changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterDiscoveryStateChangedEvent()
+        {
+            _discoveryStateChangedCallback = (int result, BluetoothDeviceDiscoveryState state, IntPtr deviceInfo, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Discovery state changed callback is called");
+                if (_discoveryStateChanged != null)
+                {
+                    BluetoothError res = (BluetoothError)result;
+                    switch(state)
+                    {
+                    case BluetoothDeviceDiscoveryState.Started:
+                        _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state));
+                        break;
+                    case BluetoothDeviceDiscoveryState.Finished:
+                        {
+                            _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state));
+                            break;
+                        }
+                    case BluetoothDeviceDiscoveryState.Found:
+                        {
+                            BluetoothDiscoveredDeviceStruct info = (BluetoothDiscoveredDeviceStruct)Marshal.PtrToStructure(deviceInfo, typeof(BluetoothDiscoveredDeviceStruct));
+                            _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state,BluetoothUtils.ConvertStructToDiscoveredDevice(info)));
+                            break;
+                        }
+                    default:
+                        break;
+                    }
+                }
+            };
+            int ret = Interop.Bluetooth.SetDiscoveryStateChangedCallback(_discoveryStateChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set discovery state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterDiscoveryStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetDiscoveryStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset discovery state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        internal bool IsBluetoothEnabled
+        {
+            get
+            {
+                BluetoothState active;
+                int ret = Interop.Bluetooth.GetState(out active);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get state, Error - " + (BluetoothError)ret);
+                }
+                if (active == BluetoothState.Enabled)
+                    return true;
+                else
+                    return false;
+            }
+        }
+        internal string Address
+        {
+            get
+            {
+                string address;
+                int ret = Interop.Bluetooth.GetAddress(out address);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get address, Error - " + (BluetoothError)ret);
+                    return "";
+                }
+                return address;
+            }
+        }
+
+        internal VisibilityMode Visibility
+        {
+            get
+            {
+                int visibilityMode;
+                int time;
+                int ret = Interop.Bluetooth.GetVisibility(out visibilityMode, out time);
+                if(ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get visibility mode, Error - " + (BluetoothError)ret);
+                    return VisibilityMode.NonDiscoverable;
+                }
+                return (VisibilityMode)visibilityMode;
+            }
+        }
+
+        internal bool IsDiscoveryInProgress
+        {
+            get
+            {
+                bool isDiscovering;
+                int ret = Interop.Bluetooth.IsDiscovering(out isDiscovering);
+                if(ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get discovery progress state, Error - " + (BluetoothError)ret);
+                }
+                return isDiscovering;
+            }
+        }
+
+        internal int RemainingTimeAsVisible
+        {
+            get
+            {
+                int duration = 0;
+                int visibilityMode;
+                int ret = Interop.Bluetooth.GetVisibility(out visibilityMode, out duration);
+                if ((ret != (int)BluetoothError.None) || ((VisibilityMode)visibilityMode != VisibilityMode.TimeLimitedDiscoverable))
+                {
+                    Log.Error(Globals.LogTag, "Failed to get remaining visible time, Error - " + (BluetoothError)ret);
+                }
+                return duration;
+            }
+        }
+
+        internal string Name
+        {
+            get
+            {
+                string name;
+                int ret = Interop.Bluetooth.GetName(out name);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get adapter name, Error - " + (BluetoothError)ret);
+                    return "";
+                }
+                return name;
+            }
+            set
+            {
+                int ret = Interop.Bluetooth.SetName(value.ToString());
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to set adapter name, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        internal void StartDiscovery()
+        {
+            int ret = Interop.Bluetooth.StartDiscovery();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to start discovery, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void StopDiscovery()
+        {
+            int ret = Interop.Bluetooth.StopDiscovery();
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to stop discovery, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal IEnumerable<BluetoothDevice> GetBondedDevices()
+        {
+            List<BluetoothDevice> deviceList = new List<BluetoothDevice>();
+            Interop.Bluetooth.BondedDeviceCallback callback = (ref BluetoothDeviceStruct deviceInfo, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Bonded devices cb is called");
+                if(!deviceInfo.Equals(null))
+                {
+                    deviceList.Add(BluetoothUtils.ConvertStructToDeviceClass(deviceInfo));
+                }
+                return true;
+            };
+            int ret = Interop.Bluetooth.GetBondedDevices(callback, IntPtr.Zero);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get bonded devices, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return deviceList;
+        }
+
+        internal BluetoothDevice GetBondedDevice(string address)
+        {
+            IntPtr deviceInfo;
+            int ret = Interop.Bluetooth.GetBondedDeviceByAddress(address, out deviceInfo);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get bonded device by address, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            BluetoothDeviceStruct device = (BluetoothDeviceStruct)Marshal.PtrToStructure(deviceInfo, typeof(BluetoothDeviceStruct));
+
+            return BluetoothUtils.ConvertStructToDeviceClass(device);
+        }
+
+        internal bool IsServiceUsed(string serviceUuid)
+        {
+            bool isUsed;
+            int ret = Interop.Bluetooth.IsServiceUsed(serviceUuid, out isUsed);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to check the usage of service, Error - " + (BluetoothError)ret);
+            }
+            return isUsed;
+        }
+
+        internal BluetoothOobData GetLocalOobData()
+        {
+            BluetoothOobData oobData = new BluetoothOobData();
+            IntPtr hash;
+            IntPtr randomizer;
+            int hashLength;
+            int randomizerLength;
+            int ret = Interop.Bluetooth.GetOobData(out hash, out randomizer, out hashLength, out randomizerLength);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get the local oob data, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+
+            byte[] hashArr = new byte[hashLength];
+            Marshal.Copy(hash, hashArr, 0, hashLength);
+            byte[] randomizerArr = new byte[randomizerLength];
+            Marshal.Copy(randomizer, randomizerArr, 0, randomizerLength);
+
+            oobData.HashValue = hashArr;
+            oobData.RandomizerValue = randomizerArr;
+            return oobData;
+        }
+
+        internal void SetRemoteOobData(string deviceAddress, BluetoothOobData oobData)
+        {
+            byte[] hash = oobData.HashValue;
+            byte[] randomizer = oobData.RandomizerValue;
+            int hashLength = hash.Length;
+            int randomizerLength = randomizer.Length;
+
+            IntPtr hashPtr = Marshal.AllocHGlobal(hashLength);
+            Marshal.Copy(hash, 0, hashPtr, hashLength);
+            IntPtr randomizerPtr = Marshal.AllocHGlobal(randomizerLength);
+            Marshal.Copy(randomizer, 0, randomizerPtr, randomizerLength);
+
+            int ret = Interop.Bluetooth.SetOobData(deviceAddress, hashPtr, randomizerPtr, hashLength, randomizerLength);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set the remote oob data, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void RemoveRemoteOobData(string deviceAddress)
+        {
+            int ret = Interop.Bluetooth.RemoveOobData(deviceAddress);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to remove the remote oob data, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal BluetoothServerSocket CreateServerSocket(string serviceUuid)
+        {
+            int socketFd;
+            int ret = Interop.Bluetooth.CreateServerSocket(serviceUuid, out socketFd);
+            if(ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to create server socket, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            Log.Info (Globals.LogTag, "Created socketfd: "+ socketFd);
+            return new BluetoothServerSocket(socketFd);
+        }
+
+        internal void DestroyServerSocket(BluetoothServerSocket socket)
+        {
+            int ret = Interop.Bluetooth.DestroyServerSocket(socket.socketFd);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to destroy socket, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal static BluetoothAdapterImpl Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        private BluetoothAdapterImpl()
+        {
+            initialize();
+        }
+
+        ~BluetoothAdapterImpl()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            RemoveAllRegisteredEvent();
+            deinitialize();
+            disposed = true;
+        }
+
+        private void initialize()
+        {
+            int ret = Interop.Bluetooth.Initialize();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error (Globals.LogTag, "Failed to initialize bluetooth, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException (ret);
+            }
+            else
+            {
+                Globals.IsInitialize = true;
+            }
+        }
+
+        private void deinitialize()
+        {
+            int ret = Interop.Bluetooth.Deinitialize();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException (ret);
+            }
+            else
+            {
+                Globals.IsInitialize = false;
+            }
+        }
+
+        private void RemoveAllRegisteredEvent()
+        {
+            //unregister all remaining events when this object is released.
+            if (_stateChanged != null)
+            {
+                UnregisterStateChangedEvent();
+            }
+
+            if (_nameChanged != null)
+            {
+                UnregisterNameChangedEvent();
+            }
+
+            if (_visibilityDurationChanged != null)
+            {
+                UnregisterVisibilityDurationChangedEvent();
+            }
+
+            if (_visibilityModeChanged != null)
+            {
+                UnregisterVisibilityChangedEvent();
+            }
+
+            if (_discoveryStateChanged != null)
+            {
+                UnregisterDiscoveryStateChangedEvent();
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs
new file mode 100644 (file)
index 0000000..614607f
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This class is used to handle the connection with other Bluetooth audio devices
+    /// like headset, hands-free, and headphone.
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    public class BluetoothAudio : BluetoothProfile
+    {
+        internal BluetoothAudio()
+        {
+        }
+
+        /// <summary>
+        /// The AudioConnectionStateChanged event is called when the audio connection state is changed.
+        /// </summary>
+        public event EventHandler<AudioConnectionStateChangedEventArgs> AudioConnectionStateChanged
+        {
+            add
+            {
+                BluetoothAudioImpl.Instance.AudioConnectionStateChanged += value;
+            }
+            remove
+            {
+                BluetoothAudioImpl.Instance.AudioConnectionStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Connects the remote device with the given audio profile.
+        /// </summary>
+        /// <remarks>
+        /// The device must be bonded with the remote device by CreateBond(). If connection request succeeds, the AudioConnectionStateChanged event will be invoked.
+        /// If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp <br>
+        /// and AdvancedAudioDistribution is connected.
+        /// </remarks>
+        /// <param name="profileType">The type of the audio profile.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the connection attempt fails.</exception>
+        public void Connect(BluetoothAudioProfileType profileType)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothAudioImpl.Instance.Connect(RemoteAddress, profileType);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to Connect - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Disconnects the remote device with the given audio profile.
+        /// </summary>
+        /// <remarks>
+        /// The device must be connected by Connect(). If the disconnection request succeeds, the AudioConnectionStateChanged event will be invoked.
+        /// If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp <br>
+        /// and AdvancedAudioDistribution is disconnected.
+        /// </remarks>
+        /// <param name="type">The type of the audio profile.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when Disconnection attempt fails.</exception>
+        public void Disconnect(BluetoothAudioProfileType type)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothAudioImpl.Instance.Disconnect(RemoteAddress, type);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to Disconnect - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs
new file mode 100644 (file)
index 0000000..6570dc9
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    internal class BluetoothAudioImpl : IDisposable
+    {
+        private event EventHandler<AudioConnectionStateChangedEventArgs> _audioConnectionChanged;
+        private Interop.Bluetooth.AudioConnectionStateChangedCallback _audioConnectionChangedCallback;
+
+        private static readonly BluetoothAudioImpl _instance = new BluetoothAudioImpl();
+        private bool disposed = false;
+
+        internal event EventHandler<AudioConnectionStateChangedEventArgs> AudioConnectionStateChanged
+        {
+            add
+            {
+                if (_audioConnectionChanged == null)
+                {
+                    RegisterAudioConnectionChangedEvent();
+                }
+                _audioConnectionChanged += value;
+            }
+            remove
+            {
+                _audioConnectionChanged -= value;
+                if (_audioConnectionChanged == null)
+                {
+                    UnregisterAudioConnectionChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterAudioConnectionChangedEvent()
+        {
+            _audioConnectionChangedCallback = (int result, bool connected, string deviceAddress, int profileType, IntPtr userData) =>
+            {
+                if (_audioConnectionChanged != null)
+                {
+                    _audioConnectionChanged(null, new AudioConnectionStateChangedEventArgs(result, connected, deviceAddress, (BluetoothAudioProfileType)profileType));
+                }
+            };
+            int ret = Interop.Bluetooth.SetAudioConnectionStateChangedCallback(_audioConnectionChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set audio connection changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterAudioConnectionChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetAudioConnectionStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset audio connection changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        internal int Connect(string deviceAddress, BluetoothAudioProfileType type)
+        {
+            int ret = Interop.Bluetooth.Connect(deviceAddress, (int)type);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to connect device with the given profile type, Error - " + (BluetoothError)ret);
+            }
+            return ret;
+        }
+
+        internal int Disconnect(string deviceAddress, BluetoothAudioProfileType type)
+        {
+            int ret = Interop.Bluetooth.Disconnect(deviceAddress, (int)type);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to disconnect device with the given profile type, Error - " + (BluetoothError)ret);
+            }
+            return ret;
+        }
+
+        internal static BluetoothAudioImpl Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        private BluetoothAudioImpl ()
+        {
+            Log.Info(Globals.LogTag, "Initializing audio");
+            initialize();
+        }
+
+        ~BluetoothAudioImpl()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            deinitialize();
+            RemoveAllRegisteredEvent();
+            disposed = true;
+        }
+
+        private void initialize()
+        {
+            if (Globals.IsInitialize)
+            {
+                int ret = Interop.Bluetooth.InitializeAudio ();
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to initialize bluetoothaudio, Error - " + (BluetoothError)ret);
+                    Globals.IsAudioInitialize = false;
+                    BluetoothErrorFactory.ThrowBluetoothException (ret);
+                }
+                else
+                {
+                    Globals.IsAudioInitialize = true;
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized);
+            }
+        }
+
+        private void deinitialize()
+        {
+            if (Globals.IsAudioInitialize) {
+                int ret = Interop.Bluetooth.DeinitializeAudio ();
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to deinitialize bluetoothaudio, Error - " + (BluetoothError)ret);
+                }
+            }
+        }
+
+        private void RemoveAllRegisteredEvent()
+        {
+            if (_audioConnectionChanged != null)
+            {
+                UnregisterAudioConnectionChangedEvent();
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs
new file mode 100644 (file)
index 0000000..ac814ee
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This class is used to notify changes of the target device (For example, media player) to the control device (For example, headset).
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    public class BluetoothAvrcp : BluetoothProfile
+    {
+        internal BluetoothAvrcp()
+        {
+        }
+
+        /// <summary>
+        /// The TargetConnectionStateChanged event is invoked when the connection state is changed.
+        /// </summary>
+        public event EventHandler<TargetConnectionStateChangedEventArgs> TargetConnectionStateChanged
+        {
+            add
+            {
+                BluetoothAvrcpImpl.Instance.TargetConnectionStateChanged += value;
+            }
+            remove
+            {
+                BluetoothAvrcpImpl.Instance.TargetConnectionStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The EqualizerStateChanged event is invoked when the equalizer state is changed by the remote control device.
+        /// </summary>
+        public event EventHandler<EqualizerStateChangedEventArgs> EqualizerStateChanged
+        {
+            add
+            {
+                BluetoothAvrcpImpl.Instance.EqualizerStateChanged += value;
+            }
+            remove
+            {
+                BluetoothAvrcpImpl.Instance.EqualizerStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The RepeatModeChanged event is invoked when the repeat mode is changed by the remote control device.
+        /// </summary>
+        public event EventHandler<RepeatModeChangedEventArgs> RepeatModeChanged
+        {
+            add
+            {
+                BluetoothAvrcpImpl.Instance.RepeatModeChanged += value;
+            }
+            remove
+            {
+                BluetoothAvrcpImpl.Instance.RepeatModeChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The ShuffleModeChanged event is invoked when the shuffle mode is changed by the remote control device.
+        /// </summary>
+        public event EventHandler<ShuffleModeChangedeventArgs> ShuffleModeChanged
+        {
+            add
+            {
+                BluetoothAvrcpImpl.Instance.ShuffleModeChanged += value;
+            }
+            remove
+            {
+                BluetoothAvrcpImpl.Instance.ShuffleModeChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// The ScanModeChanged event is invoked when the scan mode is changed by the remote control device.
+        /// </summary>
+        public event EventHandler<ScanModeChangedEventArgs> ScanModeChanged
+        {
+            add
+            {
+                BluetoothAvrcpImpl.Instance.ScanModeChanged += value;
+            }
+            remove
+            {
+                BluetoothAvrcpImpl.Instance.ScanModeChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Notifies the equalize state to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="state">The equalizer state.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the equalizer state to the remote device fails.</exception>
+        public void NotifyEqualizerState(EqualizerState state)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyEqualizeState(state);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the repeat mode to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="mode">The repeat mode.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the repeat mode state to the remote device fails.</exception>
+        /// </exception>
+        public void NotifyRepeatMode(RepeatMode mode)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyRepeatMode(mode);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the shuffle mode to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="mode">The shuffle mode.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the shuffle mode state to the remote device fails.</exception>
+        public void NotifyShuffleMode(ShuffleMode mode)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyShuffleMode(mode);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the scan mode to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="mode">The scan mode.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the scan mode state to the remote device fails.</exception>
+        public void NotifyScanMode(ScanMode mode)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyScanMode(mode);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the player state to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="state">The player state.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the player state to the remote device fails.</exception>
+        public void NotifyPlayerState(PlayerState state)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyPlayerState(state);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the current position of the song to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="position">The current position in milliseconds.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the current position state to the remote device fails.</exception>
+        public void NotifyCurrentPosition(uint position)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyCurrentPosition(position);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Notifies the track to the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The remote device must be connected.
+        /// </remarks>
+        /// <param name="trackData">The data of the track.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when notifying the shuffle track state to the remote device fails.</exception>
+        public void NotifyTrack(Track trackData)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothAvrcpImpl.Instance.NotifyTrack(trackData);
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs
new file mode 100644 (file)
index 0000000..28abda8
--- /dev/null
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    internal class BluetoothAvrcpImpl : IDisposable
+    {
+        private event EventHandler<TargetConnectionStateChangedEventArgs> _targetConnectionChanged;
+        private event EventHandler<EqualizerStateChangedEventArgs> _equalizerStateChanged;
+        private event EventHandler<RepeatModeChangedEventArgs> _repeatModeChanged;
+        private event EventHandler<ScanModeChangedEventArgs> _scanModeChanged;
+        private event EventHandler<ShuffleModeChangedeventArgs> _shuffleModeChanged;
+
+        private Interop.Bluetooth.TargetConnectionStateChangedCallback _targetConnectionChangedCallback;
+        private Interop.Bluetooth.EqualizerStateChangedCallback _equalizerStateChangedCallback;
+        private Interop.Bluetooth.RepeatModeChangedCallback _repeatModeChangedCallback;
+        private Interop.Bluetooth.ShuffleModeChangedCallback _shuffleModeChangedCallback;
+        private Interop.Bluetooth.ScanModeChangedCallback _scanModeChangedCallback;
+
+        private static BluetoothAvrcpImpl _instance = new BluetoothAvrcpImpl();
+        private bool disposed = false;
+
+        internal event EventHandler<TargetConnectionStateChangedEventArgs> TargetConnectionStateChanged
+        {
+            add
+            {
+                _targetConnectionChanged += value;
+            }
+            remove
+            {
+                _targetConnectionChanged -= value;
+            }
+        }
+
+        internal event EventHandler<EqualizerStateChangedEventArgs> EqualizerStateChanged
+        {
+            add
+            {
+                if (_equalizerStateChanged == null)
+                {
+                    RegisterEqualizerStateChangedEvent();
+                }
+                _equalizerStateChanged += value;
+            }
+            remove
+            {
+                _equalizerStateChanged -= value;
+                if (_equalizerStateChanged == null)
+                {
+                    UnregisterEqualizerStateChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<RepeatModeChangedEventArgs> RepeatModeChanged
+        {
+            add
+            {
+                if (_repeatModeChanged == null)
+                {
+                    RegisterRepeatModeChangedEvent();
+                }
+                _repeatModeChanged += value;
+            }
+            remove
+            {
+                _repeatModeChanged -= value;
+                if (_repeatModeChanged == null)
+                {
+                    UnregisterRepeatModeChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<ShuffleModeChangedeventArgs> ShuffleModeChanged
+        {
+            add
+            {
+                if (_shuffleModeChanged == null)
+                {
+                    RegisterShuffleModeChangedEvent();
+                }
+                _shuffleModeChanged += value;
+            }
+            remove
+            {
+                _shuffleModeChanged -= value;
+                if (_shuffleModeChanged == null)
+                {
+                    UnregisterShuffleModeChangedEvent();
+                }
+            }
+        }
+
+        internal event EventHandler<ScanModeChangedEventArgs> ScanModeChanged
+        {
+            add
+            {
+                if (_scanModeChanged == null)
+                {
+                    RegisterScanModeChangedEvent();
+                }
+                _scanModeChanged += value;
+            }
+            remove
+            {
+                _scanModeChanged -= value;
+                if (_scanModeChanged == null)
+                {
+                    UnregisterScanModeChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterEqualizerStateChangedEvent()
+        {
+            _equalizerStateChangedCallback = (int equalizer, IntPtr userData) =>
+            {
+                if (_equalizerStateChanged != null)
+                {
+                    EqualizerState state = (EqualizerState) equalizer;
+                    _equalizerStateChanged(null, new EqualizerStateChangedEventArgs(state));
+                }
+            };
+            int ret = Interop.Bluetooth.SetEqualizerStateChangedCallback(_equalizerStateChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set equalizer state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+        private void UnregisterEqualizerStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetEqualizerStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset equalizer state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterRepeatModeChangedEvent()
+        {
+            _repeatModeChangedCallback = (int repeat, IntPtr userData) =>
+            {
+                if (_repeatModeChanged != null)
+                {
+                    RepeatMode mode = (RepeatMode)repeat;
+                    _repeatModeChanged(null, new RepeatModeChangedEventArgs(mode));
+                }
+            };
+            int ret = Interop.Bluetooth.SetRepeatModeChangedCallback(_repeatModeChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set repeat mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+        private void UnregisterRepeatModeChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetRepeatModeChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset repeat mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterShuffleModeChangedEvent()
+        {
+            Log.Debug (Globals.LogTag, "inside RegisterShuffleModeChangedEvent");
+            _shuffleModeChangedCallback = (int shuffle, IntPtr userData) =>
+            {
+                Log.Debug (Globals.LogTag, "inside RegisterShuffleModeChangedEvent callback");
+                if (_shuffleModeChanged != null)
+                {
+                    ShuffleMode mode = (ShuffleMode) shuffle;
+                    _shuffleModeChanged(null, new ShuffleModeChangedeventArgs(mode));
+                }
+            };
+            int ret = Interop.Bluetooth.SetShuffleModeChangedCallback(_shuffleModeChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Debug (Globals.LogTag, "failed inside RegisterShuffleModeChangedEvent");
+                Log.Error(Globals.LogTag, "Failed to set shuffle mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+        private void UnregisterShuffleModeChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetShuffleModeChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset shuffle mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterScanModeChangedEvent()
+        {
+            _scanModeChangedCallback = (int scan, IntPtr userData) =>
+            {
+                if (_scanModeChanged != null)
+                {
+                    ScanMode mode = (ScanMode) scan;
+                    _scanModeChanged(null, new ScanModeChangedEventArgs(mode));
+                }
+            };
+            int ret = Interop.Bluetooth.SetScanModeChangedCallback(_scanModeChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set scan mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+        private void UnregisterScanModeChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetScanModeChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset scan mode changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void targetInitialize()
+        {
+            if (Globals.IsInitialize)
+            {
+                _targetConnectionChangedCallback = (bool connected, string deviceAddress, IntPtr userData) =>
+                {
+                    if (_targetConnectionChanged != null)
+                    {
+                        _targetConnectionChanged(null, new TargetConnectionStateChangedEventArgs(connected, deviceAddress));
+                    }
+                };
+
+                int ret = Interop.Bluetooth.InitializeAvrcp(_targetConnectionChangedCallback, IntPtr.Zero);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error (Globals.LogTag, "Failed to initialize bluetooth avrcp, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+                else
+                {
+                    Globals.IsAudioInitialize = true;
+                }
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Failed to initialize Avrcp, BT not initialized");
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized);
+            }
+        }
+
+        private void targetDeinitialize()
+        {
+            if (Globals.IsAudioInitialize)
+            {
+                int ret = Interop.Bluetooth.DeinitializeAvrcp();
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth avrcp, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+                else
+                {
+                    Globals.IsAudioInitialize = false;
+                }
+            }
+        }
+
+        internal void NotifyEqualizeState(EqualizerState state)
+        {
+            int ret = Interop.Bluetooth.NotifyEqualizerState((int)state);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify equalizer state to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyRepeatMode(RepeatMode repeat)
+        {
+            int ret = Interop.Bluetooth.NotifyRepeatMode((int)repeat);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify repeat mode to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyShuffleMode(ShuffleMode shuffle)
+        {
+            int ret = Interop.Bluetooth.NotifyShuffleMode((int)shuffle);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify shuffle mode to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyScanMode(ScanMode scan)
+        {
+            int ret = Interop.Bluetooth.NotifyScanMode((int)scan);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify scan mode to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyPlayerState(PlayerState state)
+        {
+            int ret = Interop.Bluetooth.NotifyPlayerState((int)state);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify player state to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyCurrentPosition(uint position)
+        {
+            int ret = Interop.Bluetooth.NotifyCurrentPosition(position);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify position to remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal void NotifyTrack(Track trackData)
+        {
+            string title = trackData.Title;
+            string artist = trackData.Artist;
+            string album = trackData.Album;
+            string genre = trackData.Genre;
+            uint trackNum = trackData.TrackNum;
+            uint totalTracks = trackData.TotalTracks;
+            uint duration = trackData.Duration;
+
+            int ret = Interop.Bluetooth.NotifyTrack(title, artist, album, genre, trackNum, totalTracks, duration);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to notify track data to the remote device, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal static BluetoothAvrcpImpl Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        private BluetoothAvrcpImpl()
+        {
+            targetInitialize();
+        }
+
+        ~BluetoothAvrcpImpl()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            targetDeinitialize();
+            RemoveAllRegisteredEvent();
+            disposed = true;
+        }
+
+        private void RemoveAllRegisteredEvent()
+        {
+            //unregister all remaining events when this object is released.
+            if (_equalizerStateChanged != null)
+            {
+                UnregisterEqualizerStateChangedEvent();
+            }
+            if (_repeatModeChanged != null)
+            {
+                UnregisterRepeatModeChangedEvent();
+            }
+            if (_scanModeChanged != null)
+            {
+                UnregisterScanModeChangedEvent();
+            }
+            if (_shuffleModeChanged != null)
+            {
+                UnregisterShuffleModeChangedEvent();
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs
new file mode 100644 (file)
index 0000000..cf386c5
--- /dev/null
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This class is used to handle the device class types and the service.
+    /// </summary>
+    public class BluetoothClass
+    {
+        internal BluetoothMajorDeviceClassType MajorType;
+        internal BluetoothMinorDeviceClassType MinorType;
+        internal int Mask;
+
+        internal BluetoothClass()
+        {
+        }
+
+        /// <summary>
+        /// The type of the major device class.
+        /// </summary>
+        public BluetoothMajorDeviceClassType MajorDeviceClassType
+        {
+            get
+            {
+                return MajorType;
+            }
+        }
+        /// <summary>
+        /// The type of the minor device class.
+        /// </summary>
+        public BluetoothMinorDeviceClassType MinorDeviceClassType
+        {
+            get
+            {
+                return MinorType;
+            }
+        }
+        /// <summary>
+        /// The major service class mask.
+        /// </summary>
+        public int MajorServiceClassMask
+        {
+            get
+            {
+                return Mask;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the Bluetooth OOB data.
+    /// </summary>
+    public class BluetoothOobData
+    {
+        /// <summary>
+        /// The default constructor. Initializes an object of the BluetoothOobData.
+        /// </summary>
+        public BluetoothOobData()
+        {
+        }
+
+        /// <summary>
+        /// The hash value.
+        /// </summary>
+        public byte[] HashValue
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The randomizer value.
+        /// </summary>
+        public byte[] RandomizerValue
+        {
+            get;
+            set;
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the Bluetooth device SDP data.
+    /// </summary>
+    public class BluetoothDeviceSdpData
+    {
+        internal string Address;
+        internal Collection<string> Uuid;
+
+        internal BluetoothDeviceSdpData()
+        {
+        }
+
+        /// <summary>
+        /// The device address.
+        /// </summary>
+        public string DeviceAddress
+        {
+            get
+            {
+                return Address;
+            }
+        }
+        /// <summary>
+        /// The service UUID.
+        /// </summary>
+        public IEnumerable<string> ServiceUuid
+        {
+            get
+            {
+                return Uuid;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the Bluetooth device connection data.
+    /// </summary>
+    public class BluetoothDeviceConnectionData
+    {
+        internal string RemoteAddress;
+        internal BluetoothConnectionLinkType Link;
+        internal BluetoothDisconnectReason Reason;
+
+        internal BluetoothDeviceConnectionData()
+        {
+        }
+
+        /// <summary>
+        /// The device address.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return RemoteAddress;
+            }
+        }
+        /// <summary>
+        /// The type of the connection link.
+        /// </summary>
+        public BluetoothConnectionLinkType LinkType
+        {
+            get
+            {
+                return Link;
+            }
+        }
+        /// <summary>
+        /// The disconnect reason.
+        /// </summary>
+        public BluetoothDisconnectReason DisconnectReason
+        {
+            get
+            {
+                return Reason;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the track data.
+    /// </summary>
+    public class Track
+    {
+        /// <summary>
+        /// The default constructor. Initializes an object of the track.
+        /// </summary>
+        public Track()
+        {
+        }
+
+        /// <summary>
+        /// The title of the track.
+        /// </summary>
+        public string Title
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The artist of the track.
+        /// </summary>
+        public string Artist
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The album of the track.
+        /// </summary>
+        public string Album
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The genre of the track.
+        /// </summary>
+        public string Genre
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The track number.
+        /// </summary>
+        public uint TrackNum
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The number of all tracks.
+        /// </summary>
+        public uint TotalTracks
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The duration of the track in milliseconds.
+        /// </summary>
+        public uint Duration
+        {
+            get;
+            set;
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the manufacturer data.
+    /// </summary>
+    public class ManufacturerData
+    {
+        /// <summary>
+        /// The default Constructor. Initializes an object of the ManufacturerData.
+        /// </summary>
+        public ManufacturerData()
+        {
+        }
+
+        /// <summary>
+        /// The manufacturer ID.
+        /// </summary>
+        public int Id
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The length of the manufacturer data.
+        /// </summary>
+        public int DataLength
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The manufacturer data.
+        /// </summary>
+        public byte[] Data
+        {
+            get;
+            set;
+        }
+    }
+
+    internal class BluetoothLeScanData
+    {
+        internal string RemoteAddress
+        {
+            get;
+            set;
+        }
+        internal BluetoothLeDeviceAddressType AddressType
+        {
+            get;
+            set;
+        }
+        internal int Rssi
+        {
+            get;
+            set;
+        }
+        internal int AdvDataLength
+        {
+            get;
+            set;
+        }
+        internal byte[] AdvData
+        {
+            get;
+            set;
+        }
+        internal int ScanDataLength
+        {
+            get;
+            set;
+        }
+        internal byte[] ScanData
+        {
+            get;
+            set;
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the Bluetooth service data.
+    /// </summary>
+    public class BluetoothServiceData
+    {
+        /// <summary>
+        /// The default constructor. Initializes an object of the BluetoothServiceData.
+        /// </summary>
+        public BluetoothServiceData()
+        {
+        }
+
+        /// <summary>
+        /// The UUID of the service.
+        /// </summary>
+        public string Uuid
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The data length of the service data.
+        /// </summary>
+        public int DataLength
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The service data.
+        /// </summary>
+        public byte[] Data
+        {
+            get;
+            set;
+        }
+    }
+
+    /// <summary>
+    /// This class contains the service data information.
+    /// </summary>
+    public class BluetoothLeServiceData
+    {
+        internal string Uuid;
+        internal byte[] Data;
+        internal int Length;
+
+        internal BluetoothLeServiceData()
+        {
+        }
+
+        /// <summary>
+        /// The Bluetooth LE service UUID.
+        /// </summary>
+        public string ServiceUuid
+        {
+            get
+            {
+                return Uuid;
+            }
+        }
+        /// <summary>
+        /// The Bluetooth LE service data.
+        /// </summary>
+        public byte[] ServiceData
+        {
+            get
+            {
+                return Data;
+            }
+        }
+        /// <summary>
+        /// The length of the service data.
+        /// </summary>
+        public int ServiceDataLength
+        {
+            get
+            {
+                return Length;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the socket data.
+    /// </summary>
+    public class SocketData
+    {
+        internal string RecvData;
+        internal int Size;
+        internal int Fd;
+
+        internal SocketData()
+        {
+        }
+
+        /// <summary>
+        /// The socket FD.
+        /// </summary>
+        public int SocketFd
+        {
+            get
+            {
+                return Fd;
+            }
+        }
+        /// <summary>
+        /// The length of the received data.
+        /// </summary>
+        public int DataSize
+        {
+            get
+            {
+                return Size;
+            }
+        }
+        /// <summary>
+        /// The received data.
+        /// </summary>
+        public string Data
+        {
+            get
+            {
+                return RecvData;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This class contains the information of the socket connection.
+    /// </summary>
+    public class SocketConnection
+    {
+        internal string Uuid;
+        internal string RemoteAddress;
+        internal int Fd;
+
+        internal SocketConnection()
+        {
+        }
+
+        /// <summary>
+        /// The connected socket FD.
+        /// </summary>
+        public int SocketFd
+        {
+            get
+            {
+                return Fd;
+            }
+        }
+        /// <summary>
+        /// The remote device address.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return RemoteAddress;
+            }
+        }
+        /// <summary>
+        /// The service UUID.
+        /// </summary>
+        public string ServiceUuid
+        {
+            get
+            {
+                return Uuid;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs
new file mode 100644 (file)
index 0000000..b0debee
--- /dev/null
@@ -0,0 +1,695 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Collections.Concurrent;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This class is used to handle the connection with other devices and set authorization of other devices.<br>
+    /// The BluetoothDevice class is used to search for services available on remote devices.
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    public class BluetoothDevice
+    {
+        private event EventHandler<BondCreatedEventArgs> _bondCreated;
+        private event EventHandler<BondDestroyedEventArgs> _bondDestroyed;
+        private event EventHandler<AuthorizationChangedEventArgs> _authorizationChanged;
+        private event EventHandler<ServiceSearchedEventArgs> _serviceSearched;
+        private event EventHandler<DeviceConnectionStateChangedEventArgs> _connectionChanged;
+
+        private Interop.Bluetooth.BondCreatedCallback _bondCreatedCallback;
+        private Interop.Bluetooth.BondDestroyedCallback _bondDestroyedCallback;
+        private Interop.Bluetooth.AuthorizationChangedCallback _authorizationChangedCallback;
+        private Interop.Bluetooth.ServiceSearchedCallback _serviceSearchedCallback;
+        private Interop.Bluetooth.DeviceConnectionStateChangedCallback _connectionChangedCallback;
+
+        internal string RemoteDeviceAddress;
+        internal string RemoteDeviceName;
+        internal int RemoteDeviceRssi;
+        internal BluetoothClass RemoteDeviceClass;
+        internal Collection<string> RemoteDeviceService;
+        internal int RemoteDeviceCount;
+        internal bool RemotePaired;
+        internal bool RemoteAuthorized;
+        internal bool RemoteConnected;
+        internal BluetoothAppearanceType RemoteAppearance;
+        internal int RemoteManufLength;
+        internal string RemoteManufData;
+
+        internal BluetoothDevice()
+        {
+        }
+
+        /// <summary>
+        /// The address of the device.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return RemoteDeviceAddress;
+            }
+        }
+        /// <summary>
+        /// The name of the device.
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return RemoteDeviceName;
+            }
+        }
+        /// <summary>
+        /// The strength indicator of received signal of the device.
+        /// </summary>
+        public int Rssi
+        {
+            get
+            {
+                return RemoteDeviceRssi;
+            }
+        }
+        /// <summary>
+        /// The class of the device.
+        /// </summary>
+        public BluetoothClass Class
+        {
+            get
+            {
+                return RemoteDeviceClass;
+            }
+        }
+        /// <summary>
+        /// The service UUID list of the device.
+        /// </summary>
+        public IEnumerable<string> ServiceUuidList
+        {
+            get
+            {
+                return RemoteDeviceService;
+            }
+        }
+        /// <summary>
+        /// The number of services.
+        /// </summary>
+        public int ServiceCount
+        {
+            get
+            {
+                return RemoteDeviceCount;
+            }
+        }
+        /// <summary>
+        /// The paired state of the device.
+        /// </summary>
+        public bool IsPaired
+        {
+            get
+            {
+                return RemotePaired;
+            }
+        }
+        /// <summary>
+        /// The connection state of the device.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return RemoteConnected;
+            }
+        }
+        /// <summary>
+        /// The authorization state of the device.
+        /// </summary>
+        public bool IsAuthorized
+        {
+            get
+            {
+                return RemoteAuthorized;
+            }
+        }
+        /// <summary>
+        /// The Bluetooth appearance.
+        /// </summary>
+        public BluetoothAppearanceType AppearanceType
+        {
+            get
+            {
+                return RemoteAppearance;
+            }
+        }
+
+        /// <summary>
+        /// The length of the manufacturer data.
+        /// </summary>
+        public int ManufacturerDataLength
+        {
+            get
+            {
+                return RemoteManufLength;
+            }
+        }
+        /// <summary>
+        /// The manufacturer data.
+        /// </summary>
+        public string ManufacturerData
+        {
+            get
+            {
+                return RemoteManufData;
+            }
+        }
+
+        /// <summary>
+        /// The BondCreated event is raised when the process of creating the bond is finished.
+        /// </summary>
+        public event EventHandler<BondCreatedEventArgs> BondCreated
+        {
+            add
+            {
+                if (_bondCreated == null)
+                {
+                    RegisterBondCreatedEvent();
+                }
+                _bondCreated += value;
+            }
+            remove
+            {
+                _bondCreated -= value;
+                if (_bondCreated == null)
+                {
+                    UnregisterBondCreatedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The BondDestroyed event is raised when the bond is destroyed.
+        /// </summary>
+        public event EventHandler<BondDestroyedEventArgs> BondDestroyed
+        {
+            add
+            {
+                if (_bondDestroyed == null)
+                {
+                    RegisterBondDestroyedEvent();
+                }
+                _bondDestroyed += value;
+            }
+            remove
+            {
+                _bondDestroyed -= value;
+                if (_bondDestroyed == null)
+                {
+                    UnregisterBondDestroyedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The AuthorizationChanged event is raised when the authorization of the device is changed.
+        /// </summary>
+        public event EventHandler<AuthorizationChangedEventArgs> AuthorizationChanged
+        {
+            add
+            {
+                if (_authorizationChanged == null)
+                {
+                    RegisterAuthorizationChangedEvent();
+                }
+                _authorizationChanged += value;
+            }
+            remove
+            {
+                _authorizationChanged -= value;
+                if (_authorizationChanged == null)
+                {
+                    UnregisterAuthorizationChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The ServiceSearched event is raised when the process of service searched is finished.
+        /// </summary>
+        public event EventHandler<ServiceSearchedEventArgs> ServiceSearched
+        {
+            add
+            {
+                if (_serviceSearched == null)
+                {
+                    RegisterServiceSearchedEvent();
+                }
+                _serviceSearched += value;
+            }
+            remove
+            {
+                _serviceSearched -= value;
+                if (_serviceSearched == null)
+                {
+                    UnregisterServiceSearchedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The ConnectionStateChanged event is raised when the connection state is changed.
+        /// </summary>
+        public event EventHandler<DeviceConnectionStateChangedEventArgs> ConnectionStateChanged
+        {
+            add
+            {
+                if (_connectionChanged == null)
+                {
+                    RegisterConnectionChangedEvent();
+                }
+                _connectionChanged += value;
+            }
+            remove
+            {
+                _connectionChanged -= value;
+                if (_connectionChanged == null)
+                {
+                    UnregisterConnectionChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterBondCreatedEvent()
+        {
+            _bondCreatedCallback = (int result, ref BluetoothDeviceStruct device, IntPtr userData) =>
+            {
+                if (_bondCreated != null)
+                {
+                    BluetoothError res = (BluetoothError)result;
+                    _bondCreated(null, new BondCreatedEventArgs(res, BluetoothUtils.ConvertStructToDeviceClass(device)));
+                }
+            };
+            int ret = Interop.Bluetooth.SetBondCreatedCallback(_bondCreatedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set bond created callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterBondCreatedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetBondCreatedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset bond created callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterBondDestroyedEvent()
+        {
+            _bondDestroyedCallback = (int result, string deviceAddress, IntPtr userData) =>
+            {
+                if (_bondDestroyed != null)
+                {
+                    BluetoothError res = (BluetoothError)result;
+                    _bondDestroyed(null, new BondDestroyedEventArgs(res, deviceAddress));
+                }
+            };
+            int ret = Interop.Bluetooth.SetBondDestroyedCallback(_bondDestroyedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set bond destroyed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterBondDestroyedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetBondDestroyedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset bond destroyed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterServiceSearchedEvent()
+        {
+            _serviceSearchedCallback = (int result, ref BluetoothDeviceSdpStruct sdp, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Servicesearched cb is called");
+                if (_serviceSearched != null)
+                {
+                    BluetoothError res = (BluetoothError)result;
+                    _serviceSearched(null, new ServiceSearchedEventArgs(res, BluetoothUtils.ConvertStructToSdpData(sdp)));
+                }
+            };
+            int ret = Interop.Bluetooth.SetServiceSearchedCallback(_serviceSearchedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set service searched callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterServiceSearchedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetServiceSearchedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset service searched callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterAuthorizationChangedEvent()
+        {
+            _authorizationChangedCallback = (int authorization, string deviceAddress, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Authorization changed cb is called");
+                if (_authorizationChanged != null)
+                {
+                    BluetoothAuthorizationType auth = (BluetoothAuthorizationType)authorization;
+                    _authorizationChanged(null, new AuthorizationChangedEventArgs(auth, deviceAddress));
+                }
+            };
+            int ret = Interop.Bluetooth.SetAuthorizationChangedCallback(_authorizationChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set authroization changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterAuthorizationChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetAuthorizationChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset authroization changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void RegisterConnectionChangedEvent()
+        {
+            _connectionChangedCallback = (bool connected, ref BluetoothDeviceConnectionStruct device, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Connection state changed cb is called");
+                if (_connectionChanged != null)
+                {
+                    _connectionChanged(null, new DeviceConnectionStateChangedEventArgs(connected, BluetoothUtils.ConvertStructToConnectionData(device)));
+                }
+            };
+
+            int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set connection state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        private void UnregisterConnectionChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetConnectionStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset connection state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        /// <summary>
+        /// Creates a bond with the remote Bluetooth device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and the remote device must be discoverable by StartDiscovery(). The bond can be destroyed by DestroyBond().
+        /// The bonding request can be cancelled by CancelBonding(). If this succeeds, the BondCreated event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the create bonding process to the remote device fails.</exception>
+        public void CreateBond()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                int ret = Interop.Bluetooth.CreateBond(RemoteDeviceAddress);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to create bond, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Cancels the bonding process.
+        /// </summary>
+        /// <remarks>
+        /// Bonding must be in progress by CreateBond().
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the cancel bonding procedure to remote device fails.</exception>
+        public void CancelBonding()
+        {
+            int ret = Interop.Bluetooth.CancelBonding();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to cancel bonding process, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destroys the bond.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and the bond must be created by CreateBond().
+        /// If this succeeds, the BondDestroyed event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the destroy bonding procedure fails.</exception>
+        public void DestroyBond()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                int ret = Interop.Bluetooth.DestroyBond(RemoteDeviceAddress);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to destroy bond, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets an alias for the bonded device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and the bond must be created by CreateBond().
+        /// </remarks>
+        /// <param name="aliasName">The alias name of the remote device.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the set alias name to remote device fails.</exception>
+        public void SetAlias(string aliasName)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                int ret = Interop.Bluetooth.SetAlias(RemoteDeviceAddress, aliasName);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to set alias name, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets the authorization of a bonded device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and the bond must be created by CreateBond().
+        /// If this succeeds, the AuthorizationChanged event will be invoked.
+        /// </remarks>
+        /// <param name="authorizationState">The authorization state.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the set authorization to remote device fails.</exception>
+        public void SetAuthorization(BluetoothAuthorizationType authorizationState)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                int ret = Interop.Bluetooth.SetAuthorization(RemoteDeviceAddress, (int)authorizationState);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to set authroization state, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the mask from the UUID.
+        /// </summary>
+        /// <returns>The service mask list converted from the given UUID list.</returns>
+        /// <param name="uuids">The UUID list of the device.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the get Mask from UUID fails.</exception>
+        public BluetoothServiceClassType GetMaskFromUuid(string[] uuids)
+        {
+            BluetoothServiceClassType serviceMask;
+
+            int ret = Interop.Bluetooth.GetMaskFromUuid(uuids, uuids.Length, out serviceMask);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get service mask, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return serviceMask;
+        }
+
+        /// <summary>
+        /// Starts the search for services supported by the specified device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled and remote device must be discoverable by StartDiscovery(). The bond must be created by CreateBond().
+        /// If this succeeds, the ServiceSearched event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device service search fails.</exception>
+        public void StartServiceSearch()
+        {
+            Log.Info(Globals.LogTag, "startservicesearch entry");
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                int ret = Interop.Bluetooth.StartServiceSearch(RemoteDeviceAddress);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to start service search, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the connected profiles.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns>The connected Bluetooth profiles.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when there is no BT connection.</exception>
+        public IEnumerable<BluetoothProfileType> GetConnectedProfiles()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                List<BluetoothProfileType> profileList = new List<BluetoothProfileType>();
+                Interop.Bluetooth.ConnectedProfileCallback callback = (int profile, IntPtr userData) =>
+                {
+                    if (!profile.Equals(null))
+                    {
+                        profileList.Add((BluetoothProfileType)profile);
+                    }
+                    return true;
+                };
+                int ret = Interop.Bluetooth.GetConnectedProfiles(RemoteDeviceAddress, callback, IntPtr.Zero);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get connected profiles, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+                return profileList;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Determines if profile is connected to the specified remote device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns><c>true</c> if profile is connected, otherwise <c>false</c>.</returns>
+        /// <param name="profileType">The Bluetooth profile type.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when there is no BT connection.</exception>
+        public bool IsProfileConnected(BluetoothProfileType profileType)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled)
+            {
+                bool isConnected;
+                int ret = Interop.Bluetooth.IsProfileConnected(RemoteDeviceAddress, (int)profileType, out isConnected);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to get profile connected state, Error - " + (BluetoothError)ret);
+                }
+                return isConnected;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Returns the instance of the Bluetooth profile type.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        public T GetProfile<T>() where T : BluetoothProfile
+        {
+            /*
+             * FIXME: Find a proper way for dynamic allocation.
+             */
+            T profile = null;
+            String type = typeof(T).ToString();
+            if (type.Equals("Tizen.Network.Bluetooth.BluetoothAudio"))
+            {
+                BluetoothAudio audio = new BluetoothAudio();
+                profile = (audio as T);
+            }
+            else if (type.Equals("Tizen.Network.Bluetooth.BluetoothAvrcp"))
+            {
+                BluetoothAvrcp avrcp = new BluetoothAvrcp();
+                profile = (avrcp as T);
+            }
+            else if (type.Equals("Tizen.Network.Bluetooth.BluetoothHid"))
+            {
+                BluetoothHid hid = new BluetoothHid();
+                profile = (hid as T);
+            }
+
+            if (profile != null)
+            {
+                profile.RemoteAddress = RemoteDeviceAddress;
+            }
+            return profile;
+        }
+
+        /// <summary>
+        /// Creates the client socket.
+        /// </summary>
+        /// <returns>The IBluetoothClientSocket instance.</returns>
+        /// <param name="serviceUuid">The UUID of the service.</param>
+        public IBluetoothClientSocket CreateSocket(string serviceUuid)
+        {
+            BluetoothSocket clientSocket = new BluetoothSocket();
+            clientSocket.remoteAddress = this.Address;
+            clientSocket.serviceUuid = serviceUuid;
+            return (IBluetoothClientSocket)clientSocket;
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs
new file mode 100644 (file)
index 0000000..1842de9
--- /dev/null
@@ -0,0 +1,1202 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// Enumeration for the Bluetooth states.
+    /// </summary>
+    public enum BluetoothState
+    {
+        /// <summary>
+        /// The disabled state.
+        /// </summary>
+        Disabled = 0,
+        /// <summary>
+        /// The enabled state.
+        /// </summary>
+        Enabled
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth errors.
+    /// </summary>
+    public enum BluetoothError
+    {
+        /// <summary>
+        /// Successful.
+        /// </summary>
+        None = ErrorCode.None,
+        /// <summary>
+        /// Operation canceled.
+        /// </summary>
+        Cancelled = ErrorCode.Canceled,
+        /// <summary>
+        /// Invalid parameter.
+        /// </summary>
+        InvalidParameter = ErrorCode.InvalidParameter,
+        /// <summary>
+        /// Out of memory.
+        /// </summary>
+        OutOfMemory = ErrorCode.OutOfMemory,
+        /// <summary>
+        /// Device or resource busy.
+        /// </summary>
+        ResourceBusy = ErrorCode.ResourceBusy,
+        /// <summary>
+        /// Timeout error.
+        /// </summary>
+        TimedOut = ErrorCode.TimedOut,
+        /// <summary>
+        /// Operation now in progress.
+        /// </summary>
+        NowInProgress = ErrorCode.NowInProgress,
+        /// <summary>
+        /// Bluetooth is not supported.
+        /// </summary>
+        NotSupported = ErrorCode.NotSupported,
+        /// <summary>
+        /// Permission denied.
+        /// </summary>
+        PermissionDenied = ErrorCode.PermissionDenied,
+        /// <summary>
+        /// Quota exceeded.
+        /// </summary>
+        QuotaExceeded = ErrorCode.QuotaExceeded,
+        /// <summary>
+        /// No data available.
+        /// </summary>
+        NoData = ErrorCode.NoData,
+        /// <summary>
+        /// Local adapter not initialized.
+        /// </summary>
+        NotInitialized = -0x01C00000 | 0x0101,
+        /// <summary>
+        /// Local adapter not enabled.
+        /// </summary>
+        NotEnabled = -0x01C00000 | 0x0102,
+        /// <summary>
+        /// Operation already done.
+        /// </summary>
+        AlreadyDone = -0x01C00000 | 0x0103,
+        /// <summary>
+        /// Operation failed.
+        /// </summary>
+        OperationFailed = -0x01C00000 | 0x0104,
+        /// <summary>
+        /// Operation not in progress.
+        /// </summary>
+        NotInProgress = -0x01C00000 | 0x0105,
+        /// <summary>
+        /// Remote device not bonded.
+        /// </summary>
+        RemoteDeviceNotBonded = -0x01C00000 | 0x0106,
+        /// <summary>
+        /// Authentication rejected.
+        /// </summary>
+        AuthRejected = -0x01C00000 | 0x0107,
+        /// <summary>
+        /// Authentication failed.
+        /// </summary>
+        AuthFailed = -0x01C00000 | 0x0108,
+        /// <summary>
+        /// Remote device not found.
+        /// </summary>
+        RemoteDeviceNotFound = -0x01C00000 | 0x0109,
+        /// <summary>
+        /// Service search failed.
+        /// </summary>
+        ServiceSearchFailed = -0x01C00000 | 0x010A,
+        /// <summary>
+        /// Remote device is not connected.
+        /// </summary>
+        RemoteDeviceNotConnected = -0x01C00000 | 0x010B,
+        /// <summary>
+        /// Resource temporarily unavailable.
+        /// </summary>
+        ResourceUnavailable = -0x01C00000 | 0x010C,
+        /// <summary>
+        /// Service Not Found.
+        /// </summary>
+        ServiceNotFound = -0x01C00000 | 0x010D
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth visibility modes.
+    /// </summary>
+    public enum VisibilityMode
+    {
+        /// <summary>
+        /// The non-discoverable mode.
+        /// </summary>
+        NonDiscoverable = 0,
+        /// <summary>
+        /// The discoverable mode.
+        /// </summary>
+        Discoverable = 1,
+        /// <summary>
+        /// The discoverable mode with limited time.
+        /// </summary>
+        TimeLimitedDiscoverable = 2
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth major device class types.
+    /// </summary>
+    public enum BluetoothMajorDeviceClassType
+    {
+        /// <summary>
+        /// The miscellaneous major class type.
+        /// </summary>
+        Misc = 0x00,
+        /// <summary>
+        /// The computer major class type.
+        /// </summary>
+        Computer = 0x01,
+        /// <summary>
+        /// The phone major class type.
+        /// </summary>
+        Phone = 0x02,
+        /// <summary>
+        /// The LAN/Network access point major class type.
+        /// </summary>
+        LanNetworkAccessPoint = 0x03,
+        /// <summary>
+        /// The audio/video major class type.
+        /// </summary>
+        AudioVideo = 0x04,
+        /// <summary>
+        /// The peripheral major class type.
+        /// </summary>
+        Peripheral = 0x05,
+        /// <summary>
+        /// The imaging major class type.
+        /// </summary>
+        Imaging = 0x06,
+        /// <summary>
+        /// The wearable major class type.
+        /// </summary>
+        Wearable = 0x07,
+        /// <summary>
+        /// The toy major class type.
+        /// </summary>
+        Toy = 0x08,
+        /// <summary>
+        /// The health major class type.
+        /// </summary>
+        Health = 0x09,
+        /// <summary>
+        /// The uncategorized major class type.
+        /// </summary>
+        Uncategorized = 0x1F
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth minor device class types.
+    /// </summary>
+    public enum BluetoothMinorDeviceClassType
+    {
+        /// <summary>
+        /// The uncategorized computer minor class type.
+        /// </summary>
+        ComputerUncategorized = 0x00,
+        /// <summary>
+        /// The desktop workstation computer minor class type.
+        /// </summary>
+        ComputerDesktopWorkstation = 0x04,
+        /// <summary>
+        /// The server computer minor class type.
+        /// </summary>
+        ComputerServer = 0x08,
+        /// <summary>
+        /// The laptop computer minor class type.
+        /// </summary>
+        ComputerLaptop = 0x0C,
+        /// <summary>
+        /// The handheld PC/PDA computer minor class type.
+        /// </summary>
+        ComputerHandheldPcOrPda = 0x10,
+        /// <summary>
+        /// The palm sized PC/PDA computer minor class type.
+        /// </summary>
+        ComputerPalmSizedPcOrPda = 0x14,
+        /// <summary>
+        /// The wearable computer minor class type.
+        /// </summary>
+        ComputerWearableComputer = 0x18,
+
+        /// <summary>
+        /// The unclassified phone minor class type.
+        /// </summary>
+        PhoneUncategorized = 0x00,
+        /// <summary>
+        /// The cellular phone minor class type.
+        /// </summary>
+        PhoneCellular = 0x04,
+        /// <summary>
+        /// The cordless phone minor class type.
+        /// </summary>
+        PhoneCordless = 0x08,
+        /// <summary>
+        /// The smartphone phone minor class type.
+        /// </summary>
+        PhoneSmartPhone = 0x0C,
+        /// <summary>
+        /// The wired modem or voice gateway phone minor class type.
+        /// </summary>
+        PhoneWiredModemOrVoiceGateway = 0x10,
+        /// <summary>
+        /// The ISDN phone minor class type.
+        /// </summary>
+        PhoneCommonIsdnAccess = 0x14,
+
+        /// <summary>
+        /// Fully available LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPointFullyAvailable = 0x04,
+        /// <summary>
+        /// 1-17% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint1To17PercentUtilized = 0x20,
+        /// <summary>
+        /// 17-33% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint17To33PercentUtilized = 0x40,
+        /// <summary>
+        /// 33-50% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint33To50PercentUtilized = 0x60,
+        /// <summary>
+        /// 50-67% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint50To67PercentUtilized = 0x80,
+        /// <summary>
+        /// 67-83% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint67To83PercentUtilized = 0xA0,
+        /// <summary>
+        /// 83-99% utilized LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPoint83To99PercentUtilized = 0xC0,
+        /// <summary>
+        /// No service available LAN/Network access point minor class type.
+        /// </summary>
+        LanNetworkAccessPointNoServiceAvailable = 0xE0,
+
+        /// <summary>
+        /// The uncategorized audio/video minor class type.
+        /// </summary>
+        AudioVideoUncategorized = 0x00,
+        /// <summary>
+        /// The wearable headset audio/video minor class type.
+        /// </summary>
+        AudioVideoWearableHeadset = 0x04,
+        /// <summary>
+        /// The hands free audio/video minor class type.
+        /// </summary>
+        AudioVideoHandsFree = 0x08,
+        /// <summary>
+        /// The microphone audio/video minor class type.
+        /// </summary>
+        AudioVideoMicrophone = 0x10,
+        /// <summary>
+        /// The loudspeaker audio/video minor class type.
+        /// </summary>
+        AudioVideoLoudspeaker = 0x14,
+        /// <summary>
+        /// The headphones audio/video minor class type.
+        /// </summary>
+        AudioVideoHeadphones = 0x18,
+        /// <summary>
+        /// The portable audio audio/video minor class type.
+        /// </summary>
+        AudioVideoPortableAudio = 0x1C,
+        /// <summary>
+        /// The car audio audio/video minor class type.
+        /// </summary>
+        AudioVideoCarAudio = 0x20,
+        /// <summary>
+        /// The SetTopbox audio/video minor class type.
+        /// </summary>
+        AudioVideoSetTopBox = 0x24,
+        /// <summary>
+        /// The Hi-Fi audio/video minor class type.
+        /// </summary>
+        AudioVideoHifiAudioDevice = 0x28,
+        /// <summary>
+        /// The VCR audio/video minor class type.
+        /// </summary>
+        AudioVideoVcr = 0x2C,
+        /// <summary>
+        /// The video camera audio/video minor class type.
+        /// </summary>
+        AudioVideoVideoCamera = 0x30,
+        /// <summary>
+        /// Camcorder audio/video minor class type.
+        /// </summary>
+        AudioVideoCamcorder = 0x34,
+        /// <summary>
+        /// The video monitor audio/video minor class type.
+        /// </summary>
+        AudioVideoVideoMonitor = 0x38,
+        /// <summary>
+        /// The video display and loudspeaker audio/video minor class type.
+        /// </summary>
+        AudioVideoVideoDisplayLoudspeaker = 0x3C,
+        /// <summary>
+        /// The video conferencing audio/video minor class type.
+        /// </summary>
+        AudioVideoVideoConferencing = 0x40,
+        /// <summary>
+        /// The gaming/toy audio/video minor class type.
+        /// </summary>
+        AudioVideoGamingToy = 0x48,
+
+        /// <summary>
+        /// The uncategorized peripheral minor class type.
+        /// </summary>
+        PeripheralUncategorized = 0x00,
+        /// <summary>
+        /// The keyboard peripheral minor class type.
+        /// </summary>
+        PeripheralKeyBoard = 0x40,
+        /// <summary>
+        /// The pointing device peripheral minor class type.
+        /// </summary>
+        PeripheralPointingDevice = 0x80,
+        /// <summary>
+        /// The combo keyboard peripheral minor class type.
+        /// </summary>
+        PeripheralComboKeyboardPointingDevice = 0xC0,
+        /// <summary>
+        /// The joystick peripheral minor class type.
+        /// </summary>
+        PeripheralJoystick = 0x04,
+        /// <summary>
+        /// The game pad peripheral minor class type.
+        /// </summary>
+        PeripheralGamePad = 0x08,
+        /// <summary>
+        /// The remote control peripheral minor class type.
+        /// </summary>
+        PeripheralRemoteControl = 0x0C,
+        /// <summary>
+        /// The sensing device peripheral minor class type.
+        /// </summary>
+        PeripheralSensingDevice = 0x10,
+        /// <summary>
+        /// The digitizer peripheral minor class type.
+        /// </summary>
+        PeripheralDigitizerTablet = 0x14,
+        /// <summary>
+        /// The card reader peripheral minor class type.
+        /// </summary>
+        PeripheralCardReader = 0x18,
+        /// <summary>
+        /// The digital pen peripheral minor class type.
+        /// </summary>
+        PeripheralDigitalPen = 0x1C,
+        /// <summary>
+        /// The handheld scanner peripheral minor class type.
+        /// </summary>
+        PeripheralHandheldScanner = 0x20,
+        /// <summary>
+        /// The handheld gestural input computer minor class type.
+        /// </summary>
+        PeripheralHandheldGesturalInputDevice = 0x24,
+
+        /// <summary>
+        /// The display imaging minor class type.
+        /// </summary>
+        ImagingDisplay = 0x10,
+        /// <summary>
+        /// The camera imaging minor class type.
+        /// </summary>
+        ImagingCamera = 0x20,
+        /// <summary>
+        /// The scanner imaging minor class type.
+        /// </summary>
+        ImagingScanner = 0x40,
+        /// <summary>
+        /// The printer imaging minor class type.
+        /// </summary>
+        ImagingPrinter = 0x80,
+
+        /// <summary>
+        /// The wrist watch wearable minor class type.
+        /// </summary>
+        WearableWristWatch = 0x04,
+        /// <summary>
+        /// The pager wearable minor class type.
+        /// </summary>
+        WearablePager = 0x08,
+        /// <summary>
+        /// The jacket wearable minor class type.
+        /// </summary>
+        WearableJacket = 0x0C,
+        /// <summary>
+        /// The helmet wearable minor class type.
+        /// </summary>
+        WearableHelmet = 0x10,
+        /// <summary>
+        /// The glasses wearable minor class type.
+        /// </summary>
+        WearableGlasses = 0x14,
+
+        /// <summary>
+        /// The robot toy minor class type.
+        /// </summary>
+        ToyRobot = 0x04,
+        /// <summary>
+        /// The vehicle toy minor class type.
+        /// </summary>
+        ToyVehicle = 0x08,
+        /// <summary>
+        /// The doll toy minor class type.
+        /// </summary>
+        ToyDollAction = 0x0C,
+        /// <summary>
+        /// The controller toy minor class type.
+        /// </summary>
+        ToyController = 0x10,
+        /// <summary>
+        /// The game toy minor class type.
+        /// </summary>
+        ToyGame = 0x14,
+
+        /// <summary>
+        /// The uncategorized health minor class type.
+        /// </summary>
+        HealthUncategorized = 0x00,
+        /// <summary>
+        /// The BP monitor health minor class type.
+        /// </summary>
+        HealthBloodPressureMonitor = 0x04,
+        /// <summary>
+        /// The thermometer health minor class type.
+        /// </summary>
+        HealthThermometer = 0x08,
+        /// <summary>
+        /// The scale health minor class type.
+        /// </summary>
+        HealthWeighingScale = 0x0C,
+        /// <summary>
+        /// The glucose meter health minor class type.
+        /// </summary>
+        HealthGlucoseMeter= 0x10,
+        /// <summary>
+        /// The pulse oximeter health minor class type.
+        /// </summary>
+        HealthPulseOximeter = 0x14,
+        /// <summary>
+        /// The heart/pulse rate monitor health minor class type.
+        /// </summary>
+        HealthHeartPulseRateMonitor = 0x18,
+        /// <summary>
+        /// The display health minor class type.
+        /// </summary>
+        HealthDataDisplay = 0x1C,
+        /// <summary>
+        /// The step counter health minor class type.
+        /// </summary>
+        HealthStepCounter = 0x20,
+        /// <summary>
+        /// The body composition analyzer health minor class type.
+        /// </summary>
+        HealthBodyCompositionAnalyzer = 0x24,
+        /// <summary>
+        /// The peak flow monitor health minor class type.
+        /// </summary>
+        HealthPeakFlowMonitor = 0x28,
+        /// <summary>
+        /// The medication monitor health minor class type.
+        /// </summary>
+        HealthMedicationMonitor = 0x2C,
+        /// <summary>
+        /// The knee prosthesis health minor class type.
+        /// </summary>
+        HealthKneeProsthesis = 0x30,
+        /// <summary>
+        /// The ankle prosthesis health minor class type.
+        /// </summary>
+        HealthAnkleProsthesis = 0x34
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth device discovery states.
+    /// </summary>
+    public enum BluetoothDeviceDiscoveryState
+    {
+        /// <summary>
+        /// The device discovery is started.
+        /// </summary>
+        Started = 0,
+        /// <summary>
+        /// The device discovery is finished.
+        /// </summary>
+        Finished,
+        /// <summary>
+        /// The remote device is found.
+        /// </summary>
+        Found
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth appearance types.
+    /// </summary>
+    public enum BluetoothAppearanceType
+    {
+        /// <summary>
+        /// Unknown.
+        /// </summary>
+        Unknown = 0,
+        /// <summary>
+        /// Generic phone.
+        /// </summary>
+        GenericPhone = 1,
+        /// <summary>
+        /// Generic computer.
+        /// </summary>
+        GenericComputer = 2,
+        /// <summary>
+        /// Generic watch.
+        /// </summary>
+        GenericWatch = 3
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth audio profile types.
+    /// </summary>
+    public enum BluetoothAudioProfileType
+    {
+        /// <summary>
+        /// All supported profiles of audio.
+        /// </summary>
+        All = 0,
+        /// <summary>
+        /// The Headset and Hands-Free profile.
+        /// </summary>
+        HspHfp,
+        /// <summary>
+        /// The Advanced Audio Distribution profile.
+        /// </summary>
+        AdvancedAudioDistribution,
+        /// <summary>
+        /// The Audio Gateway profile.
+        /// </summary>
+        AudioGateway,
+        /// <summary>
+        /// The Advanced Audio Distribution profile sink role.
+        /// </summary>
+        AdvancedAudioDistributionSink
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth service class types.
+    /// </summary>
+    public enum BluetoothServiceClassType
+    {
+        /// <summary>
+        /// No service class.
+        /// </summary>
+        None = 0,
+        /// <summary>
+        /// The RES service class.
+        /// </summary>
+        Res = 0x00000001,
+        /// <summary>
+        /// The SPP service class.
+        /// </summary>
+        Spp = 0x00000002,
+        /// <summary>
+        /// The DUN service class.
+        /// </summary>
+        Dun = 0x00000004,
+        /// <summary>
+        /// The FAX service class.
+        /// </summary>
+        Fax = 0x00000008,
+        /// <summary>
+        /// The LAP service class.
+        /// </summary>
+        Lap = 0x00000010,
+        /// <summary>
+        /// The HSP service class.
+        /// </summary>
+        Hsp = 0x00000020,
+        /// <summary>
+        /// The HFPservice class.
+        /// </summary>
+        Hfp = 0x00000040,
+        /// <summary>
+        /// The OPP service class.
+        /// </summary>
+        Opp = 0x00000080,
+        /// <summary>
+        /// The FTP service class.
+        /// </summary>
+        Ftp = 0x00000100,
+        /// <summary>
+        /// The CTP service class.
+        /// </summary>
+        Ctp = 0x00000200,
+        /// <summary>
+        /// The ICP service class.
+        /// </summary>
+        Icp = 0x00000400,
+        /// <summary>
+        /// The Sync service class.
+        /// </summary>
+        Sync = 0x00000800,
+        /// <summary>
+        /// The BPP service class.
+        /// </summary>
+        Bpp = 0x00001000,
+        /// <summary>
+        /// The BIP service class.
+        /// </summary>
+        Bip = 0x00002000,
+        /// <summary>
+        /// The PANU service class.
+        /// </summary>
+        Panu = 0x00004000,
+        /// <summary>
+        /// The NAP service class.
+        /// </summary>
+        Nap = 0x00008000,
+        /// <summary>
+        /// The GN service class.
+        /// </summary>
+        Gn = 0x00010000,
+        /// <summary>
+        /// The SAP service class.
+        /// </summary>
+        Sap = 0x00020000,
+        /// <summary>
+        /// The A2DP service class.
+        /// </summary>
+        A2dp = 0x00040000,
+        /// <summary>
+        /// The AVRCP service class.
+        /// </summary>
+        Avrcp = 0x00080000,
+        /// <summary>
+        /// The PBAP service class.
+        /// </summary>
+        Pbap = 0x00100000,
+        /// <summary>
+        /// The HID service class.
+        /// </summary>
+        Hid = 0x00200000,
+        /// <summary>
+        /// The A2DP Source service class.
+        /// </summary>
+        A2dpSource = 0x00400000,
+        /// <summary>
+        /// All service class.
+        /// </summary>
+        All = 0x00FFFFFF,
+        /// <summary>
+        /// The Max service class.
+        /// </summary>
+        Max
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth profile types.
+    /// </summary>
+    public enum BluetoothProfileType
+    {
+        /// <summary>
+        /// The RFCOMM profile.
+        /// </summary>
+        Rfcomm = 0,
+        /// <summary>
+        /// The Advanced Audio Distribution Profile Source role.
+        /// </summary>
+        AdvancedAudioDistribution,
+        /// <summary>
+        /// The Headset profile.
+        /// </summary>
+        Headset,
+        /// <summary>
+        /// The Human Interface Device profile.
+        /// </summary>
+        HumanInterfaceDevice,
+        /// <summary>
+        /// The Network Access Point profile.
+        /// </summary>
+        NetworkAccessPoint,
+        /// <summary>
+        /// The Audio Gateway profile.
+        /// </summary>
+        AudioGateway,
+        /// <summary>
+        /// The Generic Attribute profile.
+        /// </summary>
+        GenericAttribute,
+        /// <summary>
+        /// The NAP Server profile.
+        /// </summary>
+        NapServer,
+        /// <summary>
+        /// The advanced Audio Distribution profile sink role.
+        /// </summary>
+        AdvancedAudioDistributionSink
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth authorization types.
+    /// </summary>
+    public enum BluetoothAuthorizationType
+    {
+        /// <summary>
+        /// The authorized type.
+        /// </summary>
+        Authorized = 0,
+        /// <summary>
+        /// The unauthorized type.
+        /// </summary>
+        Unauthorized
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth connection link types.
+    /// </summary>
+    public enum BluetoothConnectionLinkType
+    {
+        /// <summary>
+        /// The BR/EDR link.
+        /// </summary>
+        BrEdr = 0,
+        /// <summary>
+        /// The LE link.
+        /// </summary>
+        Le,
+        /// <summary>
+        /// The default connection type.
+        /// </summary>
+        Default
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth disconnect reason.
+    /// </summary>
+    public enum BluetoothDisconnectReason
+    {
+        /// <summary>
+        /// The disconnected by unknown reason.
+        /// </summary>
+        Unknown = 0,
+        /// <summary>
+        /// The disconnected by timeout.
+        /// </summary>
+        Timeout,
+        /// <summary>
+        /// The disconnected by local host.
+        /// </summary>
+        LocalHost,
+        /// <summary>
+        /// The disconnected by remote.
+        /// </summary>
+        Remote
+    }
+
+    /// <summary>
+    /// Enumeration for the connected Bluetooth device event roles.
+    /// </summary>
+    public enum BluetoothSocketRole
+    {
+        /// <summary>
+        /// Unknown role.
+        /// </summary>
+        Unknown,
+        /// <summary>
+        /// The server role.
+        /// </summary>
+        Server,
+        /// <summary>
+        /// The client role.
+        /// </summary>
+        Client
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth socket connection states.
+    /// </summary>
+    public enum BluetoothSocketState
+    {
+        /// <summary>
+        /// The RFCOMM is connected.
+        /// </summary>
+        Connected,
+        /// <summary>
+        /// The RFCOMM is disconnected.
+        /// </summary>
+        Disconnected
+    }
+
+    /// <summary>
+    /// Enumeration for the equalizer states.
+    /// </summary>
+    public enum EqualizerState
+    {
+        /// <summary>
+        /// Equalizer Off.
+        /// </summary>
+        Off = 0,
+        /// <summary>
+        /// Equalizer On.
+        /// </summary>
+        On
+    }
+
+    /// <summary>
+    /// Enumeration for the repeat modes.
+    /// </summary>
+    public enum RepeatMode
+    {
+        /// <summary>
+        /// Repeat off.
+        /// </summary>
+        Off = 0,
+        /// <summary>
+        /// Single track repeat.
+        /// </summary>
+        SingleTrack,
+        /// <summary>
+        /// All track repeat.
+        /// </summary>
+        AllTrack,
+        /// <summary>
+        /// Group repeat.
+        /// </summary>
+        Group
+    }
+
+    /// <summary>
+    /// Enumeration for the shuffle modes.
+    /// </summary>
+    public enum ShuffleMode
+    {
+        /// <summary>
+        /// Shuffle off.
+        /// </summary>
+        Off = 0,
+        /// <summary>
+        /// All tracks shuffle.
+        /// </summary>
+        AllTrack,
+        /// <summary>
+        /// Group shuffle.
+        /// </summary>
+        Group
+    }
+
+    /// <summary>
+    /// Enumeration for the scan modes.
+    /// </summary>
+    public enum ScanMode
+    {
+        /// <summary>
+        /// Scan off.
+        /// </summary>
+        Off = 0,
+        /// <summary>
+        /// All tracks scan.
+        /// </summary>
+        AllTrack,
+        /// <summary>
+        /// Group scan.
+        /// </summary>
+        Group
+    }
+
+    /// <summary>
+    /// Enumeration for the player states.
+    /// </summary>
+    public enum PlayerState
+    {
+        /// <summary>
+        /// The stopped state.
+        /// </summary>
+        Stopped = 0,
+        /// <summary>
+        /// The playing state.
+        /// </summary>
+        Playing,
+        /// <summary>
+        /// The paused state.
+        /// </summary>
+        Paused,
+        /// <summary>
+        /// The seek forward state.
+        /// </summary>
+        SeekForward,
+        /// <summary>
+        /// The seek rewind state.
+        /// </summary>
+        SeekRewind
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth LE device address types.
+    /// </summary>
+    public enum BluetoothLeDeviceAddressType
+    {
+        /// <summary>
+        /// The Buetooth LE public address.
+        /// </summary>
+        BluetoothLePublicAddress,
+        /// <summary>
+        /// The Bluetooth LE private address.
+        /// </summary>
+        BluetoothLePrivateAddress
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth LePacket types.
+    /// </summary>
+    public enum BluetoothLePacketType
+    {
+        /// <summary>
+        /// The Bluetooth LE advertising packet.
+        /// </summary>
+        BluetoothLeAdvertisingPacket,
+        /// <summary>
+        /// The Bluetooth LE scan response packet.
+        /// </summary>
+        BluetoothLeScanResponsePacket
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth LE data types.
+    /// </summary>
+    public enum BluetoothLeDataType
+    {
+        /// <summary>
+        /// The Bluetooth LE packet data list 16 bit service uuid.
+        /// </summary>
+        BluetoothLePacketDataList16BitServiceUuid,
+        /// <summary>
+        /// The Bluetooth LE packet manufacturer data.
+        /// </summary>
+        BluetoothLePacketManufacturerData
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth LE advertising mode types.
+    /// </summary>
+    public enum BluetoothLeAdvertisingMode
+    {
+        /// <summary>
+        /// The Bluetooth LE advertising balanced mode.
+        /// </summary>
+        BluetoothLeAdvertisingBalancedMode,
+        /// <summary>
+        /// The Bluetooth LE advertising low latency mode.
+        /// </summary>
+        BluetoothLeAdvertisingLowLatencyMode,
+        /// <summary>
+        /// The Bluetooth LE advertising low energy mode.
+        /// </summary>
+        BluetoothLeAdvertisingLowEnergyMode
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth LE advertising mode type.
+    /// </summary>
+    public enum BluetoothLeAdvertisingState
+    {
+        /// <summary>
+        /// The Bluetooth LE advertising stopped.
+        /// </summary>
+        BluetoothLeAdvertisingStopped,
+        /// <summary>
+        /// The Bluetooth LE advertising started.
+        /// </summary>
+        BluetoothLeAdvertisingStarted
+    }
+
+    /// <summary>
+    /// Enumeration for the integer type for GATT handle's values.
+    /// </summary>
+    public enum IntDataType
+    {
+        /// <summary>
+        /// The 8-bit signed integer type.
+        /// </summary>
+        SignedInt8,
+        /// <summary>
+        /// The 16-bit signed integer type.
+        /// </summary>
+        SignedInt16,
+        /// <summary>
+        /// The 32-bit signed integer type.
+        /// </summary>
+        SignedInt32,
+        /// <summary>
+        /// The 8-bit unsigned integer type.
+        /// </summary>
+        UnsignedInt8,
+        /// <summary>
+        /// The 16-bit unsigned integer type.
+        /// </summary>
+        UnsignedInt16,
+        /// <summary>
+        /// The 32-bit unsigned integer type.
+        /// </summary>
+        UnsignedInt32
+    }
+
+    /// <summary>
+    /// Enumerations of the float type for GATT handle's values.
+    /// </summary>
+    public enum FloatDataType
+    {
+        /// <summary>
+        /// The 32-bit float type.
+        /// </summary>
+        Float,
+        /// <summary>
+        /// The 16-bit float type.
+        /// </summary>
+        SFloat,
+    }
+
+    /// <summary>
+    /// Enumeration for the GATT handle's types.
+    /// </summary>
+    public enum GattHandleType
+    {
+        /// <summary>
+        /// The GATT service type.
+        /// </summary>
+        Service,
+        /// <summary>
+        /// The GATT characteristic type.
+        /// </summary>
+        Characteristic,
+        /// <summary>
+        /// The GATT descriptor type.
+        /// </summary>
+        Descriptor
+    }
+
+    /// <summary>
+    /// Enumeration for the service types.
+    /// </summary>
+    public enum BluetoothGattServiceType
+    {
+        /// <summary>
+        /// The GATT primary service type.
+        /// </summary>
+        Primary,
+        /// <summary>
+        /// The GATT secondary service type.
+        /// </summary>
+        Secondary
+    }
+
+    /// <summary>
+    /// Enumeration for the characteristic's property.
+    /// </summary>
+    [Flags]
+    public enum BluetoothGattProperty
+    {
+        /// <summary>
+        /// The broadcast property.
+        /// </summary>
+        Broadcast = 1,
+        /// <summary>
+        /// The read property.
+        /// </summary>
+        Read = 2,
+        /// <summary>
+        /// The write without response property.
+        /// </summary>
+        WriteWithoutResponse = 4,
+        /// <summary>
+        /// The write property.
+        /// </summary>
+        Write = 8,
+        /// <summary>
+        /// The notify property.
+        /// </summary>
+        Notify = 16,
+        /// <summary>
+        /// The indicate property.
+        /// </summary>
+        Indicate = 32,
+        /// <summary>
+        /// The authenticated signed writes property.
+        /// </summary>
+        AuthenticatedSignedWrites = 64,
+        /// <summary>
+        /// The extended properties.
+        /// </summary>
+        ExtendedProperties = 128,
+    }
+
+    /// <summary>
+    /// Enumeration for the Bluetooth GATT permission types.
+    /// </summary>
+    [Flags]
+    public enum BluetoothGattPermission
+    {
+        /// <summary>
+        /// Read permission.
+        /// </summary>
+        Read = 1,
+        /// <summary>
+        /// Write permission.
+        /// </summary>
+        Write = 2,
+    }
+
+    /// <summary>
+    /// Enumeration for the write types.
+    /// </summary>
+    public enum BluetoothGattWriteType
+    {
+        /// <summary>
+        /// The write without response.
+        /// </summary>
+        NoResponse,
+        /// <summary>
+        /// The write with response.
+        /// </summary>
+        WriteWithResponse
+    }
+
+    /// <summary>
+    /// Enumeration for the remote device request types for attributes.
+    /// </summary>
+    public enum BluetoothGattRequestType
+    {
+        /// <summary>
+        /// Read requested.
+        /// </summary>
+        Read = 0,
+        /// <summary>
+        /// Write requested.
+        /// </summary>
+        Write = 1,
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs
new file mode 100644 (file)
index 0000000..9f418e3
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    static internal class BluetoothErrorFactory
+    {
+        static internal void ThrowBluetoothException(int exception)
+        {
+            BluetoothError error = (BluetoothError)exception;
+            switch (error)
+            {
+            case BluetoothError.InvalidParameter:
+                throw new InvalidOperationException("Invalid parameter");
+
+            case BluetoothError.Cancelled:
+                throw new InvalidOperationException("Operation cancelled");
+
+            case BluetoothError.AlreadyDone:
+                throw new InvalidOperationException("Operation already done");
+
+            case BluetoothError.TimedOut:
+                throw new InvalidOperationException("Timeout error");
+
+            case BluetoothError.AuthFailed:
+                throw new InvalidOperationException("Authentication failed");
+
+            case BluetoothError.AuthRejected:
+                throw new InvalidOperationException("Authentication rejected");
+
+            case BluetoothError.NoData:
+                throw new InvalidOperationException("No data available");
+
+            case BluetoothError.NotEnabled:
+                throw new InvalidOperationException("Local adapter not enabled");
+
+            case BluetoothError.NotInitialized:
+                throw new InvalidOperationException("Local adapter not initialized");
+
+            case BluetoothError.NowInProgress:
+                throw new InvalidOperationException("Operation now in progress");
+
+            case BluetoothError.NotInProgress:
+                throw new InvalidOperationException("Operation not in progress");
+
+            case BluetoothError.NotSupported:
+                throw new NotSupportedException("Bluetooth is not supported");
+
+            case BluetoothError.OperationFailed:
+                throw new InvalidOperationException("Operation failed");
+
+            case BluetoothError.OutOfMemory:
+                throw new InvalidOperationException("Out of memory");
+
+            case BluetoothError.PermissionDenied:
+                throw new InvalidOperationException("Permission denied");
+
+            case BluetoothError.QuotaExceeded:
+                throw new InvalidOperationException("Quota exceeded");
+
+            case BluetoothError.RemoteDeviceNotBonded:
+                throw new InvalidOperationException("Remote device not bonded");
+
+            case BluetoothError.RemoteDeviceNotConnected:
+                throw new InvalidOperationException("Remote device not connected");
+
+            case BluetoothError.RemoteDeviceNotFound:
+                throw new InvalidOperationException("Remote device not found");
+
+            case BluetoothError.ResourceBusy:
+                throw new InvalidOperationException("Device or resource busy");
+
+            case BluetoothError.ResourceUnavailable:
+                throw new InvalidOperationException("Resource temporarily unavailable");
+
+            case BluetoothError.ServiceNotFound:
+                throw new InvalidOperationException("Service Not Found");
+
+            case BluetoothError.ServiceSearchFailed:
+                throw new InvalidOperationException("Service search failed");
+
+            default:
+                throw new InvalidOperationException("Unknown exception");
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs
new file mode 100644 (file)
index 0000000..c7e6740
--- /dev/null
@@ -0,0 +1,1044 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth state.
+    /// </summary>
+    public class StateChangedEventArgs : EventArgs
+    {
+        private BluetoothState _type;
+        private BluetoothError _result;
+
+        internal StateChangedEventArgs(BluetoothError result, BluetoothState type)
+        {
+            _type = type;
+            _result = result;
+        }
+
+        /// <summary>
+        /// The state of Bluetooth.
+        /// </summary>
+        public BluetoothState BTState
+        {
+            get
+            {
+                return _type;
+            }
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth name.
+    /// </summary>
+    public class NameChangedEventArgs : EventArgs
+    {
+        private string _name;
+
+        internal NameChangedEventArgs(string name)
+        {
+            _name = name;
+        }
+
+        /// <summary>
+        /// The name of the device.
+        /// </summary>
+        public string DeviceName
+        {
+            get
+            {
+                return _name;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth visibility mode.
+    /// </summary>
+    public class VisibilityModeChangedEventArgs : EventArgs
+    {
+        private VisibilityMode _mode;
+        private BluetoothError _result;
+
+        internal VisibilityModeChangedEventArgs(BluetoothError result, VisibilityMode mode)
+        {
+            _result = result;
+            _mode = mode;
+        }
+
+        /// <summary>
+        /// The visibility mode.
+        /// </summary>
+        public VisibilityMode Visibility
+        {
+            get
+            {
+                return _mode;
+            }
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the duration until the visibility mode is changed from TimeLimitedDiscoverable to NonDiscoverable.
+    /// </summary>
+    public class VisibilityDurationChangedEventArgs : EventArgs
+    {
+        private int _duration;
+
+        internal VisibilityDurationChangedEventArgs(int duration)
+        {
+            _duration = duration;
+        }
+
+        /// <summary>
+        /// The duration.
+        /// </summary>
+        public int Duration
+        {
+            get
+            {
+                return _duration;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth device discovery state and the discovered device information.
+    /// </summary>
+    public class DiscoveryStateChangedEventArgs : EventArgs
+    {
+        private BluetoothError _result;
+        private BluetoothDeviceDiscoveryState _state;
+        private BluetoothDevice _device;
+
+        internal DiscoveryStateChangedEventArgs(BluetoothError result, BluetoothDeviceDiscoveryState state)
+        {
+            _result = result;
+            _state = state;
+        }
+
+        internal DiscoveryStateChangedEventArgs(BluetoothError result, BluetoothDeviceDiscoveryState state, BluetoothDevice device)
+        {
+            _result = result;
+            _state = state;
+            _device = device;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The state of the discovery.
+        /// </summary>
+        public BluetoothDeviceDiscoveryState DiscoveryState
+        {
+            get
+            {
+                return _state;
+            }
+        }
+
+        /// <summary>
+        /// The remote device found.
+        /// </summary>
+        public BluetoothDevice DeviceFound
+        {
+            get
+            {
+                return _device;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the bonded device information.
+    /// </summary>
+    public class BondCreatedEventArgs : EventArgs
+    {
+        private BluetoothError _result;
+        private BluetoothDevice _device;
+
+        internal BondCreatedEventArgs(BluetoothError result, BluetoothDevice device)
+        {
+            _result = result;
+            _device = device;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The remote device.
+        /// </summary>
+        public BluetoothDevice Device
+        {
+            get
+            {
+                return _device;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the address of the remote Bluetooth device to destroy bond with.
+    /// </summary>
+    public class BondDestroyedEventArgs : EventArgs
+    {
+        private BluetoothError _result;
+        private string _address;
+
+        internal BondDestroyedEventArgs(BluetoothError result, string address)
+        {
+            _result = result;
+            _address = address;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The remote device address.
+        /// </summary>
+        /// <value>The device address.</value>
+        public string DeviceAddress
+        {
+            get
+            {
+                return _address;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the authorization state and the address of the remote Bluetooth device.
+    /// </summary>
+    public class AuthorizationChangedEventArgs : EventArgs
+    {
+        private BluetoothAuthorizationType _authType;
+        private string _address;
+
+        internal AuthorizationChangedEventArgs(BluetoothAuthorizationType authType, string address)
+        {
+            _authType = authType;
+            _address = address;
+        }
+
+        /// <summary>
+        /// The authorization.
+        /// </summary>
+        public BluetoothAuthorizationType Authorization
+        {
+            get
+            {
+                return _authType;
+            }
+        }
+
+        /// <summary>
+        /// The device address.
+        /// </summary>
+        public string DeviceAddress
+        {
+            get
+            {
+                return _address;
+            }
+        }
+
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the service lists found on the remote Bluetooth device.
+    /// </summary>
+    public class ServiceSearchedEventArgs : EventArgs
+    {
+        private BluetoothDeviceSdpData _sdpData;
+        private BluetoothError _result;
+
+        internal ServiceSearchedEventArgs(BluetoothError result, BluetoothDeviceSdpData sdpData)
+        {
+            _result = result;
+            _sdpData = sdpData;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+        /// <summary>
+        /// The sdp data.
+        /// </summary>
+        public BluetoothDeviceSdpData SdpData
+        {
+            get
+            {
+                return _sdpData;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the connection state and the connection information of the remote device.
+    /// </summary>
+    public class DeviceConnectionStateChangedEventArgs : EventArgs
+    {
+        private bool _isConnected;
+        private BluetoothDeviceConnectionData _connectionData;
+
+        internal DeviceConnectionStateChangedEventArgs(bool isConnected, BluetoothDeviceConnectionData connectionData)
+        {
+            _isConnected = isConnected;
+            _connectionData = connectionData;
+        }
+
+        /// <summary>
+        /// A value indicating whether the device is connected.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return _isConnected;
+            }
+        }
+
+        /// <summary>
+        /// The device connection data.
+        /// </summary>
+        public BluetoothDeviceConnectionData ConnectionData
+        {
+            get
+            {
+                return _connectionData;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the data received information.
+    /// </summary>
+    public class SocketDataReceivedEventArgs : EventArgs
+    {
+        private SocketData _data;
+
+        internal SocketDataReceivedEventArgs(SocketData data)
+        {
+            _data = data;
+        }
+
+        /// <summary>
+        /// The socket data.
+        /// </summary>
+        public SocketData Data
+        {
+            get
+            {
+                return _data;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed connection state.
+    /// </summary>
+    public class SocketConnectionStateChangedEventArgs : EventArgs
+    {
+        private BluetoothError _result;
+        private BluetoothSocketState _state;
+        private SocketConnection _connection;
+
+        internal SocketConnectionStateChangedEventArgs(BluetoothError result, BluetoothSocketState state, SocketConnection connection)
+        {
+            _result = result;
+            _state = state;
+            _connection = connection;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The socket state.
+        /// </summary>
+        public BluetoothSocketState State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+
+        /// <summary>
+        /// The socket connection.
+        /// </summary>
+        public SocketConnection Connection
+        {
+            get
+            {
+                return _connection;
+            }
+        }
+    }
+
+    public class AcceptStateChangedEventArgs : EventArgs
+    {
+        private BluetoothError _result;
+        private BluetoothSocketState _state;
+        private SocketConnection _connection;
+        private IBluetoothServerSocket _server;
+
+        internal AcceptStateChangedEventArgs(BluetoothError result, BluetoothSocketState state, SocketConnection connection, BluetoothSocket server)
+        {
+            _result = result;
+            _state = state;
+            _connection = connection;
+            _server = (IBluetoothServerSocket)server;
+        }
+
+        /// <summary>
+        /// The BluetoothError result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The socket state.
+        /// </summary>
+        public BluetoothSocketState State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+
+        /// <summary>
+        /// The socket connection.
+        /// </summary>
+        public SocketConnection Connection
+        {
+            get
+            {
+                return _connection;
+            }
+        }
+
+        /// <summary>
+        /// The server socket instance.
+        /// </summary>
+        public IBluetoothServerSocket Server
+        {
+            get
+            {
+                return _server;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the connection state, remote address, and the type of audio profile.
+    /// </summary>
+    public class AudioConnectionStateChangedEventArgs : EventArgs
+    {
+        private int _result;
+        private bool _isConnected;
+        private string _address;
+        private BluetoothAudioProfileType _type;
+
+        internal AudioConnectionStateChangedEventArgs(int result, bool isConnected, string address, BluetoothAudioProfileType type)
+        {
+            _result = result;
+            _type = type;
+            _isConnected = isConnected;
+            _address = address;
+        }
+
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public int Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// A value indicating whether this instance is connected.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return _isConnected;
+            }
+        }
+
+        /// <summary>
+        /// The address.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return _address;
+            }
+        }
+
+        /// <summary>
+        /// The type of the audio profile.
+        /// </summary>
+        public BluetoothAudioProfileType ProfileType
+        {
+            get
+            {
+                return _type;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the connection state and the address of the remote Bluetooth device.
+    /// </summary>
+    public class HidConnectionStateChangedEventArgs : EventArgs
+    {
+        private int _result;
+        private bool _isConnected;
+        private string _address;
+
+        internal HidConnectionStateChangedEventArgs(int result, bool isConnected, string address)
+        {
+            _result = result;
+            _isConnected = isConnected;
+            _address = address;
+        }
+
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public int Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// A value indicating whether this instance is connected.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return _isConnected;
+            }
+        }
+
+        /// <summary>
+        /// The address.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return _address;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed equalizer state.
+    /// </summary>
+    public class EqualizerStateChangedEventArgs : EventArgs
+    {
+        private EqualizerState _state;
+
+        internal EqualizerStateChangedEventArgs(EqualizerState state)
+        {
+            _state = state;
+        }
+
+        /// <summary>
+        /// The state of the equalizer.
+        /// </summary>
+        public EqualizerState State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed repeat mode.
+    /// </summary>
+    public class RepeatModeChangedEventArgs : EventArgs
+    {
+        private RepeatMode _mode;
+
+        internal RepeatModeChangedEventArgs(RepeatMode mode)
+        {
+            _mode = mode;
+        }
+
+        /// <summary>
+        /// The repeat mode.
+        /// </summary>
+        public RepeatMode Mode
+        {
+            get
+            {
+                return _mode;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed shuffle mode.
+    /// </summary>
+    public class ShuffleModeChangedeventArgs : EventArgs
+    {
+        private ShuffleMode _mode;
+
+        internal ShuffleModeChangedeventArgs(ShuffleMode mode)
+        {
+            _mode = mode;
+        }
+
+        /// <summary>
+        /// The shuffle mode.
+        /// </summary>
+        public ShuffleMode Mode
+        {
+            get
+            {
+                return _mode;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed scan mode.
+    /// </summary>
+    public class ScanModeChangedEventArgs : EventArgs
+    {
+        private ScanMode _mode;
+
+        internal ScanModeChangedEventArgs(ScanMode mode)
+        {
+            _mode = mode;
+        }
+
+        /// <summary>
+        /// The scan mode.
+        /// </summary>
+        public ScanMode Mode
+        {
+            get
+            {
+                return _mode;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the connection state and the remote device address.
+    /// </summary>
+    public class TargetConnectionStateChangedEventArgs : EventArgs
+    {
+        private bool _isConnected;
+        private string _address;
+
+        internal TargetConnectionStateChangedEventArgs(bool isConnected, string address)
+        {
+            _isConnected = isConnected;
+            _address = address;
+        }
+
+        /// <summary>
+        /// A value indicating whether this instance is connected.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return _isConnected;
+            }
+        }
+
+        /// <summary>
+        /// The address.
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return _address;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth LE advertising state changed information.
+    /// </summary>
+    public class AdvertisingStateChangedEventArgs : EventArgs
+    {
+        private BluetoothLeAdvertisingState _state;
+        private int _result;
+        private IntPtr _advertiserHandle;
+
+               //TODO : Add conversion code from IntPtr to BluetoothLeAdvertiser class later
+        internal AdvertisingStateChangedEventArgs(int result, IntPtr advertiserHandle,
+            BluetoothLeAdvertisingState state)
+        {
+            _result = result;
+            _advertiserHandle = advertiserHandle;
+            _state = state;
+        }
+
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public int Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The advertiser handle.
+        /// </summary>
+        public IntPtr AdvertiserHandle
+        {
+            get
+            {
+                return _advertiserHandle;
+            }
+        }
+
+        /// <summary>
+        /// The LE advertising state.
+        /// </summary>
+        public BluetoothLeAdvertisingState State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth LE scan result information.
+    /// </summary>
+    public class AdapterLeScanResultChangedEventArgs : EventArgs
+    {
+        private BluetoothLeDevice _deviceData;
+        private BluetoothError _result;
+
+        internal AdapterLeScanResultChangedEventArgs(BluetoothError result, BluetoothLeDevice deviceData)
+        {
+            _deviceData = deviceData;
+            _result = result;
+        }
+
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public BluetoothError Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// The LE device data.
+        /// </summary>
+        public BluetoothLeDevice DeviceData
+        {
+            get
+            {
+                return _deviceData;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed Bluetooth LE GATT connection state.
+    /// </summary>
+    public class GattConnectionStateChangedEventArgs : EventArgs
+    {
+        private bool _isConnected;
+        private int _result;
+        private string _remoteAddress;
+
+        internal GattConnectionStateChangedEventArgs(int result, bool connected, string remoteAddress)
+        {
+            _isConnected = connected;
+            _result = result;
+            _remoteAddress = remoteAddress;
+        }
+
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public int Result
+        {
+            get
+            {
+                return _result;
+            }
+        }
+
+        /// <summary>
+        /// A value indicating whether this instance is connected.
+        /// </summary>
+        public bool IsConnected
+        {
+            get
+            {
+                return _isConnected;
+            }
+        }
+
+        /// <summary>
+        /// The remote address.
+        /// </summary>
+        public string RemoteAddress
+        {
+            get
+            {
+                return _remoteAddress;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the changed attribute value.
+    /// </summary>
+    public class ValueChangedEventArgs : EventArgs
+    {
+        internal ValueChangedEventArgs(byte[] value)
+        {
+            Value = value;
+        }
+
+        /// <summary>
+        /// The attribute value.
+        /// </summary>
+        public byte[] Value { get; }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the read value request data.
+    /// </summary>
+    public class ReadRequestedEventArgs : EventArgs
+    {
+        internal ReadRequestedEventArgs(BluetoothGattServer server, string clientAddress, int requestId, int offset)
+        {
+            Server = server;
+            ClientAddress = clientAddress;
+            RequestId = requestId;
+            Offset = offset;
+        }
+
+        /// <summary>
+        /// The GATT server instance.
+        /// </summary>
+        public BluetoothGattServer Server { get; }
+        /// <summary>
+        /// The client address.
+        /// </summary>
+        public string ClientAddress { get; }
+        /// <summary>
+        /// The request identifier.
+        /// </summary>
+        public int RequestId { get; }
+        /// <summary>
+        /// The offset.
+        /// </summary>
+        public int Offset { get; }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the read value request data.
+    /// </summary>
+    public class WriteRequestedEventArgs : EventArgs
+    {
+        internal WriteRequestedEventArgs(BluetoothGattServer server, string clientAddress, int requestId, byte[] value, int offset, bool response_needed)
+        {
+            Server = server;
+            ClientAddress = clientAddress;
+            RequestId = requestId;
+            Value = value;
+            Offset = offset;
+            Response_needed = response_needed;
+        }
+
+        /// <summary>
+        /// The GATT server instance.
+        /// </summary>
+        public BluetoothGattServer Server { get; }
+        /// <summary>
+        /// The client address.
+        /// </summary>
+        public string ClientAddress { get; }
+        /// <summary>
+        /// The request identifier.
+        /// </summary>
+        public int RequestId { get; }
+        /// <summary>
+        /// The read value.
+        /// </summary>
+        public byte[] Value { get; }
+        /// <summary>
+        /// The offset.
+        /// </summary>
+        public int Offset { get; }
+        /// <summary>
+        /// Indicates whether a response is required by the remote device.
+        /// </summary>
+        public bool Response_needed { get; }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the client preference to enable or disable the Notification/Indication.
+    /// </summary>
+    public class NotificationStateChangedEventArg : EventArgs
+    {
+        internal NotificationStateChangedEventArg(BluetoothGattServer server, bool value)
+        {
+            Server = server;
+            Value = value;
+        }
+
+        /// <summary>
+        /// The GATT server instance.
+        /// </summary>
+        public BluetoothGattServer Server { get; }
+        /// <summary>
+        /// A value indicating whether the notification is enabled.
+        /// </summary>
+        public bool Value { get; }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class contains the read value request data.
+    /// </summary>
+    public class NotificationSentEventArg : EventArgs
+    {
+        internal NotificationSentEventArg(BluetoothGattServer server, string clientAddress, int result, bool completed)
+        {
+            Result = result;
+            ClientAddress = clientAddress;
+            Server = server;
+            Completed = completed;
+        }
+
+        /// <summary>
+        /// The GATT server instance.
+        /// </summary>
+        public BluetoothGattServer Server { get; }
+        /// <summary>
+        /// The client address.
+        /// </summary>
+        public string ClientAddress { get; }
+        /// <summary>
+        /// The result.
+        /// </summary>
+        public int Result { get; }
+        /// <summary>
+        /// Gets a value indicating whether the notification sent is completed.
+        /// </summary>
+        public bool Completed { get; }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs
new file mode 100644 (file)
index 0000000..923f99c
--- /dev/null
@@ -0,0 +1,966 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// The Bluetooth GATT server.
+    /// </summary>
+    public class BluetoothGattServer
+    {
+        private static BluetoothGattServer _instance;
+        private BluetoothGattServerImpl _impl;
+        private BluetoothGattServer()
+        {
+            _impl = new BluetoothGattServerImpl();
+        }
+
+        /// <summary>
+        /// (event) This event is called when the indication acknowledgement is received for each notified client.
+        /// </summary>
+        public event EventHandler<NotificationSentEventArg> NotificationSent
+        {
+            add
+            {
+                _impl._notificationSent += value;
+            }
+            remove
+            {
+                _impl._notificationSent -= value;
+            }
+        }
+
+        /// <summary>
+        /// Creates the Bluetooth GATT server.
+        /// </summary>
+        /// <returns></returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the create GATT server fails.</exception>
+        public static BluetoothGattServer CreateServer()
+        {
+            if (_instance == null)
+            {
+                BluetoothGattServer server = new BluetoothGattServer();
+                if (server.IsValid())
+                {
+                    _instance = server;
+                }
+            }
+            return _instance;
+        }
+
+        /// <summary>
+        /// Registers the server along with the GATT services of the application it is hosting.
+        /// </summary>
+        /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the register server application fails.</exception>
+        public void Start()
+        {
+            _impl.Start();
+        }
+
+        /// <summary>
+        /// Registers a specified service to this server.
+        /// </summary>
+        /// <param name="service">The service, which needs to be registered with this server.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the register service fails.</exception>
+        public void RegisterGattService(BluetoothGattService service)
+        {
+            if (service.IsRegistered())
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter);
+            }
+            _impl.RegisterGattService(this, service);
+        }
+
+        /// <summary>
+        /// Unregisters a specified service from this server.
+        /// </summary>
+        /// <param name="service">The service, which needs to be unregistered from this server.</param>
+        /// <remarks>
+        /// Once unregistered, the service object will become invalid and should not be used to access sevices or any children attribute's methods/members.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the unregister service fails.</exception>
+        public void UnregisterGattService(BluetoothGattService service)
+        {
+            if (service.GetGattServer() != this)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter);
+            }
+
+            _impl.UnregisterGattService(service);
+        }
+
+        /// <summary>
+        /// Unregisters all services from this server.
+        /// </summary>
+        /// <remarks>
+        /// Once unregistered, servicees will become invalid and should not be used to access sevices or any children attribute's methods/members.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the unregister all services fail.</exception>
+        public void UnregisterGattServices()
+        {
+            _impl.UnregisterAllGattServices(this);
+        }
+
+        /// <summary>
+        /// Gets service with given UUID that belongs to this server.
+        /// </summary>
+        /// <param name="uuid">The UUID for the service to get.</param>
+        /// <returns>The Service with the given UUID if it exists, null otherwise.</returns>
+        public BluetoothGattService GetService(string uuid)
+        {
+            return _impl.GetService(this, uuid);
+        }
+
+        /// <summary>
+        /// Gets the list of services that belongs to this server.
+        /// </summary>
+        /// <returns>The list of services that belongs to this server.</returns>
+        public IEnumerable<BluetoothGattService> GetServices()
+        {
+            return _impl.GetServices(this);
+        }
+
+        /// <summary>
+        /// Sends indication for the value change of the characteristic to the remote devices.
+        /// </summary>
+        /// <param name="characteristic">The characteristic whose the value is changed.</param>
+        /// <param name="clientAddress">The remote device address to send, notify, or indicate and if set to NULL, then notify/indicate all is enabled.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when service is not registered, or when the CCCD is not enabled.</exception>
+        public async Task<bool> SendIndicationAsync(BluetoothGattCharacteristic characteristic, string clientAddress)
+        {
+            return await _impl.SendIndicationAsync(this, characteristic, clientAddress);
+        }
+
+        /// <summary>
+        /// Sends the notification for the value change of the characteristic to the remote devices.
+        /// </summary>
+        /// <param name="characteristic">The characteristic, which has a changed value.</param>
+        /// <param name="clientAddress">The remote device address to send, notify, or indicate and if set to NULL, then notify/indicate all is enabled.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when service is not registered, or when the CCCD is not enabled.</exception>
+        public void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress)
+        {
+            _impl.SendNotification(characteristic, clientAddress);
+        }
+
+        /// <summary>
+        /// Sends a response to the remote device as a result of a read/write request.
+        /// </summary>
+        /// <param name="requestId">The identification of a read/write request.</param>
+        /// <param name="type">The request type for read/write.</param>
+        /// <param name="status">The error value in case of failure, 0 for success.</param>
+        /// <param name="value">The value to be sent.</param>
+        /// <param name="offset">The offset from where the value is read.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or the send response procedure fails.</exception>
+        public void SendResponse(int requestId, BluetoothGattRequestType type, int status, byte[] value, int offset)
+        {
+            _impl.SendResponse(requestId, (int)type, status, value, offset);
+        }
+
+        internal bool IsValid()
+        {
+            return _impl.GetHandle().IsInvalid == false;
+        }
+    }
+
+    /// <summary>
+    /// The Bluetooth GATT client.
+    /// </summary>
+    public class BluetoothGattClient
+    {
+        private BluetoothGattClientImpl _impl;
+        private string _remoteAddress = string.Empty;
+
+        internal BluetoothGattClient(string remoteAddress)
+        {
+            _impl = new BluetoothGattClientImpl(remoteAddress);
+            _remoteAddress = remoteAddress;
+        }
+
+        internal static BluetoothGattClient CreateClient(string remoteAddress)
+        {
+            BluetoothGattClient client = new BluetoothGattClient(remoteAddress);
+            return client.Isvalid() ? client : null;
+        }
+
+        public void DestroyClient()
+        {
+            _impl.GetHandle().Dispose();
+        }
+
+        /// <summary>
+        /// The address of the remote device.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected.</exception>
+        public string RemoteAddress
+        {
+            get
+            {
+                if (string.IsNullOrEmpty(_remoteAddress))
+                {
+                    _remoteAddress = _impl.GetRemoteAddress();
+                }
+                return _remoteAddress;
+            }
+        }
+
+        /// <summary>
+        /// Gets the service with the given UUID that belongs to the remote device.
+        /// </summary>
+        /// <param name="uuid">The UUID for the service to get.</param>
+        /// <returns>The service with the given UUID if it exists, null otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when the get service fails.</exception>
+        public BluetoothGattService GetService(string uuid)
+        {
+            return _impl.GetService(this, uuid);
+        }
+
+        /// <summary>
+        /// Gets list of services that belongs to the remote device.
+        /// </summary>
+        /// <returns>The list of services that belongs to the remote device.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when the get service fails.</exception>
+        public IEnumerable<BluetoothGattService> GetServices()
+        {
+            return _impl.GetServices(this);
+        }
+
+        /// <summary>
+        /// Reads the value of a given characteristic from the remote device asynchronously.
+        /// </summary>
+        /// <param name="characteristic">The characteristic to be read.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when the read attribute value fails.</exception>
+        public async Task<bool> ReadValueAsync(BluetoothGattCharacteristic characteristic)
+        {
+            return await _impl.ReadValueAsyncTask(characteristic.GetHandle());
+        }
+
+        /// <summary>
+        /// Reads the value of the given descriptor from the remote device asynchronously.
+        /// </summary>
+        /// <param name="descriptor">The descriptor to be read.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when the read attribute value fails.</exception>
+        public async Task<bool> ReadValueAsync(BluetoothGattDescriptor descriptor)
+        {
+            return await _impl.ReadValueAsyncTask(descriptor.GetHandle());
+        }
+
+        /// <summary>
+        /// Writes the value of a given characteristic to the remote device asynchronously.
+        /// </summary>
+        /// <param name="characteristic">The characteristic to be written.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected or when the write attribute value fails.</exception>
+        public async Task<bool> WriteValueAsync(BluetoothGattCharacteristic characteristic)
+        {
+            return await _impl.WriteValueAsyncTask(characteristic.GetHandle());
+        }
+
+        /// <summary>
+        /// Writes the value of the given descriptor to the remote device asynchronously.
+        /// </summary>
+        /// <param name="descriptor">The descriptor to be written.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not enabled
+        /// or when the remote device is disconnected, or when the write attribute value fails.</exception>
+        public async Task<bool> WriteValueAsync(BluetoothGattDescriptor descriptor)
+        {
+            return await _impl.WriteValueAsyncTask(descriptor.GetHandle());
+        }
+
+        internal bool Isvalid()
+        {
+            return _impl.GetHandle().IsInvalid == false;
+        }
+    }
+
+    /// <summary>
+    /// The Bluetooth GATT service.
+    /// </summary>
+    public class BluetoothGattService
+    {
+        private BluetoothGattServiceImpl _impl;
+        private BluetoothGattClient _parentClient = null;
+        private BluetoothGattServer _parentServer = null;
+        private BluetoothGattService _parentService = null;
+
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <param name="uuid">The UUID of the service.</param>
+        /// <param name="type">The type of service.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the create GATT service procedure fails.</exception>
+        public BluetoothGattService(string uuid, BluetoothGattServiceType type)
+        {
+            Uuid = uuid;
+            _impl = new BluetoothGattServiceImpl(uuid, type);
+        }
+
+        internal BluetoothGattService(BluetoothGattServiceImpl impl, string uuid)
+        {
+            Uuid = uuid;
+            _impl = impl;
+        }
+
+        /// <summary>
+        /// Specification name from the UUID.
+        /// </summary>
+        public string Uuid { get; }
+
+        /// <summary>
+        /// Adds a characteristic to this service.
+        /// </summary>
+        /// <param name="characteristic">The characteristic to be added.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the add GATT characteristic procedure fails.</exception>
+        public void AddCharacteristic(BluetoothGattCharacteristic characteristic)
+        {
+            if (GetGattClient() != null)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported);
+            }
+
+            if (characteristic.GetService() != null)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter);
+            }
+
+            _impl.AddCharacteristic(characteristic);
+            characteristic.SetParent(this);
+        }
+
+        /// <summary>
+        /// Gets the characteristic with the given UUID that belongs to this service.
+        /// </summary>
+        /// <param name="uuid">The UUID for the characteristic to get.</param>
+        /// <returns>The characteristic with a given UUID if it exists, null otherwise.</returns>
+        public BluetoothGattCharacteristic GetCharacteristic(string uuid)
+        {
+            return _impl.GetCharacteristic(this, uuid);
+        }
+
+        /// <summary>
+        /// Gets list of the characteristic that belongs to this service.
+        /// </summary>
+        /// <returns>The list of the characteristic that belongs to this service.</returns>
+        public IEnumerable<BluetoothGattCharacteristic> GetCharacteristics()
+        {
+            return _impl.GetCharacteristics(this);
+        }
+
+        /// <summary>
+        /// Includes a service to this service.
+        /// </summary>
+        /// <param name="service">The service to be included.</param>
+        /// <returns>true on success, false otherwise</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the add GATT service procedure fails.</exception>/// 
+        public void AddService(BluetoothGattService service)
+        {
+            if (GetGattClient() != null)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported);
+            }
+
+            if (service.IsRegistered())
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter);
+            }
+
+            _impl.AddIncludeService(service);
+            service.SetParent(this);
+        }
+
+        /// <summary>
+        /// Gets the included service.
+        /// </summary>
+        /// <param name="uuid">The UUID for the service to get.</param>
+        /// <returns>The service with a given UUID if it exists, null otherwise.</returns>
+        public BluetoothGattService GetIncludeService(string uuid)
+        {
+            return _impl.GetIncludeService(this, uuid);
+        }
+
+        /// <summary>
+        /// Gets the included service list of this service.
+        /// </summary>
+        /// <returns>The included service list of this service.</returns>
+        public IEnumerable<BluetoothGattService> GetIncludeServices()
+        {
+            return _impl.GetIncludeServices(this);
+        }
+
+        /// <summary>
+        /// Gets the server instance which the specified service belongs to.
+        /// </summary>
+        /// <returns>The server instance which the specified service belongs to.</returns>
+        public BluetoothGattServer GetGattServer()
+        {
+            return _parentServer;
+        }
+
+        /// <summary>
+        /// Gets the client instance which the specified service belongs to.
+        /// </summary>
+        /// <returns>The client instance which the specified service belongs to.</returns>
+        public BluetoothGattClient GetGattClient()
+        {
+            return _parentClient;
+        }
+
+        internal BluetoothGattAttributeHandle GetHandle()
+        {
+            return _impl.GetHandle();
+        }
+
+        internal void SetParent(BluetoothGattService parent)
+        {
+            if (!IsRegistered())
+            {
+                _parentService = parent;
+                _impl.ReleaseHandleOwnership();
+            }
+        }
+
+        internal void SetParent(BluetoothGattClient parent)
+        {
+            if (!IsRegistered())
+            {
+                _parentClient = parent;
+                _impl.ReleaseHandleOwnership();
+            }
+        }
+
+        internal void SetParent(BluetoothGattServer parent)
+        {
+            if (!IsRegistered())
+            {
+                _parentServer = parent;
+                _impl.ReleaseHandleOwnership();
+            }
+        }
+
+        internal void UnregisterService()
+        {
+            _parentServer = null;
+            _parentClient = null;
+            _parentService = null;
+        }
+
+        internal bool IsRegistered()
+        {
+            return _parentClient != null || _parentServer != null || _parentService != null;
+        }
+    }
+
+    /// <summary>
+    /// The Bluetooth GATT characteristic.
+    /// </summary>
+    public class BluetoothGattCharacteristic : BluetoothGattAttribute
+    {
+        private BluetoothGattCharacteristicImpl _impl;
+        private BluetoothGattService _parent = null;
+
+        private Interop.Bluetooth.BtClientCharacteristicValueChangedCallback _characteristicValueChangedCallback;
+        private Interop.Bluetooth.BtGattServerNotificationStateChangeCallback _notificationStateChangedCallback;
+
+        private EventHandler<ValueChangedEventArgs> _characteristicValueChanged;
+        internal EventHandler<NotificationStateChangedEventArg> _notificationStateChanged;
+
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <param name="uuid">The UUID of the characterstic.param>
+        /// <param name="permissions">Permissions for the characterstic.</param>
+        /// <param name="properties">Properties set for the characterstic.</param>
+        /// <param name="value">The value associated with the characterstic.</param>
+        /// <remarks>throws in case of internal error.</remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the create GATT characteristics procedure fails.</exception>
+        public BluetoothGattCharacteristic(string uuid, BluetoothGattPermission permissions, BluetoothGattProperty properties, byte[] value) : base(uuid, permissions)
+        {
+            _impl = new BluetoothGattCharacteristicImpl(uuid, permissions, properties, value);
+        }
+
+        internal BluetoothGattCharacteristic(BluetoothGattCharacteristicImpl impl, string uuid, BluetoothGattPermission permission) : base(uuid, permission)
+        {
+            _impl = impl;
+        }
+
+        /// <summary>
+        /// The CharacteristicValueChanged event is raised when the server notifies for change in this characteristic value.
+        /// </summary>
+        /// <remarks>
+        /// Adding the event handle on characteristic on the server side will not have any effect.
+        /// </remarks>
+        public event EventHandler<ValueChangedEventArgs> ValueChanged
+        {
+            add
+            {
+                if (Client != null)
+                {
+                    if (_characteristicValueChanged == null)
+                    {
+                        _characteristicValueChangedCallback = (gattHandle, characteristicValue, len, userData) =>
+                        {
+                            _characteristicValueChanged?.Invoke(this, new ValueChangedEventArgs(characteristicValue));
+                        };
+
+                        _impl.SetCharacteristicValueChangedEvent(_characteristicValueChangedCallback);
+                    }
+                    _characteristicValueChanged = value;
+                }
+            }
+            remove
+            {
+                if (Client != null)
+                {
+                    _characteristicValueChanged = null;
+                    if (_characteristicValueChanged == null)
+                    {
+                        _impl.UnsetCharacteristicValueChangedEvent();
+                    }
+
+                }
+            }
+        }
+
+        /// <summary>
+        /// The NotificationStateChanged event is called when the client enables or disables the Notification/Indication for particular characteristics.
+        /// </summary>
+        /// <remarks>
+        /// Adding event handle on the characteristic on the client side will not have any effect.
+        /// </remarks>
+        public event EventHandler<NotificationStateChangedEventArg> NotificationStateChanged
+        {
+            add
+            {
+                if (Server != null)
+                {
+                    if (_notificationStateChangedCallback == null)
+                    {
+                        _notificationStateChangedCallback = (notify, serverHandle, characteristicHandle, userData) =>
+                        {
+                            _notificationStateChanged?.Invoke(this, new NotificationStateChangedEventArg(Server, notify));
+                        };
+
+                        _impl.SetNotificationStateChangedEvent(_notificationStateChangedCallback);
+                    }
+
+                    _notificationStateChanged = value;
+                }
+            }
+            remove
+            {
+                if (Server != null)
+                {
+                    _notificationStateChanged = null;
+                    // CAPI does not allow unsetting ReadValueRequestedEventCallback.
+                }
+            }
+        }
+
+        /// <summary>
+        /// The property for this characteristic.
+        /// </summary>
+        public BluetoothGattProperty Properties
+        {
+            get
+            {
+                return _impl.GetProperties();
+            }
+            set
+            {
+                if (Server != null)
+                {
+                    _impl.SetProperties(value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The write type to be used for write operations.
+        /// </summary>
+        public BluetoothGattWriteType WriteType
+        {
+            get
+            {
+                return _impl.GetWriteType();
+            }
+            set
+            {
+                _impl.SetWriteType(value);
+            }
+        }
+
+        internal override BluetoothGattClient Client
+        {
+            get
+            {
+                return _parent?.GetGattClient();
+            }
+        }
+
+        internal override BluetoothGattServer Server
+        {
+            get
+            {
+                return _parent?.GetGattServer();
+            }
+        }
+
+        internal override BluetoothGattAttributeImpl Impl
+        {
+            get
+            {
+                return _impl;
+            }
+        }
+
+        /// <summary>
+        /// Adds a descriptor to this characteristic.
+        /// </summary>
+        /// <param name="descriptor">The descriptor to be added.</param>
+        /// <returns>true on success, false otherwise.</returns>
+        /// <exception cref="System.InvalidOperationException">Thrown when the add GATT descriptor procedure fails.</exception>
+        public void AddDescriptor(BluetoothGattDescriptor descriptor)
+        {
+            if (Client != null)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported);
+            }
+
+            if (descriptor.GetCharacteristic() != null)
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter);
+            }
+
+            _impl.AddDescriptor(descriptor);
+            descriptor.SetParent(this);
+        }
+
+        /// <summary>
+        /// Gets the descriptor with the given UUID that belongs to this characteristic.
+        /// </summary>
+        /// <param name="uuid">The UUID for the descriptor to get.</param>
+        /// <returns>The descriptor with a given UUID if it exists, null otherwise.</returns>
+        public BluetoothGattDescriptor GetDescriptor(string uuid)
+        {
+            return _impl.GetDescriptor(this, uuid);
+        }
+
+        /// <summary>
+        /// Gets the list of descriptors that belongs to this characteristic.
+        /// </summary>
+        /// <returns>The list of descriptors that belongs to this characteristic.</returns>
+        public IEnumerable<BluetoothGattDescriptor> GetDescriptors()
+        {
+            return _impl.GetDescriptors(this);
+        }
+
+        /// <summary>
+        /// Gets the service instance, which the specified characterstic belongs to.
+        /// </summary>
+        /// <returns>The characteristic instance, the specified characterstic belongs to.</returns>
+        public BluetoothGattService GetService()
+        {
+            return _parent;
+        }
+
+        internal void SetParent(BluetoothGattService parent)
+        {
+            if (_parent == null)
+            {
+                _parent = parent;
+                ReleaseHandleOwnership();
+            }
+         }
+    }
+
+    /// <summary>
+    /// The Bluetooth GATT descriptor.
+    /// </summary>
+    public class BluetoothGattDescriptor : BluetoothGattAttribute
+    {
+        private BluetoothGattCharacteristic _parent = null;
+        private BluetoothGattDescriptorImpl _impl;
+
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <param name="uuid">The UUID of the descriptor.</param>
+        /// <param name="permisions">Permissions for the descriptor.</param>
+        /// <param name="value">The value associated with the descriptor.</param>
+        /// <remarks>throws in case of internal error.</remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the create GATT descriptor procedure fails.</exception>
+        public BluetoothGattDescriptor(string uuid, BluetoothGattPermission permisions, byte[] value) : base (uuid, permisions)
+        {
+            _impl = new BluetoothGattDescriptorImpl(uuid, permisions, value);
+        }
+
+        internal BluetoothGattDescriptor(BluetoothGattDescriptorImpl impl, string uuid, BluetoothGattPermission permission) : base(uuid, permission)
+        {
+            _impl = impl;
+        }
+
+        internal override BluetoothGattClient Client
+        {
+            get
+            {
+                return _parent?.Client;
+            }
+        }
+
+        internal override BluetoothGattServer Server
+        {
+            get
+            {
+                return _parent?.Server;
+            }
+        }
+
+        internal override BluetoothGattAttributeImpl Impl
+        {
+            get
+            {
+                return _impl;
+            }
+        }
+
+        /// <summary>
+        /// Gets the characteristic instance, which the specified descriptor belongs to.
+        /// </summary>
+        /// <returns>The characteristic instance, the specified descriptor belongs to.</returns>
+        public BluetoothGattCharacteristic GetCharacteristic()
+        {
+            return _parent;
+        }
+
+        internal void SetParent(BluetoothGattCharacteristic parent)
+        {
+            if (_parent == null)
+            {
+                _parent = parent;
+                ReleaseHandleOwnership();
+            }
+        }
+    }
+
+    /// <summary>
+    /// The Bluetooth GATT attribute.
+    /// </summary>
+    public abstract class BluetoothGattAttribute
+    {
+        private Interop.Bluetooth.BtGattServerReadValueRequestedCallback _readValueRequestedCallback;
+        private Interop.Bluetooth.BtGattServerWriteValueRequestedCallback _writeValueRequestedCallback;
+
+        private EventHandler<ReadRequestedEventArgs> _readValueRequested;
+        private EventHandler<WriteRequestedEventArgs> _writeValueRequested;
+
+        public BluetoothGattAttribute(string uuid, BluetoothGattPermission permission)
+        {
+            Uuid = uuid;
+            Permissions = permission;
+        }
+
+        // Events
+
+        /// <summary>
+        /// This event is called when the client request to read the value of a characteristic or a descriptor.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the set read value requested callback procedure fails.</exception>
+        public event EventHandler<ReadRequestedEventArgs> ReadRequested
+        {
+            add
+            {
+                if (Server == null) return;
+                if (_readValueRequestedCallback == null)
+                {
+                    _readValueRequestedCallback = (clientAddress, requestId, serverHandle, gattHandle, offset, userData) =>
+                    {
+                        _readValueRequested?.Invoke(this, new ReadRequestedEventArgs(Server, clientAddress, requestId, offset));
+                    };
+                    Impl.SetReadValueRequestedEventCallback(_readValueRequestedCallback);
+                }
+                _readValueRequested = value;
+            }
+            remove
+            {
+                if (Server == null) return;
+                _readValueRequested = null;
+                // CAPI does not allow unsetting ReadValueRequestedEventCallback.
+            }
+        }
+
+        /// <summary>
+        /// This event is called when a value of a characteristic or a descriptor has been changed by a client.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the set write value requested callback procedure fails.</exception>
+        public event EventHandler<WriteRequestedEventArgs> WriteRequested
+        {
+            add
+            {
+                if (Server == null) return;
+                if (_writeValueRequested == null)
+                {
+                    _writeValueRequestedCallback = (clientAddress, requestId, serverHandle, gattHandle, offset, response_needed, valueToWrite, len, userData) =>
+                    {
+                        _writeValueRequested?.Invoke(this, new WriteRequestedEventArgs(Server, clientAddress, requestId, valueToWrite, offset, response_needed));
+                    };
+                    Impl.SetWriteValueRequestedEventCallback(_writeValueRequestedCallback);
+                }
+                _writeValueRequested = value;
+            }
+            remove
+            {
+                if (Server == null) return;
+                _writeValueRequested = null;
+                // CAPI does not allow unsetting ReadValueRequestedEventCallback.
+            }
+        }
+
+        /// <summary>
+        /// The attribute's UUID.
+        /// </summary>
+        public string Uuid { get; }
+
+        /// <summary>
+        /// Permissions for this attribute.
+        /// </summary>
+        public BluetoothGattPermission Permissions { get; }
+
+        /// <summary>
+        /// The value of this descriptor.
+        /// </summary>
+        public byte[] Value
+        {
+            get
+            {
+                return Impl.GetValue();
+            }
+            set
+            {
+                Impl.SetValue(value);
+            }
+        }
+
+        internal abstract BluetoothGattClient Client { get; }
+        internal abstract BluetoothGattServer Server { get; }
+        internal abstract BluetoothGattAttributeImpl Impl { get; }
+
+        /// <summary>
+        /// Returns a string value at the specified offset.
+        /// </summary>
+        /// <param name="offset"></param>
+        /// <returns>The string value at specified offset.</returns>
+        public string GetValue(int offset)
+        {
+            return Impl.GetValue(offset);
+        }
+
+        /// <summary>
+        /// Sets the string value as a specified offset.
+        /// </summary>
+        /// <param name="value">value to set</param>
+        /// <exception cref="InvalidOperationException">Throws exception if the value is null.</exception>
+        public void SetValue(string value)
+        {
+            if (string.IsNullOrEmpty(value))
+                GattUtil.ThrowForError((int)BluetoothError.InvalidParameter, "value should not be null");
+
+            byte[] val = Encoding.UTF8.GetBytes(value);
+            Impl.SetValue(val);
+        }
+
+        /// <summary>
+        /// Returns a value at specified offset as the int value of the specified type.
+        /// </summary>
+        /// <param name="type">The type of the int value.</param>
+        /// <param name="An offset">An offset in the attribute value buffer.</param>
+        /// <returns>The int value at given offset.</returns>
+        /// <exception cref="InvalidOperationException">Throws exception if (offset + size of int value) is greater than the length of the value buffer.</exception>
+        public int GetValue(IntDataType type, int offset)
+        {
+            return Impl.GetValue(type, offset);
+        }
+
+        /// <summary>
+        /// Updates a value at the specified offset by the int value of the specified type.
+        /// </summary>
+        /// <param name="type">The type of the int value.</param>
+        /// <param name="value">The value to set.</param>
+        /// <param name="offset">An offset in the attribute value buffer.</param>
+        /// <exception cref="InvalidOperationException">Throws exception if (offset + size of int value) is greater than the length of the value buffer.</exception>
+        public void SetValue(IntDataType type, int value, int offset)
+        {
+            Impl.SetValue(type, value, offset);
+        }
+
+        /// <summary>
+        /// Returns a value at the specified offset as the float value of the specified type.
+        /// </summary>
+        /// <param name="type">The type of the float value.</param>
+        /// <param name="offset">An offset in the attribute value buffer.</param>
+        /// <returns>The float value at given offset.</returns>
+        /// <exception cref="InvalidOperationException">Throws exception if (offset + size of float value) is greater than the length of the value buffer.</exception>
+        public float GetValue(FloatDataType type, int offset)
+        {
+            return Impl.GetValue(type, offset);
+        }
+
+        /// <summary>
+        /// Updates the value at the specified offset by the float value of the specified type.
+        /// </summary>
+        /// <param name="type">The type of the float value.</param>
+        /// <param name="mantissa">The mantissa of the float value.</param>
+        /// <param name="exponent">An exponent of the float value.</param>
+        /// <param name="offset">An offset in the attribute value buffer.</param>
+        /// <exception cref="InvalidOperationException">Throws exception if (offset + size of float value) is greater than the length of the value buffer.</exception>
+        public void SetValue(FloatDataType type, int mantissa, int exponent, int offset)
+        {
+            Impl.SetValue(type, mantissa, exponent, offset);
+        }
+
+        internal void ReleaseHandleOwnership()
+        {
+            Impl.ReleaseHandleOwnership();
+        }
+
+        internal BluetoothGattAttributeHandle GetHandle()
+        {
+            return Impl.GetHandle();
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs
new file mode 100644 (file)
index 0000000..39530db
--- /dev/null
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Network.Bluetooth
+{
+    internal class BluetoothGattServerImpl
+    {
+        private BluetoothGattServerHandle _handle;
+        internal event EventHandler<NotificationSentEventArg> _notificationSent;
+
+        internal BluetoothGattServerImpl()
+        {
+            int err = Interop.Bluetooth.BtGattServerInitialize();
+            GattUtil.ThrowForError(err, "Failed to initialize server");
+
+            err = Interop.Bluetooth.BtGattServerCreate(out _handle);
+            GattUtil.ThrowForError(err, "Failed to create server");
+        }
+
+        internal void Start()
+        {
+            int err = Interop.Bluetooth.BtGattServerStart();
+            GattUtil.ThrowForError(err, "Failed to start server");
+        }
+
+        internal void RegisterGattService(BluetoothGattServer server, BluetoothGattService service)
+        {
+            int err = Interop.Bluetooth.BtGattServerRegisterService(_handle, service.GetHandle());
+            GattUtil.ThrowForError(err, "Failed to Register service");
+
+            service.SetParent(server);
+        }
+
+        internal void UnregisterGattService(BluetoothGattService service)
+        {
+            int err = Interop.Bluetooth.BtGattServerUnregisterService(_handle, service.GetHandle());
+            GattUtil.ThrowForError(err, "Failed to Unregister service");
+
+            service.UnregisterService();
+        }
+
+        internal void UnregisterAllGattServices(BluetoothGattServer server)
+        {
+            int err = Interop.Bluetooth.BtGattServerUnregisterAllServices(_handle);
+            GattUtil.ThrowForError(err, "Failed to Unregister all services");
+        }
+
+        internal BluetoothGattService GetService(BluetoothGattServer server, string uuid)
+        {
+            BluetoothGattAttributeHandle serviceHandle;
+            int err = Interop.Bluetooth.BtGattServerGetService(_handle, uuid, out serviceHandle);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, string.Format("Failed to get service with UUID ({0})", uuid));
+                return null;
+            }
+
+            BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(serviceHandle), uuid); ;
+            service.SetParent(server);
+            return service;
+        }
+
+        internal IEnumerable<BluetoothGattService> GetServices(BluetoothGattServer server)
+        {
+            List<BluetoothGattService> attribututeList = new List<BluetoothGattService>();
+            Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) =>
+            {
+                BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false);
+                BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, ""); ;
+                if (service != null)
+                {
+                    service.SetParent(server);
+                    attribututeList.Add(service);
+                }
+                return true;
+            };
+
+            int err = Interop.Bluetooth.BtGattServerForeachServices(_handle, cb, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to get all services");
+
+            return attribututeList;
+        }
+
+        internal void SendResponse(int requestId, int request_type, int status, byte[] value, int offset)
+        {
+            int err = Interop.Bluetooth.BtGattServerSendResponse(requestId, request_type, offset, status, value, value.Length);
+            GattUtil.ThrowForError(err, string.Format("Failed to send response for request Id {0}", requestId));
+        }
+
+        internal void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress)
+        {
+            int err = Interop.Bluetooth.BtGattServerNotify(characteristic.GetHandle(), null, clientAddress, IntPtr.Zero);
+            GattUtil.ThrowForError(err, string.Format("Failed to send value changed notification for characteristic uuid {0}", characteristic.Uuid));
+        }
+
+        internal Task<bool> SendIndicationAsync(BluetoothGattServer server, BluetoothGattCharacteristic characteristic, string clientAddress)
+        {
+            TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
+            Interop.Bluetooth.BtGattServerNotificationSentCallback cb = (result, address, serverHandle, characteristicHandle, completed, userData) =>
+            {
+                _notificationSent?.Invoke(characteristic, new NotificationSentEventArg(server, address, result, completed));
+                if (completed)
+                {
+                    tcs.SetResult(true);
+                }
+            };
+
+            int err = Interop.Bluetooth.BtGattServerNotify(characteristic.GetHandle(), cb, clientAddress, IntPtr.Zero);
+            GattUtil.ThrowForError(err, string.Format("Failed to send value changed indication for characteristic uuid {0}", characteristic.Uuid));
+
+            return tcs.Task;
+        }
+
+        internal BluetoothGattServerHandle GetHandle()
+        {
+            return _handle;
+        }
+    }
+
+    internal class BluetoothGattClientImpl
+    {
+        private BluetoothGattClientHandle _handle;
+
+        internal BluetoothGattClientImpl(string remoteAddress)
+        {
+            int err = Interop.Bluetooth.BtGattClientCreate(remoteAddress, out _handle);
+            GattUtil.ThrowForError(err, "Failed to get native client handle");
+        }
+
+        internal string GetRemoteAddress()
+        {
+            string remoteAddress;
+            int err = Interop.Bluetooth.BtGattClientGetRemoteAddress(_handle, out remoteAddress);
+            GattUtil.ThrowForError(err, "Failed to get remote address for this client");
+
+            return remoteAddress;
+        }
+
+        internal BluetoothGattService GetService(BluetoothGattClient client, string uuid)
+        {
+            BluetoothGattAttributeHandle serviceHandle;
+            int err = Interop.Bluetooth.BtGattClientGetService(_handle, uuid, out serviceHandle);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, string.Format("Failed to get service with UUID ({0})", uuid));
+                return null;
+            }
+
+            BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(serviceHandle), uuid); ;
+            service.SetParent(client);
+            return service;
+        }
+
+        internal IEnumerable<BluetoothGattService> GetServices(BluetoothGattClient client)
+        {
+            List<BluetoothGattService> attribututeList = new List<BluetoothGattService>();
+            Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) =>
+            {
+                BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false);
+                BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, "");
+                if (service != null)
+                {
+                    service.SetParent(client);
+                    attribututeList.Add(service);
+                }
+                return true;
+            };
+
+            int err = Interop.Bluetooth.BtGattClientForeachServices(_handle, cb, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to get all services");
+
+            return attribututeList;
+        }
+
+        internal Task<bool> ReadValueAsyncTask(BluetoothGattAttributeHandle handle)
+        {
+            TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
+            Interop.Bluetooth.BtGattClientRequestCompletedCallback cb = (result, requestHandle, userData) =>
+            {
+                if (result == (int)BluetoothError.None)
+                    tcs.SetResult(true);
+                else
+                    tcs.SetResult(false);
+            };
+
+            int err = Interop.Bluetooth.BtGattClientReadValue(handle, cb, IntPtr.Zero);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, "Failed to read value from remote device");
+                tcs.SetResult(false);
+                BluetoothErrorFactory.ThrowBluetoothException(err);
+            }
+            return tcs.Task;
+        }
+
+        internal Task<bool> WriteValueAsyncTask(BluetoothGattAttributeHandle handle)
+        {
+            TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
+            Interop.Bluetooth.BtGattClientRequestCompletedCallback cb = (result, requestHandle, userData) =>
+            {
+                if (result == (int)BluetoothError.None)
+                    tcs.SetResult(true);
+                else
+                    tcs.SetResult(false);
+            };
+
+            int err = Interop.Bluetooth.BtGattClientWriteValue(handle, cb, IntPtr.Zero);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, "Failed to write value to remote device");
+                tcs.SetResult(false);
+                BluetoothErrorFactory.ThrowBluetoothException(err);
+            }
+            return tcs.Task;
+        }
+
+        internal BluetoothGattClientHandle GetHandle()
+        {
+            return _handle;
+        }
+    }
+
+    internal class BluetoothGattServiceImpl : BluetoothGattAttributeImpl
+    {
+        internal BluetoothGattServiceImpl(string uuid, BluetoothGattServiceType type)
+        {
+            int err = Interop.Bluetooth.BtGattServiceCreate(uuid, (int)type, out _handle);
+            GattUtil.ThrowForError(err, "Failed to get native service handle");
+        }
+
+        internal BluetoothGattServiceImpl(BluetoothGattAttributeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        internal static BluetoothGattService CreateBluetoothGattService(BluetoothGattAttributeHandle handle, string uuid)
+        {
+            if (uuid == "")
+            {
+                int err = Interop.Bluetooth.BtGattGetUuid(handle, out uuid);
+                GattUtil.ThrowForError(err, "Failed to get UUID");
+            }
+
+            BluetoothGattServiceImpl impl = new BluetoothGattServiceImpl(handle);
+            return new BluetoothGattService(impl, uuid);
+        }
+
+        internal void AddCharacteristic(BluetoothGattCharacteristic characteristic)
+        {
+            int err = Interop.Bluetooth.BtGattServiceAddCharacteristic(_handle, characteristic.GetHandle());
+            GattUtil.ThrowForError(err, string.Format("Failed to add characteristic with UUID ({0})", characteristic.Uuid));
+        }
+
+        internal BluetoothGattCharacteristic GetCharacteristic(BluetoothGattService service, string uuid)
+        {
+            BluetoothGattAttributeHandle attributeHandle;
+            int err = Interop.Bluetooth.BtGattServiceGetCharacteristic(_handle, uuid, out attributeHandle);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, string.Format("Failed to get Characteristic with UUID ({0})", uuid));
+                return null;
+            }
+
+            BluetoothGattCharacteristic Characteristic = BluetoothGattCharacteristicImpl.CreateBluetoothGattGattCharacteristic(attributeHandle, uuid);
+            Characteristic.SetParent(service);
+            return Characteristic;
+        }
+
+        internal IEnumerable<BluetoothGattCharacteristic> GetCharacteristics(BluetoothGattService service)
+        {
+            List<BluetoothGattCharacteristic> attribututeList = new List<BluetoothGattCharacteristic>();
+            Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) =>
+            {
+                BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false);
+                BluetoothGattCharacteristic Characteristic = BluetoothGattCharacteristicImpl.CreateBluetoothGattGattCharacteristic(handle, "");
+                if (Characteristic != null)
+                {
+                    Characteristic.SetParent(service);
+                    attribututeList.Add(Characteristic);
+                }
+                return true;
+            };
+
+            int err = Interop.Bluetooth.BtGattServiceForeachCharacteristics(service.GetHandle(), cb, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to get all Characteristic");
+
+            return attribututeList;
+        }
+
+        internal void AddIncludeService(BluetoothGattService includedService)
+        {
+            int err = Interop.Bluetooth.BtGattServiceAddIncludedService(_handle, includedService.GetHandle());
+            GattUtil.ThrowForError(err, string.Format("Failed to add service with UUID ({0})", includedService.Uuid));
+        }
+
+        internal BluetoothGattService GetIncludeService(BluetoothGattService parentService, string uuid)
+        {
+            BluetoothGattAttributeHandle attributeHandle;
+            int err = Interop.Bluetooth.BtGattServiceGetIncludedService(_handle, uuid, out attributeHandle);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, string.Format("Failed to get included service with UUID ({0})", uuid));
+                return null;
+            }
+
+            BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(attributeHandle), uuid);
+            service.SetParent(parentService);
+            return service;
+        }
+
+        internal IEnumerable<BluetoothGattService> GetIncludeServices(BluetoothGattService parentService)
+        {
+            List<BluetoothGattService> attribututeList = new List<BluetoothGattService>();
+            Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) =>
+            {
+                BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false);
+                BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, "");
+                if (service != null)
+                {
+                    service.SetParent(parentService);
+                    attribututeList.Add(service);
+                }
+                return true;
+            };
+
+            int err = Interop.Bluetooth.BtGattServiceForeachIncludedServices(parentService.GetHandle(), cb, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to get all services");
+
+            return attribututeList;
+        }
+    }
+
+    internal class BluetoothGattCharacteristicImpl : BluetoothGattAttributeImpl
+    {
+        internal BluetoothGattCharacteristicImpl(string uuid, BluetoothGattPermission permission, BluetoothGattProperty property, byte[] value)
+        {
+            int err = Interop.Bluetooth.BtGattCharacteristicCreate(uuid, (int)permission, (int)property, value, value.Length, out _handle);
+            GattUtil.ThrowForError(err, "Failed to get native characteristic handle");
+        }
+
+        internal BluetoothGattCharacteristicImpl(BluetoothGattAttributeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        internal static BluetoothGattCharacteristic CreateBluetoothGattGattCharacteristic(BluetoothGattAttributeHandle handle, string uuid)
+        {
+            int permission;
+            int err = Interop.Bluetooth.BtGattCharacteristicGetPermissions(handle, out permission);
+            GattUtil.ThrowForError(err, "Failed to get permissions");
+
+            if (uuid == "")
+            {
+                err = Interop.Bluetooth.BtGattGetUuid(handle, out uuid);
+                GattUtil.ThrowForError(err, "Failed to get UUID");
+            }
+
+            BluetoothGattCharacteristicImpl impl = new BluetoothGattCharacteristicImpl(handle);
+            return new BluetoothGattCharacteristic(impl, uuid, (BluetoothGattPermission)permission);
+        }
+
+        internal void SetCharacteristicValueChangedEvent(Interop.Bluetooth.BtClientCharacteristicValueChangedCallback callback)
+        {
+            int err = Interop.Bluetooth.BtGattClientSetCharacteristicValueChangedCallback(_handle, callback, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to set client characteristic value changed callback");
+        }
+
+        internal void UnsetCharacteristicValueChangedEvent()
+        {
+            int err = Interop.Bluetooth.BtGattClientUnsetCharacteristicValueChangedCallback(_handle);
+            GattUtil.Error(err, "Failed to unset client characteristic value changed callback");
+        }
+
+        internal void SetNotificationStateChangedEvent(Interop.Bluetooth.BtGattServerNotificationStateChangeCallback callback)
+        {
+            int err = Interop.Bluetooth.BtGattServeSetNotificationStateChangeCallback(_handle, callback, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to set characteristic notification state changed callback");
+        }
+
+        internal BluetoothGattProperty GetProperties()
+        {
+            int properties = 0 ;
+            int err = Interop.Bluetooth.BtGattCharacteristicGetProperties(_handle, out properties);
+            GattUtil.Error(err, "Failed to get characteristic properties");
+            return (BluetoothGattProperty)properties;
+        }
+
+        internal void SetProperties(BluetoothGattProperty perperties)
+        {
+            int err = Interop.Bluetooth.BtGattCharacteristicSetProperties(_handle, (int)perperties);
+            GattUtil.Error(err, "Failed to set characteristic properties");
+        }
+
+        internal BluetoothGattWriteType GetWriteType()
+        {
+            int writeType;
+            int err = Interop.Bluetooth.BtGattCharacteristicGetWriteType(_handle, out writeType);
+            GattUtil.Error(err, "Failed to get characteristic writetype");
+            return (BluetoothGattWriteType) writeType;
+        }
+
+        internal void SetWriteType(BluetoothGattWriteType writeType)
+        {
+            int err = Interop.Bluetooth.BtGattCharacteristicSetWriteType(_handle, (int)writeType);
+            GattUtil.Error(err, "Failed to get characteristic writetype");
+        }
+
+        internal void AddDescriptor(BluetoothGattDescriptor descriptor)
+        {
+            int err = Interop.Bluetooth.BtGattCharacteristicAddDescriptor(_handle, descriptor.GetHandle());
+            GattUtil.ThrowForError(err, string.Format("Failed to add descriptor with UUID ({0})", descriptor.Uuid));
+        }
+
+        internal BluetoothGattDescriptor GetDescriptor(BluetoothGattCharacteristic characteristic, string uuid)
+        {
+            BluetoothGattAttributeHandle handle;
+            int err = Interop.Bluetooth.BtGattCharacteristicGetDescriptor(_handle, uuid, out handle);
+            if (err.IsFailed())
+            {
+                GattUtil.Error(err, string.Format("Failed to get descriptor with UUID ({0})", uuid));
+                return null;
+            }
+            BluetoothGattDescriptor descriptor = BluetoothGattDescriptorImpl.CreateBluetoothGattDescriptor(handle, uuid);
+            descriptor.SetParent(characteristic);
+            return descriptor;
+        }
+
+        internal IEnumerable<BluetoothGattDescriptor> GetDescriptors(BluetoothGattCharacteristic characteristic)
+        {
+            List<BluetoothGattDescriptor> attribututeList = new List<BluetoothGattDescriptor>();
+            Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) =>
+            {
+                BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false);
+                BluetoothGattDescriptor descriptor = BluetoothGattDescriptorImpl.CreateBluetoothGattDescriptor(handle, "");
+                if (descriptor != null)
+                {
+                    descriptor.SetParent(characteristic);
+                    attribututeList.Add(descriptor);
+                }
+                return true;
+            };
+
+            int err = Interop.Bluetooth.BtGattCharacteristicForeachDescriptors(characteristic.GetHandle(), cb, IntPtr.Zero);
+            GattUtil.Error(err, "Failed to get all descriptor");
+
+            return attribututeList;
+        }
+    }
+
+    internal class BluetoothGattDescriptorImpl : BluetoothGattAttributeImpl
+    {
+        internal BluetoothGattDescriptorImpl(string uuid, BluetoothGattPermission permission, byte[] value)
+        {
+            int err = Interop.Bluetooth.BtGattDescriptorCreate(uuid, (int)permission, value, value.Length, out _handle);
+            GattUtil.ThrowForError(err, "Failed to get native descriptor handle");
+        }
+
+        internal BluetoothGattDescriptorImpl(BluetoothGattAttributeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        internal static BluetoothGattDescriptor CreateBluetoothGattDescriptor(BluetoothGattAttributeHandle handle, string uuid)
+        {
+            int permission;
+            int err = Interop.Bluetooth.BtGattDescriptorGetPermissions(handle, out permission);
+            GattUtil.ThrowForError(err, string.Format("Failed to get permissions with UUID ({0})", uuid));
+
+            if (uuid == "")
+            {
+                int ret = Interop.Bluetooth.BtGattGetUuid(handle, out uuid);
+                GattUtil.ThrowForError(ret, "Failed to get UUID");
+            }
+
+            BluetoothGattDescriptorImpl impl = new BluetoothGattDescriptorImpl(handle);
+            return new BluetoothGattDescriptor(impl, uuid, (BluetoothGattPermission)permission);
+        }
+    }
+
+    internal abstract class BluetoothGattAttributeImpl
+    {
+        protected BluetoothGattAttributeHandle _handle;
+
+        internal string GetUuid()
+        {
+            string uuid;
+            int err = Interop.Bluetooth.BtGattGetUuid(_handle, out uuid);
+            GattUtil.Error(err, "Failed to get attribute uuid");
+
+            return uuid;
+        }
+
+        internal byte[] GetValue()
+        {
+            IntPtr nativeValue;
+            int nativeValueLength;
+            int err = Interop.Bluetooth.BtGattGetValue(_handle, out nativeValue, out nativeValueLength);
+            GattUtil.Error(err, "Failed to get attribute value");
+
+            return GattUtil.IntPtrToByteArray(nativeValue, nativeValueLength);
+        }
+
+        internal void SetValue(byte[] value)
+        {
+            int err = Interop.Bluetooth.BtGattSetValue(_handle, value, value.Length);
+            GattUtil.ThrowForError(err, "Failed to set attribute value");
+        }
+
+        internal string GetValue(int offset)
+        {
+            byte[] value = GetValue();
+
+            int nullPos = value.Length - offset;
+            for (int i = offset; i < value.Length; ++i)
+            {
+                if (value[i] == '\0')
+                {
+                    nullPos = i;
+                    break;
+                }
+            }
+
+            string strValue = "";
+            strValue = Encoding.UTF8.GetString(value, offset, nullPos - offset);
+            return strValue;
+        }
+
+        internal int GetValue(IntDataType type, int offset)
+        {
+            int value;
+            int err = Interop.Bluetooth.BtGattGetIntValue(_handle, (int)type, offset, out value);
+            GattUtil.Error(err, "Failed to get attribute int value at offset");
+            return value;
+        }
+
+        internal void SetValue(IntDataType type, int value, int offset)
+        {
+            int err = Interop.Bluetooth.BtGattSetIntValue(_handle, (int)type, value, offset);
+            GattUtil.ThrowForError(err, "Failed to set attribute int value at offset");
+        }
+
+        internal float GetValue(FloatDataType type, int offset)
+        {
+            float value;
+            int err = Interop.Bluetooth.BtGattGetFloatValue(_handle, (int)type, offset, out value);
+            GattUtil.Error(err, "Failed to get attribute float value at offset");
+            return value;
+        }
+
+        internal void SetValue(FloatDataType type, int mantissa, int exponent, int offset)
+        {
+            int err = Interop.Bluetooth.BtGattSetFloatValue(_handle, (int)type, mantissa, exponent, offset);
+            GattUtil.ThrowForError(err, "Failed to set attribute float value at offset");
+        }
+
+        internal void SetReadValueRequestedEventCallback(Interop.Bluetooth.BtGattServerReadValueRequestedCallback callback)
+        {
+            int err = Interop.Bluetooth.BtGattServerSetReadValueRequestedCallback(_handle, callback, IntPtr.Zero);
+            GattUtil.ThrowForError(err, "Failed to set attribute read value requested callback");
+        }
+
+        internal void SetWriteValueRequestedEventCallback(Interop.Bluetooth.BtGattServerWriteValueRequestedCallback callback)
+        {
+            int err = Interop.Bluetooth.BtGattServerSetWriteValueRequestedCallback(_handle, callback, IntPtr.Zero);
+            GattUtil.ThrowForError(err, "Failed to set attribute write value requested callback");
+        }
+
+        internal BluetoothGattAttributeHandle GetHandle()
+        {
+            return _handle;
+        }
+
+        internal void ReleaseHandleOwnership()
+        {
+            _handle.ReleaseOwnership();
+        }
+    }
+
+
+    internal class BluetoothGattAttributeHandle : BluetoothGattHandle
+    {
+        public BluetoothGattAttributeHandle(IntPtr nativeHandle, bool hasOwnership) : base(nativeHandle, hasOwnership)
+        {
+        }
+
+        public BluetoothGattAttributeHandle()
+        {
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            if (_hasOwnership == true)
+            {
+                Interop.Bluetooth.BtGattDestroy(handle);
+            }
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+
+    internal class BluetoothGattClientHandle : BluetoothGattHandle
+    {
+        protected override bool ReleaseHandle()
+        {
+            if (_hasOwnership == true)
+            {
+                Interop.Bluetooth.BtGattClientDestroy(handle);
+            }
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+
+    internal class BluetoothGattServerHandle : BluetoothGattHandle
+    {
+        protected override bool ReleaseHandle()
+        {
+            if (_hasOwnership == true)
+            {
+                Interop.Bluetooth.BtGattServerDeinitialize();
+                Interop.Bluetooth.BtGattServerDestroy(handle);
+            }
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+
+    internal abstract class BluetoothGattHandle : SafeHandle
+    {
+        protected bool _hasOwnership;
+
+        public BluetoothGattHandle() : base(IntPtr.Zero, true)
+        {
+            _hasOwnership = true;
+        }
+
+        public BluetoothGattHandle(IntPtr nativeHandle, bool hasOwnership) : base(nativeHandle, true)
+        {
+            _hasOwnership = hasOwnership;
+        }
+
+        public override bool IsInvalid
+        {
+            get { return handle == IntPtr.Zero; }
+        }
+
+        public void ReleaseOwnership()
+        {
+            _hasOwnership = false;
+        }
+    }
+
+    internal static class GattUtil
+    {
+        internal static byte[] IntPtrToByteArray(IntPtr nativeValue, int lenght)
+        {
+            byte[] value = new byte[lenght];
+            if (nativeValue != IntPtr.Zero)
+            {
+                Marshal.Copy(nativeValue, value, 0, lenght);
+            }
+            return value;
+        }
+
+        internal static void Error(int err, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (err.IsFailed())
+            {
+                Log.Error(Globals.LogTag, string.Format("{0}, err: {1}", message, (BluetoothError)err), file, func, line);
+            }
+        }
+
+        internal static void ThrowForError(int err, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (err.IsFailed())
+            {
+                Log.Error(Globals.LogTag, string.Format("{0}, err: {1}", message, (BluetoothError)err), file, func, line);
+                BluetoothErrorFactory.ThrowBluetoothException(err);
+            }
+        }
+
+        internal static bool IsFailed(this int err)
+        {
+            return err != (int)BluetoothError.None;
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs
new file mode 100644 (file)
index 0000000..c35a963
--- /dev/null
@@ -0,0 +1,79 @@
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// A class which is used to handle the connection to Bluetooth HID like keyboards and mouse.
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    public class BluetoothHid : BluetoothProfile
+    {
+        internal BluetoothHid()
+        {
+        }
+
+        /// <summary>
+        /// The HidConnectionStateChanged event is called when the HID host connection state is changed.
+        /// </summary>
+        public event EventHandler<HidConnectionStateChangedEventArgs> HidConnectionStateChanged
+        {
+            add
+            {
+                BluetoothHidImpl.Instance.HidConnectionStateChanged += value;
+            }
+            remove
+            {
+                BluetoothHidImpl.Instance.HidConnectionStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Connects the remote device with the HID service.
+        /// </summary>
+        /// <remarks>
+        /// The device must be bonded with the remote device by CreateBond().
+        /// If connection request succeeds, the HidConnectionStateChanged event will be invoked.
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the connection attempt to the remote device fails.</exception>
+        public void Connect()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothHidImpl.Instance.Connect(RemoteAddress);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to Connect - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Disconnects the remote device with the HID service.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the disconnection attempt to the remote device fails.</exception>
+        public void Disconnect()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothHidImpl.Instance.Disconnect(RemoteAddress);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to Disconnect - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs
new file mode 100644 (file)
index 0000000..6a1401e
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace Tizen.Network.Bluetooth
+{
+    internal class BluetoothHidImpl : IDisposable
+    {
+        private event EventHandler<HidConnectionStateChangedEventArgs> _hidConnectionChanged;
+        private Interop.Bluetooth.HidConnectionStateChangedCallback _hidConnectionChangedCallback;
+
+        private static readonly BluetoothHidImpl _instance = new BluetoothHidImpl();
+        private bool disposed = false;
+
+        internal event EventHandler<HidConnectionStateChangedEventArgs> HidConnectionStateChanged
+        {
+            add
+            {
+                _hidConnectionChanged += value;
+            }
+            remove
+            {
+                //nothing to be done
+            }
+        }
+
+        internal int Connect(string deviceAddress)
+        {
+            if (Globals.IsHidInitialize)
+            {
+                int ret = Interop.Bluetooth.Connect (deviceAddress);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to connect device with the hid service, Error - " + (BluetoothError)ret);
+                }
+                return ret;
+            }
+            return (int)BluetoothError.NotInitialized;
+        }
+
+        internal int Disconnect(string deviceAddress)
+        {
+            if (Globals.IsHidInitialize)
+            {
+                int ret = Interop.Bluetooth.Disconnect (deviceAddress);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to disconnect device with the hid service, Error - " + (BluetoothError)ret);
+                }
+                return ret;
+            }
+            return (int)BluetoothError.NotInitialized;
+        }
+
+        internal static BluetoothHidImpl Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+        private BluetoothHidImpl ()
+        {
+            initialize();
+        }
+        ~BluetoothHidImpl()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            deinitialize();
+            disposed = true;
+        }
+
+        private void initialize()
+        {
+            if (Globals.IsInitialize)
+            {
+                _hidConnectionChangedCallback = (int result, bool connected, string deviceAddress, IntPtr userData) =>
+                {
+                    if (_hidConnectionChanged != null)
+                    {
+                        _hidConnectionChanged(null, new HidConnectionStateChangedEventArgs(result, connected, deviceAddress));
+                    }
+                };
+
+                int ret = Interop.Bluetooth.InitializeHid (_hidConnectionChangedCallback, IntPtr.Zero);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to initialize bluetooth hid, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException (ret);
+                }
+                else
+                {
+                    Globals.IsHidInitialize = true;
+                }
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Failed to initialize HID, BT not initialized");
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized);
+            }
+        }
+
+        private void deinitialize()
+        {
+            if (Globals.IsHidInitialize)
+            {
+                int ret = Interop.Bluetooth.DeinitializeHid ();
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth hid, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException (ret);
+                } else {
+                    Globals.IsHidInitialize = false;
+                }
+            }
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs
new file mode 100644 (file)
index 0000000..a700c44
--- /dev/null
@@ -0,0 +1,831 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth {
+
+    /// <summary>
+    /// This is the BluetoothLeAdvertiser class. It handles the LE advertising operation amd callback.
+    /// </summary>
+    public class BluetoothLeAdvertiser
+    {
+        private static readonly BluetoothLeAdvertiser _instance = new BluetoothLeAdvertiser();
+
+        internal static BluetoothLeAdvertiser Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        private BluetoothLeAdvertiser()
+        {
+        }
+
+        /// <summary>
+        /// This event is called when the LE advertising state changes.
+        /// </summary>
+        public event EventHandler<AdvertisingStateChangedEventArgs> AdvertisingStateChanged
+        {
+            add
+            {
+                BluetoothLeImplAdapter.Instance.AdapterLeAdvertisingStateChanged += value;
+            }
+            remove
+            {
+                BluetoothLeImplAdapter.Instance.AdapterLeAdvertisingStateChanged -= value;
+            }
+        }
+        /// <summary>
+        /// Starts advertising using the advertise data object.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="advertiseData">The advertiser object carrying information of the advertising.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public void StartAdvertising(BluetoothLeAdvertiseData advertiseData)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.StartAdvertising (advertiseData.GetHandle ());
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to start advertising- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Stops the advertising.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="advertiseData">The advertiser object carrying information of the advertising.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public void StopAdvertising(BluetoothLeAdvertiseData advertiseData)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.StopAdvertising (advertiseData.GetHandle ());
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to stop advertising operation- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+
+    /// <summary>
+    /// This is the BluetoothLeDevice class.
+    /// It handles the LE device operations like getting data from the scan result information.
+    /// </summary>
+    public class BluetoothLeDevice
+    {
+        //properties of Bluetoothlesacandata
+        private string _remoteAddress;
+        private BluetoothLeDeviceAddressType _addressType;
+        private int _rssi;
+        private byte[] _advDataValue;
+        private byte[] _scanDataValue;
+        private BluetoothLePacketType _packetType;
+        private BluetoothLeScanData _scanData;
+
+        /// <summary>
+        /// This event is called when the GATT client connects/disconnects with the server.
+        /// </summary>
+        public event EventHandler<GattConnectionStateChangedEventArgs> GattConnectionStateChanged
+        {
+            add
+            {
+                BluetoothLeImplAdapter.Instance.LeGattConnectionStateChanged += value;
+            }
+            remove
+            {
+                BluetoothLeImplAdapter.Instance.LeGattConnectionStateChanged -= value;
+            }
+        }
+
+        internal BluetoothLeDevice(BluetoothLeScanData scanData)
+        {
+            _scanData = new BluetoothLeScanData ();
+            _scanData = scanData;
+
+            Log.Info (Globals.LogTag, "Rssi" + _scanData.Rssi);
+            _rssi = scanData.Rssi;
+            Log.Info (Globals.LogTag, "RemoteAddress" + _scanData.RemoteAddress);
+            if (scanData.RemoteAddress != null)
+                _remoteAddress = scanData.RemoteAddress;
+            Log.Info (Globals.LogTag, "AddressType" + _scanData.AddressType);
+            _addressType = scanData.AddressType;
+
+            Log.Info (Globals.LogTag, "AdvDataLength" + _scanData.AdvDataLength);
+            if (_scanData.AdvDataLength > 0)
+            {
+                _advDataValue = new byte[_scanData.AdvDataLength];
+                scanData.AdvData.CopyTo(_advDataValue, 0);
+            }
+
+            Log.Info(Globals.LogTag, "ScanDataLength" + _scanData.ScanDataLength);
+            //  Check length before copying
+            if (_scanData.ScanDataLength > 0)
+            {
+                _scanDataValue = new byte[_scanData.ScanDataLength];
+                scanData.ScanData.CopyTo(_scanDataValue, 0);
+            }
+        }
+
+        ~BluetoothLeDevice()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                BluetoothLeImplAdapter.Instance.FreeServiceDataList();
+            }
+        }
+
+        /// <summary>
+        /// The remote address.
+        /// </summary>
+        public string RemoteAddress
+        {
+            get
+            {
+                return _remoteAddress;
+            }
+        }
+
+        /// <summary>
+        /// The type of the address.
+        /// </summary>
+        public BluetoothLeDeviceAddressType AddressType
+        {
+            get
+            {
+                return _addressType;
+            }
+        }
+
+        /// <summary>
+        /// The rssi value.
+        /// </summary>
+        public int Rssi
+        {
+            get
+            {
+                return _rssi;
+            }
+        }
+
+        /// <summary>
+        /// The advertsing data information.
+        /// </summary>
+        public byte[] AdvertsingDataInformation
+        {
+            get
+            {
+                return _advDataValue;
+            }
+        }
+
+        /// <summary>
+        /// The scan data information.
+        /// </summary>
+        public byte[] ScanDataInformation
+        {
+            get
+            {
+                return _scanDataValue;
+            }
+        }
+
+        /// <summary>
+        /// The type of the packet.
+        /// </summary>
+        public BluetoothLePacketType PacketType
+        {
+            get
+            {
+                return _packetType;
+            }
+            set
+            {
+                _packetType = value;
+            }
+        }
+
+        /// <summary>
+        /// Gets the service UUIDs list from the LE scan result information.
+        /// </summary>
+        /// <value> Gets the list of the string service UUIDs.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public IEnumerable<string> ServiceUuid
+        {
+            get
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    Log.Info(Globals.LogTag, "Retrieving Service uuid- ");
+                    return BluetoothLeImplAdapter.Instance.GetLeScanResultServiceUuids(_scanData, _packetType);
+                }
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Gets the device name from the LE scan result information.
+        /// </summary>
+        /// <value> Gets the device name.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public string DeviceName
+        {
+            get
+            {
+                Log.Info(Globals.LogTag, "Retrieving device name- ");
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    return BluetoothLeImplAdapter.Instance.GetLeScanResultDeviceName(_scanData, _packetType);
+                }
+                return null;
+            }
+        }
+        /// <summary>
+        /// Gets the transmission power level from the LE scan result information.
+        /// </summary>
+        /// <value> Gets the transmission power level in dB.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public int TxPowerLevel
+        {
+            get
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    return BluetoothLeImplAdapter.Instance.GetScanResultTxPowerLevel(_scanData, _packetType);
+                }
+                return -1;
+            }
+        }
+
+        /// <summary>
+        /// Gets the service solicitation UUID list from the scan result information.
+        /// </summary>
+        /// <value> Gets the list of the service solicitation UUIDs.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public IEnumerable<string> ServiceSolictationUuid
+        {
+            get
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    return BluetoothLeImplAdapter.Instance.GetScanResultSvcSolicitationUuids(_scanData, _packetType);
+                }
+                return null;
+            }
+        }
+        /// <summary>
+        /// Gets the manufacturer data from the scan result information.
+        /// </summary>
+        /// <value> Gets the appearance value.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public int Appearance
+        {
+            get
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    return BluetoothLeImplAdapter.Instance.GetScanResultAppearance(_scanData, _packetType);
+                }
+                return -1;
+            }
+        }
+        /// <summary>
+        /// Gets the manufacturer data from the scan result information.
+        /// </summary>
+        /// <value> Gets the manufacturer data containing the manucturer data and ID information.</value>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>/// 
+        public ManufacturerData ManufacturerData
+        {
+            get
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    return BluetoothLeImplAdapter.Instance.GetScanResultManufacturerData(_scanData, _packetType);
+                }
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Gets the service data list from the scan result information.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <returns> Returns the service data list.</returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled.</exception>
+        public IEnumerable<BluetoothLeServiceData> GetServiceDataList()
+        {
+            int serviceCount = 0;
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                return BluetoothLeImplAdapter.Instance.GetScanResultServiceDataList(_scanData,
+                                            _packetType, out serviceCount);
+            }
+            return null;
+        }
+
+
+        /// <summary>
+        /// Creates a GATT connection with the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="autoConnect"> The auto connect flag.</param>
+        /// <returns>client instance</returns>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the gatt connection attempt to remote device fails.</exception>
+        public BluetoothGattClient GattConnect(bool autoConnect)
+        {
+            BluetoothGattClient client = null;
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.GattConnect (_remoteAddress, autoConnect);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to create GATT Connection with remote device- " + (BluetoothError)ret);
+                }
+                else
+                {
+                    client = BluetoothGattClient.CreateClient(_remoteAddress);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+            return client;
+        }
+
+        /// <summary>
+        /// Disconnects a GATT connection with the remote device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the GATT disconnection attempt to remote device fails.</exception>
+        public void GattDisconnect()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = BluetoothLeImplAdapter.Instance.GattDisconnect (_remoteAddress);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to disconnect GATT connection with remote device- " + (BluetoothError)ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+
+    /// <summary>
+    /// Bluetooth LE advertise data. Handles the data advertising.
+    /// </summary>
+    public class BluetoothLeAdvertiseData:IDisposable
+    {
+        private IntPtr _handle = IntPtr.Zero;
+        private BluetoothLeAdvertisingMode _mode;
+        private bool _advertisingConnectable;
+        private BluetoothLePacketType _packetType;
+        private int _appearance;
+        private bool _includePowerLevel;
+        private bool _includeDeviceName;
+
+        /// <summary>
+        /// The default constructor initializes an object of the BluetoothLeAdvertiseData.
+        /// </summary>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when create advertiser fails.</exception>
+        public BluetoothLeAdvertiseData()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                Log.Debug(Globals.LogTag, " Creating LeAdvertiser()");
+                int ret = Interop.Bluetooth.CreateAdvertiser(out _handle);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to create advertiser object- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        ~BluetoothLeAdvertiseData()
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                //clean-up
+                ClearAdvertisingData (BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+                ClearAdvertisingData (BluetoothLePacketType.BluetoothLeScanResponsePacket);
+                BluetoothLeImplAdapter.Instance.DestroyAdvertiser (_handle);
+            }
+            Dispose(false);
+        }
+
+        internal IntPtr GetHandle()
+        {
+            return _handle;
+        }
+
+        /// <summary>
+        /// The advertising mode to control the advertising power and latency.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the set advertising mode fails.</exception>
+        public BluetoothLeAdvertisingMode AdvertisingMode
+        {
+            get
+            {
+                return _mode;
+            }
+            set
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    _mode = value;
+                    int ret = Interop.Bluetooth.SetAdvertisingMode (GetHandle (), _mode);
+                    if (ret != (int)BluetoothError.None) {
+                        Log.Error (Globals.LogTag, "Failed to set advertising mode- " + (BluetoothError)ret);
+                        BluetoothErrorFactory.ThrowBluetoothException (ret);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// The advertising connectable type.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the set advertising connectable mode fails.</exception>
+        public bool AdvertisingConnectable
+        {
+            get
+            {
+                return _advertisingConnectable;
+            }
+            set
+            {
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    _advertisingConnectable = value;
+                    int ret = Interop.Bluetooth.SetAdvertisingConnectable (GetHandle (), _advertisingConnectable);
+                    if (ret != (int)BluetoothError.None) {
+                        Log.Error (Globals.LogTag, "Failed to set advertising connectable value- " + (BluetoothError)ret);
+                        BluetoothErrorFactory.ThrowBluetoothException (ret);
+                    }
+                }
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            //todo...
+        }
+
+        /// <summary>
+        /// The type of the packet.
+        /// </summary>
+        public BluetoothLePacketType PacketType
+        {
+            get
+            {
+                return _packetType;
+            }
+            set
+            {
+                _packetType = value;
+            }
+        }
+        /// <summary>
+        /// Sets the external appearance of this device to the advertise or the scan response data.
+        /// Please refer to the adopted Bluetooth specification for the appearance.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the set appearance fails.</exception>
+        public int Appearance
+        {
+            get
+            {
+                return _appearance;
+            }
+            set
+            {
+                _appearance = value;
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) {
+                    int ret = Interop.Bluetooth.SetAdvertisingAppearance (GetHandle (), _packetType, _appearance);
+                    if (ret != (int)BluetoothError.None) {
+                        Log.Error (Globals.LogTag, "Failed to add appearance value to advertising data- " + (BluetoothError)ret);
+                        BluetoothErrorFactory.ThrowBluetoothException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// Sets whether the device name has to be included in the advertise or the scan response data.
+        /// The maximum advertised or responded data size is 31 bytes including the data type and the system wide data.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the set advertising device name fails.</exception>
+        public bool IncludeDeviceName
+        {
+            get
+            {
+                return _includeDeviceName;
+            }
+            set
+            {
+                _includeDeviceName = value;
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    int ret = Interop.Bluetooth.SetAdvertisingDeviceName(GetHandle(), _packetType, _includeDeviceName);
+                    if (ret != (int)BluetoothError.None) {
+                        Log.Error (Globals.LogTag, "Failed to add device name to advertising data- " + (BluetoothError)ret);
+                        BluetoothErrorFactory.ThrowBluetoothException(ret);
+                    }
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// Sets whether the transmission power level should be included in the advertise or the scan response data.
+        /// The maximum advertised or responded data size is 31 bytes including the data type and the system wide data.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the set advertising TC power level fails.</exception>
+        public bool IncludeTxPowerLevel
+        {
+            get
+            {
+                return _includePowerLevel;
+            }
+            set
+            {
+                _includePowerLevel = value;
+                if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+                {
+                    int ret = Interop.Bluetooth.SetAdvertisingTxPowerLevel(GetHandle(), _packetType, _includePowerLevel);
+                    if (ret != (int)BluetoothError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Failed to add advertising service solicitation uuid- " + (BluetoothError)ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// Adds a service UUID to the advertise or the scan response data.
+        /// The maximum advertised or responded data size is 31 bytes
+        /// including the data type and the system wide data.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="packetType">The packet type.</param>
+        /// <param name="serviceUuid"> The service UUID to add to advertise data.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the add advertising service UUID procedure fails.</exception>
+        public void AddAdvertisingServiceUuid(BluetoothLePacketType packetType, string serviceUuid)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = Interop.Bluetooth.AddAdvertisingServiceUuid (GetHandle (), packetType, serviceUuid);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to add service uuid to advertising data- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException (ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Adds a service solicitation UUID to advertise or scan the response data.
+        /// The maximum advertised or responded data size is 31 bytes
+        /// including the data type and the system wide data.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="packetType">The packet type.</param>
+        /// <param name="serviceSolicitationUuid"> The service solicitation UUID to add to advertise data.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the add advertising service solicitation UUID procedure fails.</exception>
+        public void AddAdvertisingServiceSolicitationUuid(BluetoothLePacketType packetType,
+                                                        string serviceSolicitationUuid)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = Interop.Bluetooth.AddAdvertisingServiceSolicitationUuid(GetHandle(), packetType,
+                                                                serviceSolicitationUuid);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to add service solicitation uuid to advertising data- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Adds a service data to the advertise or the scan response data.
+        /// The maximum advertised or responded data size is 31 bytes
+        /// including data type and system wide data.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="packetType">The packet type.</param>
+        /// <param name="data"> The service data to be added to advertising.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the add advertising data procedure fails.</exception>
+        public void AddAdvertisingServiceData(BluetoothLePacketType packetType, BluetoothServiceData data)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                IntPtr serviceDataPtr;
+                serviceDataPtr = Marshal.AllocHGlobal(data.DataLength);
+                Marshal.Copy(data.Data, 0, serviceDataPtr, data.DataLength);
+
+                for (int i = 0; i < 3; i++)
+                    Log.Error (Globals.LogTag, " service data is  " + data.Data [i]);
+                int ret = Interop.Bluetooth.AddAdvertisingServiceData(GetHandle(), packetType,
+                    data.Uuid, serviceDataPtr, data.DataLength);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to add service data to advertising data- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Adds the manufacturer specific data to the advertise or the scan response data.
+        /// Please refer to the adopted Bluetooth specification for the the appearance.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="packetType">The packet type.</param>
+        /// <param name="manufacturerData"> The manufacturer specific data.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the add advertising manufacturer data procedure fails.</exception>
+        public void AddAdvertisingManufacturerData(BluetoothLePacketType packetType,
+                                    ManufacturerData manufacturerData)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                IntPtr manufDataPtr;
+                manufDataPtr = Marshal.AllocHGlobal(manufacturerData.DataLength);
+                Marshal.Copy(manufacturerData.Data, 0, manufDataPtr, manufacturerData.DataLength);
+
+                int ret = Interop.Bluetooth.AddAdvertisingManufData(GetHandle(), packetType,
+                    manufacturerData.Id, manufDataPtr, manufacturerData.DataLength);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to add service solicitation uuid to advertising data- " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+
+        /// <summary>
+        /// Clears all data to be advertised or responded to the scan request from the LE scanning device.
+        /// </summary>
+        /// <remarks>
+        /// The Bluetooth must be enabled.
+        /// </remarks>
+        /// <param name="packetType">The packet type to be cleared.</param>
+        /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not enabled
+        /// or when the clear advertising data procedure fails.</exception>
+        internal void ClearAdvertisingData(BluetoothLePacketType packetType)
+        {
+            if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
+            {
+                int ret = Interop.Bluetooth.ClearAdvertisingData (GetHandle (), packetType);
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to Clear Advertising Data- " + (BluetoothError)ret);
+                }
+            }
+            else
+            {
+                BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs
new file mode 100644 (file)
index 0000000..1fb02de
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth
+{
+    internal class BluetoothLeImplAdapter : IDisposable
+    {
+        private static readonly BluetoothLeImplAdapter _instance = new BluetoothLeImplAdapter();
+
+        private bool disposed = false;
+
+        private event EventHandler<AdapterLeScanResultChangedEventArgs> _adapterLeScanResultChanged = null;
+        private Interop.Bluetooth.AdapterLeScanResultChangedCallBack _adapterLeScanResultChangedCallback;
+
+        private event EventHandler<AdvertisingStateChangedEventArgs> _advertisingStateChanged = null;
+        private Interop.Bluetooth.AdvertisingStateChangedCallBack _advertisingStateChangedCallback;
+
+        private event EventHandler<GattConnectionStateChangedEventArgs> _gattConnectionStateChanged = null;
+        private Interop.Bluetooth.GattConnectionStateChangedCallBack _gattConnectionStateChangedCallback;
+
+        private int _serviceListCount = 0;
+        private IList<BluetoothLeServiceData> _list = new List<BluetoothLeServiceData>();
+        private bool _scanStarted;
+
+        internal static BluetoothLeImplAdapter Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        private BluetoothLeImplAdapter()
+        {
+        }
+
+        ~BluetoothLeImplAdapter()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            if (_gattConnectionStateChanged != null)
+            {
+                UnRegisterGattConnectionStateChangedEvent();
+            }
+
+            //stop scan operation in progress
+            StopScan ();
+
+            disposed = true;
+        }
+
+        internal event EventHandler<AdapterLeScanResultChangedEventArgs> AdapterLeScanResultChanged
+        {
+            add
+            {
+                _adapterLeScanResultChanged += value;
+            }
+            remove {
+                _adapterLeScanResultChanged -= value;
+            }
+        }
+
+        internal event EventHandler<AdvertisingStateChangedEventArgs> AdapterLeAdvertisingStateChanged
+        {
+            add
+            {
+                _advertisingStateChanged += value;
+            }
+            remove
+            {
+                _advertisingStateChanged -= value;
+            }
+        }
+
+        internal event EventHandler<GattConnectionStateChangedEventArgs> LeGattConnectionStateChanged
+        {
+            add
+            {
+                if (_gattConnectionStateChanged == null)
+                {
+                    RegisterGattConnectionStateChangedEvent();
+                }
+                _gattConnectionStateChanged += value;
+            }
+            remove
+            {
+                _gattConnectionStateChanged -= value;
+                if (_gattConnectionStateChanged == null)
+                {
+                    UnRegisterGattConnectionStateChangedEvent();
+                }
+            }
+        }
+
+        internal void RegisterGattConnectionStateChangedEvent()
+        {
+            _gattConnectionStateChangedCallback = (int result, bool connected,
+                                    string remoteDeviceAddress, IntPtr userData) =>
+            {
+                if (_gattConnectionStateChanged != null)
+                {
+                    Log.Info(Globals.LogTag, "Setting gatt connection state changed callback" );
+                    GattConnectionStateChangedEventArgs e = new GattConnectionStateChangedEventArgs (result,
+                        connected, remoteDeviceAddress);
+
+                    _gattConnectionStateChanged(null, e);
+                }
+            };
+
+            int ret = Interop.Bluetooth.SetGattConnectionStateChangedCallback(
+                                    _gattConnectionStateChangedCallback, IntPtr.Zero);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set gatt connection state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        internal void UnRegisterGattConnectionStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetGattConnectionStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset gatt connection state changed callback, Error - " + (BluetoothError)ret);
+            }
+        }
+
+        internal int StartScan()
+        {
+            _adapterLeScanResultChangedCallback = (int result, ref BluetoothLeScanDataStruct scanData, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Inside Le scan callback " );
+                BluetoothLeScanData scanDataInfo = BluetoothUtils.ConvertStructToLeScanData(scanData);
+
+                BluetoothLeDevice device = new BluetoothLeDevice(scanDataInfo);
+                BluetoothError res = (BluetoothError)result;
+
+                AdapterLeScanResultChangedEventArgs e = new AdapterLeScanResultChangedEventArgs (res,
+                                                                    device);
+                _adapterLeScanResultChanged (null, e);
+            };
+
+            IntPtr data = IntPtr.Zero;
+            int ret = Interop.Bluetooth.StartScan(_adapterLeScanResultChangedCallback, data);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to start BLE scan - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            _scanStarted = true;
+            return ret;
+        }
+
+        internal int StopScan()
+        {
+            int ret = (int)BluetoothError.None;
+
+            if (_scanStarted)
+            {
+                ret = Interop.Bluetooth.StopScan ();
+                if (ret != (int)BluetoothError.None) {
+                    Log.Error (Globals.LogTag, "Failed to stop BLE scan - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException (ret);
+                }
+            }
+            return ret;
+        }
+
+        internal IList<string> GetLeScanResultServiceUuids(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            IntPtr uuidListArray = IntPtr.Zero;
+            int count = -1;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct(scanData);
+
+            int ret = Interop.Bluetooth.GetScanResultServiceUuid(ref scanDataStruct, packetType,
+                                                ref uuidListArray, ref count);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Info(Globals.LogTag, "Failed to service uuids list- " + (BluetoothError)ret);
+                return null;
+            }
+
+            Log.Info(Globals.LogTag, "count of uuids :  " + count);
+
+            IntPtr[] uuidList = new IntPtr[count];
+            Marshal.Copy(uuidListArray, uuidList, 0, count);
+            IList<string> list = new List<string>();
+            foreach(IntPtr uuids in uuidList)
+            {
+                list.Add(Marshal.PtrToStringAnsi(uuids));
+                Interop.Libc.Free(uuids);
+            }
+
+            Interop.Libc.Free(uuidListArray);
+            return list;
+        }
+
+        internal string GetLeScanResultDeviceName(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            string deviceName;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData);
+
+            int ret = Interop.Bluetooth.GetLeScanResultDeviceName(ref scanDataStruct, packetType, out deviceName);
+            if (ret != (int)BluetoothError.None) {
+                Log.Error(Globals.LogTag, "Failed to get Device name- " + (BluetoothError)ret);
+                return null;
+            }
+            Log.Info (Globals.LogTag, "Device name " + deviceName);
+            return deviceName;
+        }
+
+        internal int GetScanResultTxPowerLevel(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            int powerLevel = -1;
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData);
+
+            int ret = Interop.Bluetooth.GetScanResultTxPowerLevel(ref scanDataStruct, packetType, out powerLevel);
+            if (ret != (int)BluetoothError.None) {
+                Log.Error(Globals.LogTag, "Failed to get tx power level- " + (BluetoothError)ret);
+            }
+            Log.Info (Globals.LogTag, "TxPowerLevel is --- " + powerLevel);
+            return powerLevel;
+        }
+
+        internal IList<string> GetScanResultSvcSolicitationUuids(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            IntPtr uuidListArray;
+            int count;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct(scanData);
+
+            int ret = Interop.Bluetooth.GetScaResultSvcSolicitationUuids(ref scanDataStruct, packetType, out uuidListArray, out count);
+            if (ret != (int)BluetoothError.None) {
+                Log.Error(Globals.LogTag, "Failed to get service solicitation uuids " + (BluetoothError)ret);
+                return null;
+            }
+
+            IntPtr[] uuidList = new IntPtr[count];
+            Marshal.Copy(uuidListArray, uuidList, 0, count);
+            IList<string> list = new List<string>();
+            foreach(IntPtr uuids in uuidList)
+            {
+                list.Add(Marshal.PtrToStringAnsi(uuids));
+                Interop.Libc.Free(uuids);
+            }
+
+            Interop.Libc.Free(uuidListArray);
+            return list;
+        }
+
+        internal IList<BluetoothLeServiceData> GetScanResultServiceDataList(BluetoothLeScanData scanData,
+                            BluetoothLePacketType packetType, out int serviceCount)
+        {
+            int ret = 0;
+            IntPtr serviceListArray;
+            _serviceListCount = 0;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData);
+
+            ret = Interop.Bluetooth.GetScanResultServiceDataList(ref scanDataStruct, packetType, out serviceListArray, out _serviceListCount);
+            Log.Info(Globals.LogTag, "ServiceListCount :  " + _serviceListCount + " PacketType : " + packetType + " Error: " + (BluetoothError)ret);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Info(Globals.LogTag, "Failed to get Service Data List, Error - " + (BluetoothError)ret);
+                serviceCount = 0;
+                Marshal.FreeHGlobal(serviceListArray);
+                Marshal.FreeHGlobal(scanDataStruct.AdvData);
+                Marshal.FreeHGlobal(scanDataStruct.ScanData);
+                return null;
+            }
+
+            BluetoothLeServiceDataStruct[] svcList = new BluetoothLeServiceDataStruct[_serviceListCount];
+            int sizePointerToABC = Marshal.SizeOf(new BluetoothLeServiceDataStruct());
+            for (int i = 0; i < _serviceListCount; i++)
+            {
+                svcList[i] = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(new IntPtr(serviceListArray.ToInt32() + (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct));
+                Log.Info(Globals.LogTag, " Uuid : " + svcList[i].ServiceUuid + "length :  " + svcList[i].ServiceDataLength);
+
+                _list.Add(BluetoothUtils.ConvertStructToLeServiceData(svcList[i]));
+            }
+
+            serviceCount = _serviceListCount;
+
+            Interop.Libc.Free(serviceListArray);
+            Marshal.FreeHGlobal(scanDataStruct.AdvData);
+            Marshal.FreeHGlobal(scanDataStruct.ScanData);
+            return _list;
+        }
+
+        internal int FreeServiceDataList()
+        {
+            if (_list.Count > 0)
+            {
+                int iServiceDataSize = Marshal.SizeOf(typeof(BluetoothLeServiceData));
+                IntPtr structServiceData = Marshal.AllocHGlobal(iServiceDataSize);
+                Marshal.StructureToPtr(_list, structServiceData, false);
+
+                int ret = Interop.Bluetooth.FreeServiceDataList(structServiceData, _serviceListCount);
+                if (ret != (int)BluetoothError.None)
+                {
+                    Log.Error(Globals.LogTag, "Failed to free Service Data List, Error - " + (BluetoothError)ret);
+                    BluetoothErrorFactory.ThrowBluetoothException(ret);
+                }
+
+                Marshal.FreeHGlobal(structServiceData);
+            }
+            return 0;
+        }
+
+        internal int GetScanResultAppearance(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            int appearance;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData);
+
+            int ret = Interop.Bluetooth.GetScanResultAppearance(ref scanDataStruct, packetType, out appearance);
+            if (ret != (int)BluetoothError.None) {
+                Log.Error(Globals.LogTag, "Failed to get Appearance value- " + (BluetoothError)ret);
+            }
+            return appearance;
+        }
+
+        internal ManufacturerData GetScanResultManufacturerData(BluetoothLeScanData scanData, BluetoothLePacketType packetType)
+        {
+            int dataId = 0;
+            int dataLength = 0;
+            IntPtr manufData;
+
+            BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData);
+            ManufacturerData data = new ManufacturerData();
+
+            int ret = Interop.Bluetooth.GetScanResultManufacturerData(ref scanDataStruct, packetType, out dataId,
+                out manufData, out dataLength);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get Manufacturer data - " + (BluetoothError)ret);
+                return null;
+            }
+
+            data.Id = dataId;
+            data.DataLength = dataLength;
+            if (data.DataLength > 0)
+            {
+                data.Data = new byte[data.DataLength];
+                Marshal.Copy(manufData, data.Data, 0, data.DataLength);
+            }
+
+            return data;
+        }
+
+        internal int GattConnect(string remoteAddress, bool autoConnect)
+        {
+            int ret = Interop.Bluetooth.GattConnect (remoteAddress, autoConnect);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to establish GATT connection - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return ret;
+        }
+
+        internal int GattDisconnect(string remoteAddress)
+        {
+            int ret = Interop.Bluetooth.GattDisconnect (remoteAddress);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to disconnect GATT connection - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return ret;
+        }
+
+        internal int CreateAdvertiser(out IntPtr advertiserHandle)
+        {
+            return Interop.Bluetooth.CreateAdvertiser (out advertiserHandle);
+        }
+
+        internal int DestroyAdvertiser(IntPtr advertiserHandle)
+        {
+            int ret =  Interop.Bluetooth.DestroyAdvertiser (advertiserHandle);
+            if (ret != (int)BluetoothError.None) {
+                Log.Error(Globals.LogTag, "Failed to destroy the Advertiser- " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return ret;
+        }
+
+        internal int StartAdvertising(IntPtr advertisingHandle)
+        {
+            _advertisingStateChangedCallback = (int result, IntPtr advertiserHandle,
+                            BluetoothLeAdvertisingState state, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "Setting advertising state changed callback !! " );
+                AdvertisingStateChangedEventArgs e = new AdvertisingStateChangedEventArgs(result, advertiserHandle, state);
+                _advertisingStateChanged(null, e);
+            };
+
+            IntPtr uData = IntPtr.Zero;
+            int ret = Interop.Bluetooth.BluetoothLeStartAdvertising (advertisingHandle,
+                                   _advertisingStateChangedCallback, uData );
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to start BLE advertising - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return ret;
+        }
+
+
+        internal int StopAdvertising(IntPtr advertisingHandle)
+        {
+            return Interop.Bluetooth.BluetoothLeStopAdvertising (advertisingHandle);
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs
new file mode 100644 (file)
index 0000000..6be950a
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// This generic class represents all Bluetooth profiles.<br>
+    /// Any common properties/functions can be added in this class in future.
+    /// </summary>
+    /// <privilege> http://tizen.org/privilege/bluetooth </privilege>
+    public abstract class BluetoothProfile
+    {
+        internal string RemoteAddress { get; set; }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs
new file mode 100644 (file)
index 0000000..3d4509b
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// The BluetoothSocket provides functions for managing connections to other devices and exchanging data.
+    /// </summary>
+    public class BluetoothServerSocket : IDisposable
+    {
+        private event EventHandler<AcceptStateChangedEventArgs> _acceptStateChanged;
+        private Interop.Bluetooth.SocketConnectionStateChangedCallback _connectionStateChangedCallback;
+        internal int socketFd;
+        private bool disposed = false;
+
+        /// <summary>
+        /// The AcceptStateChanged event is raised when the socket connection state is changed.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the register accpet state changed callback fails.</exception>
+        public event EventHandler<AcceptStateChangedEventArgs> AcceptStateChanged
+        {
+            add
+            {
+                if (_acceptStateChanged == null)
+                {
+                    RegisterAcceptStateChangedEvent();
+                }
+                _acceptStateChanged += value;
+            }
+            remove
+            {
+                _acceptStateChanged -= value;
+                if (_acceptStateChanged == null)
+                {
+                    UnregisterAcceptStateChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterAcceptStateChangedEvent()
+        {
+            _connectionStateChangedCallback = (int result, BluetoothSocketState connectionState, ref SocketConnectionStruct socketConnection, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "AcceptStateChanged cb is called");
+                if (_acceptStateChanged != null)
+                {
+                    BluetoothSocket socket = new BluetoothSocket();
+                    socket.connectedSocket = socketConnection.SocketFd;
+                    GCHandle handle2 = (GCHandle) userData;
+                    _acceptStateChanged(handle2.Target as BluetoothServerSocket, new AcceptStateChangedEventArgs((BluetoothError)result, connectionState, BluetoothUtils.ConvertStructToSocketConnection(socketConnection), socket));
+                }
+            };
+            GCHandle handle1 = GCHandle.Alloc(this);
+            IntPtr data = (IntPtr) handle1;
+            int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionStateChangedCallback, data);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set accept state changed callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        private void UnregisterAcceptStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetSocketConnectionStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset accept state changed callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        internal BluetoothServerSocket(int socketFd)
+        {
+            Log.Info (Globals.LogTag, "Constructing server socket");
+            this.socketFd = socketFd;
+        }
+
+        /// <summary>
+        /// Starts listening on the passed RFCOMM socket and accepts connection requests.
+        /// </summary>
+        /// <remarks>
+        /// The socket must be created with CreateServerSocket(). This API invokes the ConnectionStateChanged event.
+        /// </remarks>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the listen on socket procedure fails.</exception>
+        public void Listen()
+        {
+            int ret = Interop.Bluetooth.Listen(socketFd, 1);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to accept connection, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        ~BluetoothServerSocket()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            RemoveRegisteredEvents();
+            disposed = true;
+        }
+
+        private void RemoveRegisteredEvents()
+        {
+            //unregister all remaining events when this object is released.
+            if (_acceptStateChanged != null)
+            {
+                UnregisterAcceptStateChangedEvent();
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs
new file mode 100644 (file)
index 0000000..5639cc2
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// The IBluetoothServerSocket interface handles the server socket operations.
+    /// </summary>
+    public interface IBluetoothServerSocket
+    {
+        event EventHandler<SocketDataReceivedEventArgs> DataReceived;
+        event EventHandler<SocketConnectionStateChangedEventArgs> ConnectionStateChanged;
+        int SendData(string data);
+    }
+
+    /// <summary>
+    /// The IBluetoothClientSocket interface handles the client socket operations.
+    /// </summary>
+    public interface IBluetoothClientSocket : IBluetoothServerSocket
+    {
+        void Connect();
+        void Disconnect();
+    }
+
+    internal class BluetoothSocket : IBluetoothClientSocket, IDisposable
+    {
+        private event EventHandler<SocketDataReceivedEventArgs> _dataReceived;
+        private event EventHandler<SocketConnectionStateChangedEventArgs> _connectionStateChanged;
+        private Interop.Bluetooth.DataReceivedCallback _dataReceivedCallback;
+        private Interop.Bluetooth.SocketConnectionStateChangedCallback _connectionStateChangedCallback;
+        private bool disposed = false;
+        internal int connectedSocket;
+        internal string remoteAddress;
+        internal string serviceUuid;
+
+        /// <summary>
+        /// This event occurs when the socket server receives data from the client.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the register data received callback fails.</exception>
+        public event EventHandler<SocketDataReceivedEventArgs> DataReceived
+        {
+            add
+            {
+                if (_dataReceived == null)
+                {
+                    RegisterDataReceivedEvent();
+                }
+                _dataReceived += value;
+            }
+            remove
+            {
+                _dataReceived -= value;
+                if (_dataReceived == null)
+                {
+                    UnregisterDataReceivedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// This event occurs when the connection state between two devices is changed.
+        /// </summary>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the register connection changed callback fails.</exception>
+        public event EventHandler<SocketConnectionStateChangedEventArgs> ConnectionStateChanged
+        {
+            add
+            {
+                if (_connectionStateChanged == null)
+                {
+                    RegisterConnectionStateChangedEvent();
+                }
+                _connectionStateChanged += value;
+            }
+            remove
+            {
+                _connectionStateChanged -= value;
+                if (_connectionStateChanged == null)
+                {
+                    UnregisterConnectionStateChangedEvent();
+                }
+            }
+        }
+
+        private void RegisterDataReceivedEvent()
+        {
+            _dataReceivedCallback = (ref SocketDataStruct socketData, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "DataReceivedCallback is called");
+                if (_dataReceived != null)
+                {
+                    GCHandle handle2 = (GCHandle) userData;
+                    _dataReceived(handle2.Target as IBluetoothServerSocket, new SocketDataReceivedEventArgs(BluetoothUtils.ConvertStructToSocketData(socketData)));
+                }
+            };
+            GCHandle handle1 = GCHandle.Alloc (this);
+            IntPtr uData = (IntPtr) handle1;
+            int ret = Interop.Bluetooth.SetDataReceivedCallback(_dataReceivedCallback, uData);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set data received callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        private void UnregisterDataReceivedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetDataReceivedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset data received callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        private void RegisterConnectionStateChangedEvent()
+        {
+            _connectionStateChangedCallback = (int result, BluetoothSocketState connectionState, ref SocketConnectionStruct socketConnection, IntPtr userData) =>
+            {
+                Log.Info(Globals.LogTag, "ConnectionStateChangedCallback is called");
+                if (_connectionStateChanged != null)
+                {
+                    connectedSocket = socketConnection.SocketFd;
+                    GCHandle handle2 = (GCHandle) userData;
+                    _connectionStateChanged(handle2.Target as IBluetoothServerSocket, new SocketConnectionStateChangedEventArgs((BluetoothError)result, connectionState, BluetoothUtils.ConvertStructToSocketConnection(socketConnection)));
+                }
+            };
+            GCHandle handle1 = GCHandle.Alloc(this);
+            IntPtr data = (IntPtr) handle1;
+            int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionStateChangedCallback, data);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to set connection state changed callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        private void UnregisterConnectionStateChangedEvent()
+        {
+            int ret = Interop.Bluetooth.UnsetSocketConnectionStateChangedCallback();
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to unset connection state changed callback, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Connects to a specific RFCOMM based service on a remote Bluetooth device UUID.
+        /// </summary>
+        /// <remarks>
+        /// The bluetooth must be enabled, discoverable with StartDiscovery(), and bonded with the remote device using CreateBond(). The ConnectionStateChanged event is raised once this API is called.
+        /// </remarks>
+        /// <param name="address">The address of the remote Bluetooth device.</param>
+        /// <param name="serviceUuid">The UUID of the service provided by the remote Bluetooth device.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the connect socket attempt to remote device fails, or when the service UUID is not supported by the remote device.</exception>
+        void IBluetoothClientSocket.Connect()
+        {
+            int ret = Interop.Bluetooth.ConnectSocket(remoteAddress, serviceUuid);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to connect to socket, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Disconnects the RFCOMM connection with the given file descriptor of the conneted socket.
+        /// </summary>
+        /// <remarks>
+        /// The connection must be established.
+        /// </remarks>
+        /// <param name="socketFd">The file descriptor of the socket to close.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the socket disconnect to remote device fails.</exception>
+        void IBluetoothClientSocket.Disconnect()
+        {
+            int ret = Interop.Bluetooth.DisconnectSocket(connectedSocket);
+            if (ret != (int)BluetoothError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to disconnect socket, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Sends data to the connected device.
+        /// </summary>
+        /// <returns>The number of bytes written (zero indicates nothing was written).</returns>
+        /// <remarks>
+        /// The connection must be established.
+        /// </remarks>
+        /// <param name="socketFd">The file descriptor of the connected socket.</param>
+        /// <param name="data">The data to be sent.</param>
+        /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not enabled
+        /// or when the remote device is not connected, or the send data procedure fails.</exception>
+        public int SendData(string data)
+        {
+            int ret = Interop.Bluetooth.SendData(connectedSocket, data, data.Length);
+            if (ret < 0)
+            {
+                Log.Error(Globals.LogTag, "Failed to send data, Error - " + (BluetoothError)ret);
+                BluetoothErrorFactory.ThrowBluetoothException(ret);
+            }
+            return ret;
+        }
+
+        ~BluetoothSocket()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+            //Free unmanaged objects
+            RemoveRegisteredEvents();
+            disposed = true;
+        }
+
+        private void RemoveRegisteredEvents()
+        {
+            //unregister all remaining events when this object is released.
+            if (_dataReceived != null)
+            {
+                UnregisterDataReceivedEvent();
+            }
+            if (_connectionStateChanged != null)
+            {
+                UnregisterConnectionStateChangedEvent();
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs
new file mode 100644 (file)
index 0000000..dcd53a2
--- /dev/null
@@ -0,0 +1,390 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Reflection;
+using System.Linq;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Bluetooth
+{
+    /// <summary>
+    /// The structure of the device class type and service.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct BluetoothClassStruct
+    {
+        /// <summary>
+        /// The type of the major device class.
+        /// </summary>
+        internal BluetoothMajorDeviceClassType MajorDeviceClassType;
+        /// <summary>
+        /// The type of the minor device class.
+        /// </summary>
+        internal BluetoothMinorDeviceClassType MinorDeviceClassType;
+        /// <summary>
+        /// The major service class mask.
+        /// </summary>
+        internal int MajorServiceClassMask;
+    }
+
+    /// <summary>
+    /// This structure contains the information of the Bluetooth device.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct BluetoothDeviceStruct
+    {
+        /// <summary>
+        /// The address of the device.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string Address;
+
+        /// <summary>
+        /// The name of the device.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string Name;
+
+        /// <summary>
+        /// The class of the device.
+        /// </summary>
+        internal BluetoothClassStruct Class;
+
+        /// <summary>
+        /// The service UUID list of the device.
+        /// </summary>
+        internal IntPtr ServiceUuidList;
+
+        /// <summary>
+        /// The service count of the device.
+        /// </summary>
+        internal int ServiceCount;
+
+        /// <summary>
+        /// The paired state of the device.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.I1)]
+        internal bool IsPaired;
+
+        /// <summary>
+        /// The connection state of the device.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.I1)]
+        internal bool IsConnected;
+
+        /// <summary>
+        /// The authorization state of the device.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.I1)]
+        internal bool IsAuthorized;
+
+        /// <summary>
+        /// The length of the manufacturer the data.
+        /// </summary>
+        internal int ManufacturerDataLength;
+
+        /// <summary>
+        /// The manufacturer data.
+        /// </summary>
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string ManufacturerData;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct BluetoothDiscoveredDeviceStruct
+    {
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string Address;
+
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string Name;
+
+        internal BluetoothClassStruct Class;
+
+        internal int Rssi;
+
+        [MarshalAsAttribute(UnmanagedType.I1)]
+        internal bool IsPaired;
+
+        internal IntPtr ServiceUuidList;
+
+        internal int ServiceCount;
+
+        internal BluetoothAppearanceType AppearanceType;
+
+        internal int ManufacturerDataLength;
+
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string ManufacturerData;
+    }
+
+    internal struct BluetoothDeviceSdpStruct
+    {
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string DeviceAddress;
+        internal IntPtr ServiceUuid;
+        internal int ServiceCount;
+    }
+
+    internal struct BluetoothDeviceConnectionStruct
+    {
+        internal string Address;
+        internal BluetoothConnectionLinkType LinkType;
+        internal BluetoothDisconnectReason DisconnectReason;
+    }
+
+    internal struct SocketDataStruct
+    {
+        internal int SocketFd;
+        internal int DataSize;
+        internal IntPtr Data;
+    }
+
+    internal struct SocketConnectionStruct
+    {
+        internal int SocketFd;
+        internal int ServerFd;
+        internal BluetoothSocketRole LocalRole;
+        internal string Address;
+        internal string ServiceUuid;
+    }
+
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct BluetoothLeScanDataStruct
+    {
+        [MarshalAsAttribute(UnmanagedType.LPStr)]
+        internal string RemoteAddress;
+
+        internal BluetoothLeDeviceAddressType AddressType;
+
+        internal int Rssi;
+
+        internal int AdvDataLength;
+
+        internal IntPtr AdvData;
+
+        internal int ScanDataLength;
+
+        internal IntPtr ScanData;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct BluetoothLeServiceDataStruct
+    {
+        /// <summary>
+        /// The Bluetooth LE service UUID.
+        /// </summary>
+        [MarshalAs(UnmanagedType.LPStr)]
+        internal string ServiceUuid;
+        /// <summary>
+        /// The Bluetooth LE service data.
+        /// </summary>
+        internal IntPtr ServiceData;
+
+        internal int ServiceDataLength;
+    }
+
+    internal static class BluetoothUtils
+    {
+        internal static BluetoothDevice ConvertStructToDeviceClass(BluetoothDeviceStruct device)
+        {
+            BluetoothDevice resultDevice = new BluetoothDevice();
+            Collection<string> uuidList = null;
+
+            if (device.ServiceCount > 0)
+            {
+                IntPtr[] extensionList = new IntPtr[device.ServiceCount];
+                Marshal.Copy (device.ServiceUuidList, extensionList, 0, device.ServiceCount);
+                uuidList = new Collection<string> ();
+                foreach (IntPtr extension in extensionList) {
+                    string uuid = Marshal.PtrToStringAnsi (extension);
+                    uuidList.Add (uuid);
+                }
+            }
+
+            resultDevice.RemoteDeviceAddress = device.Address;
+            resultDevice.RemoteDeviceName = device.Name;
+            resultDevice.RemoteDeviceClass = new BluetoothClass();
+            resultDevice.Class.MajorType = device.Class.MajorDeviceClassType;
+            resultDevice.Class.MinorType = device.Class.MinorDeviceClassType;
+            resultDevice.Class.Mask = device.Class.MajorServiceClassMask;
+            resultDevice.RemotePaired = device.IsPaired;
+            resultDevice.RemoteConnected = device.IsConnected;
+            resultDevice.RemoteAuthorized = device.IsAuthorized;
+            resultDevice.RemoteDeviceService = uuidList;
+            resultDevice.RemoteDeviceCount = device.ServiceCount;
+            resultDevice.RemoteManufLength = device.ManufacturerDataLength;
+            resultDevice.RemoteManufData = device.ManufacturerData;
+
+            return resultDevice;
+        }
+
+        internal static BluetoothDevice ConvertStructToDiscoveredDevice(BluetoothDiscoveredDeviceStruct structDevice)
+        {
+            BluetoothDevice resultDevice = new BluetoothDevice();
+            Collection<string> uuidList = null;
+
+            if (structDevice.ServiceCount > 0) {
+                IntPtr[] extensionList = new IntPtr[structDevice.ServiceCount];
+                Marshal.Copy (structDevice.ServiceUuidList, extensionList, 0, structDevice.ServiceCount);
+                uuidList = new Collection<string> ();
+                foreach (IntPtr extension in extensionList) {
+                    string uuid = Marshal.PtrToStringAnsi (extension);
+                    uuidList.Add (uuid);
+                }
+            }
+
+            resultDevice.RemoteDeviceAddress = structDevice.Address;
+            resultDevice.RemoteDeviceName = structDevice.Name;
+
+            resultDevice.RemoteDeviceClass = new BluetoothClass();
+            resultDevice.Class.MajorType = structDevice.Class.MajorDeviceClassType;
+            resultDevice.Class.MinorType = structDevice.Class.MinorDeviceClassType;
+            resultDevice.Class.Mask = structDevice.Class.MajorServiceClassMask;
+
+            resultDevice.RemoteDeviceRssi = structDevice.Rssi;
+            resultDevice.RemoteAppearance = structDevice.AppearanceType;
+
+            if (structDevice.ServiceCount > 0) {
+                resultDevice.RemoteDeviceService = uuidList;
+                resultDevice.RemoteDeviceCount = structDevice.ServiceCount;
+            }
+
+            resultDevice.RemotePaired = structDevice.IsPaired;
+            resultDevice.RemoteManufData = structDevice.ManufacturerData;
+            resultDevice.RemoteManufLength = structDevice.ManufacturerDataLength;
+            return resultDevice;
+        }
+
+        internal static BluetoothDeviceSdpData ConvertStructToSdpData(BluetoothDeviceSdpStruct structData)
+        {
+            BluetoothDeviceSdpData resultData = new BluetoothDeviceSdpData();
+            Collection<string> uuidList = null;
+
+            if (structData.ServiceCount > 0) {
+                IntPtr[] extensionList = new IntPtr[structData.ServiceCount];
+                Marshal.Copy (structData.ServiceUuid, extensionList, 0, structData.ServiceCount);
+                uuidList = new Collection<string> ();
+                foreach (IntPtr extension in extensionList) {
+                    string uuid = Marshal.PtrToStringAnsi (extension);
+                    uuidList.Add (uuid);
+                }
+            }
+
+            resultData.Uuid = uuidList;
+            resultData.Address = structData.DeviceAddress;
+
+            return resultData;
+        }
+
+        internal static BluetoothDeviceConnectionData ConvertStructToConnectionData(BluetoothDeviceConnectionStruct structInfo)
+        {
+            BluetoothDeviceConnectionData resultData = new BluetoothDeviceConnectionData();
+            resultData.RemoteAddress = structInfo.Address;
+            resultData.Link = structInfo.LinkType;
+            resultData.Reason = structInfo.DisconnectReason;
+            return resultData;
+        }
+
+        internal static BluetoothLeScanData ConvertStructToLeScanData(BluetoothLeScanDataStruct structScanData)
+        {
+            BluetoothLeScanData scanData = new BluetoothLeScanData();
+
+            scanData.RemoteAddress = structScanData.RemoteAddress;
+            scanData.AddressType = structScanData.AddressType;
+            scanData.Rssi = structScanData.Rssi;
+
+            if (structScanData.AdvDataLength > 0)
+            {
+                scanData.AdvDataLength = structScanData.AdvDataLength;
+                scanData.AdvData = new byte[scanData.AdvDataLength];
+                Marshal.Copy (structScanData.AdvData, scanData.AdvData, 0, scanData.AdvDataLength);
+            }
+
+            if (structScanData.ScanDataLength > 0)
+            {
+                scanData.ScanDataLength = structScanData.ScanDataLength;
+                scanData.ScanData = new byte[scanData.ScanDataLength];
+                Marshal.Copy (structScanData.ScanData, scanData.ScanData, 0, scanData.ScanDataLength);
+            }
+            return scanData;
+        }
+
+        internal static BluetoothLeScanDataStruct ConvertLeScanDataToStruct(BluetoothLeScanData scanData)
+        {
+            BluetoothLeScanDataStruct scanDataStruct = new BluetoothLeScanDataStruct();
+
+            scanDataStruct.RemoteAddress = scanData.RemoteAddress;
+            scanDataStruct.AddressType = scanData.AddressType;
+            scanDataStruct.Rssi = scanData.Rssi;
+
+            if (scanData.AdvDataLength > 0)
+            {
+                scanDataStruct.AdvDataLength = scanData.AdvDataLength;
+                scanDataStruct.AdvData = Marshal.AllocHGlobal(scanData.AdvDataLength);
+                Marshal.Copy (scanData.AdvData, 0, scanDataStruct.AdvData, scanData.AdvDataLength);
+            }
+
+            if (scanData.ScanDataLength > 0)
+            {
+                scanDataStruct.ScanDataLength = scanData.ScanDataLength;
+                scanDataStruct.ScanData = Marshal.AllocHGlobal(scanData.ScanDataLength);
+                Marshal.Copy (scanData.ScanData, 0, scanDataStruct.ScanData, scanData.ScanDataLength);
+            }
+
+            return scanDataStruct;
+        }
+
+        internal static BluetoothLeServiceData ConvertStructToLeServiceData(BluetoothLeServiceDataStruct structServiceData)
+        {
+            BluetoothLeServiceData serviceData = new BluetoothLeServiceData();
+            Log.Info(Globals.LogTag, "ServiceDataLength" + structServiceData.ServiceDataLength);
+
+            if (structServiceData.ServiceDataLength > 0)
+            {
+                serviceData.Uuid = structServiceData.ServiceUuid;
+                serviceData.Length = structServiceData.ServiceDataLength;
+                serviceData.Data = new byte[serviceData.Length];
+                Marshal.Copy(structServiceData.ServiceData, serviceData.Data, 0, serviceData.Length);
+            }
+            return serviceData;
+        }
+
+        internal static SocketData ConvertStructToSocketData(SocketDataStruct structInfo)
+        {
+            SocketData data = new SocketData();
+            data.Fd = structInfo.SocketFd;
+            data.Size = structInfo.DataSize;
+            data.RecvData = Marshal.PtrToStringAnsi(structInfo.Data);
+            return data;
+        }
+
+        internal static SocketConnection ConvertStructToSocketConnection(SocketConnectionStruct structInfo)
+        {
+            SocketConnection connectionInfo = new SocketConnection();
+            connectionInfo.Fd = structInfo.SocketFd;
+            connectionInfo.RemoteAddress = structInfo.Address;
+            connectionInfo.Uuid = structInfo.ServiceUuid;
+            return connectionInfo;
+        }
+    }
+}
+
diff --git a/src/Tizen.Network.Connection/Interop/Interop.Connection.cs b/src/Tizen.Network.Connection/Interop/Interop.Connection.cs
new file mode 100755 (executable)
index 0000000..89011c8
--- /dev/null
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Network.Connection;
+
+internal static partial class Interop
+{
+    internal static partial class Connection
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void ConnectionTypeChangedCallback(ConnectionType type, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void EthernetCableStateChangedCallback(EthernetCableState state, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void ConnectionAddressChangedCallback(IntPtr ipv4, IntPtr ipv6, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void ConnectionCallback(ConnectionError result, IntPtr userData);
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate bool IPv6AddressCallback(IntPtr ipv6, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_create")]
+        public static extern int Create(out IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_destroy")]
+        public static extern int Destroy(IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_type")]
+        public static extern int GetType(IntPtr handle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_ip_address")]
+        public static extern int GetIPAddress(IntPtr handle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_foreach_ipv6_address")]
+        public static extern int GetAllIPv6Addresses(IntPtr handle, int type, IPv6AddressCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_proxy")]
+        public static extern int GetProxy(IntPtr handle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_mac_address")]
+        public static extern int GetMacAddress(IntPtr handle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_wifi_state")]
+        public static extern int GetWiFiState(IntPtr handle, out int state);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_cellular_state")]
+        public static extern int GetCellularState(IntPtr handle, out int state);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_ethernet_state")]
+        public static extern int GetEthernetState(IntPtr handle, out int state);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_ethernet_cable_state")]
+        public static extern int GetEthernetCableState(IntPtr handle, out int state);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_bt_state")]
+        public static extern int GetBtState(IntPtr handle, out int state);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_statistics")]
+        public static extern int GetStatistics(IntPtr handle, int connectionType, int statisticsType, out long size);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_reset_statistics")]
+        public static extern int ResetStatistics(IntPtr handle, int connectionType, int statisticsType);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_add_route_entry")]
+        public static extern int AddRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_remove_route_entry")]
+        public static extern int RemoveRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_set_type_changed_cb")]
+        public static extern int SetTypeChangedCallback(IntPtr handle, ConnectionTypeChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_set_ip_address_changed_cb")]
+        public static extern int SetIPAddressChangedCallback(IntPtr handle, ConnectionAddressChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_set_ethernet_cable_state_chaged_cb")]
+        public static extern int SetEthernetCableStateChagedCallback(IntPtr handle, EthernetCableStateChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_set_proxy_address_changed_cb")]
+        public static extern int SetProxyAddressChangedCallback(IntPtr handle, ConnectionAddressChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_unset_type_changed_cb")]
+        public static extern int UnsetTypeChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_unset_ip_address_changed_cb")]
+        public static extern int UnsetIPAddressChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_unset_ethernet_cable_state_chaged_cb")]
+        public static extern int UnsetEthernetCableStateChagedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_unset_proxy_address_changed_cb")]
+        public static extern int UnsetProxyAddressChangedCallback(IntPtr handle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_add_profile")]
+        public static extern int AddProfile(IntPtr handle, IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_remove_profile")]
+        public static extern int RemoveProfile(IntPtr handle, IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_update_profile")]
+        public static extern int UpdateProfile(IntPtr handle, IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_default_cellular_service_profile")]
+        public static extern int GetDefaultCellularServiceProfile(IntPtr handle, int type, out IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_current_profile")]
+        public static extern int GetCurrentProfile(IntPtr handle, out IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_open_profile")]
+        public static extern int OpenProfile(IntPtr handle, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_close_profile")]
+        public static extern int CloseProfile(IntPtr handle, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_reset_profile")]
+        public static extern int ResetProfile(IntPtr handle, int Option, int Id, ConnectionCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_set_default_cellular_service_profile_async")]
+        public static extern int SetDefaultCellularServiceProfileAsync(IntPtr handle, int Type, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_get_profile_iterator")]
+        public static extern int GetProfileIterator(IntPtr handle, int type, out IntPtr iterHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_iterator_next")]
+        public static extern int GetNextProfileIterator(IntPtr iterHandle, out IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_iterator_has_next")]
+        public static extern bool HasNextProfileIterator(IntPtr iterHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_destroy_profile_iterator")]
+        public static extern int DestroyProfileIterator(IntPtr iterHandle);
+    }
+
+    internal static partial class ConnectionProfile
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        public delegate void ProfileStateChangedCallback(ProfileState type, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_create")]
+        public static extern int Create(int ProfileType, string Keyword, out IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_clone")]
+        public static extern int Clone(out IntPtr cloneHandle, IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_destroy")]
+        public static extern int Destroy(IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_id")]
+        public static extern int GetId(IntPtr profileHandle, out IntPtr profileId);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_name")]
+        public static extern int GetName(IntPtr profileHandle, out IntPtr name);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_type")]
+        public static extern int GetType(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_network_interface_name")]
+        public static extern int GetNetworkInterfaceName(IntPtr profileHandle, out IntPtr interfaceName);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_state")]
+        public static extern int GetState(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ipv6_state")]
+        public static extern int GetIPv6State(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ip_config_type")]
+        public static extern int GetIPConfigType(IntPtr profileHandle, int family, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_proxy_type")]
+        public static extern int GetProxyType(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ip_address")]
+        public static extern int GetIPAddress(IntPtr profileHandle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_subnet_mask")]
+        public static extern int GetSubnetMask(IntPtr profileHandle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_gateway_address")]
+        public static extern int GetGatewayAddress(IntPtr profileHandle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dns_address")]
+        public static extern int GetDnsAddress(IntPtr profileHandle, int order, int Family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_proxy_address")]
+        public static extern int GetProxyAddress(IntPtr profileHandle, int family, out IntPtr address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_prefix_length")]
+        public static extern int GetPrefixLength(IntPtr profileHandle, int family, out int length);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dns_config_type")]
+        public static extern int GetDnsConfigType(IntPtr profileHandle, int family, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dhcp_server_address")]
+        public static extern int GetDhcpServerAddress(IntPtr profileHandle, AddressFamily family, out string dhcpServerAddress);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_refresh")]
+        public static extern int Refresh(IntPtr profileHandle);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_ip_config_type")]
+        public static extern int SetIPConfigType(IntPtr profileHandle, int family, int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_proxy_type")]
+        public static extern int SetProxyType(IntPtr profileHandle, int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_ip_address")]
+        public static extern int SetIPAddress(IntPtr profileHandle, int family, string address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_subnet_mask")]
+        public static extern int SetSubnetMask(IntPtr profileHandle, int family, string address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_gateway_address")]
+        public static extern int SetGatewayAddress(IntPtr profileHandle, int family, string address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_dns_address")]
+        public static extern int SetDnsAddress(IntPtr profileHandle, int order, int family, string address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_proxy_address")]
+        public static extern int SetProxyAddress(IntPtr profileHandle, int family, string address);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_prefix_length")]
+        public static extern int SetPrefixLength(IntPtr profileHandle, int family, int length);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_dns_config_type")]
+        public static extern int SetDnsConfigType(IntPtr profileHandle, int family, int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_state_changed_cb")]
+        public static extern int SetStateChangeCallback(IntPtr profileHandle, ProfileStateChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_unset_state_changed_cb")]
+        public static extern int UnsetStateChangeCallback(IntPtr profileHandle);
+    }
+
+    internal static partial class ConnectionCellularProfile
+    {
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_service_type")]
+        public static extern int GetServiceType(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_apn")]
+        public static extern int GetApn(IntPtr profileHandle, out IntPtr apn);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_auth_info")]
+        public static extern int GetAuthInfo(IntPtr profileHandle, out int authType, out string name, out string password);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_home_url")]
+        public static extern int GetHomeUrl(IntPtr profileHandle, out IntPtr homeUrl);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_pdn_type")]
+        public static extern int GetPdnType(IntPtr profileHandle, out int pdnType);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_roam_pdn_type")]
+        public static extern int GetRoamingPdnType(IntPtr profileHandle, out int roamPdnType);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_roaming")]
+        public static extern int IsRoaming(IntPtr profileHandle, out bool roaming);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_hidden")]
+        public static extern int IsHidden(IntPtr profileHandle, out bool hidden);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_editable")]
+        public static extern int IsEditable(IntPtr profileHandle, out bool editable);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_default")]
+        public static extern int IsDefault(IntPtr profileHandle, out bool isDefault);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_service_type")]
+        public static extern int SetServiceType(IntPtr profileHandle, int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_apn")]
+        public static extern int SetApn(IntPtr profileHandle, string apn);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_auth_info")]
+        public static extern int SetAuthInfo(IntPtr profileHandle, int authType, string name, string password);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_home_url")]
+        public static extern int SetHomeUrl(IntPtr profileHandle, string homeUrl);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_pdn_type")]
+        public static extern int SetPdnType(IntPtr profileHandle, int pdnType);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_roam_pdn_type")]
+        public static extern int SetRoamingPdnType(IntPtr profileHandle, int roamPdnType);
+    }
+
+    internal static partial class ConnectionWiFiProfile
+    {
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_essid")]
+        public static extern int GetEssid(IntPtr profileHandle, out IntPtr essid);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_bssid")]
+        public static extern int GetBssid(IntPtr profileHandle, out IntPtr bssid);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_rssi")]
+        public static extern int GetRssi(IntPtr profileHandle, out int rssi);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_frequency")]
+        public static extern int GetFrequency(IntPtr profileHandle, out int frequency);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_max_speed")]
+        public static extern int GetMaxSpeed(IntPtr profileHandle, out int maxSpeed);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_security_type")]
+        public static extern int GetSecurityType(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_encryption_type")]
+        public static extern int GetEncryptionType(IntPtr profileHandle, out int type);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_wifi_passphrase_required")]
+        public static extern int IsRequiredPassphrase(IntPtr profileHandle, out bool required);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_wifi_passphrase")]
+        public static extern int SetPassphrase(IntPtr profileHandle, string passphrase);
+
+        [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_wifi_wps_supported")]
+        public static extern int IsSupportedWps(IntPtr profileHandle, out bool supported);
+    }
+       
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free")]
+        public static extern void Free(IntPtr userData);
+
+    }
+}
diff --git a/src/Tizen.Network.Connection/Interop/Interop.Libraries.cs b/src/Tizen.Network.Connection/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..03ee0cd
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Connection = "libcapi-network-connection.so.1";
+        public const string WiFi = "libcapi-network-wifi.so.1";
+        public const string Bluetooth = "libcapi-network-bluetooth.so.0";
+        public const string Smartcard = "libcapi-network-smartcard.so.0";
+        public const string Nfc = "libcapi-network-nfc.so.0";
+        public const string WiFiDirect = "libwifi-direct.so.1";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection.csproj b/src/Tizen.Network.Connection/Tizen.Network.Connection.csproj
new file mode 100644 (file)
index 0000000..e7d758b
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.20</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Connection APIs for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Network.Connection.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection.snk b/src/Tizen.Network.Connection/Tizen.Network.Connection.snk
new file mode 100644 (file)
index 0000000..c2e0c4c
Binary files /dev/null and b/src/Tizen.Network.Connection/Tizen.Network.Connection.snk differ
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs
new file mode 100755 (executable)
index 0000000..86658a2
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This Class is CellularProfile. It provides functions to manage the cellular profile.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class CellularProfile : ConnectionProfile
+    {
+        internal CellularProfile(IntPtr handle): base(handle)
+        {
+        }
+
+        private CellularAuthInformation _cellularAuthInfo = null;
+
+        ~CellularProfile()
+        {
+        }
+
+        /// <summary>
+        /// The APN (access point name).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular access point name.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown during set when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public string Apn
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "Get Apn");
+                IntPtr Value;
+                int ret = Interop.ConnectionCellularProfile.GetApn(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get apn, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+            }
+
+            set
+            {
+                Log.Debug(Globals.LogTag, "Set Apn");
+                CheckDisposed();
+                if (value != null)
+                {
+                    int ret = Interop.ConnectionCellularProfile.SetApn(ProfileHandle, value);
+                    if ((ConnectionError)ret != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "It failed to set apn, " + (ConnectionError)ret);
+                        ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                        ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                        ConnectionErrorFactory.ThrowConnectionException(ret);
+                    }
+                }
+
+                else
+                {
+                    throw new ArgumentNullException("Value of Apn is null");
+                }
+            }
+        }
+
+        /// <summary>
+        /// The home URL.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular home URL.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown during set when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public string HomeUri
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "Get HomeUri");
+                IntPtr Value;
+                int ret = Interop.ConnectionCellularProfile.GetHomeUrl(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get home url, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+            }
+
+            set
+            {
+                Log.Debug(Globals.LogTag, "Set HomeUri");
+                CheckDisposed();
+                if (value != null)
+                {
+                    int ret = Interop.ConnectionCellularProfile.SetHomeUrl(ProfileHandle, value);
+                    if ((ConnectionError)ret != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "It failed to set home url, " + (ConnectionError)ret);
+                        ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                        ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                        ConnectionErrorFactory.ThrowConnectionException(ret);
+                    }
+                }
+
+                else
+                {
+                    throw new ArgumentNullException("Value of HomeUri is null");
+                }
+            }
+        }
+
+        /// <summary>
+        /// The service type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular service type.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public CellularServiceType ServiceType
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "Get ServiceType");
+                int value;
+                int ret = Interop.ConnectionCellularProfile.GetServiceType(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get service type, " + (ConnectionError)ret);
+                }
+                return (CellularServiceType)value;
+            }
+
+            set
+            {
+                Log.Debug(Globals.LogTag, "Set ServiceType");
+                CheckDisposed();
+                int ret = Interop.ConnectionCellularProfile.SetServiceType(ProfileHandle, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set service type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The cellular pdn type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular pdn type.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public CellularPdnType PdnType
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "Get PdnType");
+                int value;
+                int ret = Interop.ConnectionCellularProfile.GetPdnType(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get pdn type, " + (ConnectionError)ret);
+                }
+                return (CellularPdnType)value;
+            }
+
+            set
+            {
+                Log.Debug(Globals.LogTag, "Set PdnType");
+                CheckDisposed();
+                int ret = Interop.ConnectionCellularProfile.SetPdnType(ProfileHandle, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set pdn type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The cellular roaming pdn type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular roaming pdn type.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public CellularPdnType RoamingPdnType
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "Get RoamingPdnType");
+                int value;
+                int ret = Interop.ConnectionCellularProfile.GetRoamingPdnType(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get roam pdn type, " + (ConnectionError)ret);
+                }
+                return (CellularPdnType)value;
+            }
+
+            set
+            {
+                Log.Debug(Globals.LogTag, "Set RoamingPdnType");
+                CheckDisposed();
+                int ret = Interop.ConnectionCellularProfile.SetRoamingPdnType(ProfileHandle, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set roam pdn type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Cellular Authentication Information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Instance of CellularAuthInformation.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown during set when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public CellularAuthInformation CellularAuthInfo
+        {
+            get
+            {
+                int type;
+                string name;
+                string password;
+                int ret = Interop.ConnectionCellularProfile.GetAuthInfo(ProfileHandle, out type, out name, out password);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get cellular authentication information, " + (ConnectionError)ret);
+                    return null;
+                }
+
+                if (_cellularAuthInfo == null)
+                    _cellularAuthInfo = new CellularAuthInformation();
+                _cellularAuthInfo.AuthType = (CellularAuthType)type;
+                _cellularAuthInfo.UserName = name;
+                _cellularAuthInfo.Password = password;
+                return _cellularAuthInfo;
+            }
+
+            set
+            {
+                CheckDisposed();
+                if (value != null)
+                {
+                    _cellularAuthInfo = value;
+                    int type = (int)_cellularAuthInfo.AuthType;
+                    string name = _cellularAuthInfo.UserName;
+                    string password = _cellularAuthInfo.Password;
+                    int ret = Interop.ConnectionCellularProfile.SetAuthInfo(ProfileHandle, type, name, password);
+                    if ((ConnectionError)ret != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "It failed to set auth information, " + (ConnectionError)ret);
+                        ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                        ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                        ConnectionErrorFactory.ThrowConnectionException(ret);
+                    }
+                }
+
+                else
+                {
+                    throw new ArgumentNullException("CellularAuthInformation value is null");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the profile is hidden.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>True if the cellular profile is hidden, otherwise false.</value>
+        public bool Hidden
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.ConnectionCellularProfile.IsHidden(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get hidden value, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the profile is editable.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>True if the cellular profile is editable, otherwise false.</value>
+        public bool Editable
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.ConnectionCellularProfile.IsEditable(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get editable value, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the profile is default.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>True if the cellular profile is default, otherwise false.</value>
+        public bool IsDefault
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.ConnectionCellularProfile.IsDefault(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get IsDefault value, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+    }
+
+    /// <summary>
+    /// This Class is CellularAuthInformation. It provides the properties to get and set the cellular authentication information.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class CellularAuthInformation
+    {
+        /// <summary>
+        /// Default Constructor.Initializes an object of CellularAuthInformation.
+        /// </summary>
+        public CellularAuthInformation()
+        {
+        }
+
+        /// <summary>
+        /// The user name.
+        /// <since_tizen> 3 </since_tizen>
+        /// </summary>
+        /// <value>Cellular user name.</value>
+        public string UserName { get; set;}
+        /// <summary>
+        /// The password
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular password.</value>
+        public string Password { get; set; }
+
+        /// <summary>
+        /// The authentication type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular authentication type.</value>
+        public CellularAuthType AuthType { get; set; }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs
new file mode 100755 (executable)
index 0000000..9e8d587
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Network.Connection
+{
+    internal static class ConnectionErrorFactory
+    {
+        internal static void CheckFeatureUnsupportedException(int err, string message)
+        {
+            if ((ConnectionError)err == ConnectionError.NotSupported)
+            {
+                ThrowConnectionException(err, message);
+            }
+        }
+
+        internal static void CheckPermissionDeniedException(int err, string message)
+        {
+            if ((ConnectionError)err == ConnectionError.PermissionDenied)
+            {
+                ThrowConnectionException(err, message);
+            }
+        }
+
+        internal static void CheckHandleNullException(int err, bool isHandleInvalid, string message)
+        {
+            if ((ConnectionError)err == ConnectionError.InvalidParameter)
+            {
+                if (isHandleInvalid)
+                {
+                    ThrowConnectionException((int)ConnectionError.InvalidOperation, message);
+                }
+            }
+        }
+
+        internal static void ThrowConnectionException(int errno , string message = "")
+        {
+            ConnectionError _error = (ConnectionError)errno;
+            Log.Debug(Globals.LogTag, "ThrowConnectionException " + _error);
+            switch (_error)
+            {
+                case ConnectionError.AddressFamilyNotSupported:
+                    throw new InvalidOperationException("Address Family Not Supported");
+                case ConnectionError.AlreadyExists:
+                    throw new InvalidOperationException("Already Exists");
+                case ConnectionError.DhcpFailed:
+                    throw new InvalidOperationException("DHCP Failed");
+                case ConnectionError.EndOfIteration:
+                    throw new InvalidOperationException("End Of Iteration");
+                case ConnectionError.InvalidKey:
+                    throw new InvalidOperationException("Invalid Key");
+                case ConnectionError.InvalidOperation:
+                    throw new InvalidOperationException("Invalid Operation " + message);
+                case ConnectionError.InvalidParameter:
+                    throw new ArgumentException("Invalid Parameter");
+                case ConnectionError.NoConnection:
+                    throw new InvalidOperationException("No Connection");
+                case ConnectionError.NoReply:
+                    throw new InvalidOperationException("No Reply");
+                case ConnectionError.NotSupported:
+                    throw new NotSupportedException("Unsupported feature " + message);
+                case ConnectionError.NowInProgress:
+                    throw new InvalidOperationException("Now In Progress");
+                case ConnectionError.OperationAborted:
+                    throw new InvalidOperationException("Operation Aborted");
+                case ConnectionError.OperationFailed:
+                    throw new InvalidOperationException("Operation Failed");
+                case ConnectionError.OutOfMemoryError:
+                    throw new OutOfMemoryException("Out Of Memory Error");
+                case ConnectionError.PermissionDenied:
+                    throw new UnauthorizedAccessException("Permission Denied " + message);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs
new file mode 100755 (executable)
index 0000000..cad51a7
--- /dev/null
@@ -0,0 +1,945 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+using System.Collections;
+using System.Threading;
+
+namespace Tizen.Network.Connection
+{
+    class HandleHolder : IDisposable
+    {
+        private IntPtr Handle;
+        private bool disposed = false;
+
+        public HandleHolder()
+        {
+            Log.Debug(Globals.LogTag, "Handle: " + Handle);
+            int ret = Interop.Connection.Create(out Handle);
+            if(ret != (int)ConnectionError.None)
+            {
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        ~HandleHolder()
+        {
+            Dispose(false);
+        }
+
+        internal IntPtr GetHandle()
+        {
+            Log.Debug(Globals.LogTag, "handleholder handle = " + Handle);
+            return Handle;
+        }
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            Log.Debug(Globals.LogTag, ">>> HandleHolder Dispose with " + disposing);
+            Log.Debug(Globals.LogTag, ">>> Handle: " + Handle);
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+                Destroy();
+            }
+            disposed = true;
+        }
+
+        private void Destroy()
+        {
+            Interop.Connection.Destroy(Handle);
+            if (Handle != IntPtr.Zero)
+            {
+                Handle = IntPtr.Zero;
+            }
+        }
+    }
+
+    internal class ConnectionInternalManager
+    {
+        private bool disposed = false;
+        private static ConnectionInternalManager s_instance = null;
+
+        private EventHandler _ConnectionTypeChanged = null;
+        private EventHandler _IPAddressChanged = null;
+        private EventHandler _EthernetCableStateChanged = null;
+        private EventHandler _ProxyAddressChanged = null;
+
+        private Interop.Connection.ConnectionAddressChangedCallback _connectionAddressChangedCallback;
+        private Interop.Connection.ConnectionTypeChangedCallback _connectionTypeChangedCallback;
+        private Interop.Connection.ConnectionAddressChangedCallback _proxyAddressChangedCallback;
+
+        internal static ConnectionInternalManager Instance
+        {
+            get
+            {
+                if (s_instance == null)
+                {
+                    s_instance = new ConnectionInternalManager();
+                }
+
+                return s_instance;
+            }
+        }
+
+        private static ThreadLocal<HandleHolder> s_threadName = new ThreadLocal<HandleHolder>(() =>
+        {
+            Log.Info(Globals.LogTag, "In threadlocal delegate");
+            return new HandleHolder();
+        });
+
+        private ConnectionInternalManager()
+        {
+
+        }
+
+        ~ConnectionInternalManager()
+        {
+            Dispose(false);
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            Log.Debug(Globals.LogTag, ">>> ConnectionInternalManager Dispose with disposing " + disposing + ", disposed " + disposed);
+            Log.Debug(Globals.LogTag, ">>> Handle: " + GetHandle());
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+            }
+
+            UnregisterEvents();
+            disposed = true;
+        }
+
+        internal IntPtr GetHandle()
+        {
+            return s_threadName.Value.GetHandle();
+        }
+
+        internal event EventHandler ConnectionTypeChanged
+        {
+            add
+            {
+                if (_ConnectionTypeChanged == null)
+                {
+                    ConnectionTypeChangedStart();
+                }
+
+                _ConnectionTypeChanged += value;
+            }
+            remove
+            {
+                _ConnectionTypeChanged -= value;
+                if (_ConnectionTypeChanged == null)
+                {
+                    ConnectionTypeChangedStop();
+                }
+            }
+        }
+
+        private void ConnectionTypeChangedStart()
+        {
+            _connectionTypeChangedCallback = (ConnectionType type, IntPtr user_data) =>
+            {
+                if (_ConnectionTypeChanged != null)
+                {
+                    _ConnectionTypeChanged(null, new ConnectionTypeEventArgs(type));
+                }
+            };
+
+            int ret = Interop.Connection.SetTypeChangedCallback(GetHandle(), _connectionTypeChangedCallback, IntPtr.Zero);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to register connection type changed callback, " + (ConnectionError)ret);
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        private void ConnectionTypeChangedStop()
+        {
+            int ret = Interop.Connection.UnsetTypeChangedCallback(GetHandle());
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to unregister connection type changed callback, " + (ConnectionError)ret);
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        internal event EventHandler EthernetCableStateChanged
+        {
+            add
+            {
+                if (_EthernetCableStateChanged == null)
+                {
+                    EthernetCableStateChangedStart();
+                }
+                _EthernetCableStateChanged += value;
+            }
+            remove
+            {
+                _EthernetCableStateChanged -= value;
+                if (_EthernetCableStateChanged == null)
+                {
+                    EthernetCableStateChangedStop();
+                }
+            }
+        }
+
+        private void EthernetCableStateChangedStart()
+        {
+            int ret = Interop.Connection.SetEthernetCableStateChagedCallback(GetHandle(), EthernetCableStateChangedCallback, IntPtr.Zero);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to register ethernet cable state changed callback, " + (ConnectionError)ret);
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        private void EthernetCableStateChangedStop()
+        {
+            int ret = Interop.Connection.UnsetEthernetCableStateChagedCallback(GetHandle());
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to unregister ethernet cable state changed callback, " + (ConnectionError)ret);
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        private void EthernetCableStateChangedCallback(EthernetCableState state, IntPtr user_data)
+        {
+            if (_EthernetCableStateChanged != null)
+            {
+                _EthernetCableStateChanged(null, new EthernetCableStateEventArgs(state));
+            }
+        }
+
+        internal event EventHandler IPAddressChanged
+        {
+            add
+            {
+                if (_IPAddressChanged == null)
+                {
+                    IPAddressChangedStart();
+                }
+                _IPAddressChanged += value;
+            }
+
+            remove
+            {
+                _IPAddressChanged -= value;
+                if (_IPAddressChanged == null)
+                {
+                    IPAddressChangedStop();
+                }
+            }
+        }
+
+        private void IPAddressChangedStart()
+        {
+            _connectionAddressChangedCallback = (IntPtr IPv4, IntPtr IPv6, IntPtr UserData) =>
+            {
+                if (_IPAddressChanged != null)
+                {
+                    string ipv4 = Marshal.PtrToStringAnsi(IPv4);
+                    string ipv6 = Marshal.PtrToStringAnsi(IPv6);
+
+                    if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false))
+                    {
+                        _IPAddressChanged(null, new AddressEventArgs(ipv4, ipv6));
+                    }
+                }
+            };
+
+            int ret = Interop.Connection.SetIPAddressChangedCallback(GetHandle(), _connectionAddressChangedCallback, IntPtr.Zero);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to register callback for changing IP address, " + (ConnectionError)ret);
+            }
+        }
+
+        private void IPAddressChangedStop()
+        {
+            int ret = Interop.Connection.UnsetIPAddressChangedCallback(GetHandle());
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to unregister callback for changing IP address, " + (ConnectionError)ret);
+            }
+        }
+
+        internal event EventHandler ProxyAddressChanged
+        {
+            add
+            {
+                //Console.WriteLine("ProxyAddressChanged Add **");
+                if (_ProxyAddressChanged == null)
+                {
+                    ProxyAddressChangedStart();
+                }
+
+                _ProxyAddressChanged += value;
+            }
+            remove
+            {
+                //Console.WriteLine("ProxyAddressChanged Remove");
+                _ProxyAddressChanged -= value;
+                if (_ProxyAddressChanged == null)
+                {
+                    ProxyAddressChangedStop();
+                }
+            }
+        }
+
+        private void ProxyAddressChangedStart()
+        {
+            _proxyAddressChangedCallback = (IntPtr IPv4, IntPtr IPv6, IntPtr UserData) =>
+            {
+                if (_ProxyAddressChanged != null)
+                {
+                    string ipv4 = Marshal.PtrToStringAnsi(IPv4);
+                    string ipv6 = Marshal.PtrToStringAnsi(IPv6);
+
+                    if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false))
+                    {
+                        _ProxyAddressChanged(null, new AddressEventArgs(ipv4, ipv6));
+                    }
+                }
+            };
+
+            int ret = Interop.Connection.SetProxyAddressChangedCallback(GetHandle(), _proxyAddressChangedCallback, IntPtr.Zero);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to register callback for changing proxy address, " + (ConnectionError)ret);
+            }
+        }
+
+        private void ProxyAddressChangedStop()
+        {
+            int ret = Interop.Connection.UnsetProxyAddressChangedCallback(GetHandle());
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to unregister callback for changing proxy address, " + (ConnectionError)ret);
+            }
+        }
+
+        private void UnregisterEvents()
+        {
+            if (_ConnectionTypeChanged != null)
+            {
+                ConnectionTypeChangedStop();
+            }
+            if (_IPAddressChanged != null)
+            {
+                IPAddressChangedStop();
+            }
+            if (_EthernetCableStateChanged != null)
+            {
+                EthernetCableStateChangedStop();
+            }
+            if (_ProxyAddressChanged != null)
+            {
+                ProxyAddressChangedStop();
+            }
+        }
+
+        internal int GetProfileIterator(ProfileListType type, out IntPtr iterator)
+        {
+            return Interop.Connection.GetProfileIterator(GetHandle(), (int)type, out iterator);
+        }
+
+        internal bool HasNext(IntPtr iterator)
+        {
+            return Interop.Connection.HasNextProfileIterator(iterator);
+        }
+
+        internal int NextProfileIterator(IntPtr iterator, out IntPtr profileHandle)
+        {
+            return Interop.Connection.GetNextProfileIterator(iterator, out profileHandle);
+        }
+
+        internal int DestoryProfileIterator(IntPtr iterator)
+        {
+            return Interop.Connection.DestroyProfileIterator(iterator);
+        }
+
+        internal System.Net.IPAddress GetIPAddress(AddressFamily family)
+        {
+            Log.Debug(Globals.LogTag, "GetIPAddress " + family);
+            IntPtr ip;
+            int ret = Interop.Connection.GetIPAddress(GetHandle(), (int)family, out ip);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get IP address, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            string result = Marshal.PtrToStringAnsi(ip);
+            Interop.Libc.Free(ip);
+            return System.Net.IPAddress.Parse(result);;
+        }
+
+        internal IEnumerable<System.Net.IPAddress> GetAllIPv6Addresses(ConnectionType type)
+        {
+            Log.Debug(Globals.LogTag, "GetAllIPv6Addresses");
+            List<System.Net.IPAddress> ipList = new List<System.Net.IPAddress>();
+            Interop.Connection.IPv6AddressCallback callback = (IntPtr ipv6Address, IntPtr userData) =>
+            {
+                if (ipv6Address != IntPtr.Zero)
+                {
+                    string ipv6 = Marshal.PtrToStringAnsi(ipv6Address);
+                    ipList.Add(System.Net.IPAddress.Parse(ipv6));
+                    return true;
+                }
+                return false;
+            };
+
+            int ret = Interop.Connection.GetAllIPv6Addresses(GetHandle(), (int)type, callback, IntPtr.Zero);
+            if (ret != (int)ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            return ipList;
+        }
+
+        internal string GetProxy(AddressFamily family)
+        {
+            Log.Debug(Globals.LogTag, "GetProxy " + family);
+            IntPtr ip;
+            int ret = Interop.Connection.GetProxy(GetHandle(), (int)family, out ip);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get proxy, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            string result = Marshal.PtrToStringAnsi(ip);
+            Interop.Libc.Free(ip);
+            return result;
+        }
+
+        internal string GetMacAddress(ConnectionType type)
+        {
+            Log.Debug(Globals.LogTag, "GetMacAddress " + type);
+            IntPtr mac;
+            int ret = Interop.Connection.GetMacAddress(GetHandle(), (int)type, out mac);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get mac address, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            string result = Marshal.PtrToStringAnsi(mac);
+            Interop.Libc.Free(mac);
+            return result;
+        }
+
+        internal long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
+        {
+            Log.Debug(Globals.LogTag, "GetStatistics " + connectionType + ", " + statisticsType);
+            long size;
+            int ret = Interop.Connection.GetStatistics(GetHandle(), (int)connectionType,
+                    (int)statisticsType, out size);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get statistics, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+            return size;
+        }
+
+        internal void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
+        {
+            Log.Debug(Globals.LogTag, "ResetStatistics " + connectionType + ", " + statisticsType);
+            int ret = Interop.Connection.ResetStatistics(GetHandle(), (int)connectionType,
+                    (int)statisticsType);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to reset statistics, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        internal void AddRoute(AddressFamily family, string interfaceName, System.Net.IPAddress address, System.Net.IPAddress gateway)
+        {
+            if (interfaceName != null && address != null && gateway != null)
+            {
+                Log.Debug(Globals.LogTag, "AddRoute " + family + ", " + interfaceName + ", " + address + ", " + gateway);
+                int ret = Interop.Connection.AddRoute(GetHandle(), family, interfaceName, address.ToString(), gateway.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to add route to the routing table, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Arguments are null");
+            }
+        }
+
+        internal void RemoveRoute(AddressFamily family, string interfaceName, System.Net.IPAddress address, System.Net.IPAddress gateway)
+        {
+            if (interfaceName != null && address != null && gateway != null)
+            {
+                Log.Debug(Globals.LogTag, "RemoveRoute " + family + ", " + interfaceName + ", " + address + ", " + gateway);
+                int ret = Interop.Connection.RemoveRoute(GetHandle(), family, interfaceName, address.ToString(), gateway.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to remove route from the routing table, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Arguments are null");
+            }
+        }
+
+        internal ConnectionType ConnectionType
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get ConnectionType");
+                int type = 0;
+                int ret = Interop.Connection.GetType(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get connection type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (ConnectionType)type;
+            }
+        }
+
+        internal CellularState CellularState
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get CellularState");
+                int type = 0;
+                int ret = Interop.Connection.GetCellularState(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get cellular state, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (CellularState)type;
+            }
+        }
+
+        internal ConnectionState WiFiState
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get WiFiState");
+                int type = 0;
+                int ret = Interop.Connection.GetWiFiState(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get wifi state, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (ConnectionState)type;
+            }
+        }
+
+        internal ConnectionState BluetoothState
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get BluetoothState");
+                int type = 0;
+                int ret = Interop.Connection.GetBtState(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get bluetooth state, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (ConnectionState)type;
+            }
+        }
+
+        internal ConnectionState EthernetState
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get ConnectionType");
+                int type = 0;
+                int ret = Interop.Connection.GetEthernetState(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get ethernet state, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (ConnectionState)type;
+            }
+        }
+
+        internal EthernetCableState EthernetCableState
+        {
+            get
+            {
+                Log.Debug(Globals.LogTag, "get EthernetCableState");
+                int type = 0;
+                int ret = Interop.Connection.GetEthernetCableState(GetHandle(), out type);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get ethernet cable state, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+                return (EthernetCableState)type;
+            }
+        }
+
+        internal IntPtr CreateCellularProfile(ConnectionProfileType type, string keyword)
+        {
+            Log.Debug(Globals.LogTag, "CreateCellularProfile, " + type + ", " + keyword);
+            if (keyword != null)
+            {
+                IntPtr handle = IntPtr.Zero;
+                int ret = Interop.ConnectionProfile.Create((int)type, keyword, out handle);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to Create profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+
+                return handle;
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Keyword is null");
+            }
+        }
+
+        internal void AddCellularProfile(CellularProfile profile)
+        {
+
+            Log.Debug(Globals.LogTag, "AddCellularProfile");
+            if (profile != null)
+            {
+                if (profile.Type == ConnectionProfileType.Cellular)
+                {
+                    int ret = Interop.Connection.AddProfile(GetHandle(), profile.ProfileHandle);
+                    if ((ConnectionError)ret != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Failed to add cellular profile, " + (ConnectionError)ret);
+                        ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                        ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.profile)");
+                        ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                        ConnectionErrorFactory.ThrowConnectionException(ret);
+                    }
+                }
+
+                else
+                {
+                    throw new ArgumentException("Profile type is not cellular");
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+
+        internal void RemoveProfile(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "RemoveProfile");
+            if (profile != null)
+            {
+                int ret = Interop.Connection.RemoveProfile(GetHandle(), profile.ProfileHandle);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to remove profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+
+        internal void UpdateProfile(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "UpdateProfile");
+            if (profile != null)
+            {
+                int ret = Interop.Connection.UpdateProfile(GetHandle(), profile.ProfileHandle);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to update profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+
+        internal ConnectionProfile GetCurrentProfile()
+        {
+            Log.Debug(Globals.LogTag, "GetCurrentProfile");
+            IntPtr ProfileHandle;
+            int ret = Interop.Connection.GetCurrentProfile(GetHandle(), out ProfileHandle);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            ConnectionProfile Profile = new ConnectionProfile(ProfileHandle);
+            return Profile;
+        }
+
+        internal ConnectionProfile GetDefaultCellularProfile(CellularServiceType type)
+        {
+            Log.Debug(Globals.LogTag, "GetDefaultCellularProfile");
+            IntPtr ProfileHandle;
+            int ret = Interop.Connection.GetDefaultCellularServiceProfile(GetHandle(), (int)type, out ProfileHandle);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "Error: " + ret);
+                Log.Error(Globals.LogTag, "It failed to get default cellular profile, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            CellularProfile Profile = new CellularProfile(ProfileHandle);
+            return Profile;
+        }
+
+        internal Task SetDefaultCellularProfile(CellularServiceType type, ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "SetDefaultCellularProfile");
+            if (profile != null)
+            {
+                TaskCompletionSource<bool> task = new TaskCompletionSource<bool>();
+                Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) =>
+                {
+                    if (Result != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Error occurs during set default cellular profile, " + Result);
+                        task.SetException(new InvalidOperationException("Error occurs during set default cellular profile, " + Result));
+                    }
+
+                    task.SetResult(true);
+                };
+
+                int ret = Interop.Connection.SetDefaultCellularServiceProfileAsync(GetHandle(), (int)type, profile.ProfileHandle, Callback, (IntPtr)0);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set default cellular profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+
+                return task.Task;
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+
+
+        internal Task<IEnumerable<ConnectionProfile>> GetProfileListAsync(ProfileListType type)
+        {
+            Log.Debug(Globals.LogTag, "GetProfileListAsync");
+            var task = new TaskCompletionSource<IEnumerable<ConnectionProfile>>();
+
+            List<ConnectionProfile> Result = new List<ConnectionProfile>();
+            IntPtr iterator;
+            int ret = Interop.Connection.GetProfileIterator(GetHandle(), (int)type, out iterator);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get profile iterator, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            while (Interop.Connection.HasNextProfileIterator(iterator))
+            {
+                IntPtr nextH;
+                IntPtr profileH;
+                Interop.Connection.GetNextProfileIterator(iterator, out nextH);
+                Interop.ConnectionProfile.Clone(out profileH, nextH);
+
+                int profileType;
+                Interop.ConnectionProfile.GetType(profileH, out profileType);
+
+                if ((ConnectionProfileType)profileType == ConnectionProfileType.WiFi)
+                {
+                    WiFiProfile cur = new WiFiProfile(profileH);
+                    Result.Add(cur);
+                }
+                else if ((ConnectionProfileType)profileType == ConnectionProfileType.Cellular)
+                {
+                    CellularProfile cur = new CellularProfile(profileH);
+                    Result.Add(cur);
+                }
+                else {
+                    ConnectionProfile cur = new ConnectionProfile(profileH);
+                    Result.Add(cur);
+                }
+            }
+            Interop.Connection.DestroyProfileIterator(iterator);
+            task.SetResult(Result);
+            return task.Task;
+        }
+
+        internal Task OpenProfileAsync(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "OpenProfileAsync");
+            if (profile != null)
+            {
+                Log.Debug(Globals.LogTag, "OpenProfileAsync " + profile.Name);
+                TaskCompletionSource<bool> task = new TaskCompletionSource<bool>();
+                Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) =>
+                {
+                    Log.Debug(Globals.LogTag, "Connected " + profile.Name);
+                    if (Result != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Error occurs during connecting profile, " + Result);
+                        task.SetException(new InvalidOperationException("Error occurs during connecting profile, " + Result));
+                    }
+
+                    task.SetResult(true);
+                };
+
+                int ret = Interop.Connection.OpenProfile(GetHandle(), profile.ProfileHandle, Callback, IntPtr.Zero);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to connect profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+
+                return task.Task;
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+
+        internal Task CloseProfileAsync(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "CloseProfileAsync");
+            if (profile != null)
+            {
+                Log.Debug(Globals.LogTag, "CloseProfileAsync " + profile.Name);
+                TaskCompletionSource<bool> task = new TaskCompletionSource<bool>();
+                Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) =>
+                {
+                    if (Result != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "Error occurs during disconnecting profile, " + Result);
+                        task.SetException(new InvalidOperationException("Error occurs during disconnecting profile, " + Result));
+                    }
+
+                    task.SetResult(true);
+                };
+
+                int ret = Interop.Connection.CloseProfile(GetHandle(), profile.ProfileHandle, Callback, IntPtr.Zero);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to disconnect profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth");
+                    ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+
+                return task.Task;
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Profile is null");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs
new file mode 100755 (executable)
index 0000000..0b574b5
--- /dev/null
@@ -0,0 +1,628 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// The Connection API provides functions, enumerations to get the status of network and current profile and manage profiles.
+/// </summary>
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This class manages the connection handle resources.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public sealed class SafeConnectionHandle : SafeHandle
+    {
+        internal SafeConnectionHandle(IntPtr handle) : base(handle, true)
+        {
+        }
+
+        /// <summary>
+        /// Checks whether the handle value is valid or not.
+        /// </summary>
+        /// <value>True if the handle is invalid, otherwise false.</value>
+        public override bool IsInvalid
+        {
+            get
+            {
+                return this.handle == IntPtr.Zero;
+            }
+        }
+
+        /// <summary>
+        /// Frees the handle.
+        /// </summary>
+        /// <returns>True if the handle is released successfully, otherwise false.</returns>
+        protected override bool ReleaseHandle()
+        {
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+
+    /// <summary>
+    /// This class is ConnectionManager. It provides functions to manage data connections.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class ConnectionManager
+    {
+        private static ConnectionItem _currentConnection = null;
+
+        /// <summary>
+        /// Event that is called when the type of the current connection is changed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        public static event EventHandler ConnectionTypeChanged
+        {
+            add
+            {
+                ConnectionInternalManager.Instance.ConnectionTypeChanged += value;
+            }
+
+            remove
+            {
+                ConnectionInternalManager.Instance.ConnectionTypeChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Event for ethernet cable is plugged [in/out] event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        public static event EventHandler EthernetCableStateChanged
+        {
+            add
+            {
+                ConnectionInternalManager.Instance.EthernetCableStateChanged += value;
+            }
+
+            remove
+            {
+                ConnectionInternalManager.Instance.EthernetCableStateChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Event that is called when the IP address is changed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        public static event EventHandler IPAddressChanged
+        {
+            add
+            {
+                ConnectionInternalManager.Instance.IPAddressChanged += value;
+            }
+
+            remove
+            {
+                ConnectionInternalManager.Instance.IPAddressChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Event that is called when the proxy address is changed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        public static event EventHandler ProxyAddressChanged
+        {
+            add
+            {
+                ConnectionInternalManager.Instance.ProxyAddressChanged += value;
+            }
+
+            remove
+            {
+                ConnectionInternalManager.Instance.ProxyAddressChanged -= value;
+            }
+        }
+
+        /// <summary>
+        /// Gets the connection handle.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Instance of SafeConnectionHandle</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static SafeConnectionHandle GetConnectionHandle()
+        {
+            IntPtr handle = ConnectionInternalManager.Instance.GetHandle();
+            return new SafeConnectionHandle(handle);
+        }
+
+        /// <summary>
+        /// Gets the IP address of the current connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="family">The address family</param>
+        /// <returns>IP address of the connection (global address in case of IPv6).</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static System.Net.IPAddress GetIPAddress(AddressFamily family)
+        {
+            return ConnectionInternalManager.Instance.GetIPAddress(family);
+        }
+
+        /// <summary>
+        /// Gets the all IPv6 addresses of the current connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The type of current network connection</param>
+        /// <returns>A list of IPv6 addresses of the connection.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static IEnumerable<System.Net.IPAddress> GetAllIPv6Addresses(ConnectionType type)
+        {
+            return ConnectionInternalManager.Instance.GetAllIPv6Addresses(type);
+        }
+
+        /// <summary>
+        /// Gets the proxy address of the current connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="family">The address family</param>
+        /// <returns>Proxy address of the connection.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static string GetProxy(AddressFamily family)
+        {
+            return ConnectionInternalManager.Instance.GetProxy(family);
+        }
+
+        /// <summary>
+        /// Gets the MAC address of the Wi-Fi or ethernet.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The type of current network connection</param>
+        /// <returns>MAC address of the Wi-Fi or ethernet.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static string GetMacAddress(ConnectionType type)
+        {
+            return ConnectionInternalManager.Instance.GetMacAddress(type);
+        }
+
+        /// <summary>
+        /// Gets the statistics information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="connectionType">The type of connection (only WiFi and Cellular are supported)</param>
+        /// <param name="statisticsType">The type of statistics</param>
+        /// <returns>The statistics information associated with statisticsType</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
+        {
+            return ConnectionInternalManager.Instance.GetStatistics(connectionType, statisticsType);
+        }
+
+        /// <summary>
+        /// Resets the statistics information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="connectionType">The type of connection (only WiFi and Cellular are supported)</param>
+        /// <param name="statisticsType">The type of statistics</param>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.set</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
+        {
+            ConnectionInternalManager.Instance.ResetStatistics(connectionType, statisticsType);
+        }
+
+        /// <summary>
+        /// Adds a route to the routing table.
+        /// </summary>
+        /// <param name="family">The address family</param>
+        /// <param name="interfaceName">The name of network interface</param>
+        /// <param name="hostAddress">The IP address of the host</param>
+        /// <param name="gateway">The gateway address</param>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.set</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when interfaceName or hostAddress or gateway is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static void AddRoute(AddressFamily family, string interfaceName, System.Net.IPAddress hostAddress, System.Net.IPAddress gateway)
+        {
+            ConnectionInternalManager.Instance.AddRoute(family, interfaceName, hostAddress, gateway);
+        }
+
+        /// <summary>
+        /// Removes a route from the routing table.
+        /// </summary>
+        /// <param name="family">The address family</param>
+        /// <param name="interfaceName">The name of network interface</param>
+        /// <param name="hostAddress">The IP address of the host</param>
+        /// <param name="gateway">The gateway address</param>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.set</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when interfaceName or hostAddress or gateway is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation.</exception>
+        public static void RemoveRoute(AddressFamily family, string interfaceName, System.Net.IPAddress hostAddress, System.Net.IPAddress gateway)
+        {
+            ConnectionInternalManager.Instance.RemoveRoute(family, interfaceName, hostAddress, gateway);
+        }
+
+        /// <summary>
+        /// Type and state of the current profile for data connection
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Instance of ConnectionItem</value>
+        public static ConnectionItem CurrentConnection
+        {
+            get
+            {
+                if (_currentConnection == null)
+                {
+                    _currentConnection = new ConnectionItem();
+                }
+
+                return _currentConnection;
+            }
+        }
+
+        /// <summary>
+        /// Creates a cellular profile handle.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The type of profile. Cellular profile type is supported.</param>
+        /// <param name="keyword">The keyword included in profile name.</param>
+        /// <returns>CellularProfile object</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when keyword value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+        public static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword)
+        {
+            IntPtr profileHandle = IntPtr.Zero;
+            if (type == ConnectionProfileType.Cellular)
+            {
+                profileHandle = ConnectionInternalManager.Instance.CreateCellularProfile(type, keyword);
+            }
+
+            else
+            {
+                Log.Error(Globals.LogTag, "ConnectionProfile Type is not supported");
+                ConnectionErrorFactory.ThrowConnectionException((int)ConnectionError.InvalidParameter);
+            }
+
+            return new CellularProfile(profileHandle);
+        }
+
+        /// <summary>
+        /// The state of cellular connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Cellular network state.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public static CellularState CellularState
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.CellularState;
+            }
+        }
+
+        /// <summary>
+        /// The state of the Wi-Fi.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>WiFi connection state.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public static ConnectionState WiFiState
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.WiFiState;
+            }
+        }
+
+        /// <summary>
+        /// The state of the Bluetooth.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Bluetooth connection state.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public static ConnectionState BluetoothState
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.BluetoothState;
+            }
+        }
+
+        /// <summary>
+        /// The Ethernet connection state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Ethernet connection state.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public static ConnectionState EthernetState
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.EthernetState;
+            }
+        }
+
+        /// <summary>
+        /// Checks for ethernet cable is attached or not.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Ethernet cable state.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public static EthernetCableState EthernetCableState
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.EthernetCableState;
+            }
+        }
+
+    } // class ConnectionManager
+
+    /// <summary>
+    /// This class contains connection information such as connection type and state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ConnectionItem
+    {
+        internal ConnectionItem()
+        {
+        }
+
+        /// <summary>
+        /// The type of the current profile for data connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Data connection current profile.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public ConnectionType Type
+        {
+            get
+            {
+                return ConnectionInternalManager.Instance.ConnectionType;
+            }
+        }
+
+        /// <summary>
+        /// The state of the current profile for data connection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Connection state of the current connection type.</value>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        public ConnectionState State
+        {
+            get
+            {
+                if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Cellular)
+                {
+                    if (ConnectionInternalManager.Instance.CellularState == CellularState.Connected)
+                    {
+                        return ConnectionState.Connected;
+                    }
+                    else if (ConnectionInternalManager.Instance.CellularState == CellularState.Available)
+                    {
+                        return ConnectionState.Disconnected;
+                    }
+                    else {
+                        return ConnectionState.Deactivated;
+                    }
+                }
+                else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Bluetooth)
+                {
+                    return ConnectionInternalManager.Instance.BluetoothState;
+                }
+                else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.WiFi)
+                {
+                    return ConnectionInternalManager.Instance.WiFiState;
+                }
+                else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Ethernet)
+                {
+                    return ConnectionInternalManager.Instance.EthernetState;
+                }
+                else { // TO DO : Add Net Proxy
+                    return ConnectionState.Disconnected;
+                }
+            }
+        }
+    } // class ConnectionItem
+
+    /// <summary>
+    /// An extended EventArgs class which contains changed connection type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ConnectionTypeEventArgs : EventArgs
+    {
+        private ConnectionType Type = ConnectionType.Disconnected;
+
+        internal ConnectionTypeEventArgs(ConnectionType type)
+        {
+            Type = type;
+        }
+
+        /// <summary>
+        /// The connection type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Type of the connection.</value>
+        public ConnectionType ConnectionType
+        {
+            get
+            {
+                return Type;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class which contains changed ethernet cable state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class EthernetCableStateEventArgs : EventArgs
+    {
+        private EthernetCableState State;
+
+        internal EthernetCableStateEventArgs(EthernetCableState state)
+        {
+            State = state;
+        }
+
+        /// <summary>
+        /// The ethernet cable state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Attached or detached state of the ethernet cable.</value>
+        public EthernetCableState EthernetCableState
+        {
+            get
+            {
+                return State;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class which contains changed address.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class AddressEventArgs : EventArgs
+    {
+        private string IPv4 = "";
+        private string IPv6 = "";
+
+        internal AddressEventArgs(string ipv4, string ipv6)
+        {
+            IPv4 = ipv4;
+            IPv6 = ipv6;
+        }
+
+        /// <summary>
+        /// The  IPV4 address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>IP address in the format of IPV4 syntax.</value>
+        public string IPv4Address
+        {
+            get
+            {
+                return IPv4;
+            }
+        }
+
+        /// <summary>
+        /// The  IPV6 address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>IP address in the format of IPV6 syntax.</value>
+        public string IPv6Address
+        {
+            get
+            {
+                return IPv6;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs
new file mode 100755 (executable)
index 0000000..87fc8a2
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This Class is ConnectionProfile. It provides event and propeties of the connection profile.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ConnectionProfile : IDisposable
+    {
+        internal IntPtr ProfileHandle = IntPtr.Zero;
+        private IAddressInformation IPv4;
+        private IAddressInformation IPv6;
+        private bool disposed = false;
+        private EventHandler _ProfileStateChanged = null;
+
+        private Interop.ConnectionProfile.ProfileStateChangedCallback _profileChangedCallback;
+
+        internal IntPtr GetHandle()
+        {
+            return ProfileHandle;
+        }
+
+        /// <summary>
+        /// The event that is called when the state of profile is changed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        public event EventHandler ProfileStateChanged
+        {
+            add
+            {
+                Log.Debug(Globals.LogTag, "ProfileStateChanged add");
+                if (_ProfileStateChanged == null)
+                {
+                    ProfileStateChangedStart();
+                }
+                _ProfileStateChanged += value;
+            }
+            remove
+            {
+                Log.Debug(Globals.LogTag, "ProfileStateChanged remove");
+                _ProfileStateChanged -= value;
+                if (_ProfileStateChanged == null)
+                {
+                    ProfileStateChangedStop();
+                }
+            }
+        }
+
+        private void ProfileStateChangedStart()
+        {
+            _profileChangedCallback = (ProfileState state, IntPtr userData) =>
+            {
+                if (_ProfileStateChanged != null)
+                {
+                    _ProfileStateChanged(null, new ProfileStateEventArgs(state));
+                }
+            };
+
+            Log.Debug(Globals.LogTag, "ProfileStateChangedStart");
+            int ret = Interop.ConnectionProfile.SetStateChangeCallback(ProfileHandle, _profileChangedCallback, IntPtr.Zero);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to register callback for changing profile state, " + (ConnectionError)ret);
+            }
+        }
+
+        private void ProfileStateChangedStop()
+        {
+            Log.Debug(Globals.LogTag, "ProfileStateChangedStop");
+            int ret = Interop.ConnectionProfile.UnsetStateChangeCallback(ProfileHandle);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to unregister callback for changing profile state, " + (ConnectionError)ret);
+            }
+        }
+
+        internal ConnectionProfile(IntPtr handle)
+        {
+            ProfileHandle = handle;
+            IPv4 = new ConnectionAddressInformation(ProfileHandle, AddressFamily.IPv4);
+            IPv6 = new ConnectionAddressInformation(ProfileHandle, AddressFamily.IPv6);
+        }
+
+        ~ConnectionProfile()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Disposes the memory allocated to unmanaged resources.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        private void Dispose(bool disposing)
+        {
+            Log.Debug(Globals.LogTag, ">>> ConnectionProfile Dispose with " + disposing);
+            if (disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects.
+                UnregisterEvents();
+                Destroy();
+            }
+            disposed = true;
+        }
+
+        private void UnregisterEvents()
+        {
+            if (_ProfileStateChanged != null)
+            {
+                ProfileStateChangedStop();
+            }
+        }
+
+        private void Destroy()
+        {
+            Interop.ConnectionProfile.Destroy(ProfileHandle);
+            ProfileHandle = IntPtr.Zero;
+        }
+
+        internal void CheckDisposed()
+        {
+            if (disposed)
+            {
+                throw new ObjectDisposedException(GetType().FullName);
+            }
+        }
+
+        /// <summary>
+        /// The profile ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Unique ID of the profile.</value>
+        public string Id
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetId(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get id of connection profile, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// The profile name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>User friendly name of the profile.</value>
+        public string Name
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetName(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get name of connection profile, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// The network type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Profile type of the network connection.</value>
+        public ConnectionProfileType Type
+        {
+            get
+            {
+                int Value;
+                int ret = Interop.ConnectionProfile.GetType(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get type of connection profile, " + (ConnectionError)ret);
+                }
+                return (ConnectionProfileType)Value;
+            }
+        }
+
+        /// <summary>
+        /// The name of the network interface.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Network interface name, e.g. eth0 and pdp0.</value>
+        public string InterfaceName
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetNetworkInterfaceName(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get network interface name, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Refreshes the profile information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when profile instance is invalid or when method failed due to invalid operation</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public void Refresh()
+        {
+            CheckDisposed();
+            int ret = Interop.ConnectionProfile.Refresh(ProfileHandle);
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get network interface name, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Get the network state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="family">The address family</param>
+        /// <returns>The network state.</returns>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when profile instance is invalid or when method failed due to invalid operation</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public ProfileState GetState(AddressFamily family)
+        {
+            CheckDisposed();
+            int Value;
+            int ret = (int)ConnectionError.None;
+            if (family == AddressFamily.IPv4)
+            {
+                ret = Interop.ConnectionProfile.GetState(ProfileHandle, out Value);
+            }
+
+            else
+            {
+                ret = Interop.ConnectionProfile.GetIPv6State(ProfileHandle, out Value);
+            }
+
+            if ((ConnectionError)ret != ConnectionError.None)
+            {
+                Log.Error(Globals.LogTag, "It failed to get profile state, " + (ConnectionError)ret);
+                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                ConnectionErrorFactory.ThrowConnectionException(ret);
+            }
+
+            return (ProfileState)Value;
+        }
+
+        /// <summary>
+        /// The Proxy type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Proxy type of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown during set when operation is performed on a disposed object.</exception>
+        public ProxyType ProxyType
+        {
+            get
+            {
+                int Value;
+                int ret = Interop.ConnectionProfile.GetProxyType(ProfileHandle, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get proxy type, " + (ConnectionError)ret);
+                }
+                return (ProxyType)Value;
+
+            }
+
+            set
+            {
+                CheckDisposed();
+                int ret = Interop.ConnectionProfile.SetProxyType(ProfileHandle, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set proxy type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The proxy address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Proxy address of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown during set when value is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public string ProxyAddress
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetProxyAddress(ProfileHandle, (int)AddressFamily.IPv4, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get proxy address, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                return result;
+
+            }
+
+            set
+            {
+                CheckDisposed();
+                if (value != null)
+                {
+                    int ret = Interop.ConnectionProfile.SetProxyAddress(ProfileHandle, (int)AddressFamily.IPv4, value);
+                    if ((ConnectionError)ret != ConnectionError.None)
+                    {
+                        Log.Error(Globals.LogTag, "It failed to set proxy address, " + (ConnectionError)ret);
+                        ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                        ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                        ConnectionErrorFactory.ThrowConnectionException(ret);
+                    }
+                }
+
+                else
+                {
+                    throw new ArgumentNullException("ProxyAddress is null");
+                }
+            }
+        }
+
+        /// <summary>
+        /// The address information (IPv4)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Instance of IAddressInformation with IPV4 address.</value>
+        public IAddressInformation IPv4Settings
+        {
+            get
+            {
+                return IPv4;
+
+            }
+        }
+
+        /// <summary>
+        /// The address information (IPv6)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Instance of IAddressInformation with IPV6 address.</value>
+        public IAddressInformation IPv6Settings
+        {
+            get
+            {
+                return IPv6;
+            }
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class which contains changed profile state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ProfileStateEventArgs : EventArgs
+    {
+        private ProfileState _State = ProfileState.Disconnected;
+
+        internal ProfileStateEventArgs(ProfileState state)
+        {
+            _State = state;
+        }
+
+        /// <summary>
+        /// The profile state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>State type of the connection profile.</value>
+        public ProfileState State
+        {
+            get
+            {
+                return _State;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs
new file mode 100755 (executable)
index 0000000..5049686
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Collections;
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This class is ConnectionProfileManager. It provides functions to add, get, connect or modify the connection profile.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class ConnectionProfileManager
+    {
+        /// <summary>
+        /// Adds a new profile
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="profile">The cellular profile object</param>
+        /// <privilege>http://tizen.org/privilege/network.profile</privilege>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static void AddCellularProfile(CellularProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "AddCellularProfile");
+            ConnectionInternalManager.Instance.AddCellularProfile(profile);
+        }
+
+        /// <summary>
+        /// Gets the list of profile with profile list type
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The type of profile</param>
+        /// <returns>List of connection profile objects.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance has been disposed.</exception>
+        public static Task<IEnumerable<ConnectionProfile>> GetProfileListAsync(ProfileListType type)
+        {
+            Log.Debug(Globals.LogTag, "GetProfileListAsync");
+            return ConnectionInternalManager.Instance.GetProfileListAsync(type);
+        }
+
+        /// <summary>
+        /// Opens a connection of profile, asynchronously.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="profile">The connection profile object</param>
+        /// <returns>A task indicates whether the ConnectProfileAsync method is done successfully or not.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.set</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static Task ConnectProfileAsync(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "ConnectProfile");
+            return ConnectionInternalManager.Instance.OpenProfileAsync(profile);
+        }
+
+        /// <summary>
+        /// Closes a connection of profile.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="profile">The connection profile object</param>
+        /// <returns>A task indicates whether the DisconnectProfileAsync method is done successfully or not.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.set</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static Task DisconnectProfileAsync(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "DisconnectProfileAsync");
+            return ConnectionInternalManager.Instance.CloseProfileAsync(profile);
+        }
+
+        /// <summary>
+        /// Removes an existing profile.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="profile">The connection profile object</param>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.profile</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static void RemoveProfile(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "RemoveProfile. Id: " + profile.Id + ", Name: " + profile.Name + ", Type: " + profile.Type);
+            ConnectionInternalManager.Instance.RemoveProfile(profile);
+        }
+
+        /// <summary>
+        /// Updates an existing profile.
+        /// When a profile is changed, these changes will be not applied to the ConnectionProfileManager immediately.
+        /// When you call this function, your changes affect the ConnectionProfileManager and the existing profile is updated.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="profile">The connection profile object</param>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.profile</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static void UpdateProfile(ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "UpdateProfile");
+            ConnectionInternalManager.Instance.UpdateProfile(profile);
+        }
+
+        /// <summary>
+        /// Gets the name of the default profile.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Connection profile object.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation</exception>
+        public static ConnectionProfile GetCurrentProfile()
+        {
+            Log.Debug(Globals.LogTag, "GetCurrentProfile");
+            return ConnectionInternalManager.Instance.GetCurrentProfile();
+        }
+
+        /// <summary>
+        /// Gets the default profile which provides the given cellular service.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The cellular service type</param>
+        /// <returns>Connection profile object.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection instance is invalid or when method failed due to invalid operation</exception>
+        public static ConnectionProfile GetDefaultCellularProfile(CellularServiceType type)
+        {
+            Log.Debug(Globals.LogTag, "GetDefaultCurrentProfile");
+            return ConnectionInternalManager.Instance.GetDefaultCellularProfile(type);
+        }
+
+        /// <summary>
+        /// Sets the default profile which provides the given cellular service.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">The cellular service type</param>
+        /// <param name="profile">The connection profile object</param>
+        /// <returns>A task indicates whether the SetDefaultCellularProfile method is done successfully or not.</returns>
+        /// <privilege>http://tizen.org/privilege/network.get</privilege>
+        /// <privilege>http://tizen.org/privilege/network.profile</privilege>
+        /// <feature>http://tizen.org/feature/network.telephony</feature>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <feature>http://tizen.org/feature/network.tethering.bluetooth</feature>
+        /// <feature>http://tizen.org/feature/network.ethernet</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.UnauthorizedAccessException">Thrown when permission is denied.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when value is null.</exception>
+        /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when connection or profile instance is invalid or when method failed due to invalid operation</exception>
+        public static Task SetDefaultCellularProfile(CellularServiceType type, ConnectionProfile profile)
+        {
+            Log.Debug(Globals.LogTag, "SetDefaultCellularProfile");
+            return ConnectionInternalManager.Instance.SetDefaultCellularProfile(type, profile);
+        }
+    }
+
+    /// <summary>
+    /// An extended EventArgs class which contains the state of changed connection profile.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ConnectionProfileStateEventArgs : EventArgs
+    {
+        private  ConnectionProfileState State;
+
+        internal ConnectionProfileStateEventArgs(ConnectionProfileState state)
+        {
+            State = state;
+        }
+
+        /// <summary>
+        /// The connection profile state.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>State of the connection profile.</value>
+        public ConnectionProfileState ConnectionProfileState
+        {
+            get
+            {
+                return State;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs
new file mode 100755 (executable)
index 0000000..6c206ff
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Tizen.Internals.Errors;
+
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// Enumeration for connection type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ConnectionType
+    {
+        Disconnected = 0,  /**< Disconnected */
+        WiFi = 1,          /**< Wi-Fi type */
+        Cellular = 2,      /**< Cellular type */
+        Ethernet = 3,      /**< Ethernet type */
+        Bluetooth = 4,     /**< Bluetooth type */
+        NetProxy = 5       /**< Proxy type for internet connection */
+    }
+
+    /// <summary>
+    /// Enumeration for address family.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum AddressFamily
+    {
+        IPv4 = 0,   /**< IPv4 Address */
+        IPv6 = 1    /**< IPv6 Address */
+    }
+
+    /// <summary>
+    /// Enumeration for cellular network state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum CellularState
+    {
+        OutOfService = 0,  /**< Out of service */
+        FlightMode = 1,    /**< Flight mode */
+        RoamingOff = 2,    /**< Roaming is turned off */
+        CallOnlyAvailable = 3,  /**< Call is only available */
+        Available = 4,     /**< Available but not connected yet */
+        Connected = 5,     /**< Connected */
+    }
+
+    /// <summary>
+    /// Enumeration for connection state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ConnectionState
+    {
+        Deactivated = 0,   /**< Deactivated */
+        Disconnected = 1,  /**< Disconnected */
+        Connected = 2,     /**< Connected */
+    }
+
+    /// <summary>
+    /// This enumeration defines the attached or detached state of ethernet cable.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum EthernetCableState
+    {
+        Detached = 0,  /**< Ethernet cable is detached */
+        Attached = 1,  /**< Ethernet cable is attached */
+    }
+
+    /// <summary>
+    /// Enumeration for statistics type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum StatisticsType
+    {
+        LastReceivedData = 0,  /**< Last received data */
+        LastSentData = 1,  /**< Last sent data */
+        TotalReceivedData = 2,  /**< Total received data */
+        TotalSentData = 3,  /**< Total sent data */
+    }
+
+    /// <summary>
+    /// Enumeration for network connection type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ConnectionProfileType
+    {
+        Cellular = 0,  /**< Cellular type */
+        WiFi = 1,      /**< Wi-Fi type */
+        Ethernet = 2,  /**< Ethernet type */
+        Bt = 3,        /**< Bluetooth type */
+    }
+
+    /// <summary>
+    /// Enumeration for profile state type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ProfileState
+    {
+        Disconnected = 0,  /**< Disconnected state */
+        Association = 1,  /**< Association state */
+        Configuration = 2,  /**< Configuration state */
+        Connected = 3,  /**< Connected state */
+    }
+
+    /// <summary>
+    /// Enumeration for proxy method type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ProxyType
+    {
+        Direct = 0,  /**< Direct connection */
+        Auto = 1,    /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
+        Manual = 2,  /**< Manual configuration */
+    }
+
+    /// <summary>
+    /// Enumeration for IP configuration type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum IPConfigType
+    {
+        None = 0,  /**< Not defined */
+        Static = 1,  /**< Manual IP configuration */
+        Dynamic = 2,  /**< Config IP using DHCP client*/
+        Auto = 3,  /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
+        Fixed = 4,  /**< Indicates an IP address that can not be modified */
+    }
+
+    /// <summary>
+    /// Enumeration for cellular service type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum CellularServiceType
+    {
+        Unknown = 0,  /**< Unknown */
+        Internet = 1,  /**< Internet */
+        MMS = 2,  /**< MMS */
+        PrepaidInternet = 3,  /**< Prepaid internet */
+        PrepaidMMS = 4,  /**< Prepaid MMS */
+        Tethering = 5,  /**< Tethering */
+        Application = 6,  /**< Specific application */
+    }
+
+    /// <summary>
+    /// Enumeration for cellular pdn type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum CellularPdnType
+    {
+        Unknown = 0,  /**< Unknown */
+        IPv4 = 1,  /**< IPv4 */
+        IPv6 = 2,  /**< IPv6 */
+        IPv4_IPv6 = 3,  /**< Both IPv4 and IPv6 */
+    }
+
+    /// <summary>
+    /// Enumeration for DNS configuration type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum DnsConfigType
+    {
+        None = 0,  /**< Not defined */
+        Static = 1,  /**< Manual DNS configuration */
+        Dynamic = 2,  /**< Config DNS using DHCP client */
+    }
+
+    static internal class ConnectionErrorValue
+    {
+        internal const int Base = -0x01C10000;
+    }
+
+
+    /// <summary>
+    /// Enumeration for connection errors.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    // To do : have to assign valid error code
+    public enum ConnectionError
+    {
+        None = ErrorCode.None,         /**< Successful */
+        InvalidParameter = ErrorCode.InvalidParameter, /**< Invalid parameter */
+        OutOfMemoryError = ErrorCode.OutOfMemory, /**< Out of memory error */
+        InvalidOperation = ErrorCode.InvalidOperation, /**< Invalid Operation */
+        AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported, /**< Address family not supported */
+        OperationFailed = ConnectionErrorValue.Base | 0x0401,  /**< Operation failed */
+        EndOfIteration = ConnectionErrorValue.Base | 0x0402,   /**< End of iteration */
+        NoConnection = ConnectionErrorValue.Base | 0x0403,     /**< There is no connection */
+        NowInProgress = ErrorCode.NowInProgress,    /** Now in progress */
+        AlreadyExists = ConnectionErrorValue.Base | 0x0404, /**< Already exists */
+        OperationAborted = ConnectionErrorValue.Base | 0x0405, /**< Operation is aborted */
+        DhcpFailed = ConnectionErrorValue.Base | 0x0406, /**< DHCP failed  */
+        InvalidKey = ConnectionErrorValue.Base | 0x0407, /**< Invalid key  */
+        NoReply = ConnectionErrorValue.Base | 0x0408, /**< No reply */
+        PermissionDenied = ErrorCode.PermissionDenied, /**< Permission denied */
+        NotSupported = ErrorCode.NotSupported    /**< Not Supported */
+    }
+
+    /// <summary>
+    /// Enumeration for profile list type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ProfileListType
+    {
+        Registered = 0,  /**< The iterator of the registered profile  */
+        Connected = 1,   /**< The iterator of the connected profile  */
+        Default = 2,      /**< The iterator of the default profile  */
+    }
+
+    /// <summary>
+    /// Enumeration for security type of Wi-Fi.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum WiFiSecurityType
+    {
+        None  =  0,       /**< Security disabled */
+        Wep = 1,          /**< WEP */
+        WpaPsk = 2,    /**< WPA-PSK */
+        Wpa2Psk = 3,  /**< WPA2-PSK */
+        Eap = 4,            /**< EAP */
+    }
+
+    /// <summary>
+    /// Enumeration for encryption modes.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum WiFiEncryptionType
+    {
+        None = 0,  /**< Encryption disabled */
+        Wep = 1,  /**< WEP */
+        Tkip = 2,  /**< TKIP */
+        Aes = 3,  /**< AES */
+        TkipAesMixed = 4,  /**< TKIP and AES are both supported */
+    }
+
+    /// <summary>
+    /// Enumeration for connection profile state.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ConnectionProfileState
+    {
+        Disconnected = 0,  /**< Disconnected state */
+        Association = 1,  /**< Association state */
+        Configuration = 2,  /**< Configuration state */
+        Connected = 3,   /**< Connected state */
+    }
+
+    /// <summary>
+    /// Enumeration for cellular authentication type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum CellularAuthType
+    {
+        None = 0,  /**< No authentication */
+        Pap = 1,  /**< PAP authentication */
+        Chap = 2,  /**< CHAP authentication */
+    }
+
+    public enum AddressInformationType
+    {
+        Connection = 0,
+        WiFi = 1
+    }
+
+    static internal class Globals
+    {
+        internal const string LogTag = "Tizen.Network.Connection";
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs
new file mode 100755 (executable)
index 0000000..5185186
--- /dev/null
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This interface provides properties to manage address information of the connection.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public interface IAddressInformation
+    {
+        /// <summary>
+        /// The DNS address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>First DNS address of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        System.Net.IPAddress Dns1 { get; set; }
+
+        /// <summary>
+        /// The DNS address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Second DNS address of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        System.Net.IPAddress Dns2 { get; set; }
+
+        /// <summary>
+        /// The gateway address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Gateway address of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        System.Net.IPAddress Gateway { get; set; }
+
+        /// <summary>
+        /// The subnet mask address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Subnet mask of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        System.Net.IPAddress SubnetMask { get; set; }
+
+        /// <summary>
+        /// The IP address.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>IP address of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        System.Net.IPAddress IP { get; set; }
+
+        /// <summary>
+        /// The type of IP config.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>IP config type of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        IPConfigType IPConfigType { get; set; }
+
+        /// <summary>
+        /// The prefix length.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Prefix length of the connection.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        int PrefixLength { get; set; }
+
+        /// <summary>
+        /// The DNS config type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Config type of the DNS.</value>
+        /// <exception cref="System.NotSupportedException">Thrown during set when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown during set when value is invalid parameter.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown during set when profile instance is invalid or when method failed due to invalid operation.</exception>
+        DnsConfigType DnsConfigType { get; set; }
+
+        /// <summary>
+        /// The DHCP server address. It is only supported for IPV4 address family.
+        /// </summary>
+        /// <value>Server address of the DHCP.</value>
+        System.Net.IPAddress DhcpServerAddress { get; }
+    }
+
+    internal class ConnectionAddressInformation : IAddressInformation
+    {
+        private IntPtr _profileHandle;
+        private AddressFamily _family;
+
+        internal ConnectionAddressInformation(IntPtr handle, AddressFamily family)
+        {
+            _profileHandle = handle;
+            _family = family;
+        }
+
+        public System.Net.IPAddress Dns1
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetDnsAddress(_profileHandle, 1, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get dns1 address, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                if (result == null)
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                return System.Net.IPAddress.Parse(result);
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetDnsAddress(_profileHandle, 1, (int)_family, value.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set dns1 address, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+        public System.Net.IPAddress Dns2
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetDnsAddress(_profileHandle, 2, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get dns2 address, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                if (result == null)
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                return System.Net.IPAddress.Parse(result);
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetDnsAddress(_profileHandle, 2, (int)_family, value.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set dns2 address, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        public System.Net.IPAddress Gateway
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetGatewayAddress(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get gateway, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                if (result == null)
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                return System.Net.IPAddress.Parse(result);
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetGatewayAddress(_profileHandle, (int)_family, value.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set gateway, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+
+        public System.Net.IPAddress SubnetMask
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetSubnetMask(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get subnet mask, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                if (result == null)
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                return System.Net.IPAddress.Parse(result);
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetSubnetMask(_profileHandle, (int)_family, value.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set subnet mask, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+
+        public System.Net.IPAddress IP
+        {
+            get
+            {
+                IntPtr Value;
+                int ret = Interop.ConnectionProfile.GetIPAddress(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get ip, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(Value);
+                Interop.Libc.Free(Value);
+                if (result == null)
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                return System.Net.IPAddress.Parse(result);
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetIPAddress(_profileHandle, (int)_family, value.ToString());
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set ip, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        public IPConfigType IPConfigType
+        {
+            get
+            {
+                int Value;
+                int ret = Interop.ConnectionProfile.GetIPConfigType(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get ip config type, " + (ConnectionError)ret);
+                }
+                return (IPConfigType)Value;
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetIPConfigType(_profileHandle, (int)_family, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set ip config type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        public int PrefixLength
+        {
+            get
+            {
+                int Value;
+                int ret = Interop.ConnectionProfile.GetPrefixLength(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get prefix length, " + (ConnectionError)ret);
+                }
+                return Value;
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetPrefixLength(_profileHandle, (int)_family, value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set prefix length, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        public DnsConfigType DnsConfigType
+        {
+            get
+            {
+                int Value;
+                int ret = Interop.ConnectionProfile.GetDnsConfigType(_profileHandle, (int)_family, out Value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get DNS config type, " + (ConnectionError)ret);
+                }
+                return (DnsConfigType)Value;
+            }
+
+            set
+            {
+                int ret = Interop.ConnectionProfile.SetDnsConfigType(_profileHandle, (int)_family, (int)value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+        }
+
+        public System.Net.IPAddress DhcpServerAddress
+        {
+            get
+            {
+                string dhcpServer;
+                int ret = Interop.ConnectionProfile.GetDhcpServerAddress(_profileHandle, _family, out dhcpServer);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get the DHCP server address, " + (ConnectionError)ret);
+                }
+
+                if (dhcpServer == null)
+                {
+                    return System.Net.IPAddress.Parse("0.0.0.0");
+                }
+
+                else
+                {
+                    return System.Net.IPAddress.Parse(dhcpServer);
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs
new file mode 100755 (executable)
index 0000000..8ac6234
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.Connection
+{
+    /// <summary>
+    /// This Class is WiFiProfile. It provides functions to manage the WiFi profile.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class WiFiProfile : ConnectionProfile
+    {
+        internal WiFiProfile(IntPtr Handle) : base(Handle)
+        {
+        }
+
+        ~WiFiProfile()
+        {
+        }
+
+        /// <summary>
+        /// The ESSID (Extended Service Set Identifier).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>ESSID of the WiFi.</value>
+        public string Essid
+        {
+            get
+            {
+                IntPtr value;
+                int ret = Interop.ConnectionWiFiProfile.GetEssid(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to create profile handle, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(value);
+                Interop.Libc.Free(value);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// The BSSID (Basic Service Set Identifier).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>BSSID of the WiFi.</value>
+        public string Bssid
+        {
+            get
+            {
+                IntPtr value;
+                int ret = Interop.ConnectionWiFiProfile.GetBssid(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get bssid, " + (ConnectionError)ret);
+                }
+                string result = Marshal.PtrToStringAnsi(value);
+                Interop.Libc.Free(value);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// The RSSI.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>RSSI of the WiFi.</value>
+        public int Rssi
+        {
+            get
+            {
+                int value;
+                int ret = Interop.ConnectionWiFiProfile.GetRssi(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get rssi, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// The frequency (MHz).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Frequency of the WiFi.</value>
+        public int Frequency
+        {
+            get
+            {
+                int value;
+                int ret = Interop.ConnectionWiFiProfile.GetFrequency(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get frequency, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// The max speed (Mbps).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Maximum speed of the WiFi.</value>
+        public int MaxSpeed
+        {
+            get
+            {
+                int value;
+                int ret = Interop.ConnectionWiFiProfile.GetMaxSpeed(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get max speed, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// The security type of WiFi.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Security type of the WiFi.</value>
+        public WiFiSecurityType SecurityType
+        {
+            get
+            {
+                int value;
+                int ret = Interop.ConnectionWiFiProfile.GetSecurityType(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get security type, " + (ConnectionError)ret);
+                }
+                return (WiFiSecurityType)value;
+            }
+        }
+
+        /// <summary>
+        /// The encryption type of WiFi.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Encryption mode of the WiFi.</value>
+        public WiFiEncryptionType EncryptionType
+        {
+            get
+            {
+                int value;
+                int ret = Interop.ConnectionWiFiProfile.GetEncryptionType(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get encryption type, " + (ConnectionError)ret);
+                }
+                return (WiFiEncryptionType)value;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether passphrase is required.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>True if a passphrase is required, otherwise false.</value>
+        /// <remarks>This property is not valid if <c>WiFiSecurityType</c> is <c>Eap</c>.</remarks>
+        public bool PassphraseRequired
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.ConnectionWiFiProfile.IsRequiredPassphrase(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get PassphraseRequired, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the WPS (Wi-Fi Protected Setup) is supported.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>True if WPS is supported, otherwise false.</value>
+        public bool WpsSupported
+        {
+            get
+            {
+                bool value;
+                int ret = Interop.ConnectionWiFiProfile.IsSupportedWps(ProfileHandle, out value);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to get IsSupportedWps, " + (ConnectionError)ret);
+                }
+                return value;
+            }
+        }
+
+        /// <summary>
+        /// Sets the passphrase of the Wi-Fi WPA.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="passphrase">The passphrase of Wi-Fi security</param>
+        /// <feature>http://tizen.org/feature/network.wifi</feature>
+        /// <exception cref="System.NotSupportedException">Thrown when feature is not supported.</exception>
+        /// <exception cref="System.ArgumentException">Thrown when value is invalid parameter.</exception>
+        /// <exception cref="System.ArgumentNullException">Thrown when passphrase is null.</exception>
+        /// <exception cref="System.InvalidOperationException">Thrown when profile instance is invalid or when method failed due to invalid operation.</exception>
+        /// <exception cref="System.ObjectDisposedException">Thrown when operation is performed on a disposed object.</exception>
+        public void SetPassphrase(string passphrase)
+        {
+            CheckDisposed();
+            if (passphrase != null)
+            {
+                int ret = Interop.ConnectionWiFiProfile.SetPassphrase(ProfileHandle, passphrase);
+                if ((ConnectionError)ret != ConnectionError.None)
+                {
+                    Log.Error(Globals.LogTag, "It failed to set passphrase, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
+            }
+
+            else
+            {
+                throw new ArgumentNullException("Value of passphrase is null");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs
new file mode 100755 (executable)
index 0000000..f1d4ace
--- /dev/null
@@ -0,0 +1,244 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class IoTConnectivity
+    {
+        internal static partial class Client
+        {
+            internal static partial class DeviceInformation
+            {
+                internal delegate bool DeviceInformationCallback(IntPtr deviceInfoHandle, int result, IntPtr userData);
+
+                internal enum Property
+                {
+                    Name = 0,
+                    SpecVersion,
+                    Id,
+                    DataModelVersion,
+                }
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_device_info")]
+                internal static extern int Find(string hostAddress, int connectivityType, IntPtr query, DeviceInformationCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_device_info_get_property")]
+                internal static extern int GetProperty(IntPtr deviceInfoHandle, int property, out IntPtr value);
+            }
+
+            internal static partial class PlatformInformation
+            {
+                internal delegate bool PlatformInformationCallback(IntPtr platformInfoHandle, int result, IntPtr userData);
+
+                internal enum Propery
+                {
+                    Id = 0,
+                    MfgName,
+                    MfgUrl,
+                    ModelNumber,
+                    DateOfMfg,
+                    PlatformVer,
+                    OsVer,
+                    HardwareVer,
+                    FirmwareVer,
+                    SupportUrl,
+                    SystemTime
+                }
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_platform_info")]
+                internal static extern int Find(string hostAddress, int connectivityType, IntPtr query, PlatformInformationCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_platform_info_get_property")]
+                internal static extern int GetProperty(IntPtr platformInfoHandle, int property, out IntPtr value);
+            }
+
+            internal static partial class RemoteResource
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void ResponseCallback(IntPtr resource, int err, int requestType, IntPtr response, IntPtr userData);
+
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void ObserveCallback(IntPtr resource, int err, int sequenceNumber, IntPtr response, IntPtr userData);
+
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void CachedRepresentationChangedCallback(IntPtr resource, IntPtr representation, IntPtr userData);
+
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void StateChangedCallback(IntPtr resource, int state, IntPtr userData);
+
+                internal enum ConnectivityType
+                {
+                    None = -1,
+                    All,
+                    Ip,
+                    Ipv4,
+                    Ipv6
+                }
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_create")]
+                internal static extern int Create(string hostAddress, int connectivityType, string uriPath, int properties, IntPtr resourceTypes, IntPtr resourceInterfaces, out IntPtr remoteResource);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_destroy")]
+                internal static extern void Destroy(IntPtr resource);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_clone")]
+                internal static extern int Clone(IntPtr src, out IntPtr dest);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_observe_register")]
+                internal static extern int RegisterObserve(IntPtr resource, int observePolicy, IntPtr query, ObserveCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_observe_deregister")]
+                internal static extern int DeregisterObserve(IntPtr resource);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get")]
+                internal static extern int Get(IntPtr resource, IntPtr query, ResponseCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_put")]
+                internal static extern int Put(IntPtr resource, IntPtr repr, IntPtr query, ResponseCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_post")]
+                internal static extern int Post(IntPtr resource, IntPtr repr, IntPtr query, ResponseCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_delete")]
+                internal static extern int Delete(IntPtr resource, ResponseCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_start_caching")]
+                internal static extern int StartCaching(IntPtr resource, CachedRepresentationChangedCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_stop_caching")]
+                internal static extern int StopCaching(IntPtr resource);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_start_monitoring")]
+                internal static extern int StartMonitoring(IntPtr resource, StateChangedCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_stop_monitoring")]
+                internal static extern int StopMonitoring(IntPtr resource);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_uri_path")]
+                internal static extern int GetUriPath(IntPtr resource, out IntPtr uriPath);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_connectivity_type")]
+                internal static extern int GetConnectivityType(IntPtr resource, out int connectivityType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_host_address")]
+                internal static extern int GetHostAddress(IntPtr resource, out IntPtr hostAddress);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_device_id")]
+                internal static extern int GetDeviceId(IntPtr resource, out IntPtr deviceId);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_types")]
+                internal static extern int GetTypes(IntPtr resource, out IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_interfaces")]
+                internal static extern int GetInterfaces(IntPtr resource, out IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_policies")]
+                internal static extern int GetPolicies(IntPtr resource, out int properties);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_options")]
+                internal static extern int GetOptions(IntPtr resource, out IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_set_options")]
+                internal static extern int SetOptions(IntPtr resource, IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_cached_representation")]
+                internal static extern int GetCachedRepresentation(IntPtr resource, out IntPtr representation);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_checking_interval")]
+                internal static extern int GetTimeInterval(IntPtr resource, out int timeInterval);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_set_checking_interval")]
+                internal static extern int SetTimeInterval(IntPtr resource, int timeInterval);
+            }
+
+            internal static partial class IoTCon
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_initialize")]
+                internal static extern int Initialize(string filePath);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_deinitialize")]
+                internal static extern void Deinitialize();
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_get_timeout")]
+                internal static extern int GetTimeout(out int timeoutSeconds);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_set_timeout")]
+                internal static extern int SetTimeout(int timeoutSeconds);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_get_interval")]
+                internal static extern int GetPollingInterval(out int interval);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_set_interval")]
+                internal static extern int SetPollingInterval(int interval);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_invoke")]
+                internal static extern int InvokePolling();
+            }
+
+            internal static partial class ResourceFinder
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate bool FoundResourceCallback(IntPtr remoteResourceHandle, int result, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_resource")]
+                internal static extern int AddResourceFoundCb(string hostAddress, int connectivityType, IntPtr query, FoundResourceCallback cb, IntPtr userData);
+            }
+
+            internal static partial class Presence
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void PresenceCallback(IntPtr presenceResponseHandle, int err, IntPtr response, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_add_presence_cb")]
+                internal static extern int AddPresenceCb(string hostAddress, int connectivityType, string resourceType, PresenceCallback cb, IntPtr userData, out IntPtr presenceHandle);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remove_presence_cb")]
+                internal static extern int RemovePresenceCb(IntPtr presenceHandle);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_host_address")]
+                internal static extern int GetHostAddress(IntPtr presence, out IntPtr hostAddress);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_connectivity_type")]
+                internal static extern int GetConnectivityType(IntPtr presence, out int connectivityType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_resource_type")]
+                internal static extern int GetResourceType(IntPtr presence, out IntPtr resourceType);
+            }
+
+            internal static partial class PresenceResponse
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_result")]
+                internal static extern int GetResult(IntPtr response, out int result);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_trigger")]
+                internal static extern int GetTrigger(IntPtr response, out int trigger);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_host_address")]
+                internal static extern int GetHostAddress(IntPtr response, out IntPtr hostAddress);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_connectivity_type")]
+                internal static extern int GetConnectivityType(IntPtr response, out int connectivityType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_resource_type")]
+                internal static extern int GetResourceType(IntPtr response, out IntPtr resourceType);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs
new file mode 100755 (executable)
index 0000000..9b4fa48
--- /dev/null
@@ -0,0 +1,368 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class IoTConnectivity
+    {
+        internal static partial class Common
+        {
+            internal enum DataType
+            {
+                None = 0,
+                Int,
+                Bool,
+                Double,
+                String,
+                ByteStr,
+                Null,
+                List,
+                Attributes
+            }
+
+            internal static partial class ResourceTypes
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate bool ForeachCallback(string type, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_create")]
+                internal static extern int Create(out IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_destroy")]
+                internal static extern void Destroy(IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_add")]
+                internal static extern int Add(IntPtr types, string type);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_remove")]
+                internal static extern int Remove(IntPtr types, string type);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_foreach")]
+                internal static extern int Foreach(IntPtr types, ForeachCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_clone")]
+                internal static extern int Clone(IntPtr src, out IntPtr dest);
+            }
+
+            internal static partial class ResourceInterfaces
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate bool ForeachCallback(string iface, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_create")]
+                internal static extern int Create(out IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_destroy")]
+                internal static extern void Destroy(IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_add")]
+                internal static extern int Add(IntPtr ifaces, string iface);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_remove")]
+                internal static extern int Remove(IntPtr ifaces, string iface);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_foreach")]
+                internal static extern int Foreach(IntPtr ifaces, ForeachCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_clone")]
+                internal static extern int Clone(IntPtr src, out IntPtr dest);
+            }
+
+            internal static partial class Attributes
+            {
+                internal delegate bool AttributesCallback(IntPtr attributes, string key, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_create")]
+                internal static extern int Create(out IntPtr attributes);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_destroy")]
+                internal static extern void Destroy(IntPtr attributes);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_clone")]
+                internal static extern int Clone(IntPtr attributes, out IntPtr attributes_clone);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_int")]
+                internal static extern int AddInt(IntPtr attributes, string key, int val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_bool")]
+                internal static extern int AddBool(IntPtr attributes, string key, bool val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_double")]
+                internal static extern int AddDouble(IntPtr attributes, string key, double val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_str")]
+                internal static extern int AddStr(IntPtr attributes, string key, string val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_byte_str")]
+                internal static extern int AddByteStr(IntPtr attributes, string key, byte[] val, int len);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_list")]
+                internal static extern int AddList(IntPtr attributes, string key, IntPtr list);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_attributes")]
+                internal static extern int AddAttributes(IntPtr dest, string key, IntPtr src);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_null")]
+                internal static extern int AddNull(IntPtr attributes, string key);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_int")]
+                internal static extern int GetInt(IntPtr attributes, string key, out int val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_bool")]
+                internal static extern int GetBool(IntPtr attributes, string key, out bool val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_double")]
+                internal static extern int GetDouble(IntPtr attributes, string key, out double val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_str")]
+                internal static extern int GetStr(IntPtr attributes, string key, out IntPtr val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_byte_str")]
+                internal static extern int GetByteStr(IntPtr attributes, string key, out IntPtr value, out int size);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_list")]
+                internal static extern int GetList(IntPtr attributes, string key, out IntPtr list);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_attributes")]
+                internal static extern int GetAttributes(IntPtr src, string key, out IntPtr dest);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_is_null")]
+                internal static extern int IsNull(IntPtr attributes, string key, out bool isNull);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_remove")]
+                internal static extern int Remove(IntPtr attributes, string key);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_type")]
+                internal static extern int GetType(IntPtr attributes, string key, out DataType type);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_foreach")]
+                internal static extern int Foreach(IntPtr attributes, AttributesCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_keys_count")]
+                internal static extern int GetKeysCount(IntPtr attributes, out int count);
+            }
+
+            internal static partial class Query
+            {
+                internal delegate bool QueryCallback(string key, string value, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_create")]
+                internal static extern int Create(out IntPtr query);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_destroy")]
+                internal static extern void Destroy(IntPtr query);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_get_resource_type")]
+                internal static extern int GetResourceType(IntPtr query, out IntPtr resourceType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_get_interface")]
+                internal static extern int GetInterface(IntPtr query, out IntPtr resourceInterface);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_set_resource_type")]
+                internal static extern int SetResourceType(IntPtr query, string resourceType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_set_interface")]
+                internal static extern int SetInterface(IntPtr query, string resourceInterface);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_add")]
+                internal static extern int Add(IntPtr query, string key, string value);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_remove")]
+                internal static extern int Remove(IntPtr query, string key);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_lookup")]
+                internal static extern int Lookup(IntPtr query, string key, out IntPtr data);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_foreach")]
+                internal static extern int Foreach(IntPtr query, QueryCallback cb, IntPtr userData);
+            }
+
+            internal static partial class Representation
+            {
+                internal delegate bool RepresentationChildrenCallback(IntPtr child, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_create")]
+                internal static extern int Create(out IntPtr repr);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_destroy")]
+                internal static extern void Destroy(IntPtr repr);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_clone")]
+                internal static extern int Clone(IntPtr src, out IntPtr dest);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_uri_path")]
+                internal static extern int SetUriPath(IntPtr repr, string uriPath);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_uri_path")]
+                internal static extern int GetUriPath(IntPtr repr, out IntPtr uriPath);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_resource_types")]
+                internal static extern int SetResourceTypes(IntPtr repr, IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_resource_types")]
+                internal static extern int GetResourceTypes(IntPtr repr, out IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_resource_interfaces")]
+                internal static extern int SetResourceInterfaces(IntPtr repr, IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_resource_interfaces")]
+                internal static extern int GetResourceInterfaces(IntPtr repr, out IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_attributes")]
+                internal static extern int SetAttributes(IntPtr repr, IntPtr attribs);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_attributes")]
+                internal static extern int GetAttributes(IntPtr repr, out IntPtr attribs);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_add_child")]
+                internal static extern int AddChild(IntPtr parent, IntPtr child);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_remove_child")]
+                internal static extern int RemoveChild(IntPtr parent, IntPtr child);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_foreach_children")]
+                internal static extern int ForeachChildren(IntPtr parent, RepresentationChildrenCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_children_count")]
+                internal static extern int GetChildrenCount(IntPtr parent, out int count);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_nth_child")]
+                internal static extern int GetNthChild(IntPtr parent, int pos, out IntPtr child);
+            }
+
+            internal static partial class Options
+            {
+                internal delegate bool OptionsCallback(ushort id, string data, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_create")]
+                internal static extern int Create(out IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_destroy")]
+                internal static extern void Destroy(IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_add")]
+                internal static extern int Add(IntPtr options, ushort id, string data);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_remove")]
+                internal static extern int Remove(IntPtr options, ushort id);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_lookup")]
+                internal static extern int Lookup(IntPtr options, ushort id, out IntPtr data);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_foreach")]
+                internal static extern int ForEach(IntPtr options, OptionsCallback cb, IntPtr userData);
+            }
+
+            internal static partial class List
+            {
+                internal delegate bool IntCallback(int pos, int value, IntPtr userData);
+
+                internal delegate bool BoolCallback(int pos, bool value, IntPtr userData);
+
+                internal delegate bool DoubleCallback(int pos, double value, IntPtr userData);
+
+                internal delegate bool ByteStrCallback(int pos, byte[] value, int len, IntPtr userData);
+
+                internal delegate bool StrCallback(int pos, string value, IntPtr userData);
+
+                internal delegate bool ListCallback(int pos, IntPtr value, IntPtr userData);
+
+                internal delegate bool AttribsCallback(int pos, IntPtr value, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_create")]
+                internal static extern int Create(DataType type, out IntPtr list);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_destroy")]
+                internal static extern void Destroy(IntPtr list);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_int")]
+                internal static extern int AddInt(IntPtr list, int val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_bool")]
+                internal static extern int AddBool(IntPtr list, bool val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_double")]
+                internal static extern int AddDouble(IntPtr list, double val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_str")]
+                internal static extern int AddStr(IntPtr list, string val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_byte_str")]
+                internal static extern int AddByteStr(IntPtr list, byte[] val, int len, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_list")]
+                internal static extern int AddList(IntPtr list, IntPtr val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_attributes")]
+                internal static extern int AddAttributes(IntPtr list, IntPtr val, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_int")]
+                internal static extern int GetNthInt(IntPtr list, int pos, out int val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_bool")]
+                internal static extern int GetNthBool(IntPtr list, int pos, out bool val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_double")]
+                internal static extern int GetNthDouble(IntPtr list, int pos, out double val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_str")]
+                internal static extern int GetNthStr(IntPtr list, int pos, out IntPtr val);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_byte_str")]
+                internal static extern int GetNthByteStr(IntPtr list, int pos, out IntPtr val, out int len);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_list")]
+                internal static extern int GetNthList(IntPtr src, int pos, out IntPtr dest);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_attributes")]
+                internal static extern int GetNthAttributes(IntPtr list, int pos, out IntPtr attribs);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_remove_nth")]
+                internal static extern int RemoveNth(IntPtr list, int pos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_type")]
+                internal static extern int GetType(IntPtr list, out int type);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_length")]
+                internal static extern int GetLength(IntPtr list, out int length);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_int")]
+                internal static extern int ForeachInt(IntPtr list, IntCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_bool")]
+                internal static extern int ForeachBool(IntPtr list, BoolCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_double")]
+                internal static extern int ForeachDouble(IntPtr list, DoubleCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_byte_str")]
+                internal static extern int ForeachByteStr(IntPtr list, ByteStrCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_str")]
+                internal static extern int ForeachStr(IntPtr list, StrCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_list")]
+                internal static extern int ForeachList(IntPtr list, ListCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_attributes")]
+                internal static extern int ForeachAttributes(IntPtr list, AttribsCallback cb, IntPtr userData);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs
new file mode 100755 (executable)
index 0000000..59b9355
--- /dev/null
@@ -0,0 +1,169 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class IoTConnectivity
+    {
+        internal static partial class Server
+        {
+            internal enum RequestType
+            {
+                Unknown = 0,
+                Get = 1,
+                Put = 2,
+                Post = 3,
+                Delete = 4,
+            }
+
+            internal static partial class IoTCon
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_start_presence")]
+                internal static extern int StartPresence(uint time);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_stop_presence")]
+                internal static extern int StopPresence();
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_set_device_name")]
+                internal static extern int SetDeviceName(string deviceName);
+            }
+
+            internal static partial class Resource
+            {
+                [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+                internal delegate void RequestHandlerCallback(IntPtr resource, IntPtr request, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_create")]
+                internal static extern int Create(string uriPath, IntPtr resTypes, IntPtr ifaces, int properties, RequestHandlerCallback cb, IntPtr userData, out IntPtr resourceHandle);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_destroy")]
+                internal static extern int Destroy(IntPtr resourceHandle);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_interface")]
+                internal static extern int BindInterface(IntPtr resource, string iface);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_type")]
+                internal static extern int BindType(IntPtr resourceHandle, string resourceType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_set_request_handler")]
+                internal static extern int SetRequestHandler(IntPtr resource, RequestHandlerCallback cb, IntPtr userData);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_child_resource")]
+                internal static extern int BindChildResource(IntPtr parent, IntPtr child);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_unbind_child_resource")]
+                internal static extern int UnbindChildResource(IntPtr parent, IntPtr child);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_notify")]
+                internal static extern int Notify(IntPtr resource, IntPtr repr, IntPtr observers, int qos);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_number_of_children")]
+                internal static extern int GetNumberOfChildren(IntPtr resource, out int number);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_nth_child")]
+                internal static extern int GetNthChild(IntPtr parent, int index, out IntPtr child);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_uri_path")]
+                internal static extern int GetUriPath(IntPtr resource, out IntPtr uriPath);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_types")]
+                internal static extern int GetTypes(IntPtr resource, out IntPtr types);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_interfaces")]
+                internal static extern int GetInterfaces(IntPtr resource, out IntPtr ifaces);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_properties")]
+                internal static extern int GetProperties(IntPtr resource, out int properties);
+            }
+
+            internal static partial class Request
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_host_address")]
+                internal static extern int GetHostAddress(IntPtr request, out IntPtr hostAddress);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_connectivity_type")]
+                internal static extern int GetConnectivityType(IntPtr request, out int connectivityType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_representation")]
+                internal static extern int GetRepresentation(IntPtr request, out IntPtr repr);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_request_type")]
+                internal static extern int GetRequestType(IntPtr request, out int type);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_options")]
+                internal static extern int GetOptions(IntPtr request, out IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_query")]
+                internal static extern int GetQuery(IntPtr request, out IntPtr query);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_type")]
+                internal static extern int GetObserveType(IntPtr request, out int observeType);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_id")]
+                internal static extern int GetObserveId(IntPtr request, out int observeId);
+            }
+
+            internal static partial class Response
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_create")]
+                internal static extern int Create(IntPtr request, out IntPtr response);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_destroy")]
+                internal static extern void Destroy(IntPtr resp);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_options")]
+                internal static extern int GetOptions(IntPtr resp, out IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_representation")]
+                internal static extern int GetRepresentation(IntPtr resp, out IntPtr repr);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_result")]
+                internal static extern int GetResult(IntPtr resp, out int result);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_result")]
+                internal static extern int SetResult(IntPtr resp, int result);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_representation")]
+                internal static extern int SetRepresentation(IntPtr resp, IntPtr repr);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_options")]
+                internal static extern int SetOptions(IntPtr resp, IntPtr options);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_send")]
+                internal static extern int Send(IntPtr resp);
+            }
+
+            internal static partial class Observers
+            {
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_create")]
+                internal static extern int Create(out IntPtr observers);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_destroy")]
+                internal static extern void Destroy(IntPtr observers);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_add")]
+                internal static extern int Add(IntPtr observers, int observeId);
+
+                [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_remove")]
+                internal static extern int Remove(IntPtr observers, int observeId);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..b918618
--- /dev/null
@@ -0,0 +1,25 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string IoTCon = "libiotcon.so.0";
+        public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj
new file mode 100644 (file)
index 0000000..008a597
--- /dev/null
@@ -0,0 +1,26 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.7</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Tizen IoTConnectivity API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Network.IoTConnectivity.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
+
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.snk b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.snk
new file mode 100644 (file)
index 0000000..2913977
Binary files /dev/null and b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.snk differ
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs
new file mode 100755 (executable)
index 0000000..6dd18a8
--- /dev/null
@@ -0,0 +1,860 @@
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents current attributes of a resource.
+    /// It provides API to manage attributes.
+    /// This class is accessed by using a constructor to create a new instance of this object.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Attributes : IDictionary<string, object>, IDisposable
+    {
+        internal IntPtr _resourceAttributesHandle = IntPtr.Zero;
+        private readonly IDictionary<string, object> _attributes = new Dictionary<string, object>();
+        private bool _disposed = false;
+
+        /// <summary>
+        /// The Attributes constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
+        /// </code>
+        public Attributes()
+        {
+            int ret = Interop.IoTConnectivity.Common.Attributes.Create(out _resourceAttributesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create attributes handle");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        internal Attributes(IntPtr attributesHandleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Common.Attributes.Clone(attributesHandleToClone, out _resourceAttributesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create attributes handle");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            SetAttributes(_resourceAttributesHandle);
+        }
+
+        /// <summary>
+        /// Destructor of the Attributes class.
+        /// </summary>
+        ~Attributes()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets the number of keys.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The number of keys.</value>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        /// attributes.Add("brightness", 50);
+        /// var count = attributes.Count;
+        /// Console.WriteLine("There are {0} keys in the attribute object", count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _attributes.Count;
+            }
+        }
+
+        /// <summary>
+        /// Represents whether an attribute is readonly.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Whether an attribute is readonly.</value>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// if (attributes.IsReadOnly)
+        ///     Console.WriteLine("Read only attribute");
+        /// </code>
+        public bool IsReadOnly
+        {
+            get
+            {
+                return _attributes.IsReadOnly;
+            }
+        }
+
+        /// <summary>
+        /// Contains all the attribute keys.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the attribute keys.</value>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// var keys = attributes.Keys;
+        /// Console.WriteLine("Attribute contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
+        /// </code>
+        public ICollection<string> Keys
+        {
+            get
+            {
+                return _attributes.Keys;
+            }
+        }
+
+        /// <summary>
+        /// Contains all the attribute values.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the attribute values.</value>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// var values = attributes.Values;
+        /// Console.WriteLine("Attribute contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
+        /// </code>
+        public ICollection<object> Values
+        {
+            get
+            {
+                return _attributes.Values;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the attribute with the specified key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The attribute with the specified key.</value>
+        /// <param name="key">The key of the attribute to get or set.</param>
+        /// <returns>The element with the specified key.</returns>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
+        /// attributes["state"] = "ON";
+        /// Console.WriteLine("Attribute value for key 'state' : {0}", attributes["state"]);
+        /// </code>
+        public object this[string key]
+        {
+            get
+            {
+                if (_attributes.ContainsKey(key))
+                    return _attributes[key];
+                else
+                    return null;
+            }
+
+            set
+            {
+                Add(key, value);
+            }
+        }
+
+        /// <summary>
+        /// Adds the attribute key and a value as a key value pair.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair to add.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
+        /// attributes.Add(new KeyValuePair<string, object> ("state", "ON"));
+        /// </code>
+        public void Add(KeyValuePair<string, object> item)
+        {
+            Add(item.Key, item.Value);
+        }
+
+        /// <summary>
+        /// Adds an attribute.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The key representing the attribute.</param>
+        /// <param name="value">The value representing the attribute.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
+        /// attributes.Add("brightness", 50);
+        /// </code>
+        public void Add(string key, object value)
+        {
+            int ret = 0;
+            if (value is int)
+            {
+                ret = Interop.IoTConnectivity.Common.Attributes.AddInt(_resourceAttributesHandle, key, (int)value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add int");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is Attributes)
+            {
+                Attributes attribs = (Attributes)value;
+                ret = Interop.IoTConnectivity.Common.Attributes.AddAttributes(_resourceAttributesHandle, key, attribs._resourceAttributesHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is string)
+            {
+                ret = Interop.IoTConnectivity.Common.Attributes.AddStr(_resourceAttributesHandle, key, (string)value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add string");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is double)
+            {
+                ret = Interop.IoTConnectivity.Common.Attributes.AddDouble(_resourceAttributesHandle, key, (double)value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add double");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is bool)
+            {
+                ret = Interop.IoTConnectivity.Common.Attributes.AddBool(_resourceAttributesHandle, key, (bool)value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is byte[])
+            {
+                byte[] val = value as byte[];
+                if (val == null)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get byte[] val");
+                    throw new ArgumentException("Invalid Parameter");
+                }
+                ret = Interop.IoTConnectivity.Common.Attributes.AddByteStr(_resourceAttributesHandle, key, val, val.Length);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else if (value is IEnumerable)
+            {
+                IntPtr listHandle = List.GetListHandle(value);
+                ret = Interop.IoTConnectivity.Common.Attributes.AddList(_resourceAttributesHandle, key, listHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add list");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Add");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+            _attributes.Add(key, value);
+        }
+
+        /// <summary>
+        /// Clears attributes collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
+        /// attributes.Add("brightness", 50);
+        /// attributes.Clear();
+        /// </code>
+        public void Clear()
+        {
+            foreach (string key in _attributes.Keys)
+            {
+                int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to clear attributes");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            _attributes.Clear();
+        }
+
+        /// <summary>
+        /// Checks whether the given key value pair exists in attributes collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The status key value pair.</param>
+        /// <returns>true if exists. Otherwise, false.</returns>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// if (attributes.Contains(new KeyValuePair<string, object> ("dim", 10))
+        ///     Console.WriteLine("Attribute conatins pair ('dim', 10)");
+        /// </code>
+        public bool Contains(KeyValuePair<string, object> item)
+        {
+            return _attributes.Contains(item);
+        }
+
+        /// <summary>
+        /// Checks whether the given key exists in attributes collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The status key to look for.</param>
+        /// <returns>true if exists. Otherwise, false.</returns>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// if (attributes.ContainsKey("dim"))
+        ///     Console.WriteLine("Attribute conatins key : dim");
+        /// </code>
+        public bool ContainsKey(string key)
+        {
+            return _attributes.ContainsKey(key);
+        }
+
+        /// <summary>
+        /// Copies the elements of the attributes to an array, starting at a particular index.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="array">The destination array.</param>
+        /// <param name="arrayIndex">The zero-based index in an array at which copying begins.</param>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// KeyValuePair<string, object>[] dest = new KeyValuePair<string, object>[attributes.Count];
+        /// int index = 0;
+        /// attributes.CopyTo(dest, index);
+        /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+        /// </code>
+        public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
+        {
+            _attributes.CopyTo(array, arrayIndex);
+        }
+
+        /// <summary>
+        /// Returns an enumerator that iterates through the collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns> An enumerator that can be used to iterate through the collection.</returns>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// foreach (KeyValuePair<string, object> pair in attributes)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
+        {
+            return _attributes.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Removes an attribute from collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The attributes element to remove.</param>
+        /// <returns>true if operation is successful, otherwise, false.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// if (attributes.Remove(new KeyValuePair<string, object>("dim", 10)))
+        ///     Console.WriteLine("Remove was successful");
+        /// </code>
+        public bool Remove(KeyValuePair<string, object> item)
+        {
+            return Remove(item.Key);
+        }
+
+        /// <summary>
+        /// Removes an attribute from collection using a key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The attributes element to remove.</param>
+        /// <returns>true if operation is successful, otherwise, false.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// if (attributes.Remove("state"))
+        ///     Console.WriteLine("Remove was successful");
+        /// </code>
+        public bool Remove(string key)
+        {
+            int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove attributes");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            bool isRemoved = _attributes.Remove(key);
+
+            return isRemoved;
+        }
+
+        /// <summary>
+        /// Gets the value associated with the specified key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The key whose value to get.</param>
+        /// <param name="value"> The value associated with the specified key.</param>
+        /// <returns> true if the attributes collection contains an element with the specified key, otherwise, false.</returns>
+        /// <code>
+        /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
+        ///     { "state", "ON" }
+        /// };
+        /// object value;
+        /// var isPresent = attributes.TryGetValue("state", out value);
+        /// if (isPresent)
+        ///     Console.WriteLine("value : {0}", value);
+        /// </code>
+        public bool TryGetValue(string key, out object value)
+        {
+            return _attributes.TryGetValue(key, out value);
+        }
+
+        /// <summary>
+        /// Returns an enumerator that iterates through the collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _attributes.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Common.Attributes.Destroy(_resourceAttributesHandle);
+            _disposed = true;
+        }
+
+        private void SetAttributes(IntPtr attributesHandle)
+        {
+            Interop.IoTConnectivity.Common.Attributes.AttributesCallback cb = (IntPtr attributes, string key, IntPtr userData) =>
+            {
+                Interop.IoTConnectivity.Common.DataType dataType;
+                int ret = Interop.IoTConnectivity.Common.Attributes.GetType(attributes, key, out dataType);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+
+                switch ((Interop.IoTConnectivity.Common.DataType)dataType)
+                {
+                    case Interop.IoTConnectivity.Common.DataType.Int:
+                        {
+                            int value;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetInt(attributes, key, out value);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            _attributes.Add(key, value);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.Bool:
+                        {
+                            bool value;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetBool(attributes, key, out value);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            _attributes.Add(key, value);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.Double:
+                        {
+                            double value;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetDouble(attributes, key, out value);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            _attributes.Add(key, value);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.String:
+                        {
+                            IntPtr value;
+                            string Str;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetStr(attributes, key, out value);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            Str = (value != IntPtr.Zero) ? Marshal.PtrToStringAnsi(value) : string.Empty;
+                            _attributes.Add(key, Str);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.ByteStr:
+                        {
+                            IntPtr byteStrPtr;
+                            int byteStrSize;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetByteStr(attributes, key, out byteStrPtr, out byteStrSize);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            byte[] byteStr = new byte[byteStrSize];
+                            Marshal.Copy(byteStrPtr, byteStr, 0, byteStrSize);
+                            _attributes.Add(key, byteStr);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.Null:
+                        {
+                            _attributes.Add(key, null);
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.List:
+                        {
+                            IntPtr listHandle;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetList(attributes, key, out listHandle);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            _attributes.Add(key, List.GetList(listHandle));
+                            break;
+                        }
+                    case Interop.IoTConnectivity.Common.DataType.Attributes:
+                        {
+                            IntPtr attribsHandle;
+                            ret = Interop.IoTConnectivity.Common.Attributes.GetAttributes(attributes, key, out attribsHandle);
+                            if (ret != (int)IoTConnectivityError.None)
+                            {
+                                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                                throw IoTConnectivityErrorFactory.GetException(ret);
+                            }
+                            _attributes.Add(key, new Attributes(attribsHandle));
+                            break;
+                        }
+                    default:
+                        break;
+                }
+
+                return true;
+            };
+
+            int res = Interop.IoTConnectivity.Common.Attributes.Foreach(attributesHandle, cb, IntPtr.Zero);
+            if (res != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove attributes");
+                throw IoTConnectivityErrorFactory.GetException(res);
+            }
+        }
+    }
+
+    internal static class List
+    {
+        internal static IntPtr GetListHandle(object list)
+        {
+            IntPtr listHandle = IntPtr.Zero;
+            int ret;
+            int pos = 0;
+
+            if (list is IEnumerable<IEnumerable>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.List, out listHandle);
+                pos = 0;
+                foreach (IEnumerable val in (IEnumerable<IEnumerable>)list)
+                {
+                    IntPtr childList = GetListHandle(val);
+                    ret = Interop.IoTConnectivity.Common.List.AddList(listHandle, childList, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes");
+                        Interop.IoTConnectivity.Common.List.Destroy(childList);
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<int>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Int, out listHandle);
+                pos = 0;
+                foreach (int val in (IEnumerable<int>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddInt(listHandle, val, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<string>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.String, out listHandle);
+                pos = 0;
+                foreach (string val in (IEnumerable<string>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddStr(listHandle, val, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add str");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<double>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Double, out listHandle);
+                pos = 0;
+                foreach (double val in (IEnumerable<double>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddDouble(listHandle, val, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add double");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<bool>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Bool, out listHandle);
+                pos = 0;
+                foreach (bool val in (IEnumerable<bool>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddBool(listHandle, val, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<Attributes>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Attributes, out listHandle);
+                pos = 0;
+                foreach (Attributes val in (IEnumerable<Attributes>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddAttributes(listHandle, val._resourceAttributesHandle, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (list is IEnumerable<byte[]>)
+            {
+                ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.ByteStr, out listHandle);
+                pos = 0;
+                foreach (byte[] val in (IEnumerable<byte[]>)list)
+                {
+                    ret = Interop.IoTConnectivity.Common.List.AddByteStr(listHandle, val, val.Length, pos++);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add byte[]");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to GetListHandle");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+            return listHandle;
+        }
+
+        internal static object GetList(IntPtr listHandle)
+        {
+            IList list = null;
+            int type;
+            int ret = Interop.IoTConnectivity.Common.List.GetType(listHandle, out type);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            switch ((Interop.IoTConnectivity.Common.DataType)type)
+            {
+                case Interop.IoTConnectivity.Common.DataType.Int:
+                    {
+                        list = new List<int>();
+                        Interop.IoTConnectivity.Common.List.IntCallback cb = (int pos, int value, IntPtr userData) =>
+                        {
+                            list.Add(value);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachInt(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.Bool:
+                    {
+                        list = new List<bool>();
+                        Interop.IoTConnectivity.Common.List.BoolCallback cb = (int pos, bool value, IntPtr userData) =>
+                        {
+                            list.Add(value);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachBool(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.Double:
+                    {
+                        list = new List<double>();
+                        Interop.IoTConnectivity.Common.List.DoubleCallback cb = (int pos, double value, IntPtr userData) =>
+                        {
+                            list.Add(value);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachDouble(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.String:
+                    {
+                        list = new List<string>();
+                        Interop.IoTConnectivity.Common.List.StrCallback cb = (int pos, string value, IntPtr userData) =>
+                        {
+                            list.Add(value);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachStr(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.Attributes:
+                    {
+                        list = new List<Attributes>();
+                        Interop.IoTConnectivity.Common.List.AttribsCallback cb = (int pos, IntPtr value, IntPtr userData) =>
+                        {
+                            list.Add(new Attributes(value));
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachAttributes(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.ByteStr:
+                    {
+                        list = new List<byte[]>();
+                        Interop.IoTConnectivity.Common.List.ByteStrCallback cb = (int pos, byte[] value, int len, IntPtr userData) =>
+                        {
+                            list.Add(value);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachByteStr(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                case Interop.IoTConnectivity.Common.DataType.List:
+                    {
+                        list = new List<List<object>>();
+                        Interop.IoTConnectivity.Common.List.ListCallback cb = (int pos, IntPtr value, IntPtr userData) =>
+                        {
+                            object childList = GetList(value);
+                            if (childList != null)
+                                list.Add(childList);
+                            return true;
+                        };
+                        ret = Interop.IoTConnectivity.Common.List.ForeachList(listHandle, cb, IntPtr.Zero);
+                        break;
+                    }
+                default:
+                    break;
+            }
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            return list;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs
new file mode 100755 (executable)
index 0000000..7ca278e
--- /dev/null
@@ -0,0 +1,37 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the CacheUpdated event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class CacheUpdatedEventArgs : EventArgs
+    {
+        internal CacheUpdatedEventArgs() { }
+
+        /// <summary>
+        /// Indicates the updated representation of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The updated representation of the resource.</value>
+        public Representation Representation { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs
new file mode 100755 (executable)
index 0000000..605fc03
--- /dev/null
@@ -0,0 +1,70 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the DeviceInformationFound event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class DeviceInformationFoundEventArgs
+    {
+        internal DeviceInformationFoundEventArgs() { }
+
+        /// <summary>
+        /// The request ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The request ID.</value>
+        public int RequestId { get; internal set; }
+
+        /// <summary>
+        /// Indicates to continuously receive the event for finding device information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Continuously receive the event for finding device information.</value>
+        public bool EventContinue { get; set; }
+
+        /// <summary>
+        /// Indicates the human friendly name for device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Human friendly name for device.</value>
+        public string Name { get; internal set; }
+
+        /// <summary>
+        /// Indicates the spec version of the core specification.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Spec version of the core specification.</value>
+        public string SpecVersion { get; internal set; }
+
+        /// <summary>
+        /// Indicates an unique identifier for the OIC device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Unique identifier for OIC device.</value>
+        public string DeviceId { get; internal set; }
+
+        /// <summary>
+        /// Indicates version of the specs this device data model is implemented to.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Version of the specs this device data model is implemented to.</value>
+        public string DataModelVersion { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs
new file mode 100755 (executable)
index 0000000..eec4fbe
--- /dev/null
@@ -0,0 +1,74 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for resource found errors.
+    /// </summary>
+    internal enum FindingError
+    {
+        /// <summary>
+        /// I/O error.
+        /// </summary>
+        Io = 1,
+        /// <summary>
+        /// Out of memory.
+        /// </summary>
+        OutOfMemory,
+        /// <summary>
+        /// Permission denied.
+        /// </summary>
+        PermissionDenied,
+        /// <summary>
+        /// Not supported.
+        /// </summary>
+        NotSupported,
+        /// <summary>
+        /// Invalid parameter.
+        /// </summary>
+        InvalidParameter,
+        /// <summary>
+        /// No data available.
+        /// </summary>
+        NoData,
+        /// <summary>
+        /// Time out.
+        /// </summary>
+        TimeOut,
+        /// <summary>
+        /// IoTivity errors.
+        /// </summary>
+        Iotivity,
+        /// <summary>
+        /// Representation errors.
+        /// </summary>
+        Representation,
+        /// <summary>
+        /// Invalid type.
+        /// </summary>
+        InvalidType,
+        /// <summary>
+        /// Already.
+        /// </summary>
+        Already,
+        /// <summary>
+        /// System errors.
+        /// </summary>
+        System
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs
new file mode 100755 (executable)
index 0000000..bc28027
--- /dev/null
@@ -0,0 +1,44 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the FindingErrorOccurred event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class FindingErrorOccurredEventArgs : EventArgs
+    {
+        internal FindingErrorOccurredEventArgs() { }
+
+        /// <summary>
+        /// The request ID of the operation, which caused this error.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The request ID of the operation, which caused this error.</value>
+        public int RequestId { get; internal set; }
+
+        /// <summary>
+        /// Contains error details.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Error details.</value>
+        public Exception Error { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs
new file mode 100755 (executable)
index 0000000..9da873d
--- /dev/null
@@ -0,0 +1,966 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// IoT connectivity client manager consists of client side APIs.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class IoTConnectivityClientManager
+    {
+        /// <summary>
+        /// The IP Address for multicast.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string MulticastAddress = null;
+
+        private static int s_presenceListenerId = 1;
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Client.Presence.PresenceCallback> s_presenceCallbacksMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Client.Presence.PresenceCallback>();
+        private static Dictionary<IntPtr, IntPtr> s_presenceHandlesMap = new Dictionary<IntPtr, IntPtr>();
+
+        private static int s_requestId = 1;
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Client.ResourceFinder.FoundResourceCallback> s_resourceFoundCallbacksMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Client.ResourceFinder.FoundResourceCallback>();
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Client.DeviceInformation.DeviceInformationCallback> s_deviceInformationCallbacksMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Client.DeviceInformation.DeviceInformationCallback>();
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Client.PlatformInformation.PlatformInformationCallback> s_platformInformationCallbacksMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Client.PlatformInformation.PlatformInformationCallback>();
+
+        /// <summary>
+        /// PresenceReceived event. This event occurs when server starts sending presence of a resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static event EventHandler<PresenceReceivedEventArgs> PresenceReceived;
+
+        /// <summary>
+        /// ResourceFound event. This event occurs when a resource is found from the remote server
+        /// after sending request using API StartFindingResource().
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static event EventHandler<ResourceFoundEventArgs> ResourceFound;
+
+        /// <summary>
+        /// PlatformInformationFound event. This event occurs when platform information is found
+        /// after sending request using API StartFindingPlatformInformation().
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static event EventHandler<PlatformInformationFoundEventArgs> PlatformInformationFound;
+
+        /// <summary>
+        /// DeviceInformationFound event. This event occurs when device information is found
+        /// after sending request using API StartFindingDeviceInformation().
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static event EventHandler<DeviceInformationFoundEventArgs> DeviceInformationFound;
+
+        /// <summary>
+        /// FindingError event. This event occurs when an error is found.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public static event EventHandler<FindingErrorOccurredEventArgs> FindingErrorOccurred;
+
+        /// <summary>
+        /// Timeout in seconds.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// Value to be set must be in range from 1 to 3600. Default timeout interval value is 30.\n
+        /// Sets/gets the timeout of StartFindingResource(), StartFindingDeviceInformation(), StartFindingPlatformInformation(),
+        /// RemoteResource.GetAsync(), RemoteResource.PutAsync(), RemoteResource.PostAsync() and RemoteResource.DeleteAsync() APIs.\n
+        /// Setter can throw exception.
+        /// </value>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <code>
+        /// IoTConnectivityClientManager.Initialize();
+        /// IoTConnectivityClientManager.TimeOut = 120;
+        /// </code>
+        public static int TimeOut
+        {
+            get
+            {
+                int timeout;
+                int ret = Interop.IoTConnectivity.Client.IoTCon.GetTimeout(out timeout);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get timeout");
+                    return 0;
+                }
+                return timeout;
+            }
+            set
+            {
+                int ret = Interop.IoTConnectivity.Client.IoTCon.SetTimeout(value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set timeout");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Polling interval of IoTConnectivity.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// Sets/Gets the polling inerval(milliseconds) of IoTCon. Default value is 100 milliseconds.
+        /// Value to be set must be in range from 1 to 999. The closer to 0, the faster it operates.
+        /// Setter is invoked immediately for changing the interval.
+        /// If you want the faster operation, we recommend you set 10 milliseconds for polling interval.
+        /// Setter can throw exception.
+        /// </value>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <code>
+        /// IoTConnectivityClientManager.Initialize();
+        /// IoTConnectivityClientManager.PollingInterval = 100;
+        /// </code>
+        public static int PollingInterval
+        {
+            get
+            {
+                int interval;
+                int ret = Interop.IoTConnectivity.Client.IoTCon.GetPollingInterval(out interval);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get polling interval");
+                    return 0;
+                }
+                return interval;
+            }
+            set
+            {
+                int ret = Interop.IoTConnectivity.Client.IoTCon.SetPollingInterval(value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set polling interval");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Initializes IoTCon.
+        /// Call this function to start IoTCon.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// @a filePath point to a file for handling secure virtual resources.
+        /// The file that is CBOR(Concise Binary Object Representation)-format must already exist
+        /// in @a filePath. We recommend to use application-local file for @a filePath.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/network.get \n
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="filePath">The file path to point to storage for handling secure virtual resources.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <post>
+        /// You must call Deinitialize() if IoTCon API is no longer needed.
+        /// </post>
+        /// <seealso cref="Deinitialize()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// string filePath = "../../res/iotcon-test-svr-db-client.dat";
+        /// IoTConnectivityClientManager.Initialize(filePath);
+        /// </code>
+        public static void Initialize(string filePath)
+        {
+            int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to initialize");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Deinitializes IoTCon.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// This API must be called if IoTCon API is no longer needed.
+        /// </remarks>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="Initialize()"/>
+        /// <seealso cref="SecureInitialize()"/>
+        /// <code>
+        /// IoTConnectivityClientManager.Deinitialize();
+        /// </code>
+        public static void Deinitialize()
+        {
+            s_presenceListenerId = 1;
+            s_presenceCallbacksMap.Clear();
+            s_presenceHandlesMap.Clear();
+
+            s_requestId = 1;
+            s_resourceFoundCallbacksMap.Clear();
+            s_deviceInformationCallbacksMap.Clear();
+            s_platformInformationCallbacksMap.Clear();
+
+            PresenceReceived = delegate{};
+            ResourceFound = delegate{};
+            PlatformInformationFound = delegate{};
+            DeviceInformationFound = delegate{};
+            FindingErrorOccurred = delegate{};
+
+            Interop.IoTConnectivity.Client.IoTCon.Deinitialize();
+        }
+
+        /// <summary>
+        /// Invokes a next message from a queue for receiving messages from others, immediately.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// This API invokes a next message from a queue for receiving messages from others, immediately.
+        /// After calling the API, it continues the polling with existing interval.
+        /// </remarks>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <code>
+        /// IoTConnectivityClientManager.InvokePolling();
+        /// </code>
+        public static void InvokePolling()
+        {
+            int ret = Interop.IoTConnectivity.Client.IoTCon.InvokePolling();
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to invoke polling");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Starts receiving presence events.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Sends request to receive presence to an interested server's resource with resourceType.
+        /// If succeeded, <see cref="PresenceReceived"/> event handler will be triggered when the server sends presence.
+        /// A server sends presence events when adds / removes / alters a resource or start / stop presence.\n
+        /// @a hostAddress could be <see cref="MulticastAddress"/> for IPv4 multicast.
+        /// The length of @ resourceType should be less than or equal to 61. The @ resourceType must start with a lowercase alphabetic character, followed by a sequence
+        /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="hostAddress">The address or addressable name of the server.</param>
+        /// <param name="resourceType">A resource type that a client is interested in.</param>
+        /// <returns>PresenceId - An identifier for this request.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>Initialize() should be called to initialize.</pre>
+        /// <post>
+        /// When the resource receive presence, <see cref="PresenceReceived"/> event handler will be invoked.\n
+        /// You must destroy presence by calling StopReceivingPresence() if presence event is no longer needed.
+        /// </post>
+        /// <seealso cref="IoTConnectivityServerManager.StartSendingPresence()"/>
+        /// <seealso cref="IoTConnectivityServerManager.StopSendingPresence()"/>
+        /// <seealso cref="StopReceivingPresence()"/>
+        /// <seealso cref="PresenceReceived"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
+        ///     Console.Log("PresenceReceived, presence id :" + e.PresenceId);
+        /// }
+        /// EventHandler<FindingErrorOccurredEventArgs> errorHandler = (sender, e) => {
+        ///     Console.Log("Found error :" + e.Error.Message);
+        /// }
+        /// IoTConnectivityClientManager.PresenceReceived += handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
+        /// // Do not forget to remove these event handlers when they are not required any more.
+        /// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door");
+        /// </code>
+        public static int StartReceivingPresence(string hostAddress, string resourceType)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
+
+            if (resourceType != null && !ResourceTypes.IsValid(resourceType))
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid type");
+                throw new ArgumentException("Invalid type");
+            }
+
+            IntPtr id = IntPtr.Zero;
+            lock (s_presenceCallbacksMap)
+            {
+                id = (IntPtr)s_presenceListenerId++;
+            }
+            s_presenceCallbacksMap[id] = (IntPtr presence, int result, IntPtr presenceResponseHandle, IntPtr userData) =>
+            {
+                int presenceId = (int)userData;
+                if (result == (int)IoTConnectivityError.None)
+                {
+                    if (presenceResponseHandle != IntPtr.Zero)
+                    {
+                        PresenceReceivedEventArgs e = GetPresenceReceivedEventArgs(presenceId, presenceResponseHandle);
+                        if (e == null)
+                        {
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get PresenceReceivedEventArgs");
+                            return;
+                        }
+                        PresenceReceived?.Invoke(null, e);
+                    }
+                    else
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null");
+                        return;
+                    }
+                }
+                else
+                {
+                    FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(presenceId, result);
+                    FindingErrorOccurred?.Invoke(null, e);
+                }
+            };
+
+            IntPtr presenceHandle;
+            int errorCode = Interop.IoTConnectivity.Client.Presence.AddPresenceCb(hostAddress, (int)connectivityType, resourceType, s_presenceCallbacksMap[id], id, out presenceHandle);
+            if (errorCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register presence event handler");
+                lock (s_presenceCallbacksMap)
+                {
+                    s_presenceCallbacksMap.Remove(id);
+                }
+                throw IoTConnectivityErrorFactory.GetException(errorCode);
+            }
+
+            lock (s_presenceHandlesMap)
+            {
+                s_presenceHandlesMap[id] = presenceHandle;
+            }
+            return (int)id;
+        }
+
+        /// <summary>
+        /// Stops receiving presence events.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Sends request to not to receive server's presence any more.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="presenceId">The start presence request identifier.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="IoTConnectivityServerManager.StartSendingPresence()"/>
+        /// <seealso cref="IoTConnectivityServerManager.StopSendingPresence()"/>
+        /// <seealso cref="StartReceivingPresence()"/>
+        /// <seealso cref="PresenceReceived"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
+        ///     Console.Log("PresenceReceived, presence id :" + e.PresenceId);
+        /// }
+        /// EventHandler<FindingErrorOccurredEventArgs> errorHandler = (sender, e) => {
+        ///     Console.Log("Found error :" + e.Error.Message);
+        /// }
+        /// IoTConnectivityClientManager.PresenceReceived += handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
+        /// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door");
+        /// await Task.Delay(5000); // Do other things here
+        /// // Call StopReceivingPresence() when receiving presence is not required any more
+        /// IoTConnectivityClientManager.PresenceReceived -= handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler;
+        /// IoTConnectivityClientManager.StopReceivingPresence(id);
+        /// </code>
+        public static void StopReceivingPresence(int presenceId)
+        {
+            if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId))
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "this presenceId does not exist");
+                throw new ArgumentException("this presenceId does not exist");
+            }
+
+            if (s_presenceHandlesMap.ContainsKey((IntPtr)presenceId))
+            {
+                IntPtr presenceHandle = s_presenceHandlesMap[(IntPtr)presenceId];
+                int ret = Interop.IoTConnectivity.Client.Presence.RemovePresenceCb(presenceHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to deregister presence event handler");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+
+                lock (s_presenceHandlesMap)
+                {
+                    s_presenceHandlesMap.Remove((IntPtr)presenceId);
+                }
+            }
+
+            if (s_presenceCallbacksMap.ContainsKey((IntPtr)presenceId))
+            {
+                lock (s_presenceCallbacksMap)
+                {
+                    s_presenceCallbacksMap.Remove((IntPtr)presenceId);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Starts finding resources.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Sends request to find a resource of @a hostAddress server with @a resourceType.
+        /// If succeeded, <see cref="ResourceFound"/> event handler will be triggered with information of the resource.\n
+        /// @a hostAddress could be <see cref="MulticastAddress"/> for the IPv4 multicast.
+        /// The length of @a resourceType should be less than or equal to 61. The @ resourceType must start with a lowercase alphabetic character, followed by a sequence
+        /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="hostAddress">The address or addressable name of the server. The address includes a protocol like coaps://.</param>
+        /// <param name="query">The query specified as a filter for founding resources.</param>
+        /// <returns>RequestId - An identifier for this request.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>Initialize() should be called to initialize.</pre>
+        /// <post>
+        /// When the resource is found, <see cref="ResourceFound"/> event handler will be invoked.
+        /// </post>
+        /// <seealso cref="ResourceFound"/>
+        /// <seealso cref="ResourceFoundEventArgs"/>
+        /// <seealso cref="TimeOut"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// EventHandler<ResourceFoundEventArgs> handler = (sender, e) => {
+        ///     Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath);
+        /// }
+        /// EventHandler<FindingErrorOccurredEventArgs> errorHandler = (sender, e) => {
+        ///     Console.Log("Found error :" + e.Error.Message);
+        /// }
+        /// IoTConnectivityClientManager.ResourceFound += handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Type = "oic.iot.door";
+        /// // Do not forget to remove these event handlers when they are not required any more.
+        /// int id = IoTConnectivityClientManager.StartFindingResource(null, query);
+        /// </code>
+        public static int StartFindingResource(string hostAddress, ResourceQuery query = null)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
+
+            IntPtr id = IntPtr.Zero;
+            lock (s_resourceFoundCallbacksMap)
+            {
+                id = (IntPtr)s_requestId++;
+            }
+            s_resourceFoundCallbacksMap[id] = (IntPtr remoteResourceHandle, int result, IntPtr userData) =>
+            {
+                if (ResourceFound == null)
+                    return false;
+
+                int requestId = (int)userData;
+                if (result == (int)IoTConnectivityError.None)
+                {
+                    if (remoteResourceHandle != IntPtr.Zero)
+                    {
+                        RemoteResource resource = null;
+                        try
+                        {
+                            resource = new RemoteResource(remoteResourceHandle);
+                        }
+                        catch (Exception exp)
+                        {
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't clone RemoteResource's handle: " + exp.Message);
+                            return true;
+                        }
+                        ResourceFoundEventArgs e = new ResourceFoundEventArgs()
+                        {
+                            RequestId = requestId,
+                            Resource = resource
+                        };
+                        ResourceFound?.Invoke(null, e);
+                        Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue);
+                        return e.EventContinue;
+                    }
+                    else
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null");
+                    }
+                }
+                else
+                {
+                    FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result);
+                    FindingErrorOccurred?.Invoke(null, e);
+
+                    lock (s_resourceFoundCallbacksMap)
+                    {
+                        s_resourceFoundCallbacksMap.Remove(id);
+                    }
+                }
+                return true;
+            };
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errorCode = Interop.IoTConnectivity.Client.ResourceFinder.AddResourceFoundCb(hostAddress, (int)connectivityType, queryHandle, s_resourceFoundCallbacksMap[id], id);
+            if (errorCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register resource found event handler");
+                lock (s_resourceFoundCallbacksMap)
+                {
+                    s_resourceFoundCallbacksMap.Remove(id);
+                }
+                throw IoTConnectivityErrorFactory.GetException(errorCode);
+            }
+            return (int)id;
+        }
+
+        /// <summary>
+        /// Starts finding the device information of remote server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Requests server for device information.
+        /// If succeeded, <see cref="DeviceInformationFound"/> event handler will be triggered with information of the device.\n
+        /// @a hostAddress could be <see cref="MulticastAddress"/> for the IPv4 multicast.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="hostAddress">The host address of the remote server.</param>
+        /// <param name="query">The query specified as a filter for founding resources.</param>
+        /// <returns>RequestId - An identifier for this request.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>Initialize() should be called to initialize.</pre>
+        /// <post>
+        /// <see cref="DeviceInformationFound" /> event handler will be invoked.
+        /// </post>
+        /// <seealso cref="IoTConnectivityServerManager.SetDeviceName()"/>
+        /// <seealso cref="DeviceInformationFound"/>
+        /// <seealso cref="DeviceInformationFoundEventArgs"/>
+        /// <seealso cref="TimeOut"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// EventHandler<DeviceInformationFoundEventArgs> handler = (sender, e) => {
+        ///     Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name);
+        /// }
+        /// EventHandler<FindingErrorOccurredEventArgs> errorHandler = (sender, e) => {
+        ///     Console.Log("Found error :" + e.Error.Message);
+        /// }
+        /// IoTConnectivityClientManager.DeviceInformationFound += handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
+        /// // Do not forget to remove these event handlers when they are not required any more.
+        /// int id = IoTConnectivityClientManager.StartFindingDeviceInformation(IoTConnectivityClientManager.MulticastAddress);
+        /// </code>
+        public static int StartFindingDeviceInformation(string hostAddress, ResourceQuery query = null)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
+
+            IntPtr id = IntPtr.Zero;
+            lock (s_deviceInformationCallbacksMap)
+            {
+                id = (IntPtr)s_requestId++;
+            }
+            s_deviceInformationCallbacksMap[id] = (IntPtr deviceInfoHandle, int result, IntPtr userData) =>
+            {
+                if (DeviceInformationFound == null)
+                    return false;
+
+                int requestId = (int)userData;
+                if (result == (int)IoTConnectivityError.None)
+                {
+                    if (deviceInfoHandle != IntPtr.Zero)
+                    {
+                        DeviceInformationFoundEventArgs e = GetDeviceInformationFoundEventArgs(requestId, deviceInfoHandle);
+                        if (e == null)
+                        {
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get DeviceInformationFoundEventArgs");
+                            return true;
+                        }
+                        DeviceInformationFound?.Invoke(null, e);
+                        Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue);
+                        return e.EventContinue;
+                    }
+                    else
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null");
+                    }
+                }
+                else
+                {
+                    FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result);
+                    FindingErrorOccurred?.Invoke(null, e);
+
+                    lock (s_deviceInformationCallbacksMap)
+                    {
+                        s_deviceInformationCallbacksMap.Remove(id);
+                    }
+                }
+                return true;
+            };
+
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errorCode = Interop.IoTConnectivity.Client.DeviceInformation.Find(hostAddress, (int)connectivityType, queryHandle, s_deviceInformationCallbacksMap[id], id);
+            if (errorCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device information");
+                lock (s_deviceInformationCallbacksMap)
+                {
+                    s_deviceInformationCallbacksMap.Remove(id);
+                }
+                throw IoTConnectivityErrorFactory.GetException(errorCode);
+            }
+
+            return (int)id;
+        }
+
+        /// <summary>
+        /// Starts finding the platform information of remote server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Requests server for platform information.
+        /// If succeeded, <see cref="PlatformInformationFound" /> event handler will be triggered with information of the platform.\n
+        /// @a hostAddress could be <see cref="MulticastAddress"/> for IPv4 multicast.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="hostAddress">The host address of remote server.</param>
+        /// <param name="query">The query specified as a filter for founding resources.</param>
+        /// <returns>RequestId - An identifier for this request.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>Initialize() should be called to initialize.</pre>
+        /// <post>
+        /// <see cref="PlatformInformationFound" /> event handler will be invoked.
+        /// </post>
+        /// <seealso cref="PlatformInformationFound"/>
+        /// <seealso cref="PlatformInformationFoundEventArgs"/>
+        /// <seealso cref="TimeOut"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// EventHandler<PlatformInformationFoundEventArgs> handler = (sender, e) => {
+        ///     Console.Log("PlatformInformationFound :" + e.RequestId);
+        /// }
+        /// EventHandler<FindingErrorOccurredEventArgs> errorHandler = (sender, e) => {
+        ///     Console.Log("Found error :" + e.Error.Message);
+        /// }
+        /// IoTConnectivityClientManager.PlatformInformationFound += handler;
+        /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
+        /// // Do not forget to remove these event handlers when they are not required any more.
+        /// int id = IoTConnectivityClientManager.StartFindingPlatformInformation(IoTConnectivityClientManager.MulticastAddress);
+        /// </code>
+        public static int StartFindingPlatformInformation(string hostAddress, ResourceQuery query = null)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
+
+            IntPtr id = IntPtr.Zero;
+            lock (s_platformInformationCallbacksMap)
+            {
+                id = (IntPtr)s_requestId++;
+            }
+            s_platformInformationCallbacksMap[id] = (IntPtr platformInfoHandle, int result, IntPtr userData) =>
+            {
+                if (PlatformInformationFound == null)
+                    return false;
+
+                int requestId = (int)userData;
+                if (result == (int)IoTConnectivityError.None)
+                {
+                    if (platformInfoHandle != IntPtr.Zero)
+                    {
+                        PlatformInformationFoundEventArgs e = GetPlatformInformationFoundEventArgs(requestId, platformInfoHandle);
+                        if (e == null)
+                        {
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get PlatformInformationFoundEventArgs");
+                            return true;
+                        }
+                        PlatformInformationFound?.Invoke(null, e);
+                        Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue);
+                        return e.EventContinue;
+                    }
+                    else
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null");
+                    }
+                }
+                else
+                {
+                    FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result);
+                    FindingErrorOccurred?.Invoke(null, e);
+
+                    lock (s_platformInformationCallbacksMap)
+                    {
+                        s_platformInformationCallbacksMap.Remove(id);
+                    }
+                }
+                return true;
+            };
+
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errorCode = Interop.IoTConnectivity.Client.PlatformInformation.Find(hostAddress, (int)connectivityType, queryHandle, s_platformInformationCallbacksMap[id], id);
+            if (errorCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform information");
+                lock (s_platformInformationCallbacksMap)
+                {
+                    s_platformInformationCallbacksMap.Remove(id);
+                }
+                throw IoTConnectivityErrorFactory.GetException(errorCode);
+            }
+
+            return (int)id;
+        }
+
+        // Private methods
+        private static PresenceReceivedEventArgs GetPresenceReceivedEventArgs(int presenceId, IntPtr presenceResponseHandle)
+        {
+            int trigger;
+            IntPtr host, type;
+
+            int ret = Interop.IoTConnectivity.Client.PresenceResponse.GetHostAddress(presenceResponseHandle, out host);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get host address");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PresenceResponse.GetResourceType(presenceResponseHandle, out type);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource type");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PresenceResponse.GetTrigger(presenceResponseHandle, out trigger);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get event type");
+                return null;
+            }
+
+            PresenceReceivedEventArgs e = new PresenceReceivedEventArgs()
+            {
+                PresenceId = presenceId,
+                HostAddress = (host != IntPtr.Zero) ? Marshal.PtrToStringAnsi(host) : string.Empty,
+                Type = (type != IntPtr.Zero) ? Marshal.PtrToStringAnsi(type) : string.Empty,
+                EventType = (PresenceEventType)trigger
+            };
+
+            return e;
+        }
+
+        private static DeviceInformationFoundEventArgs GetDeviceInformationFoundEventArgs(int requestId, IntPtr deviceInfoHandle)
+        {
+            IntPtr name, specVersion, deviceId, dataModelVersion;
+
+            int ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.Name, out name);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get name");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.SpecVersion, out specVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get spec version");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.Id, out deviceId);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device id");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.DataModelVersion, out dataModelVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get data model version");
+                return null;
+            }
+
+            DeviceInformationFoundEventArgs e = new DeviceInformationFoundEventArgs()
+            {
+                RequestId = requestId,
+                EventContinue = true,
+                Name = (name != IntPtr.Zero) ? Marshal.PtrToStringAnsi(name) : string.Empty,
+                SpecVersion = (specVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(specVersion) : string.Empty,
+                DeviceId = (deviceId != IntPtr.Zero) ? Marshal.PtrToStringAnsi(deviceId) : string.Empty,
+                DataModelVersion = (dataModelVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(dataModelVersion) : string.Empty
+            };
+
+            return e;
+        }
+
+        private static PlatformInformationFoundEventArgs GetPlatformInformationFoundEventArgs(int requestId, IntPtr platformInfoHandle)
+        {
+            IntPtr platformId, manufacturerName, manufacturerUrl, modelNumber, dateOfManufacture, platformVersion, osVersion, hardwareVersion, firmwareVersion, supportUrl, systemTime;
+
+            int ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.Id, out platformId);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform id");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.MfgName, out manufacturerName);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get manufacturer name");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.MfgUrl, out manufacturerUrl);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get manufacturer url");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.ModelNumber, out modelNumber);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get model number");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.DateOfMfg, out dateOfManufacture);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get date of manufacture");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.PlatformVer, out platformVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform version");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.OsVer, out osVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to os version");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.HardwareVer, out hardwareVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to hardware version");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.FirmwareVer, out firmwareVersion);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get firmware version");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.SupportUrl, out supportUrl);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get support url");
+                return null;
+            }
+
+            ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.SystemTime, out systemTime);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get system time");
+                return null;
+            }
+
+            PlatformInformationFoundEventArgs e = new PlatformInformationFoundEventArgs()
+            {
+                RequestId = requestId,
+                PlatformId = (platformId != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformId) : string.Empty,
+                ManufacturerName = (manufacturerName != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerName) : string.Empty,
+                ManufacturerURL = (manufacturerUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerUrl) : string.Empty,
+                DateOfManufacture = (dateOfManufacture != IntPtr.Zero) ? Marshal.PtrToStringAnsi(dateOfManufacture) : string.Empty,
+                ModelNumber = (modelNumber != IntPtr.Zero) ? Marshal.PtrToStringAnsi(modelNumber) : string.Empty,
+                PlatformVersion = (platformVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformVersion) : string.Empty,
+                OsVersion = (osVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(osVersion) : string.Empty,
+                HardwareVersion = (hardwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hardwareVersion) : string.Empty,
+                FirmwareVersion = (firmwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(firmwareVersion) : string.Empty,
+                SupportUrl = (supportUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(supportUrl) : string.Empty,
+                SystemTime = (systemTime != IntPtr.Zero) ? Marshal.PtrToStringAnsi(systemTime) : string.Empty
+            };
+
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.RequestId is " + e.RequestId);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.PlatformId is " + e.PlatformId);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ManufacturerName is " + e.ManufacturerName);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ManufacturerURL is " + e.ManufacturerURL);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.DateOfManufacture is " + e.DateOfManufacture);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ModelNumber is " + e.ModelNumber);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.PlatformVersion is " + e.PlatformVersion);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.OsVersion is " + e.OsVersion);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.HardwareVersion is " + e.HardwareVersion);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.FirmwareVersion is " + e.FirmwareVersion);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.SupportUrl is " + e.SupportUrl);
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "e.SystemTime is " + e.SystemTime);
+
+            return e;
+        }
+
+        private static FindingErrorOccurredEventArgs GetFindingErrorOccurredEventArgs(int requestId, int err)
+        {
+            FindingErrorOccurredEventArgs e = new FindingErrorOccurredEventArgs()
+            {
+                RequestId = requestId,
+                Error = IoTConnectivityErrorFactory.GetException(err)
+            };
+            return e;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs
new file mode 100755 (executable)
index 0000000..338a093
--- /dev/null
@@ -0,0 +1,103 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.IO;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    internal enum IoTConnectivityError
+    {
+        None = ErrorCode.None,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        Io = ErrorCode.IoError,
+        PermissionDenied = ErrorCode.PermissionDenied,
+        NotSupported = ErrorCode.NotSupported,
+        NoData = ErrorCode.NoData,
+        TimedOut = ErrorCode.TimedOut,
+        Iotivity = -0x01C80000 | 0x01,
+        Representation = -0x01C80000 | 0x02,
+        InvalidType = -0x01C80000 | 0x03,
+        Already = -0x01C80000 | 0x04,
+        System = -0x01C80000 | 0x06,
+    }
+
+    internal static class IoTConnectivityErrorFactory
+    {
+        internal const string LogTag = "Tizen.Network.IoTConnectivity";
+
+        internal static void ThrowException(int err)
+        {
+            throw GetException(err);
+        }
+
+        internal static Exception GetException(int err)
+        {
+            IoTConnectivityError error = (IoTConnectivityError)err;
+            if (error == IoTConnectivityError.OutOfMemory)
+            {
+                return new OutOfMemoryException("Out of memory");
+            }
+            else if (error == IoTConnectivityError.InvalidParameter)
+            {
+                return new ArgumentException("Invalid parameter");
+            }
+            else if (error == IoTConnectivityError.Io)
+            {
+                return new IOException("I/O Error");
+            }
+            else if (error == IoTConnectivityError.NoData)
+            {
+                return new InvalidOperationException("No data found");
+            }
+            else if (error == IoTConnectivityError.TimedOut)
+            {
+                return new TimeoutException("timed out");
+            }
+            else if (error == IoTConnectivityError.PermissionDenied)
+            {
+                return new UnauthorizedAccessException("Permission denied");
+            }
+            else if (error == IoTConnectivityError.NotSupported)
+            {
+                return new NotSupportedException("Not supported");
+            }
+            else if (error == IoTConnectivityError.Representation)
+            {
+                return new InvalidOperationException("Representation error");
+            }
+            else if (error == IoTConnectivityError.InvalidType)
+            {
+                return new ArgumentException("Invalid type");
+            }
+            else if (error == IoTConnectivityError.Already)
+            {
+                return new InvalidOperationException("Duplicate");
+            }
+            else if (error == IoTConnectivityError.System)
+            {
+                return new InvalidOperationException("System error");
+            }
+            else
+            {
+                return new InvalidOperationException("Invalid operation");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs
new file mode 100755 (executable)
index 0000000..1a89430
--- /dev/null
@@ -0,0 +1,315 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// IoT connectivity server manager consists of server side APIs.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public static class IoTConnectivityServerManager
+    {
+        private static int s_requestId = 1;
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Server.Resource.RequestHandlerCallback> s_RequestHandlerCallbackMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Server.Resource.RequestHandlerCallback>();
+
+        /// <summary>
+        /// Initializes IoTCon. Calls this API to start IoTCon.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// @a filePath point to a file for handling secure virtual resources.
+        /// The file that is CBOR(Concise Binary Object Representation)-format must already exist
+        /// in @a filePath. We recommend to use application-local file for @a filePath.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/network.get \n
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="filePath">The file path to point to storage for handling secure virtual resources.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <post>
+        /// You must call Deinitialize() if IoTCon API is no longer needed.
+        /// </post>
+        /// <seealso cref="Deinitialize()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access</exception>
+        /// <code>
+        /// string filePath = "../../res/iotcon-test-svr-db-server.dat";
+        /// IoTConnectivityServerManager.Initialize(filePath);
+        /// </code>
+        public static void Initialize(string filePath)
+        {
+            int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to initialize");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Deinitializes IoTCon.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// This API must be called if IoTCon API is no longer needed.
+        /// </remarks>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="Initialize()"/>
+        /// <code>
+        /// IoTConnectivityServerManager.Deinitialize();
+        /// </code>
+        public static void Deinitialize()
+        {
+            _resources.Clear();
+            s_requestId = 1;
+            s_RequestHandlerCallbackMap.Clear();
+
+            Interop.IoTConnectivity.Client.IoTCon.Deinitialize();
+        }
+
+        /// <summary>
+        /// Registers a resource in IoTCon server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="resource">The resource to register.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="Resource"/>
+        /// <seealso cref="LiteResource"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
+        /// Attributes attributes = new Attributes { { "state", "ON" }};
+        /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
+        /// try {
+        ///     IoTConnectivityServerManager.RegisterResource(res);
+        /// } catch(Exception ex) {
+        ///     Console.Log("Exception caught : " + ex.Message);
+        /// }
+        /// </code>
+        public static void RegisterResource(Resource resource)
+        {
+            Log.Info(IoTConnectivityErrorFactory.LogTag, "...");
+
+            IntPtr id = IntPtr.Zero;
+            lock (s_RequestHandlerCallbackMap)
+            {
+                id = (IntPtr)s_requestId++;
+            }
+
+            s_RequestHandlerCallbackMap[id] = (IntPtr r_resource, IntPtr request, IntPtr userData) =>
+            {
+                int requestId = (int)userData;
+
+                Log.Info(IoTConnectivityErrorFactory.LogTag, "Received s_RequestHandlerCallbackMap : " + requestId);
+
+                if (request == IntPtr.Zero)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "request is IntPtr.Zero");
+                    return;
+                }
+                resource.OnRequest(r_resource, request, userData);
+            };
+
+            IntPtr handle = IntPtr.Zero;
+            int errorCode = Interop.IoTConnectivity.Server.Resource.Create(resource.UriPath, resource.Types._resourceTypeHandle, resource.Interfaces.ResourceInterfacesHandle, (int)resource.Policy, s_RequestHandlerCallbackMap[id], id, out handle);
+            if (errorCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed create resource");
+                lock (s_RequestHandlerCallbackMap)
+                {
+                    s_RequestHandlerCallbackMap.Remove(id);
+                }
+                throw IoTConnectivityErrorFactory.GetException(errorCode);
+            }
+            else
+            {
+                resource.ResourceHandle = handle;
+            }
+            _resources.Add(resource);
+        }
+
+        /// <summary>
+        /// Unregisters a resource in IoTCon server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="resource">The resource to unregister.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="Resource"/>
+        /// <seealso cref="LiteResource"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
+        /// Attributes attributes = new Attributes { { "state", "ON" }};
+        /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
+        /// IoTConnectivityServerManager.RegisterResource(res);
+        /// try {
+        ///     IoTConnectivityServerManager.UnregisterResource(res);
+        /// } catch(Exception ex) {
+        ///     Console.Log("Exception caught : " + ex.Message);
+        /// }
+        /// </code>
+        public static void UnregisterResource(Resource resource)
+        {
+            if (resource != null)
+            {
+                if (resource.ResourceHandle != IntPtr.Zero)
+                {
+                    Interop.IoTConnectivity.Server.Resource.Destroy(resource.ResourceHandle);
+                    resource.ResourceHandle = IntPtr.Zero;
+                }
+
+                _resources.Remove(resource);
+            }
+        }
+
+        /// <summary>
+        /// Starts presence of a server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Use this API to send server's announcements to clients.
+        /// Server can call this API when online for the first time or come back from offline to online.\n
+        /// If @a time is 0, server will set default value as 60 seconds.\n
+        /// If @a time is very big, server will set maximum value as (60 * 60 * 24) seconds, (24 hours).
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="time">The interval of announcing presence in seconds.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="IoTConnectivityClientManager.StartReceivingPresence()"/>
+        /// <seealso cref="IoTConnectivityClientManager.StopReceivingPresence()"/>
+        /// <seealso cref="IoTConnectivityClientManager.PresenceReceived"/>
+        /// <seealso cref="StopSendingPresence()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// try {
+        ///     IoTConnectivityServerManager.StartSendingPresence(120);
+        /// } catch(Exception ex) {
+        ///     Console.Log("Exception caught : " + ex.Message);
+        /// }
+        /// </code>
+        public static void StartSendingPresence(uint time)
+        {
+            int ret = Interop.IoTConnectivity.Server.IoTCon.StartPresence(time);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to start presence");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Stops presence of a server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Use this API to stop sending server's announcements to clients.
+        /// Server can call this API when terminating, entering to offline or out of network.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="IoTConnectivityClientManager.StartReceivingPresence()"/>
+        /// <seealso cref="IoTConnectivityClientManager.StopReceivingPresence()"/>
+        /// <seealso cref="IoTConnectivityClientManager.PresenceReceived"/>
+        /// <seealso cref="StartSendingPresence()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// IoTConnectivityServerManager.StopSendingPresence();
+        /// </code>
+        public static void StopSendingPresence()
+        {
+            int ret = Interop.IoTConnectivity.Server.IoTCon.StopPresence();
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed cancel presence");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Sets the device name.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// This API sets the name of the local device (the device calling the API).\n
+        /// If the device name is set, clients can get the name using <see cref="IoTConnectivityClientManager.StartFindingDeviceInformation()"/>.
+        /// </remarks>
+        /// <param name="deviceName">The device name.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="IoTConnectivityClientManager.DeviceInformationFound"/>
+        /// <seealso cref="IoTConnectivityClientManager.StartFindingDeviceInformation()"/>
+        /// <seealso cref="DeviceInformationFoundEventArgs"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <code>
+        /// IoTConnectivityServerManager.SetDeviceName("my-tizen");
+        /// </code>
+        public static void SetDeviceName(string deviceName)
+        {
+            int ret = Interop.IoTConnectivity.Server.IoTCon.SetDeviceName(deviceName);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed set device name");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+        private static List<Resource> _resources = new List<Resource>();
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs
new file mode 100755 (executable)
index 0000000..b7b4801
--- /dev/null
@@ -0,0 +1,179 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents a lite resource.
+    /// It provides APIs to encapsulate resources.
+    /// This class is accessed by using a constructor to create a new instance of this object.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class LiteResource : Resource
+    {
+        /// <summary>
+        /// The LiteResource constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Creates a lite resource, which can then be registered in server using <see cref="IoTConnectivityServerManager.RegisterResource()"/>.\n
+        /// When client requests some operations, it sends a response to client automatically.\n
+        /// @a uri length must be less than 128.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="uri">The uri path of the lite resource.</param>
+        /// <param name="types">The type of the resource.</param>
+        /// <param name="policy">Policy of the resource.</param>
+        /// <param name="attribs">Optional attributes of the resource.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="ResourceTypes"/>
+        /// <seealso cref="ResourcePolicy"/>
+        /// <seealso cref="Attributes"/>
+        /// <code>
+        /// List<string> list = new List<string>() { "org.tizen.light" };
+        /// Attributes attributes = new Attributes() {
+        ///     { "state", "ON" }
+        /// };
+        /// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable, attributes);
+        /// </code>
+        public LiteResource(string uri, ResourceTypes types, ResourcePolicy policy, Attributes attribs = null)
+            : base(uri, types, new ResourceInterfaces(new string[] { ResourceInterfaces.DefaultInterface }), policy)
+        {
+            Attributes = attribs;
+        }
+
+        /// <summary>
+        /// Gets or sets the attributes of the lite resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The attributes of the lite resource.</value>
+        /// <code>
+        /// List<string> list = new List<string>() { "org.tizen.light" };
+        /// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable);
+        /// Attributes attributes = new Attributes() {
+        ///     { "state", "ON" }
+        /// };
+        /// res.Attributes = newAttributes;
+        /// foreach (KeyValuePair<string, object> pair in res.Attributes)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        public Attributes Attributes { get; set; }
+
+        /// <summary>
+        /// Decides whether to accept or reject a post request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// Child classes of this class can override this method to accept or reject post request.
+        /// </remarks>
+        /// <param name="attribs">The new attributes of the lite resource.</param>
+        /// <returns>true to accept post request, false to reject it.</returns>
+        /// <code>
+        /// public class MyLightResource : LiteResource
+        /// {
+        ///     protected override bool OnPost(Attributes attributes)
+        ///     {
+        ///         object newAttributes;
+        ///         attributes.TryGetValue("LIGHT_ATTRIBUTE", out newAttributes);
+        ///         if((int)newAttributes == 1)
+        ///             return true;
+        ///         return false;
+        ///     }
+        /// }
+        /// </code>
+        protected virtual bool OnPost(Attributes attribs)
+        {
+            return true;
+        }
+
+        // The code block untill @endcond should not appear in doxygen spec.
+        /// @cond
+        protected sealed override Response OnGet(Request request)
+        {
+            Representation representation = new Representation()
+            {
+                UriPath = UriPath,
+                Interface = Interfaces,
+                Type = Types,
+                Attributes = Attributes
+            };
+
+            Response response = new Response()
+            {
+                Representation = representation,
+                Result = ResponseCode.Ok
+            };
+
+            return response;
+        }
+
+        protected sealed override Response OnPut(Request request)
+        {
+            Response response = new Response();
+            response.Result = ResponseCode.Forbidden;
+            return response;
+        }
+
+        protected sealed override Response OnPost(Request request)
+        {
+            if (OnPost(request.Representation.Attributes))
+            {
+                Attributes = request.Representation.Attributes;
+                Representation representation = new Representation() {
+                    UriPath = UriPath,
+                    Interface = Interfaces,
+                    Type = Types,
+                    Attributes = Attributes
+                };
+
+                Response response = new Response() {
+                    Representation = representation,
+                    Result = ResponseCode.Ok
+                };
+
+                Notify(representation, QualityOfService.High);
+                return response;
+            }
+
+            return new Response()
+            {
+                Result = ResponseCode.Error
+            };
+        }
+
+        protected sealed override Response OnDelete(Request request)
+        {
+            Response response = new Response();
+            response.Result = ResponseCode.Forbidden;
+            return response;
+        }
+
+        protected sealed override bool OnObserving(Request request, ObserveType observeType, int observeId)
+        {
+            return true;
+        }
+        /// @endcond
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs
new file mode 100755 (executable)
index 0000000..6c4b38f
--- /dev/null
@@ -0,0 +1,12 @@
+/**
+<summary>
+The Tizen.Network.IoTConnectivity namespace provides classes to manage
+Resource, RemoteResource, Request, Response and so on which are based on IoTivity project.
+</summary>
+<remarks>
+The Tizen.Network.IoTConnectivity namespace provides classes to manage
+Resource, RemoteResource, Request, Response and so on which are based on IoTivity project.
+</remarks>
+*/
+namespace Tizen.Network.IoTConnectivity {}
+
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs
new file mode 100755 (executable)
index 0000000..b70b841
--- /dev/null
@@ -0,0 +1,37 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for the policy of observation.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ObservePolicy
+    {
+        /// <summary>
+        /// Indicates the observation request for the most up-to-date notifications only.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        IgnoreOutOfOrder = 0,
+        /// <summary>
+        /// Indicates the observation request for all notifications including state notifications.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        AcceptOutOfOrder
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs
new file mode 100755 (executable)
index 0000000..6329bef
--- /dev/null
@@ -0,0 +1,45 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for the type of observation.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ObserveType
+    {
+        /// <summary>
+        /// No observe action.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        NoType = 0,
+
+        /// <summary>
+        /// Indicates an action of the registering observation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Register = 1,
+
+        /// <summary>
+        /// Indicates an action of unregistering observation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Deregister = 2,
+    }
+}
+
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs
new file mode 100755 (executable)
index 0000000..1e7c6ab
--- /dev/null
@@ -0,0 +1,44 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the ObserverNotified event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ObserverNotifiedEventArgs : EventArgs
+    {
+        internal ObserverNotifiedEventArgs() { }
+
+        /// <summary>
+        /// Result of the observe response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Result of the observe response.</value>
+        public ResponseCode Result { get; internal set; }
+
+        /// <summary>
+        /// Representation of the resource being observed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Representation of the resource being observed.</value>
+        public Representation Representation { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs
new file mode 100755 (executable)
index 0000000..d7279e9
--- /dev/null
@@ -0,0 +1,119 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the PlatformInformationFound event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class PlatformInformationFoundEventArgs
+    {
+        internal PlatformInformationFoundEventArgs() { }
+
+        /// <summary>
+        /// Indicates the request ID.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The request ID.</value>
+        public int RequestId { get; internal set; }
+
+        /// <summary>
+        /// Indicates to continuously receive the event for finding the platform information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Continuously receive the event for finding the platform information.</value>
+        public bool EventContinue { get; set; }
+
+        /// <summary>
+        /// Indicates the platform identifier.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The platform identifier.</value>
+        public string PlatformId { get; internal set; }
+
+        /// <summary>
+        /// Indicates the name of the manufacturer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The name of the manufacturer.</value>
+        public string ManufacturerName { get; internal set; }
+
+        /// <summary>
+        /// Indicates the URL of the manufacturer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The URL of the manufacturer.</value>
+        public string ManufacturerURL { get; internal set; }
+
+        /// <summary>
+        /// Indicates the model number as designated by the manufacturer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The model number as designated by the manufacturer.</value>
+        public string ModelNumber { get; internal set; }
+
+        /// <summary>
+        /// Indicates the manufacturing date of the device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The manufacturing date of the device.</value>
+        public string DateOfManufacture { get; internal set; }
+
+        /// <summary>
+        /// Indicates the version of the platfrom defined by the manufacturer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The version of platfrom defined by manufacturer.</value>
+        public string PlatformVersion { get; internal set; }
+
+        /// <summary>
+        /// Indicates the version of the platfrom resident OS.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The version of the platfrom resident OS.</value>
+        public string OsVersion { get; internal set; }
+
+        /// <summary>
+        /// Indicates the version of the platform Hardware.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The version of the platform Hardware.</value>
+        public string HardwareVersion { get; internal set; }
+
+        /// <summary>
+        /// Indicates the version of the device firmware.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The version of the device firmware.</value>
+        public string FirmwareVersion { get; internal set; }
+
+        /// <summary>
+        /// Indicates the URL that points to support information from the manufacturer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The URL that points to support information from the manufacturer.</value>
+        public string SupportUrl { get; internal set; }
+
+        /// <summary>
+        /// Indicates the reference time of the device.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The reference time of the device.</value>
+        public string SystemTime { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs
new file mode 100755 (executable)
index 0000000..5c7b58f
--- /dev/null
@@ -0,0 +1,42 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for operation of presence response.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum PresenceEventType
+    {
+        /// <summary>
+        /// Indicates the resource creation operation of the server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ResourceCreated = 0,
+        /// <summary>
+        /// Indicates the resource updation operation of the server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ResourceUpdated,
+        /// <summary>
+        /// Indicates the resource destruction operation of the server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ResourceDestroyed
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs
new file mode 100755 (executable)
index 0000000..4fc0238
--- /dev/null
@@ -0,0 +1,58 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the PresenceReceived event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class PresenceReceivedEventArgs : EventArgs
+    {
+        internal PresenceReceivedEventArgs() { }
+
+        /// <summary>
+        /// Indicates the request ID of the presence event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The request ID of the presence event.</value>
+        public int PresenceId { get; internal set; }
+
+        /// <summary>
+        /// Indicates the event type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The event type.</value>
+        public PresenceEventType EventType { get; internal set; }
+
+        /// <summary>
+        /// Indicates the host address of resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The host address of resource.</value>
+        public string HostAddress { get; internal set; }
+
+        /// <summary>
+        /// Indicates the type of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The type of the resource.</value>
+        public string Type { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs
new file mode 100755 (executable)
index 0000000..54eed08
--- /dev/null
@@ -0,0 +1,37 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for states of remote resource.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum QualityOfService
+    {
+        /// <summary>
+        /// Indicates the low quality of service.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Low = 0,
+        /// <summary>
+        /// Indicates the high quality of service.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        High
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs
new file mode 100755 (executable)
index 0000000..af90596
--- /dev/null
@@ -0,0 +1,893 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents a remote resource.
+    /// It provides APIs to manage remote resource.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class RemoteResource : IDisposable
+    {
+        internal const int TimeOutMax = 3600;
+        internal IntPtr _remoteResourceHandle = IntPtr.Zero;
+
+        private bool _disposed = false;
+        private bool _cacheEnabled = false;
+        private ResourceOptions _options;
+
+        private int _responseCallbackId = 1;
+        private static Dictionary<IntPtr, Interop.IoTConnectivity.Client.RemoteResource.ResponseCallback> _responseCallbacksMap = new Dictionary<IntPtr, Interop.IoTConnectivity.Client.RemoteResource.ResponseCallback>();
+
+        private Interop.IoTConnectivity.Client.RemoteResource.CachedRepresentationChangedCallback _cacheUpdatedCallback;
+        private Interop.IoTConnectivity.Client.RemoteResource.StateChangedCallback _stateChangedCallback;
+        private Interop.IoTConnectivity.Client.RemoteResource.ObserveCallback _observeCallback;
+
+        private EventHandler<StateChangedEventArgs> _stateChangedEventHandler;
+
+        /// <summary>
+        /// Creates a remote resource instance.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// To use this API, you should provide all the details required to correctly contact and
+        /// observe the object.\n
+        /// If not, you should discover the resource object manually.\n
+        /// The @a policy can contain multiple policies like ResourcePolicy.Discoverable | ResourcePolicy.Observable.
+        /// </remarks>
+        /// <param name="hostAddress">The host address of the resource.</param>
+        /// <param name="uriPath">The URI path of the resource.</param>
+        /// <param name="policy">The policies of the resource.</param>
+        /// <param name="resourceTypes">The resource types of the resource.</param>
+        /// <param name="resourceInterfaces">The resource interfaces of the resource.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        public RemoteResource(string hostAddress, string uriPath, ResourcePolicy policy, ResourceTypes resourceTypes, ResourceInterfaces resourceInterfaces)
+        {
+            if (hostAddress == null || uriPath == null || resourceTypes == null || resourceInterfaces == null)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid parameters");
+                throw new ArgumentException("Invalid parameter");
+            }
+
+            HostAddress = hostAddress;
+            UriPath = uriPath;
+            Policy = policy;
+            Types = new List<string>(resourceTypes);
+            Interfaces = new List<string>(resourceInterfaces);
+            DeviceId = null;
+
+            CreateRemoteResource(resourceTypes._resourceTypeHandle, resourceInterfaces.ResourceInterfacesHandle);
+        }
+
+        internal RemoteResource(IntPtr handleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.Clone(handleToClone, out _remoteResourceHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to clone");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            SetRemoteResource();
+        }
+
+        /// <summary>
+        /// Destructor of the RemoteResource class.
+        /// </summary>
+        ~RemoteResource()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The event is invoked with cached resource attributes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public event EventHandler<CacheUpdatedEventArgs> CacheUpdated;
+
+        /// <summary>
+        /// Observe an event on the resource sent by the server.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public event EventHandler<ObserverNotifiedEventArgs> ObserverNotified;
+
+        /// <summary>
+        /// The event is called when remote resource's state are changed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public event EventHandler<StateChangedEventArgs> StateChanged
+        {
+            add
+            {
+                if (_stateChangedEventHandler == null)
+                {
+                    RegisterStateChangedEvent();
+                }
+                _stateChangedEventHandler += value;
+            }
+            remove
+            {
+                _stateChangedEventHandler -= value;
+                if (_stateChangedEventHandler == null)
+                {
+                    UnregisterStateChangedEvent();
+                }
+            }
+        }
+
+        /// <summary>
+        /// The host address of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The host address of the resource.</value>
+        public string HostAddress { get; private set; }
+
+        /// <summary>
+        /// The URI path of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The URI path of the resource.</value>
+        public string UriPath { get; private set; }
+
+        /// <summary>
+        /// The resource types of the remote resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The resource types of the remote resource.</value>
+        public IEnumerable<string> Types { get; private set; }
+
+        /// <summary>
+        /// The interfaces of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The interfaces of the resource.</value>
+        public IEnumerable<string> Interfaces { get; private set; }
+
+        /// <summary>
+        /// The policy of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The policy of the resource.</value>
+        public ResourcePolicy Policy { get; private set; }
+
+        /// <summary>
+        /// The header options of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The header options of the resource.</value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        public ResourceOptions Options
+        {
+            get
+            {
+                return _options;
+            }
+            set
+            {
+                _options = value;
+                if (value != null)
+                {
+                    int ret = Interop.IoTConnectivity.Client.RemoteResource.SetOptions(_remoteResourceHandle, value._resourceOptionsHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set options");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Indicates the CacheEnabled status of the remote resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// Client can start caching only when this is set true. Set it to false to stop caching the resource attributes.
+        /// </value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        public bool CacheEnabled
+        {
+            get
+            {
+                return _cacheEnabled;
+            }
+            set
+            {
+                if (_cacheEnabled != value)
+                {
+                    _cacheEnabled = value;
+                    HandleCachePolicyChanged();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Time interval of monitoring and caching API.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// Default time interval is 10 seconds.
+        /// Seconds for time interval (must be in range from 1 to 3600).
+        /// </value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        public int TimeInterval
+        {
+            get
+            {
+                int interval;
+                int ret = Interop.IoTConnectivity.Client.RemoteResource.GetTimeInterval(_remoteResourceHandle, out interval);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get time interval");
+                    return 0;
+                }
+                return interval;
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (value <= TimeOutMax && value > 0)
+                {
+                    ret = Interop.IoTConnectivity.Client.RemoteResource.SetTimeInterval(_remoteResourceHandle, value);
+                }
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set time interval");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The device ID of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The device ID of the resource.</value>
+        public string DeviceId { get; private set; }
+
+        /// <summary>
+        /// Gets cached representation from the remote resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>cached representation from the remote resource.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public Representation CachedRepresentation()
+        {
+            IntPtr handle;
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.GetCachedRepresentation(_remoteResourceHandle, out handle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get CachedRepresentation");
+                return null;
+            }
+
+            Representation representation = new Representation(handle);
+            return representation;
+        }
+
+        /// <summary>
+        /// Starts observing on the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// When server sends notification message, <see cref="ObserverNotified"/> will be called.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="policy">The type to specify how client wants to observe.</param>
+        /// <param name="query">The query to send to server.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        public void StartObserving(ObservePolicy policy, ResourceQuery query = null)
+        {
+            _observeCallback = (IntPtr resource, int err, int sequenceNumber, IntPtr response, IntPtr userData) =>
+            {
+                int result;
+                IntPtr representationHandle;
+                int ret = Interop.IoTConnectivity.Server.Response.GetResult(response, out result);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get result");
+                    return;
+                }
+
+                ret = Interop.IoTConnectivity.Server.Response.GetRepresentation(response, out representationHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get representation");
+                    return;
+                }
+
+                Representation repr = null;
+                try
+                {
+                    repr = new Representation(representationHandle);
+                }
+                catch (Exception exp)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new representation: " + exp.Message);
+                    return;
+                }
+
+                ObserverNotifiedEventArgs e = new ObserverNotifiedEventArgs()
+                {
+                    Representation = repr,
+                    Result = (ResponseCode)result
+                };
+                ObserverNotified?.Invoke(this, e);
+            };
+
+            IntPtr queryHandle = IntPtr.Zero;
+            if (query != null)
+            {
+                queryHandle = query._resourceQueryHandle;
+            }
+
+            int errCode = Interop.IoTConnectivity.Client.RemoteResource.RegisterObserve(_remoteResourceHandle, (int)policy, queryHandle, _observeCallback, IntPtr.Zero);
+            if (errCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register observe callbacks");
+                throw IoTConnectivityErrorFactory.GetException(errCode);
+            }
+        }
+
+        /// <summary>
+        /// Stops observing on the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        public void StopObserving()
+        {
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.DeregisterObserve(_remoteResourceHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to deregister observe callbacks");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Gets the attributes of a resource asynchronously.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="query">The ResourceQuery to send to server.</param>
+        /// <returns>Remote response with result and representation.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public async Task<RemoteResponse> GetAsync(ResourceQuery query = null)
+        {
+            TaskCompletionSource<RemoteResponse> tcsRemoteResponse = new TaskCompletionSource<RemoteResponse>();
+
+            IntPtr id = IntPtr.Zero;
+            lock (_responseCallbacksMap)
+            {
+                id = (IntPtr)_responseCallbackId++;
+            }
+            _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) =>
+            {
+                IntPtr responseCallbackId = userData;
+                lock(_responseCallbacksMap)
+                {
+                    _responseCallbacksMap.Remove(responseCallbackId);
+                }
+
+                if (responseHandle != IntPtr.Zero)
+                {
+                    try
+                    {
+                        tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle));
+                    }
+                    catch(Exception exp)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message);
+                        tcsRemoteResponse.TrySetException(exp);
+                    }
+                }
+                else
+                {
+                    tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System));
+                }
+            };
+
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errCode = Interop.IoTConnectivity.Client.RemoteResource.Get(_remoteResourceHandle, queryHandle, _responseCallbacksMap[id], id);
+            if (errCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource attributes");
+                tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode));
+            }
+            return await tcsRemoteResponse.Task;
+        }
+
+        /// <summary>
+        /// Puts the representation of a resource asynchronously.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="representation">Resource representation to put.</param>
+        /// <param name="query">The ResourceQuery to send to server.</param>
+        /// <returns>Remote response with result and representation.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public async Task<RemoteResponse> PutAsync(Representation representation, ResourceQuery query = null)
+        {
+            TaskCompletionSource<RemoteResponse> tcsRemoteResponse = new TaskCompletionSource<RemoteResponse>();
+
+            IntPtr id = IntPtr.Zero;
+            lock (_responseCallbacksMap)
+            {
+                id = (IntPtr)_responseCallbackId++;
+            }
+            _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) =>
+            {
+                IntPtr responseCallbackId = userData;
+                lock (_responseCallbacksMap)
+                {
+                    _responseCallbacksMap.Remove(responseCallbackId);
+                }
+                if (err == (int)(IoTConnectivityError.Iotivity))
+                {
+                    RemoteResponse response = new RemoteResponse();
+                    response.Result = ResponseCode.Forbidden;
+                    response.Representation = null;
+                    tcsRemoteResponse.TrySetResult(response);
+                }
+                else if (responseHandle != IntPtr.Zero)
+                {
+                    try
+                    {
+                        tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle));
+                    }
+                    catch (Exception exp)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message);
+                        tcsRemoteResponse.TrySetException(exp);
+                    }
+                }
+                else
+                {
+                    tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System));
+                }
+            };
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errCode = Interop.IoTConnectivity.Client.RemoteResource.Put(_remoteResourceHandle, representation._representationHandle, queryHandle, _responseCallbacksMap[id], id);
+            if (errCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to put resource representation");
+                tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode));
+            }
+            return await tcsRemoteResponse.Task;
+        }
+
+        /// <summary>
+        /// Posts request on a resource asynchronously.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="representation">Resource representation of request.</param>
+        /// <param name="query">The ResourceQuery to send to server.</param>
+        /// <returns>Remote response with result and representation.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public async Task<RemoteResponse> PostAsync(Representation representation, ResourceQuery query = null)
+        {
+            TaskCompletionSource<RemoteResponse> tcsRemoteResponse = new TaskCompletionSource<RemoteResponse>();
+
+            IntPtr id = IntPtr.Zero;
+            lock (_responseCallbacksMap)
+            {
+                id = (IntPtr)_responseCallbackId++;
+            }
+            _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) =>
+            {
+                IntPtr responseCallbackId = userData;
+                lock (_responseCallbacksMap)
+                {
+                    _responseCallbacksMap.Remove(responseCallbackId);
+                }
+                if (responseHandle != IntPtr.Zero)
+                {
+                    try
+                    {
+                        tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle));
+                    }
+                    catch (Exception exp)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message);
+                        tcsRemoteResponse.TrySetException(exp);
+                    }
+                }
+                else
+                {
+                    tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System));
+                }
+            };
+            IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle;
+            int errCode = Interop.IoTConnectivity.Client.RemoteResource.Post(_remoteResourceHandle, representation._representationHandle, queryHandle, _responseCallbacksMap[id], id);
+            if (errCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to post request");
+                tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode));
+            }
+            return await tcsRemoteResponse.Task;
+        }
+
+        /// <summary>
+        /// Deletes the resource asynchronously.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <returns>Remote response with result and representation.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public async Task<RemoteResponse> DeleteAsync()
+        {
+            TaskCompletionSource<RemoteResponse> tcsRemoteResponse = new TaskCompletionSource<RemoteResponse>();
+
+            IntPtr id = IntPtr.Zero;
+            lock (_responseCallbacksMap)
+            {
+                id = (IntPtr)_responseCallbackId++;
+            }
+            _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) =>
+            {
+                IntPtr responseCallbackId = userData;
+                lock (_responseCallbacksMap)
+                {
+                    _responseCallbacksMap.Remove(responseCallbackId);
+                }
+                if (err == (int)(IoTConnectivityError.Iotivity))
+                {
+                    RemoteResponse response = new RemoteResponse();
+                    response.Result = ResponseCode.Forbidden;
+                    response.Representation = null;
+                    tcsRemoteResponse.TrySetResult(response);
+                }
+                else if (responseHandle != IntPtr.Zero)
+                {
+                    try
+                    {
+                        tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle));
+                    }
+                    catch (Exception exp)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message);
+                        tcsRemoteResponse.TrySetException(exp);
+                    }
+                }
+                else
+                {
+                    tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System));
+                }
+            };
+
+            int errCode = Interop.IoTConnectivity.Client.RemoteResource.Delete(_remoteResourceHandle, _responseCallbacksMap[id], id);
+            if (errCode != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to delete");
+                tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode));
+            }
+            return await tcsRemoteResponse.Task;
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal static Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType GetConnectivityType(string hostAddress)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.None;
+
+            Log.Info(IoTConnectivityErrorFactory.LogTag, hostAddress);
+
+            if (hostAddress == IoTConnectivityClientManager.MulticastAddress)
+            {
+                type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv4;
+            }
+            else
+            {
+                IPAddress address;
+                string hostName = hostAddress;
+                if (hostAddress.Contains(":"))
+                {
+                    string[] hostParts = hostAddress.Split(':');
+                    if (hostParts.Length == 2)
+                    {
+                        hostName = hostParts[0];
+                    }
+                }
+                if (hostAddress.Contains("%"))
+                {
+                    string[] hostParts = hostAddress.Split('%');
+                    if (hostParts.Length == 2)
+                    {
+                        hostName = hostParts[0];
+                    }
+                }
+                if (hostName.Contains("["))
+                {
+                    string[] hostParts = hostName.Split('[');
+                    if (hostParts.Length == 2)
+                    {
+                        hostName = hostParts[1];
+                    }
+                }
+                Log.Info(IoTConnectivityErrorFactory.LogTag, hostName);
+                if (IPAddress.TryParse(hostName, out address))
+                {
+                    switch (address.AddressFamily)
+                    {
+                        case System.Net.Sockets.AddressFamily.InterNetwork:
+                            type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv4;
+                            break;
+                        case System.Net.Sockets.AddressFamily.InterNetworkV6:
+                            type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv6;
+                            break;
+                        default:
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to parse for Ipv4 or Ipv6");
+                            break;
+                    }
+                }
+                else
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to parse hostname " + hostName);
+                }
+            }
+            return type;
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Client.RemoteResource.Destroy(_remoteResourceHandle);
+            _disposed = true;
+        }
+
+        private void HandleCachePolicyChanged()
+        {
+            if (_cacheEnabled)
+            {
+                _cacheUpdatedCallback = (IntPtr resource, IntPtr representation, IntPtr userData) =>
+                {
+                    if (CacheEnabled)
+                    {
+                        Representation repr = null;
+                        try
+                        {
+                            repr = new Representation(representation);
+                        }
+                        catch (Exception exp)
+                        {
+                            Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new Representation: " + exp.Message);
+                            return;
+                        }
+
+                        CacheUpdatedEventArgs e = new CacheUpdatedEventArgs()
+                        {
+                            Representation = repr
+                        };
+                        CacheUpdated?.Invoke(this, e);
+                    }
+                };
+
+                int ret = Interop.IoTConnectivity.Client.RemoteResource.StartCaching(_remoteResourceHandle, _cacheUpdatedCallback, IntPtr.Zero);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add cache updated event handler");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else
+            {
+                int ret = Interop.IoTConnectivity.Client.RemoteResource.StopCaching(_remoteResourceHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove cache updated event handler");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        private void RegisterStateChangedEvent()
+        {
+            _stateChangedCallback = (IntPtr resource, int state, IntPtr userData) =>
+            {
+                StateChangedEventArgs e = new StateChangedEventArgs()
+                {
+                    State = (ResourceState)state
+                };
+                _stateChangedEventHandler?.Invoke(null, e);
+            };
+
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.StartMonitoring(_remoteResourceHandle, _stateChangedCallback, IntPtr.Zero);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add state changed event handler");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        private void UnregisterStateChangedEvent()
+        {
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.StopMonitoring(_remoteResourceHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove state changed event handler");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        private void CreateRemoteResource(IntPtr resourceTypeHandle, IntPtr resourceInterfaceHandle)
+        {
+            Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = GetConnectivityType(HostAddress);
+            if (connectivityType == Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Unable to parse host address");
+                throw new ArgumentException("Unable to parse host address");
+            }
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.Create(HostAddress, (int)connectivityType, UriPath, (int)Policy, resourceTypeHandle, resourceInterfaceHandle, out _remoteResourceHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get remote resource");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        private void SetRemoteResource()
+        {
+            IntPtr hostAddressPtr, uriPathPtr;
+            int ret = Interop.IoTConnectivity.Client.RemoteResource.GetHostAddress(_remoteResourceHandle, out hostAddressPtr);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get host address");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.IoTConnectivity.Client.RemoteResource.GetUriPath(_remoteResourceHandle, out uriPathPtr);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get uri path");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            int policy = (int)ResourcePolicy.NoProperty;
+            ret = Interop.IoTConnectivity.Client.RemoteResource.GetPolicies(_remoteResourceHandle, out policy);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get uri path");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            IntPtr typesHandle, interfacesHandle;
+            ret = Interop.IoTConnectivity.Client.RemoteResource.GetTypes(_remoteResourceHandle, out typesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource types");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.IoTConnectivity.Client.RemoteResource.GetInterfaces(_remoteResourceHandle, out interfacesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource interfaces");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            IntPtr deviceIdPtr;
+            ret = Interop.IoTConnectivity.Client.RemoteResource.GetDeviceId(_remoteResourceHandle, out deviceIdPtr);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device id");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            DeviceId = (deviceIdPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(deviceIdPtr) : string.Empty;
+            HostAddress = (hostAddressPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hostAddressPtr) : string.Empty;
+            UriPath = (uriPathPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(uriPathPtr) : string.Empty;
+            Types = new ResourceTypes(typesHandle);
+            Interfaces = new ResourceInterfaces(interfacesHandle);
+            Policy = (ResourcePolicy)policy;
+        }
+
+        private RemoteResponse GetRemoteResponse(IntPtr response)
+        {
+            int result;
+            IntPtr representationHandle, optionsHandle;
+            int ret = Interop.IoTConnectivity.Server.Response.GetResult(response, out result);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get result");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.IoTConnectivity.Server.Response.GetRepresentation(response, out representationHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get representation");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            ret = Interop.IoTConnectivity.Server.Response.GetOptions(response, out optionsHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get options");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            return new RemoteResponse()
+            {
+                Result = (ResponseCode)result,
+                Representation = new Representation(representationHandle),
+                Options = (optionsHandle == IntPtr.Zero)? null : new ResourceOptions(optionsHandle)
+            };
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs
new file mode 100755 (executable)
index 0000000..cff7d44
--- /dev/null
@@ -0,0 +1,50 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents a remote response.
+    /// It represents the response of all CRUD operations.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class RemoteResponse
+    {
+        internal RemoteResponse() { }
+
+        /// <summary>
+        /// Indicates the result of the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The result of the response.</value>
+        public ResponseCode Result { get; internal set; }
+
+        /// <summary>
+        /// Indicates representation of the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Representation of the response.</value>
+        public Representation Representation { get; internal set; }
+
+        /// <summary>
+        /// Indicates header options of the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Header options of the response.</value>
+        public ResourceOptions Options { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs
new file mode 100755 (executable)
index 0000000..8281a55
--- /dev/null
@@ -0,0 +1,362 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class provides APIs to manage representation.
+    /// A representation is a payload of a request or a response.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Representation : IDisposable
+    {
+        internal IntPtr _representationHandle = IntPtr.Zero;
+
+        private bool _disposed = false;
+        private ObservableCollection<Representation> _children = new ObservableCollection<Representation>();
+
+        /// <summary>
+        /// The Representation constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// </code>
+        public Representation()
+        {
+            int ret = Interop.IoTConnectivity.Common.Representation.Create(out _representationHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create representation");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            _children.CollectionChanged += ChildrenCollectionChanged;
+        }
+
+        // Constructor for cloning native representation object
+        internal Representation(IntPtr handleToClone)
+        {
+            int ret = (int)IoTConnectivityError.InvalidParameter;
+            if (handleToClone != IntPtr.Zero)
+            {
+                ret = Interop.IoTConnectivity.Common.Representation.Clone(handleToClone, out _representationHandle);
+            }
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create representation");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            _children.CollectionChanged += ChildrenCollectionChanged;
+        }
+
+        /// <summary>
+        /// Destructor of the Representation class.
+        /// </summary>
+        ~Representation()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The URI path of resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// The URI path of resource.
+        /// Setter can throw exceptions.
+        /// </value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// repr.UriPath = "/a/light";
+        /// Console.WriteLine("URI is {0}", repr.UriPath);  //Getter
+        /// </code>
+        public string UriPath
+        {
+            get
+            {
+                IntPtr path;
+                int ret = Interop.IoTConnectivity.Common.Representation.GetUriPath(_representationHandle, out path);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get uri");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                return (path != IntPtr.Zero) ? Marshal.PtrToStringAnsi(path) : string.Empty;
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (value != null)
+                    ret = Interop.IoTConnectivity.Common.Representation.SetUriPath(_representationHandle, value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set uri");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The type of resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The type of resource.</value>
+        /// <seealso cref="ResourceTypes"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// ResourceTypes types = new ResourceTypes (new List<string>(){ "org.tizen.light" });
+        /// repr.Type = types;
+        /// var type = repr.Type;   // Getter
+        /// foreach (string item in type)
+        /// {
+        ///     Console.WriteLine("Type is {0}", item);
+        /// }
+        /// </code>
+        public ResourceTypes Type
+        {
+            get
+            {
+                IntPtr typeHandle;
+                int ret = Interop.IoTConnectivity.Common.Representation.GetResourceTypes(_representationHandle, out typeHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type");
+                    return null;
+                }
+                return (typeHandle == IntPtr.Zero) ? null : new ResourceTypes(typeHandle);
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (value != null)
+                    ret = Interop.IoTConnectivity.Common.Representation.SetResourceTypes(_representationHandle, value._resourceTypeHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set type");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// The interface of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The interface of the resource.</value>
+        /// <seealso cref="ResourceInterfaces"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// ResourceInterfaces ifaces = new ResourceInterfaces (new List<string>(){ ResourceInterfaces.DefaultInterface });
+        /// repr.Interface = ifaces;
+        /// var iface = repr.Interface;   // Getter
+        /// foreach (string item in iface)
+        /// {
+        ///     Console.WriteLine("Interface is {0}", iface);
+        /// }
+        /// </code>
+        public ResourceInterfaces Interface
+        {
+            get
+            {
+                IntPtr interfaceHandle;
+                int ret = Interop.IoTConnectivity.Common.Representation.GetResourceInterfaces(_representationHandle, out interfaceHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface");
+                    return null;
+                }
+                return (interfaceHandle == IntPtr.Zero) ? null : new ResourceInterfaces(interfaceHandle);
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (value != null)
+                    ret = Interop.IoTConnectivity.Common.Representation.SetResourceInterfaces(_representationHandle, value.ResourceInterfacesHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set interface");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Current attributes of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Current attributes of the resource.</value>
+        /// <seealso cref="Attributes"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// Attributes attributes = new Attributes() {
+        ///     { "state", "ON" },
+        ///     { "dim", 10 }
+        /// };
+        /// repr.Attributes = attributes;
+        /// var newAttributes = repr.Attributes;   // Getter
+        /// string strval = newAttributes["state"] as string;
+        /// int intval = (int)newAttributes["dim"];
+        /// Console.WriteLine("attributes are {0} and {1}", strval, intval);
+        /// </code>
+        public Attributes Attributes
+        {
+            get
+            {
+                IntPtr attributeHandle;
+                int ret = Interop.IoTConnectivity.Common.Representation.GetAttributes(_representationHandle, out attributeHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                return (attributeHandle == IntPtr.Zero) ? null : new Attributes(attributeHandle);
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (value != null)
+                {
+                    ret = Interop.IoTConnectivity.Common.Representation.SetAttributes(_representationHandle, value._resourceAttributesHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set attributes");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// List of Child resource representation.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>List of Child resource representation.</value>
+        /// <code>
+        /// Representation repr = new Representation();
+        /// Representation child1 = new Representation();
+        /// ResourceTypes types1 = new ResourceTypes(new List<string>() { "org.tizen.light" });
+        /// child1.Type = types1;
+        /// ResourceInterfaces ifaces1 = new ResourceInterfaces(new List<string>() { ResourceInterfaces.DefaultInterface });
+        /// child1.Interface = ifaces1;
+        /// try
+        /// {
+        ///     repr.Children.Add(child1);
+        ///     Console.WriteLine("Number of children : {0}", repr.Children.Count);
+        ///     Representation firstChild = repr.Children.ElementAt(0);
+        /// } catch(Exception ex)
+        /// {
+        ///     Console.WriteLine("Exception caught : " + ex.Message);
+        /// }
+        /// </code>
+        public ICollection<Representation> Children
+        {
+            get
+            {
+                return _children;
+            }
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+                Type?.Dispose();
+                Interface?.Dispose();
+                Attributes?.Dispose();
+                foreach(var child in Children)
+                {
+                    child.Dispose();
+                }
+            }
+
+            Interop.IoTConnectivity.Common.Representation.Destroy(_representationHandle);
+            _disposed = true;
+        }
+
+        private void ChildrenCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+        {
+            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
+            {
+                foreach (Representation r in e.NewItems)
+                {
+                    int ret = Interop.IoTConnectivity.Common.Representation.AddChild(_representationHandle, r._representationHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add child");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
+            {
+                foreach (Representation r in e.NewItems)
+                {
+                    int ret = Interop.IoTConnectivity.Common.Representation.RemoveChild(_representationHandle, r._representationHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove child");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs
new file mode 100755 (executable)
index 0000000..bbaeae5
--- /dev/null
@@ -0,0 +1,103 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Class respresenting request to a resource.
+    /// It provides APIs to manage client's request.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Request : IDisposable
+    {
+        private bool _disposed = false;
+
+        internal Request()
+        {
+        }
+
+        /// <summary>
+        /// Destructor of the Request class.
+        /// </summary>
+        ~Request()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The host address of the request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The host address of the request.</value>
+        public string HostAddress { get; internal set; }
+
+        /// <summary>
+        /// The representation of the request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The representation of the request.</value>
+        public Representation Representation { get; internal set; }
+
+        /// <summary>
+        /// The query of the request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The query of the request.</value>
+        public ResourceQuery Query { get; internal set; }
+
+        /// <summary>
+        /// The options related to the request.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The options related to the request.</value>
+        public ResourceOptions Options { get; internal set; }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                Representation?.Dispose();
+                Query?.Dispose();
+                Options?.Dispose();
+            }
+
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs
new file mode 100755 (executable)
index 0000000..deb277c
--- /dev/null
@@ -0,0 +1,510 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Abstract class respresenting a resource.
+    /// All resources need to inherit from this class.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public abstract class Resource : IDisposable
+    {
+        private IntPtr _resourceHandle = IntPtr.Zero;
+        private bool _disposed = false;
+        private ObservableCollection<Resource> _children = new ObservableCollection<Resource>();
+        private IntPtr _observerHandle = IntPtr.Zero;
+
+        /// <summary>
+        /// The constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// @a uri format would be relative URI path like '/a/light'
+        /// and its length must be less than 128.
+        /// </remarks>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="uri">The URI path of the resource.</param>
+        /// <param name="types">Resource types.</param>
+        /// <param name="interfaces">Resource interfaces.</param>
+        /// <param name="policy">The policies of the resoruce.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="ResourceTypes"/>
+        /// <seealso cref="ResourceInterfaces"/>
+        /// <seealso cref="ResourcePolicy"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// // Create a class which inherits from Resource
+        /// public class DoorResource : Resource
+        /// {
+        ///     public DoorResource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy)
+        ///             : base(uri, types, interfaces, policy) {
+        ///     }
+        ///     protected override Response OnDelete(Request request) {
+        ///         // Do something
+        ///     }
+        ///     protected override Response OnGet(Request request) {
+        ///         // Do something
+        ///     }
+        ///     // Override other abstract methods of Resource class
+        /// }
+        ///
+        /// // Use it like below
+        /// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
+        /// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new" });
+        /// Resource resource = new DoorResource("/door/uri1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+        /// </code>
+        protected Resource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy)
+        {
+            UriPath = uri;
+            Types = types;
+            Interfaces = interfaces;
+            Policy = policy;
+
+            _children.CollectionChanged += ChildrenCollectionChanged;
+
+            int ret = Interop.IoTConnectivity.Server.Observers.Create(out _observerHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create obsever handle");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the Resource class.
+        /// </summary>
+        ~Resource()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Type details of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Type details of the resource.</value>
+        public ResourceTypes Types { get; internal set; }
+
+        /// <summary>
+        /// Interface details of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Interface details of the resource.</value>
+        public ResourceInterfaces Interfaces { get; internal set; }
+
+        /// <summary>
+        /// The policies of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The policies of the resource.</value>
+        public ResourcePolicy Policy { get; internal set; }
+
+        /// <summary>
+        /// URI path of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>URI path of the resource.</value>
+        public string UriPath { get; internal set; }
+
+        /// <summary>
+        /// List of Child resources.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>List of Child resources.</value>
+        public ICollection<Resource> Children
+        {
+            get
+            {
+                return _children;
+            }
+        }
+
+        internal IntPtr ResourceHandle
+        {
+            get
+            {
+                return _resourceHandle;
+            }
+            set
+            {
+                _resourceHandle = value;
+            }
+        }
+
+        /// <summary>
+        /// Notify the specified representation and qos.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>
+        /// http://tizen.org/privilege/internet
+        /// </privilege>
+        /// <privlevel>public</privlevel>
+        /// <param name="representation">Representation.</param>
+        /// <param name="qos">The quality of service for message transfer.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <pre>
+        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
+        /// </pre>
+        /// <seealso cref="Representation"/>
+        /// <seealso cref="QualityOfService"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
+        /// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" });
+        /// Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+        /// IoTConnectivityServerManager.RegisterResource(resource);
+        ///
+        /// Representation repr = new Representation();
+        /// repr.UriPath = "/door/uri/new/notify";
+        /// repr.Type = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" });
+        /// repr.Attributes = new Attributes() {
+        ///      _attribute, 1 }
+        /// };
+        /// resource.Notify(repr, QualityOfService.High);
+        /// </code>
+        public void Notify(Representation representation, QualityOfService qos)
+        {
+            int ret = (int)IoTConnectivityError.None;
+            ret = Interop.IoTConnectivity.Server.Resource.Notify(_resourceHandle, representation._representationHandle, _observerHandle, (int)qos);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send notification");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// This is called when the client performs get operation on this resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="request">A request from client.</param>
+        /// <returns>A response having the representation and the result.</returns>
+        protected abstract Response OnGet(Request request);
+
+        /// <summary>
+        /// This is called when the client performs put operation on this resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="request">A request from client.</param>
+        /// <returns>A response.</returns>
+        protected abstract Response OnPut(Request request);
+
+        /// <summary>
+        /// This is called when the client performs post operation on this resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="request">A request from client.</param>
+        /// <returns>A response having the representation and the result.</returns>
+        protected abstract Response OnPost(Request request);
+
+        /// <summary>
+        /// This is called when the client performs delete operation on this resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="request">A request from client.</param>
+        /// <returns>A response.</returns>
+        protected abstract Response OnDelete(Request request);
+
+        /// <summary>
+        /// Called on the observing event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="request">A request from client.</param>
+        /// <param name="type">Observer type.</param>
+        /// <param name="observeId">Observe identifier.</param>
+        /// <returns>Returns true if it wants to be observed, else false.</returns>
+        protected abstract bool OnObserving(Request request, ObserveType type, int observeId);
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                Types?.Dispose();
+                Interfaces?.Dispose();
+            }
+
+            if (_resourceHandle != IntPtr.Zero)
+                Interop.IoTConnectivity.Server.Resource.Destroy(_resourceHandle);
+            if (_observerHandle != IntPtr.Zero)
+                Interop.IoTConnectivity.Server.Observers.Destroy(_observerHandle);
+            _disposed = true;
+        }
+
+        // This method is used as callback for Resource
+        internal void OnRequest(IntPtr resourceHandle, IntPtr requestHandle, IntPtr userData)
+        {
+            Request request = GetRequest(requestHandle);
+            Response response = null;
+
+            if (request == null)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get Request");
+                return;
+            }
+
+            try
+            {
+                int observeType;
+                int ret = Interop.IoTConnectivity.Server.Request.GetObserveType(requestHandle, out observeType);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get observe type");
+                    return;
+                }
+                if ((ObserveType)observeType != ObserveType.NoType)
+                {
+                    int observeId;
+                    ret = Interop.IoTConnectivity.Server.Request.GetObserveId(requestHandle, out observeId);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get observe id");
+                        return;
+                    }
+                    switch ((ObserveType)observeType)
+                    {
+                        case ObserveType.Register:
+                        {
+                            if (OnObserving(request, ObserveType.Register, observeId))
+                            {
+                                ret = Interop.IoTConnectivity.Server.Observers.Add(_observerHandle, observeId);
+                                if (ret != (int)IoTConnectivityError.None)
+                                {
+                                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add observer id");
+                                    return;
+                                }
+                                break;
+                            }
+                            else
+                            {
+                                // If OnObserving for ObserveType.Register returns false, do not operate for Get operation after Observe operation.
+                                return;
+                            }
+                        }
+                        case ObserveType.Deregister:
+                        {
+                            if (OnObserving(request, ObserveType.Deregister, observeId))
+                            {
+                                ret = Interop.IoTConnectivity.Server.Observers.Remove(_observerHandle, observeId);
+                                if (ret != (int)IoTConnectivityError.None)
+                                {
+                                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove observer id");
+                                    return;
+                                }
+                                break;
+                            }
+                            else
+                            {
+                                // If OnObserving for ObserveType.Deregister returns false, do not operate for Get operation after Observe operation.
+                                return;
+                            }
+                        }
+                    }
+                }
+                int requestType;
+                ret = Interop.IoTConnectivity.Server.Request.GetRequestType(requestHandle, out requestType);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get request type");
+                    return;
+                }
+                switch ((Interop.IoTConnectivity.Server.RequestType)requestType)
+                {
+                    case Interop.IoTConnectivity.Server.RequestType.Put:
+                    {
+                        response = OnPut(request);
+                        break;
+                    }
+                    case Interop.IoTConnectivity.Server.RequestType.Get:
+                    {
+                        response = OnGet(request);
+                        break;
+                    }
+                    case Interop.IoTConnectivity.Server.RequestType.Post:
+                    {
+                        response = OnPost(request);
+                        break;
+                    }
+                    case Interop.IoTConnectivity.Server.RequestType.Delete:
+                    {
+                        response = OnDelete(request);
+                        break;
+                    }
+                    default:
+                       break;
+                }
+                if (response == null)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send Response");
+                    return;
+                }
+
+                if (!response.Send(requestHandle))
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send Response");
+                    return;
+                }
+            }
+            finally
+            {
+                request?.Dispose();
+                response?.Dispose();
+            }
+        }
+
+        private Request GetRequest(IntPtr requestHandle)
+        {
+            IntPtr hostAddressPtr;
+            int ret = Interop.IoTConnectivity.Server.Request.GetHostAddress(requestHandle, out hostAddressPtr);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get host address");
+                return null;
+            }
+
+            IntPtr optionsHandle = IntPtr.Zero;
+            ret = Interop.IoTConnectivity.Server.Request.GetOptions(requestHandle, out optionsHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get options");
+                return null;
+            }
+
+            IntPtr queryHandle = IntPtr.Zero;
+            ret = Interop.IoTConnectivity.Server.Request.GetQuery(requestHandle, out queryHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get Query");
+                return null;
+            }
+
+            IntPtr representationHandle = IntPtr.Zero;
+            ret = Interop.IoTConnectivity.Server.Request.GetRepresentation(requestHandle, out representationHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get representation");
+                return null;
+            }
+
+            ResourceOptions opts = null;
+            ResourceQuery query = null;
+            Representation representation = null;
+            try
+            {
+                opts = (optionsHandle == IntPtr.Zero) ? null : new ResourceOptions(optionsHandle);
+            }
+            catch (Exception exp)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new ResourceOptions: " + exp.Message);
+                return null;
+            }
+
+            try
+            {
+                query = (queryHandle == IntPtr.Zero) ? null : new ResourceQuery(queryHandle);
+            }
+            catch (Exception exp)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new ResourceQuery: " + exp.Message);
+                opts?.Dispose();
+                return null;
+            }
+
+            try
+            {
+                representation = (representationHandle == IntPtr.Zero) ? null : new Representation(representationHandle);
+            }
+            catch (Exception exp)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new Representation: " + exp.Message);
+                opts?.Dispose();
+                query?.Dispose();
+                return null;
+            }
+
+            return new Request()
+            {
+                HostAddress = (hostAddressPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hostAddressPtr) : string.Empty,
+                Options = opts,
+                Query = query,
+                Representation = representation
+            };
+        }
+
+        private void ChildrenCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs)
+        {
+            if (eventArgs.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
+            {
+                foreach (Resource r in eventArgs.NewItems)
+                {
+                    int ret = Interop.IoTConnectivity.Server.Resource.BindChildResource(_resourceHandle, r._resourceHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to bind resource ");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+            else if (eventArgs.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
+            {
+                foreach (Resource r in eventArgs.NewItems)
+                {
+                    int ret = Interop.IoTConnectivity.Server.Resource.UnbindChildResource(_resourceHandle, r._resourceHandle);
+                    if (ret != (int)IoTConnectivityError.None)
+                    {
+                        Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to unbind resource");
+                        throw IoTConnectivityErrorFactory.GetException(ret);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs
new file mode 100755 (executable)
index 0000000..6673d7f
--- /dev/null
@@ -0,0 +1,54 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the ResourceFound event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ResourceFoundEventArgs : EventArgs
+    {
+        internal ResourceFoundEventArgs() { }
+
+        /// <summary>
+        /// Indicates the request ID.
+        /// This is the same request ID returned by the <see cref="IoTConnectivityClientManager.StartFindingResource()"/> API.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The request ID.</value>
+        public int RequestId { get; internal set; }
+
+        /// <summary>
+        /// Indicates to continuously receive the event for finding resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Continuously receive the event for finding resource.</value>
+        public bool EventContinue { get; set; }
+
+        /// <summary>
+        /// Remote resource, which is found after <see cref="IoTConnectivityClientManager.StartFindingResource()"/>.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Remote resource which is found after <see cref="IoTConnectivityClientManager.StartFindingResource()"/>.</value>
+        /// <seealso cref="IoTConnectivityClientManager.ResourceFound"/>
+        /// <seealso cref="IoTConnectivityClientManager.StartFindingResource()"/>
+        public RemoteResource Resource { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs
new file mode 100755 (executable)
index 0000000..fbdf220
--- /dev/null
@@ -0,0 +1,312 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class contains resource interfaces and provides APIs to manage, add, or remove those interfaces.
+    /// A resource interface indicates a class or category of resources.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ResourceInterfaces : IEnumerable<string>, IDisposable
+    {
+        /// <summary>
+        /// Default Interface.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string DefaultInterface = "oic.if.baseline";
+
+        /// <summary>
+        /// List Links Interface, which is used to list the references to other resources contained in a resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string LinkInterface = "oic.if.ll";
+
+        /// <summary>
+        /// Batch Interface, which is used to manipulate (GET, PUT, POST, DELETE) on other resource contained in a resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string BatchInterface = "oic.if.b";
+
+        /// <summary>
+        /// Group Interface, which is used to manipulate (GET, PUT, POST) a group of remote resources.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string GroupInterface = "oic.mi.grp";
+
+        /// <summary>
+        /// Read-Only Interface, which is used to limit the methods that can be applied to a resource to GET only.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public const string ReadonlyInterface = "oic.if.r";
+
+        private readonly IntPtr _resourceInterfacesHandle = IntPtr.Zero;
+        private const int MaxLength = 61;
+        private readonly HashSet<string> _resourceInterfaces = new HashSet<string>();
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Constructor of ResourceInterfaces.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
+        /// </code>
+        public ResourceInterfaces()
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Constructor of ResourceInterfaces using list of interfaces.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="ifaces">List of resource interfaces.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
+        ///     { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
+        /// </code>
+        public ResourceInterfaces(IEnumerable<string> ifaces)
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+            foreach (string iface in ifaces)
+            {
+                Add(iface);
+            }
+        }
+
+        internal ResourceInterfaces(IntPtr ifacesHandleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Clone(ifacesHandleToClone, out _resourceInterfacesHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            Interop.IoTConnectivity.Common.ResourceInterfaces.ForeachCallback cb = (string iface, IntPtr data) =>
+            {
+                _resourceInterfaces.Add(iface);
+                return true;
+            };
+
+            ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Foreach(ifacesHandleToClone, cb, IntPtr.Zero);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the ResourceInterfaces class.
+        /// </summary>
+        ~ResourceInterfaces()
+        {
+            Dispose(false);
+        }
+
+        internal IntPtr ResourceInterfacesHandle
+        {
+            get
+            {
+                return _resourceInterfacesHandle;
+            }
+        }
+
+        /// <summary>
+        /// Indicates count of interfaces in the list
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Count of interfaces in the list.</value>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
+        ///     { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
+        /// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _resourceInterfaces.Count;
+            }
+        }
+
+        /// <summary>
+        /// Adds a resource interface into the list.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// @a item could be a value, such as <see cref="DefaultInterface"/>.
+        /// </remarks>
+        /// <param name="item">The string data to insert into the resource interfaces.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
+        /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
+        /// </code>
+        public void Add(string item)
+        {
+            if (IsValid(item))
+            {
+                int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Add(_resourceInterfacesHandle, item);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add interface");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                _resourceInterfaces.Add(item);
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid interface");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+        }
+
+        /// <summary>
+        /// Removes a resource interface from the list.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The string data to delete from the resource ifaces.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface });
+        /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
+        /// </code>
+        public void Remove(string item)
+        {
+            bool isRemoved = _resourceInterfaces.Remove(item);
+            if (isRemoved)
+            {
+                int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Remove(_resourceInterfacesHandle, item);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove interface");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            else
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+        }
+
+        /// <summary>
+        /// Returns enumerator for the list of interfaces.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The enumerator.</returns>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
+        ///     { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
+        /// foreach(string item in resourceInterfaces)
+        /// {
+        ///     Console.WriteLine("Interface : {0}", item);
+        /// }
+        /// </code>
+        public IEnumerator<string> GetEnumerator()
+        {
+            return _resourceInterfaces.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Returns enumerator for the list of interfaces.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The enumerator.</returns>
+        /// <code>
+        /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
+        ///     { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
+        /// foreach(string item in resourceInterfaces)
+        /// {
+        ///     Console.WriteLine("Interface : {0}", item);
+        /// }
+        /// </code>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _resourceInterfaces.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal static bool IsValid(string type)
+        {
+            Regex r = new Regex("^[a-zA-Z0-9.-]+$");
+            return (type.Length <= MaxLength && type.Length > 0 && char.IsLower(type[0]) && r.IsMatch(type));
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Common.ResourceInterfaces.Destroy(_resourceInterfacesHandle);
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs
new file mode 100755 (executable)
index 0000000..d54001e
--- /dev/null
@@ -0,0 +1,474 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents resource options. It provides APIs to manage them.\n
+    /// The iotcon options API provides methods for managing vendor specific options of coap packet.\n
+    /// See more about coap packet in http://tools.ietf.org/html/rfc7252.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ResourceOptions : IDictionary<ushort, string>, IDisposable
+    {
+        internal const int MaxSize = 2;
+        internal const int IdMin = 2048;
+        internal const int IdMax = 3000;
+        internal const int DataMax = 15;
+
+        internal IntPtr _resourceOptionsHandle = IntPtr.Zero;
+        private readonly IDictionary<ushort, string> _options = new Dictionary<ushort, string>();
+        private bool _disposed = false;
+
+        /// <summary>
+        /// The resource options constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// </code>
+        public ResourceOptions()
+        {
+            int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create options");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        // internal constructor
+        internal ResourceOptions(IntPtr handleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create options");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            Interop.IoTConnectivity.Common.Options.OptionsCallback forEachCallback = (ushort id, string value, IntPtr userData) =>
+            {
+                Add(id, value);
+                return true;
+            };
+
+            ret = Interop.IoTConnectivity.Common.Options.ForEach(handleToClone, forEachCallback, IntPtr.Zero);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to iterate options");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the ResourceOptions class.
+        /// </summary>
+        ~ResourceOptions()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Contains all the Option keys.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the Option keys.</value>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "sample-data");
+        /// options.Add(2055, "sample value");
+        /// var keys = options.Keys;
+        /// Console.WriteLine("Resource options contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
+        /// </code>
+        public ICollection<ushort> Keys
+        {
+            get
+            {
+                return _options.Keys;
+            }
+        }
+
+        /// <summary>
+        /// Contains all the Option values.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the Option values.</value>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "sample-data");
+        /// options.Add(2055, "sample value");
+        /// var values = options.Values;
+        /// Console.WriteLine("Resource options contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
+        /// </code>
+        public ICollection<string> Values
+        {
+            get
+            {
+                return _options.Values;
+            }
+        }
+
+        /// <summary>
+        /// Gets the number of options.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The number of options.</value>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "sample-data");
+        /// options.Add(2055, "sample value");
+        /// var count = options.Count;
+        /// Console.WriteLine("There are {0} keys in the options object", count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _options.Count;
+            }
+        }
+
+        /// <summary>
+        /// Represents whether the collection is readonly.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Whether the collection is readonly.</value>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// if (options.IsReadOnly)
+        ///     Console.WriteLine("Read only options");
+        /// </code>
+        public bool IsReadOnly
+        {
+            get
+            {
+                return _options.IsReadOnly;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the option data.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The option data.</value>
+        /// <param name="key">The option ID to get or set.</param>
+        /// <returns>The option with the specified ID.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options[2055] = "sample-data";
+        /// Console.WriteLine("Option has : {0}", options[2055]);
+        /// </code>
+        public string this[ushort key]
+        {
+            get
+            {
+                return _options[key];
+            }
+            set
+            {
+                Add(key, value);
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the given key exists in Options collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The key to look for.</param>
+        /// <returns>true if exists. Otherwise, false.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "sample-data");
+        /// if (options.ContainsKey(2050))
+        ///     Console.WriteLine("options conatins key : 2050");
+        /// </code>
+        public bool ContainsKey(ushort key)
+        {
+            return _options.ContainsKey(key);
+        }
+
+        /// <summary>
+        /// Adds a new ID and a correspoding data into the options.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// ResourceOptions can have up to 2 options. \n
+        /// key is always situated between 2048 and 3000. \n
+        /// Length of option data is less than or equal to 15.
+        /// </remarks>
+        /// <param name="key">The ID of the option to insert.</param>
+        /// <param name="value">The string data to insert into the options.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "sample-data");
+        /// </code>
+        public void Add(ushort key, string value)
+        {
+            int ret = (int)IoTConnectivityError.InvalidParameter;
+            if (IsValid(key, value))
+            {
+                ret = Interop.IoTConnectivity.Common.Options.Add(_resourceOptionsHandle, key, value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add option");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                _options.Add(key, value);
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid options");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+        }
+
+        /// <summary>
+        /// Removes the ID and its associated data from the options.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The ID of the option to delete.</param>
+        /// <returns>True if operation is successful. Otherwise, false.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "12345");
+        /// var result = options.Remove(2050);
+        /// </code>
+        public bool Remove(ushort key)
+        {
+            int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove option");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            bool isRemoved = _options.Remove(key);
+
+            return isRemoved;
+        }
+
+        /// <summary>
+        /// Gets the value associated with the specified key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The option ID.</param>
+        /// <param name="value">Value corresponding to option ID.</param>
+        /// <returns>True if the key exists, false otherwise.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "12345");
+        /// string value;
+        /// var isPresent = options.TryGetValue(2050, out value);
+        /// if (isPresent)
+        ///     Console.WriteLine("value : {0}", value);
+        /// </code>
+        public bool TryGetValue(ushort key, out string value)
+        {
+            return _options.TryGetValue(key, out value);
+        }
+
+        /// <summary>
+        ///  Adds options key and value as a key value pair.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// </code>
+        public void Add(KeyValuePair<ushort, string> item)
+        {
+            Add(item.Key, item.Value);
+        }
+
+        /// <summary>
+        /// Clears the Options collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(2050, "12345");
+        /// options.Add(2055, "sample");
+        /// options.Clear();
+        /// </code>
+        public void Clear()
+        {
+            foreach (ushort key in Keys)
+            {
+                int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove option");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                };
+            }
+            _options.Clear();
+        }
+
+        /// <summary>
+        /// Checks if the given option pair exists.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair.</param>
+        /// <returns>True if exists. Otherwise, false.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// var isPresent = options.Contains(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// if (isPresent)
+        ///     Console.WriteLine("Key value pair is present");
+        /// </code>
+        public bool Contains(KeyValuePair<ushort, string> item)
+        {
+            return _options.Contains(item);
+        }
+
+        /// <summary>
+        /// Copies the elements of the options collection to an array, starting at a particular index.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="array">The destination array.</param>
+        /// <param name="arrayIndex">Index parameter.</param>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// KeyValuePair<ushort, string>[] dest = new KeyValuePair<ushort, string>[options.Count];
+        /// options.CopyTo(dest, 0);
+        /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+        /// </code>
+        public void CopyTo(KeyValuePair<ushort, string>[] array, int arrayIndex)
+        {
+            _options.CopyTo(array, arrayIndex);
+        }
+
+        /// <summary>
+        /// Removes the given key value pair from the options.
+        /// </summary>
+        /// <since_tizen>3</since_tizen>
+        /// <param name="item">The key value pair to remove</param>
+        /// <returns>True if operation is successful. Otherwise, false</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// var result = options.Remove(new KeyValuePair<ushort, string>(2050, "12345"));
+        /// </code>
+        public bool Remove(KeyValuePair<ushort, string> item)
+        {
+            return Remove(item.Key);
+        }
+
+        /// <summary>
+        /// Get the enumerator to options collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Enumerator to option pairs.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
+        /// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
+        /// foreach (KeyValuePair<string, object> pair in options)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        public IEnumerator<KeyValuePair<ushort, string>> GetEnumerator()
+        {
+            return _options.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Gets the enumerator to options collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Enumerator to option pairs.</returns>
+        /// <code>
+        /// ResourceOptions options = new ResourceOptions();
+        /// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
+        /// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
+        /// foreach (KeyValuePair<string, object> pair in options)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _options.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Common.Options.Destroy(_resourceOptionsHandle);
+            _disposed = true;
+        }
+
+        private bool IsValid(ushort key, string value)
+        {
+            return (key > IdMin && key < IdMax && value.Length <= DataMax && _options.Count() < MaxSize);
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs
new file mode 100755 (executable)
index 0000000..0edfb3b
--- /dev/null
@@ -0,0 +1,64 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for the policy, which can be held in a resource.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ResourcePolicy
+    {
+        /// <summary>
+        /// Indicates resource uninitialized.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        NoProperty = 0,
+        /// <summary>
+        /// Indicates resource that is allowed to be discovered.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Discoverable = (1 << 0),
+        /// <summary>
+        /// Indicates resource that is allowed to be observed.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Observable = (1 << 1),
+        /// <summary>
+        /// Indicates resource initialized and activated.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Active = (1 << 2),
+        /// <summary>
+        /// Indicates resource, which takes some delay to respond.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Slow = (1 << 3),
+        /// <summary>
+        /// Indicates secure resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Secure = (1 << 4),
+        /// <summary>
+        /// When this bit is set, the resource is allowed to be discovered only if discovery request contains an explicit querystring.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        ExplicitDiscoverable = (1 << 5),
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs
new file mode 100755 (executable)
index 0000000..4583dc5
--- /dev/null
@@ -0,0 +1,563 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class provides APIs to manage the query of request.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ResourceQuery : IDictionary<string, string>, IDisposable
+    {
+        internal const int QueryMaxLenth = 64;
+        internal IntPtr _resourceQueryHandle = IntPtr.Zero;
+        private readonly IDictionary<string, string> _query = new Dictionary<string, string>();
+        private bool _disposed = false;
+
+        /// <summary>
+        /// The resource query constructor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// </code>
+        public ResourceQuery()
+        {
+            int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create query");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        internal ResourceQuery(IntPtr resourceQueryHandleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create query");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            Interop.IoTConnectivity.Common.Query.QueryCallback forEachCallback = (string key, string value, IntPtr userData) =>
+            {
+                Add(key, value);
+                return true;
+            };
+
+            ret = Interop.IoTConnectivity.Common.Query.Foreach(resourceQueryHandleToClone, forEachCallback, IntPtr.Zero);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to iterate query");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the ResourceQuery class.
+        /// </summary>
+        ~ResourceQuery()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets and sets the resource type of the query.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The resource type of the query.</value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Type = "org.tizen.light";
+        /// Console.WriteLine("Type of query : {0}", query.Type);
+        /// </code>
+        public string Type
+        {
+            get
+            {
+                IntPtr type;
+                int ret = Interop.IoTConnectivity.Common.Query.GetResourceType(_resourceQueryHandle, out type);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type");
+                    return "";
+                }
+                return (type != IntPtr.Zero) ? Marshal.PtrToStringAnsi(type) : string.Empty;
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (ResourceTypes.IsValid(value))
+                    ret = Interop.IoTConnectivity.Common.Query.SetResourceType(_resourceQueryHandle, value);
+
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set type");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets and sets the resource interface of the query.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>
+        /// The resource interface of the query.
+        /// Setter value could be a value, such as <see cref="ResourceInterfaces.DefaultInterface"/>.
+        /// </value>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Interface = ResourceInterfaces.LinkInterface;
+        /// </code>
+        public string Interface
+        {
+            get
+            {
+                IntPtr iface;
+                int ret = Interop.IoTConnectivity.Common.Query.GetInterface(_resourceQueryHandle, out iface);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface");
+                    return "";
+                }
+                return (iface != IntPtr.Zero) ? Marshal.PtrToStringAnsi(iface) : string.Empty;
+            }
+            set
+            {
+                int ret = (int)IoTConnectivityError.InvalidParameter;
+                if (ResourceInterfaces.IsValid(value))
+                    ret = Interop.IoTConnectivity.Common.Query.SetInterface(_resourceQueryHandle, value);
+
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set interface");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Contains all the query keys.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the query keys.</value>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key", "value");
+        /// query.Add("newKey", "sample value");
+        /// var keys = query.Keys;
+        /// Console.WriteLine("Resource query contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
+        /// </code>
+        public ICollection<string> Keys
+        {
+            get
+            {
+                return _query.Keys;
+            }
+        }
+
+        /// <summary>
+        /// Contains all the query values.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>All the query values.</value>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key", "value");
+        /// query.Add("newKey", "sample value");
+        /// var values = query.Values;
+        /// Console.WriteLine("Resource query contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
+        /// </code>
+        public ICollection<string> Values
+        {
+            get
+            {
+                return _query.Values;
+            }
+        }
+
+        /// <summary>
+        /// Gets the number of query elements.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The number of query elements.</value>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key", "value");
+        /// query.Add("newKey", "sample value");
+        /// var count = query.Count;
+        /// Console.WriteLine("There are {0} keys in the query object", count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _query.Count;
+            }
+        }
+
+        /// <summary>
+        /// Represents whether the collection is readonly.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Whether the collection is readonly.</value>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// if (query.IsReadOnly)
+        ///     Console.WriteLine("Read only query");
+        /// </code>
+        public bool IsReadOnly
+        {
+            get
+            {
+                return _query.IsReadOnly;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the query data.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The query data.</value>
+        /// <param name="key">The query key to get or set.</param>
+        /// <returns>The query with the specified key.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query["key1"] = "sample-data";
+        /// Console.WriteLine("query has : {0}", query["key1"]);
+        /// </code>
+        public string this[string key]
+        {
+            get
+            {
+                return _query[key];
+            }
+
+            set
+            {
+                Add(key, value);
+            }
+        }
+
+        /// <summary>
+        /// Checks whether the given key exists in the query collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The key to look for.</param>
+        /// <returns>true if exists. Otherwise, false.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key1", "value1");
+        /// if (query.ContainsKey("key1"))
+        ///     Console.WriteLine("query conatins key : key1");
+        /// </code>
+        public bool ContainsKey(string key)
+        {
+            return _query.ContainsKey(key);
+        }
+
+        /// <summary>
+        /// Adds a new key and correspoding value into the query.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// The full length of query should be less than or equal to 64.
+        /// </remarks>
+        /// <param name="key">The key of the query to insert.</param>
+        /// <param name="value">The string data to insert into the query.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key1", "value1");
+        /// </code>
+        public void Add(string key, string value)
+        {
+            if (CanAddQuery(key, value))
+            {
+                int ret = Interop.IoTConnectivity.Common.Query.Add(_resourceQueryHandle, key, value);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add query");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                _query.Add(key, value);
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Query cannot be added");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+        }
+
+        /// <summary>
+        /// Removes the key and its associated value from the query.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The ID of the query to delete.</param>
+        /// <returns>True if operation is successful. Otherwise, false.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key1", "value1");
+        /// var result = query.Remove("key1");
+        /// </code>
+        public bool Remove(string key)
+        {
+            int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove query");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            bool isRemoved = _query.Remove(key);
+
+            return isRemoved;
+        }
+
+        /// <summary>
+        /// Gets the value associated with the specified key.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The query key.</param>
+        /// <param name="value">Value corresponding to query key.</param>
+        /// <returns>True if the key exists, false otherwise.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key1", "value1");
+        /// string value;
+        /// var isPresent = query.TryGetValue("key1", out value);
+        /// if (isPresent)
+        ///     Console.WriteLine("value : {0}", value);
+        /// </code>
+        public bool TryGetValue(string key, out string value)
+        {
+            return _query.TryGetValue(key, out value);
+        }
+
+        /// <summary>
+        /// Adds a query key and a value as a key value pair.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// </code>
+        public void Add(KeyValuePair<string, string> item)
+        {
+            Add(item.Key, item.Value);
+        }
+
+        /// <summary>
+        /// Clears the query collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add("key1", "value1");
+        /// query.Add("key2", "value2");
+        /// query.Clear();
+        /// </code>
+        public void Clear()
+        {
+            foreach (string key in _query.Keys)
+            {
+                int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to clear query");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+            }
+            _query.Clear();
+        }
+
+        /// <summary>
+        /// Checks if the given query pair exists.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair.</param>
+        /// <returns>True if exists. Otherwise, false.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// var isPresent = query.Contains(new KeyValuePair<string, string>("key1", "value1"));
+        /// if (isPresent)
+        ///     Console.WriteLine("Key value pair is present");
+        /// </code>
+        public bool Contains(KeyValuePair<string, string> item)
+        {
+            return _query.Contains(item);
+        }
+
+        /// <summary>
+        /// Copies the elements of the query collection to an array, starting at a particular index.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="array">The destination array.</param>
+        /// <param name="arrayIndex">Index parameter.</param>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// KeyValuePair<string, string>[] dest = new KeyValuePair<string, string>[query.Count];
+        /// query.CopyTo(dest, 0);
+        /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+        /// </code>
+        public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
+        {
+            _query.CopyTo(array, arrayIndex);
+        }
+
+        /// <summary>
+        /// Removes the given key value pair from the query.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The key value pair to remove.</param>
+        /// <returns>True if operation is successful. Otherwise, false.</returns>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// var result = query.Remove(new KeyValuePair<string, string>("key1", "value1"));
+        /// </code>
+        public bool Remove(KeyValuePair<string, string> item)
+        {
+            return Remove(item.Key);
+        }
+
+        /// <summary>
+        /// Gets the enumerator to the query collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>Enumerator to query pairs.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// query.Add(new KeyValuePair<string, string>("key2", "value2"));
+        /// foreach (KeyValuePair<string, string> pair in query)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
+        {
+            return _query.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Gets the enumerator to the query collection.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The enumerator to the query pairs.</returns>
+        /// <code>
+        /// ResourceQuery query = new ResourceQuery();
+        /// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+        /// query.Add(new KeyValuePair<string, string>("key2", "value2"));
+        /// foreach (KeyValuePair<string, string> pair in query)
+        /// {
+        ///     Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
+        /// }
+        /// </code>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _query.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Common.Query.Destroy(_resourceQueryHandle);
+            _disposed = true;
+        }
+
+        private bool CanAddQuery(string newKey, string newValue)
+        {
+            int queryLenth = 0;
+            foreach (string key in Keys)
+            {
+                queryLenth += key.Length + 2;
+            }
+            foreach (string value in Values)
+            {
+                queryLenth += value.Length;
+            }
+
+            if ((newKey.Length + newValue.Length + queryLenth + 2) < QueryMaxLenth)
+                return true;
+
+            return false;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs
new file mode 100755 (executable)
index 0000000..e093b0a
--- /dev/null
@@ -0,0 +1,37 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for states of the remote resource.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ResourceState
+    {
+        /// <summary>
+        /// Indicates remote resource is alive.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Alive = 0,
+        /// <summary>
+        /// Indicates remote resource is lost.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        LostSignal
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs
new file mode 100755 (executable)
index 0000000..b2c82a7
--- /dev/null
@@ -0,0 +1,268 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class contains resource types and provides APIs to manage, add, or remove those types.
+    /// A resource type indicates a class or a category of resources.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class ResourceTypes : IEnumerable<string>, IDisposable
+    {
+        internal const int MaxLength = 61;
+        internal IntPtr _resourceTypeHandle = IntPtr.Zero;
+        private readonly HashSet<string> _resourceTypes = new HashSet<string>();
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Constructor of ResourceTypes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+        /// <code>
+        /// ResourceTypes types = new ResourceTypes();
+        /// </code>
+        public ResourceTypes()
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Constructor of ResourceTypes using list of types.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="types">List of resource types.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <code>
+        /// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+        /// </code>
+        public ResourceTypes(IEnumerable<string> types)
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            foreach (string type in types)
+            {
+                Add(type);
+            }
+        }
+
+        internal ResourceTypes(IntPtr typesHandleToClone)
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceTypes.Clone(typesHandleToClone, out _resourceTypeHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            Interop.IoTConnectivity.Common.ResourceTypes.ForeachCallback cb = (string type, IntPtr data) =>
+            {
+                _resourceTypes.Add(type);
+                return true;
+            };
+
+            ret = Interop.IoTConnectivity.Common.ResourceTypes.Foreach(typesHandleToClone, cb, IntPtr.Zero);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Destructor of the ResourceTypes class.
+        /// </summary>
+        ~ResourceTypes()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Indicates count of types in the list.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>Count of types in the list.</value>
+        /// <code>
+        /// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+        /// Console.WriteLine("There are {0} items", types.Count);
+        /// </code>
+        public int Count
+        {
+            get
+            {
+                return _resourceTypes.Count;
+            }
+        }
+
+        /// <summary>
+        /// Adds a resource type into the list.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <remarks>
+        /// The length of @a item should be less than or equal to 61.\n
+        /// The @a item must start with a lowercase alphabetic character, followed by a sequence
+        /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.\n
+        /// Duplicate strings are not allowed.
+        /// </remarks>
+        /// <param name="item">The string data to insert into the resource types.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Remove()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceTypes resourceTypes = new ResourceTypes();
+        /// resourceTypes.Add("org.tizen.light");
+        /// </code>
+        public void Add(string item)
+        {
+            if (IsValid(item))
+            {
+                int ret = Interop.IoTConnectivity.Common.ResourceTypes.Add(_resourceTypeHandle, item);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add type");
+                    throw IoTConnectivityErrorFactory.GetException(ret);
+                }
+                _resourceTypes.Add(item);
+            }
+            else
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid type");
+                throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter);
+            }
+        }
+
+        /// <summary>
+        /// Removes a resource type from the list.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="item">The string data to delete from the resource types.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        /// <seealso cref="Add()"/>
+        /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
+        /// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+        /// <code>
+        /// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+        /// resourceTypes.Remove("oic.if.room");
+        /// </code>
+        public void Remove(string item)
+        {
+            int ret = Interop.IoTConnectivity.Common.ResourceTypes.Remove(_resourceTypeHandle, item);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove type");
+                throw IoTConnectivityErrorFactory.GetException(ret);
+            }
+
+            _resourceTypes.Remove(item);
+        }
+
+        /// <summary>
+        /// Returns an enumerator for the list of types.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The enumerator.</returns>
+        /// <code>
+        /// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+        /// foreach(string item in resourceTypes)
+        /// {
+        ///     Console.WriteLine("Type : {0}", item);
+        /// }
+        /// </code>
+        public IEnumerator<string> GetEnumerator()
+        {
+            return _resourceTypes.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Returns an enumerator for the list of types.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The enumerator.</returns>
+        /// <code>
+        /// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+        /// foreach(string item in resourceTypes)
+        /// {
+        ///     Console.WriteLine("Type : {0}", item);
+        /// }
+        /// </code>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _resourceTypes.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal static bool IsValid(string type)
+        {
+            Regex r = new Regex("^[a-zA-Z0-9.-]+$");
+            return (type.Length <= MaxLength && type.Length > 0 && char.IsLower(type[0]) && r.IsMatch(type));
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        /// <feature>http://tizen.org/feature/iot.ocf</feature>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+                // Free managed objects
+            }
+
+            Interop.IoTConnectivity.Common.ResourceTypes.Destroy(_resourceTypeHandle);
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs
new file mode 100755 (executable)
index 0000000..ce8306e
--- /dev/null
@@ -0,0 +1,148 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents response from a resource.
+    /// It provides APIs to manage response.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class Response : IDisposable
+    {
+        private bool _disposed = false;
+
+        /// <summary>
+        /// Constructor of Response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <code>
+        /// Response response = new Response();
+        /// </code>
+        public Response() { }
+
+        /// <summary>
+        /// Destructor of the Response class.
+        /// </summary>
+        ~Response()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Gets or sets the result from/into the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The result from/into the response.</value>
+        public ResponseCode Result { get; set; }
+
+        /// <summary>
+        /// Gets or sets the representation from/into the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The representation from/into the response.</value>
+        public Representation Representation { get; set; }
+
+        /// <summary>
+        /// Gets or sets the options from/into the response.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The options from/into the response.</value>
+        public ResourceOptions Options { get; set; }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        internal bool Send(IntPtr requestHandle)
+        {
+            IntPtr responseHandle = IntPtr.Zero;
+            int ret = Interop.IoTConnectivity.Server.Response.Create(requestHandle, out responseHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response");
+                return false;
+            }
+
+            ret = Interop.IoTConnectivity.Server.Response.SetResult(responseHandle, (int)Result);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response");
+                Interop.IoTConnectivity.Server.Response.Destroy(responseHandle);
+                return false;
+            }
+
+            if (Representation != null)
+            {
+                ret = Interop.IoTConnectivity.Server.Response.SetRepresentation(responseHandle, Representation._representationHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response");
+                    Interop.IoTConnectivity.Server.Response.Destroy(responseHandle);
+                    return false;
+                }
+            }
+
+            if (Options != null)
+            {
+                ret = Interop.IoTConnectivity.Server.Response.SetOptions(responseHandle, Options._resourceOptionsHandle);
+                if (ret != (int)IoTConnectivityError.None)
+                {
+                    Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response");
+                    Interop.IoTConnectivity.Server.Response.Destroy(responseHandle);
+                    return false;
+                }
+            }
+
+            ret = Interop.IoTConnectivity.Server.Response.Send(responseHandle);
+            if (ret != (int)IoTConnectivityError.None)
+            {
+                Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response");
+                Interop.IoTConnectivity.Server.Response.Destroy(responseHandle);
+                return false;
+            }
+
+            Interop.IoTConnectivity.Server.Response.Destroy(responseHandle);
+            return true;
+        }
+
+        /// <summary>
+        /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+        protected virtual void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
+            }
+
+            _disposed = true;
+        }
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs
new file mode 100755 (executable)
index 0000000..0792b00
--- /dev/null
@@ -0,0 +1,62 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// Enumeration for the result of response.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum ResponseCode
+    {
+        /// <summary>
+        /// Indicates the result of response for success.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Ok = 0,
+        /// <summary>
+        /// Indicates the result of response for some error.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Error,
+        /// <summary>
+        /// Indicates the result of response for created resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Created,
+        /// <summary>
+        /// Indicates the result of response for deleted resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Deleted,
+        /// <summary>
+        /// Indicates the result of response for changed resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Changed,
+        /// <summary>
+        /// Indicates the result of response for slow resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Slow,
+        /// <summary>
+        /// Indicates the result of response for accessing unauthorized resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Forbidden
+    }
+}
diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..0078a93
--- /dev/null
@@ -0,0 +1,37 @@
+ /*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using System;
+
+namespace Tizen.Network.IoTConnectivity
+{
+    /// <summary>
+    /// This class represents event arguments of the StateChanged event.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class StateChangedEventArgs : EventArgs
+    {
+        internal StateChangedEventArgs() { }
+
+        /// <summary>
+        /// Indicates the new state of the resource.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <value>The new state of the resource.</value>
+        public ResourceState State { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Database.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Database.cs
new file mode 100644 (file)
index 0000000..8183fe6
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Database
+        {
+            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+            internal delegate void DBChangedCallback(string uri, IntPtr userData);
+
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_record")]
+            internal static extern int Insert(IntPtr recordHandle, out int recordId);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_record")]
+            internal static extern int Get(string uri, int recordId, out IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_update_record")]
+            internal static extern int Update(IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_delete_record")]
+            internal static extern int Delete(string uri, int recordId);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_all_records")]
+            internal static extern int GetAllRecords(string uri, int offset, int limit, out IntPtr recordListHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_records_with_query")]
+            internal static extern int GetRecords(IntPtr queryHandle, int offset, int limit, out IntPtr recordListHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_count")]
+            internal static extern int GetCount(string uri, out int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_count_with_query")]
+            internal static extern int GetCountWithQuery(IntPtr queryHandle, out int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_records")]
+            internal static extern int InsertRecords(IntPtr recordListHandle, out IntPtr recordIds, out int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_update_records")]
+            internal static extern int UpdateRecords(IntPtr recordListHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_delete_records")]
+            internal static extern int DeleteRecords(string uri, int[] ids, int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_current_version")]
+            internal static extern int GetCurrentVersion(out int version);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_add_changed_cb")]
+            internal static extern int AddChangedCallback(string uri, DBChangedCallback callback, IntPtr userData);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_remove_changed_cb")]
+            internal static extern int RemoveChangedCallback(string uri, DBChangedCallback callback, IntPtr userData);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_changes_by_version")]
+            internal static extern int GetChangesByVersion(string uri, int bookId, int dbVersion, out IntPtr recordListHandle, out int currentDBVersion);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_vcalendars")]
+            internal static extern int InsertVcalendars(string stream, out IntPtr recordIds, out int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_vcalendars")]
+            internal static extern int ReplaceVcalendars(string stream, int[] ids, int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_record")]
+            internal static extern int Replace(IntPtr recordHandle, int recordId);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_records")]
+            internal static extern int ReplaceRecords(IntPtr recordListHandle, int[] ids, int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_last_change_version")]
+            internal static extern int GetLastChangeVersion(out int lastChangeVersion);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_changes_exception_by_version")]
+            internal static extern int GetChangesException(string uri, int eventId, int dbVersion, out IntPtr recordListHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_clean_after_sync")]
+            internal static extern int Clean(int bookId, int dbVersion);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_link_record")]
+            internal static extern int LinkRecord(int baseId, int recordId);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_unlink_record")]
+            internal static extern int UnlinkRecord(int recordId);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Filter.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Filter.cs
new file mode 100644 (file)
index 0000000..43f9577
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Pims.Calendar;
+using static Tizen.Pims.Calendar.CalendarFilter;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Filter
+        {
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_create")]
+            internal static extern int Create(string uri, out IntPtr filterHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_destroy")]
+            internal static extern int Destroy(IntPtr filterHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_str")]
+            internal static extern int AddString(IntPtr filterHandle, uint propertyId, StringMatchType match, string value);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_int")]
+            internal static extern int AddInteger(IntPtr filterHandle, uint propertyId, IntegerMatchType match, int value);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_double")]
+            internal static extern int AddDouble(IntPtr filterHandle, uint propertyId, IntegerMatchType match, double value);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_lli")]
+            internal static extern int AddLong(IntPtr filterHandle, uint propertyId, IntegerMatchType match, long value);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_caltime")]
+            internal static extern int AddCalendarTime(IntPtr filterHandle, uint propertyId, IntegerMatchType match, Interop.Calendar.Record.DateTime value);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_filter")]
+            internal static extern int AddFilter(IntPtr parentFilterHandle, IntPtr childFilterHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_operator")]
+            internal static extern int AddOperator(IntPtr filterHandle, LogicalOperator type);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Libraries.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Libraries.cs
new file mode 100644 (file)
index 0000000..ffb5218
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Calendar = "libcalendar-service2.so.0";
+    }
+}
+
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.List.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.List.cs
new file mode 100644 (file)
index 0000000..31010c8
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class List
+        {
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_create")]
+            internal static extern int Create(out IntPtr listHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_destroy")]
+            internal static extern int Destroy(IntPtr listHandle, bool delete);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_get_count")]
+            internal static extern int GetCount(IntPtr listHandle, out int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_add")]
+            internal static extern int Add(IntPtr listHandle, IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_remove")]
+            internal static extern int Remove(IntPtr listHandle, IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_get_current_record_p")]
+            internal static extern int GetCurrentRecordP(IntPtr listHandle, out IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_prev")]
+            internal static extern int Prev(IntPtr listHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_next")]
+            internal static extern int Next(IntPtr listHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_first")]
+            internal static extern int First(IntPtr listHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_last")]
+            internal static extern int Last(IntPtr listHandle);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Query.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Query.cs
new file mode 100644 (file)
index 0000000..c570495
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Query
+        {
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_create")]
+            internal static extern int Create(string uri, out IntPtr queryHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_destroy")]
+            internal static extern int Destroy(IntPtr queryHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_projection")]
+            internal static extern int SetProjection(IntPtr queryHandle, uint[] propertyIdArray, int count);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_distinct")]
+            internal static extern int SetDistinct(IntPtr queryHandle, bool set);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_filter")]
+            internal static extern int SetFilter(IntPtr queryHandle, IntPtr filterHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_sort")]
+            internal static extern int SetSort(IntPtr queryHandle, uint propertyId, bool isAscending);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Record.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Record.cs
new file mode 100644 (file)
index 0000000..befe4d9
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Pims.Calendar;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Record
+        {
+                       [StructLayout(LayoutKind.Sequential)]
+                       internal struct DateTime
+                       {
+                               internal int type;
+                               internal long utime;
+                               internal int year;
+                               internal int month;
+                               internal int mday;
+                               internal int hour;
+                               internal int minute;
+                               internal int second;
+                       };
+
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_create")]
+            internal static extern int Create(string uri, out IntPtr recordHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_destroy")]
+            internal static extern int Destroy(IntPtr recordHandle, bool isDeleteChild);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_clone")]
+            internal static extern int Clone(IntPtr recordHandle, out IntPtr cloneHandle);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_uri_p")]
+            internal static extern int GetUriPointer(IntPtr recordHandle, out IntPtr uri);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_str")]
+            internal static extern int GetString(IntPtr recordHandle, uint propertyId, out string str);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_str_p")]
+            internal static extern int GetStringPointer(IntPtr recordHandle, uint propertyId, out string str);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_int")]
+            internal static extern int GetInteger(IntPtr recordHandle, uint propertyId, out int value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_double")]
+            internal static extern int GetDouble(IntPtr recordHandle, uint propertyId, out double value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_lli")]
+            internal static extern int GetLli(IntPtr recordHandle, uint propertyId, out long value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_caltime")]
+            internal static extern int GetCalendarTime(IntPtr recordHandle, uint propertyId, out DateTime value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_str")]
+            internal static extern int SetString(IntPtr recordHandle, uint propertyId, string str);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_int")]
+            internal static extern int SetInteger(IntPtr recordHandle, uint propertyId, int value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_double")]
+            internal static extern int SetDouble(IntPtr recordHandle, uint propertyId, double value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_lli")]
+            internal static extern int SetLli(IntPtr recordHandle, uint propertyId, long value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_caltime")]
+            internal static extern int SetCalendarTime(IntPtr recordHandle, uint propertyId, DateTime value);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_add_child_record")]
+            internal static extern int AddChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childHandle);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_remove_child_record")]
+            internal static extern int RemoveChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childHandle);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_child_record_count")]
+            internal static extern int GetChildRecordCount(IntPtr recordHandle, uint propertyId, out int count);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_child_record_at_p")]
+            internal static extern int GetChildRecordPointer(IntPtr recordHandle, uint propertyId, int index, out IntPtr childHandle);
+                       [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_clone_child_record_list")]
+            internal static extern int CloneChildRecordList(IntPtr childRecordHandle, uint propertyId, out IntPtr listHandle);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Reminder.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Reminder.cs
new file mode 100644 (file)
index 0000000..a737208
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Reminder
+        {
+            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+            internal delegate void ReminderAlertedCallback(string param, IntPtr userData);
+
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_reminder_add_cb")]
+            internal static extern int Add(ReminderAlertedCallback callback, IntPtr userData);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_remove_changed_cb")]
+            internal static extern int Remove(ReminderAlertedCallback callback, IntPtr userData);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Service.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Service.cs
new file mode 100644 (file)
index 0000000..adb132b
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Service
+        {
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect")]
+            internal static extern int Connect();
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_disconnect")]
+            internal static extern int Disconnect();
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect_on_thread")]
+            internal static extern int ConnectOnThread();
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_disconnect_on_thread")]
+            internal static extern int DisconnectOnThread();
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect_with_flags")]
+            internal static extern int ConnectWithFlags(uint flags);
+        }
+    }
+}
+
diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Vcalendar.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Calendar.Vcalendar.cs
new file mode 100644 (file)
index 0000000..0b0d6a4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Calendar
+    {
+        internal static partial class Vcalendar
+        {
+            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+            internal delegate bool ParseCallback(IntPtr recordHandle, IntPtr userData);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_make_from_records")]
+            internal static extern int Compose(IntPtr listHandle, out string stream);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_parse_to_calendar")]
+            internal static extern int Parse(string stream, out IntPtr listHandle);
+            [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_parse_to_calendar_foreach")]
+            internal static extern int ParseForEach(string filePath, ParseCallback parseCb, IntPtr userData);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj
new file mode 100644 (file)
index 0000000..2c183b6
--- /dev/null
@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Calendar Service API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.nuspec b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.nuspec
new file mode 100644 (file)
index 0000000..23512ec
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<package>
+       <metadata>
+               <id>Tizen.Pims.Calendar</id>
+               <version>$version$</version>
+               <authors>Tizen Developers</authors>
+               <description>Calendar Service API for Tizen.Net</description>
+               <dependencies>
+                       <dependency id="Tizen" version="1.0.0" />
+               </dependencies>
+       </metadata>
+</package>
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs
new file mode 100644 (file)
index 0000000..2cbb6bf
--- /dev/null
@@ -0,0 +1,563 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// The Calendar Service API provides functions, enumerations used in the entire Content Service.
+/// </summary>
+/// <remarks>
+/// The Calendar Service API provides functions and ienumerations used in the entire Content Service.
+/// The Information about calendar items i.e. book, event, todo, alarm, attendee and extended are managed in the database
+/// and operations that involve database requires an active connection with the calendar service.
+/// </remarks>
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// CalendarDatabase provides methods to manage calendar information from/to the database.
+    /// </summary>
+    /// <remarks>
+    /// This class allows usre to access/create/update db operations for calendar information.
+    /// </remarks>
+    public class CalendarDatabase
+    {
+        /// <summary>
+        /// Delegete for detecting the calendar database changes.
+        /// </summary>
+        /// <param name="uri">The record uri</param>
+        /// <remarks>
+        /// The delegate must be registered using AddDBChangedDelegate.
+        /// It's invoked when the designated view changes.
+        /// </remarks>
+        /// <see cref="AddDBChangedDelegate"/>
+        public delegate void CalendarDBChangedDelegate(string uri);
+
+        private Object thisLock = new Object();
+        private Dictionary<string, CalendarDBChangedDelegate> _callbackMap = new Dictionary<string, CalendarDBChangedDelegate>();
+        private Dictionary<string, Interop.Calendar.Database.DBChangedCallback> _delegateMap = new Dictionary<string, Interop.Calendar.Database.DBChangedCallback>();
+        private Interop.Calendar.Database.DBChangedCallback _dbChangedDelegate;
+
+        internal CalendarDatabase()
+        {
+            ///To be created in CalendarManager only
+        }
+
+        /// <summary>
+        /// The calendar database version.
+        /// </summary>
+        public int Version
+        {
+            get
+            {
+                int version = -1;
+                int error = Interop.Calendar.Database.GetCurrentVersion(out version);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Version Failed with error " + error);
+                }
+                return version;
+            }
+        }
+
+        /// <summary>
+        /// Gets last successful changed calendar database version on the current connection.
+        /// </summary>
+        /// <returns>The last successful changed calendar database version on the current connection</returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public int LastChangeVersion
+        {
+            get
+            {
+                int version = -1;
+                int error = Interop.Calendar.Database.GetLastChangeVersion(out version);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "LastChangeVersion Failed with error " + error);
+                }
+                return version;
+            }
+        }
+
+        /// <summary>
+        /// Inserts a record into the calendar database.
+        /// </summary>
+        /// <param name="record">The record to be inserted</param>
+        /// <returns>The ID of inserted record</returns>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public int Insert(CalendarRecord record)
+        {
+            int id = -1;
+            int error = Interop.Calendar.Database.Insert(record._recordHandle, out id);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Insert Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return id;
+        }
+
+        /// <summary>
+        /// Gets a record from the calendar database.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a record</param>
+        /// <param name="recordId">The record ID</param>
+        /// <returns>
+        /// The record associated with the record ID
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public CalendarRecord Get(string viewUri, int recordId)
+        {
+            IntPtr handle;
+            int error = Interop.Calendar.Database.Get(viewUri, recordId, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                               if (CalendarError.DBNotFound == (CalendarError)error)
+                               {
+                                       Log.Error(Globals.LogTag, "No data" + error);
+                                       return null;
+                               }
+                               Log.Error(Globals.LogTag, "Get Failed with error " + error);
+                               throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarRecord(handle);
+        }
+
+        /// <summary>
+        /// Updates a record in the calendar database.
+        /// </summary>
+        /// <param name="record">The record to be updated</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Update(CalendarRecord record)
+        {
+            int error = Interop.Calendar.Database.Update(record._recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Update Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Deletes a record from the calendar database with related child records.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a record</param>
+        /// <param name="recordId">The record ID to be deleted</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Delete(string viewUri, int recordId)
+        {
+            int error = Interop.Calendar.Database.Delete(viewUri, recordId);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Delete Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Replaces a record in the calendar database.
+        /// </summary>
+        /// <param name="record">The record to be replaced</param>
+        /// <param name="id">the record id</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Replace(CalendarRecord record, int id)
+        {
+            int error = Interop.Calendar.Database.Replace(record._recordHandle, id);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Replace Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Retrieves all records as a list.
+        /// </summary>
+        /// <param name="viewUri">The view URI to get records from</param>
+        /// <param name="offset">The index from which results are received</param>
+        /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public CalendarList GetAll(string viewUri, int offset, int limit)
+        {
+            IntPtr handle;
+            int error = Interop.Calendar.Database.GetAllRecords(viewUri, offset, limit, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetAll Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarList(handle);
+        }
+
+        /// <summary>
+        /// Retrieves records using a query.
+        /// </summary>
+        /// <param name="query">The query used to filter results</param>
+        /// <param name="offset">The index from which results are received</param>
+        /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
+        /// <returns>
+        /// CalendarList
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public CalendarList GetRecordsWithQuery(CalendarQuery query, int offset, int limit)
+        {
+            IntPtr handle;
+            int error = Interop.Calendar.Database.GetRecords(query._queryHandle, offset, limit, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetAllWithQuery Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarList(handle);
+        }
+
+        /// <summary>
+        /// Inserts multiple records into the calendar database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <returns>
+        /// The inserted record id array
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public int[] Insert(CalendarList list)
+        {
+            IntPtr ids;
+            int count;
+            int error = Interop.Calendar.Database.InsertRecords(list._listHandle, out ids, out count);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Insert Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            int[] idArr = new int[count];
+            Marshal.Copy(ids, idArr, 0, count);
+
+            return idArr;
+        }
+
+        /// <summary>
+        /// Updates multiple records into the calendar database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Update(CalendarList list)
+        {
+            int error = Interop.Calendar.Database.UpdateRecords(list._listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Update Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Deletes multiple records with related child records from the calendar database as a batch operation.
+        /// </summary>
+        /// <param name="viewUri">The view URI of the records to delete</param>
+        /// <param name="idArray">The record IDs to delete</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Delete(string viewUri, int[] idArray)
+        {
+            int error = Interop.Calendar.Database.DeleteRecords(viewUri, idArray, idArray.Length);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Delete Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Deletes multiple records with related child records from the calendar database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Delete(CalendarList list)
+        {
+            CalendarRecord record = null;
+            if (list.Count <= 0)
+                return;
+
+            int[] ids = new int[list.Count];
+            int i;
+            uint propertyId = 0;
+            list.MoveFirst();
+            for (i = 0; i < list.Count; i++)
+            {
+                record = list.GetCurrentRecord();
+                if (0 == propertyId)
+                {
+                    if (0 == String.Compare(CalendarViews.Book.Uri, record.Uri))
+                        propertyId = CalendarViews.Book.Id;
+                    else if (0 == String.Compare(CalendarViews.Event.Uri, record.Uri))
+                        propertyId = CalendarViews.Event.Id;
+                    else if (0 == String.Compare(CalendarViews.Todo.Uri, record.Uri))
+                        propertyId = CalendarViews.Todo.Id;
+                    else if (0 == String.Compare(CalendarViews.Timezone.Uri, record.Uri))
+                        propertyId = CalendarViews.Timezone.Id;
+                    else if (0 == String.Compare(CalendarViews.Extended.Uri, record.Uri))
+                        propertyId = CalendarViews.Extended.Id;
+                    else
+                    {
+                        Log.Error(Globals.LogTag, "Invalid uri [" + record.Uri + "]");
+                        continue;
+                    }
+                }
+                ids[i] = record.Get<int>(propertyId);
+                list.MoveNext();
+            }
+            Delete(record.Uri, ids);
+        }
+
+        /// <summary>
+        /// Replaces multiple records in the calendar database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <param name="idArray">The record IDs</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Replace(CalendarList list, int[] idArray)
+        {
+            int error = Interop.Calendar.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Replace Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Retrieves records with the given calendar database version.
+        /// </summary>
+        /// <param name="viewUri">The view URI to get records from</param>
+        /// <param name="BookId">The calendar book ID to filter</param>
+        /// <param name="calendarDBVersion">The calendar database version</param>
+        /// <param name="currentDBVersion"The current calendar database versio></param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public CalendarList GetChangesByVersion(string viewUri, int BookId, int calendarDBVersion, out int currentDBVersion)
+        {
+            IntPtr recordList;
+            int error = Interop.Calendar.Database.GetChangesByVersion(viewUri, BookId, calendarDBVersion, out recordList, out currentDBVersion);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetChangesByVersion Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarList(recordList);
+        }
+
+        /// <summary>
+        /// Gets the record count of a specific view.
+        /// </summary>
+        /// <param name="viewUri">The view URI to get records from</param>
+        /// <returns>
+        /// The count of records
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        public int GetCount(string viewUri)
+        {
+            int count = -1;
+            int error = Interop.Calendar.Database.GetCount(viewUri, out count);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Gets the record count with a query.
+        /// </summary>
+        /// <param name="query">The query used for filtering the results</param>
+        /// <returns>
+        /// The count of records
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        public int GetCount(CalendarQuery query)
+        {
+            int count = -1;
+            int error = Interop.Calendar.Database.GetCountWithQuery(query._queryHandle, out count);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Registers a callback function to be invoked when a record changes.
+        /// </summary>
+        /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
+        /// <param name="callback">The callback function to register</param>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        public void AddDBChangedDelegate(string viewUri, CalendarDBChangedDelegate callback)
+        {
+            Log.Debug(Globals.LogTag, "AddDBChangedDelegate");
+
+            _dbChangedDelegate = (string uri, IntPtr userData) =>
+            {
+                _callbackMap[uri](uri);
+            };
+            int error = Interop.Calendar.Database.AddChangedCallback(viewUri, _dbChangedDelegate, IntPtr.Zero);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _callbackMap[viewUri] = callback;
+            _delegateMap[viewUri] = _dbChangedDelegate;
+        }
+
+        /// <summary>
+        /// Unregisters a callback function.
+        /// </summary>
+        /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
+        /// <param name="callback">The callback function to register</param>
+        /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        public void RemoveDBChangedDelegate(string viewUri, CalendarDBChangedDelegate callback)
+        {
+            Log.Debug(Globals.LogTag, "RemoveDBChangedDelegate");
+
+            int error = Interop.Calendar.Database.RemoveChangedCallback(viewUri, _delegateMap[viewUri], IntPtr.Zero);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _callbackMap.Remove(viewUri);
+            _delegateMap.Remove(viewUri);
+        }
+
+        /// <summary>
+        /// Link a record to another record.
+        /// </summary>
+        /// <param name="baseId">The base record ID</param>
+        /// <param name="recordId">The record ID to link to</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void LinkRecord(int baseId, int recordId)
+        {
+            Log.Debug(Globals.LogTag, "LinkRecord");
+            int error = Interop.Calendar.Database.LinkRecord(baseId, recordId);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "LinkRecor Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Unlink a record from base record.
+        /// </summary>
+        /// <param name="recordId">The record ID to unlink</param>
+        /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void UnlinkRecord(int recordId)
+        {
+            Log.Debug(Globals.LogTag, "UnlinkRecord");
+            int error = Interop.Calendar.Database.UnlinkRecord(recordId);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "UnlinkRecor Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs
new file mode 100644 (file)
index 0000000..6918f88
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Pims.Calendar
+{
+    internal enum CalendarError
+    {
+        None = Tizen.Internals.Errors.ErrorCode.None,                           /**< Successful */
+        OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,             /**< Out of Memory (-12) */
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,   /**< Invalid parameter (-22) */
+        FileNoSpace = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice,     /** <FS Full (-28) */
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,   /**< Permission denied (-13) */
+        NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,           /**< Not supported (-1073741822) */
+        NoData = Tizen.Internals.Errors.ErrorCode.NoData,                       /**< Requested data does not exist (-61) */
+        DBLocked = Globals.ErrorCalendar | 0x81,                                /**< Database table locked or file locked (-33619839) */
+        ErrorDB = Globals.ErrorCalendar | 0x9F,                                 /**< Unknown DB error (-33619809) */
+        IPCNotAvailable = Globals.ErrorCalendar | 0xB1,                         /**< IPC server is not available (-33619791) */
+        ErrorIPC = Globals.ErrorCalendar | 0xBF,                                /**< Unknown IPC error (-33619777) */
+        ErrorSystem = Globals.ErrorCalendar | 0xEF,                             /**< Internal system module error (-33619729) */
+        ErrorInternal = Globals.ErrorCalendar | 0x04,                           /**< Implementation Error Temporary Use (-33619713) */
+        DBNotFound = Globals.ErrorCalendar | 0x05,                              /**< No data in DB (-33554427) */
+    };
+
+    internal static class Globals
+    {
+        internal const string LogTag = "Tizen.Pims.Calendar";
+        internal const int ErrorCalendar = -0x02000000;
+    }
+
+    internal static class CalendarErrorFactory
+    {
+        internal static void ThrowException(int e)
+        {
+            throw GetException(e);
+        }
+
+        internal static Exception GetException(int e)
+        {
+            Exception exp;
+            switch ((CalendarError)e)
+            {
+            case CalendarError.OutOfMemory:
+                exp = new OutOfMemoryException("Out of memory");
+                Log.Error(Globals.LogTag, "Out of memory");
+                break;
+            case CalendarError.InvalidParameter:
+                exp = new ArgumentException("Invalid parameter");
+                Log.Error(Globals.LogTag, "Invalid parameter");
+                break;
+            case CalendarError.FileNoSpace:
+                exp = new InvalidOperationException("File no space Error");
+                Log.Error(Globals.LogTag, "File no space Error");
+                break;
+            case CalendarError.PermissionDenied:
+                exp = new UnauthorizedAccessException("Permission denied");
+                Log.Error(Globals.LogTag, "Permission denied");
+                break;
+            case CalendarError.NotSupported:
+                exp = new NotSupportedException("Not supported");
+                Log.Error(Globals.LogTag, "Not supported");
+                break;
+            case CalendarError.NoData:
+                exp = new InvalidOperationException("No data found");
+                Log.Error(Globals.LogTag, "No data found");
+                break;
+            case CalendarError.DBLocked:
+                exp = new InvalidOperationException("DB locked");
+                Log.Error(Globals.LogTag, "DB locked");
+                break;
+            case CalendarError.ErrorDB:
+                exp = new InvalidOperationException("DB error");
+                Log.Error(Globals.LogTag, "DB error");
+                break;
+            case CalendarError.IPCNotAvailable:
+                exp = new InvalidOperationException("IPC not available");
+                Log.Error(Globals.LogTag, "IPC not available");
+                break;
+            case CalendarError.ErrorIPC:
+                exp = new InvalidOperationException("IPC error");
+                Log.Error(Globals.LogTag, "IPC error");
+                break;
+            case CalendarError.ErrorSystem:
+                exp = new InvalidOperationException("System error");
+                Log.Error(Globals.LogTag, "System error");
+                break;
+            case CalendarError.ErrorInternal:
+                exp = new InvalidOperationException("Internal error");
+                Log.Error(Globals.LogTag, "Internal error");
+                break;
+            default:
+                exp = new InvalidOperationException("Invalid operation");
+                Log.Error(Globals.LogTag, "Invalid operation");
+                break;
+            }
+            return exp;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarFilter.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarFilter.cs
new file mode 100644 (file)
index 0000000..fd59b0f
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A filter includes the conditions for the search.
+    /// </summary>
+    public class CalendarFilter:IDisposable
+    {
+        internal IntPtr _filterHandle;
+
+        /// <summary>
+        /// Creates a filter with a condition for a string type.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarFilter(string viewUri, uint propertyId, StringMatchType matchType, string matchValue)
+        {
+            int error = 0;
+            error = Interop.Calendar.Filter.Create(viewUri, out _filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddString(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for an integer type.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, int matchValue)
+        {
+            int error = 0;
+            error = Interop.Calendar.Filter.Create(viewUri, out _filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddInteger(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for long type.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, long matchValue)
+        {
+            int error = 0;
+            error = Interop.Calendar.Filter.Create(viewUri, out _filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddLong(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for double type.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, double matchValue)
+        {
+            int error = 0;
+            error = Interop.Calendar.Filter.Create(viewUri, out _filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddDouble(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for CalendarTime type.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, CalendarTime matchValue)
+        {
+            int error = 0;
+            error = Interop.Calendar.Filter.Create(viewUri, out _filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            Interop.Calendar.Record.DateTime time = CalendarRecord.ConvertCalendarTimeToStruct(matchValue);
+            error = Interop.Calendar.Filter.AddCalendarTime(_filterHandle, propertyId, matchType, time);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        ~CalendarFilter()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Enumeration for the filter match type of a string.
+        /// </summary>
+        public enum StringMatchType
+        {
+            /// <summary>
+            /// Full string, case-sensitive
+            /// </summary>
+            Exactly,
+            /// <summary>
+            /// Full string, case-insensitive
+            /// </summary>
+            Fullstring,
+            /// <summary>
+            /// Sub string, case-insensitive
+            /// </summary>
+            Contains,
+            /// <summary>
+            /// Start with, case-insensitive
+            /// </summary>
+            Startswith,
+            /// <summary>
+            /// End with, case-insensitive
+            /// </summary>
+            Endswith,
+            /// <summary>
+            /// IS NOT NUL
+            /// </summary>
+            Exists,
+        }
+
+        /// <summary>
+        /// Enumeration for the filter match type of an integer.
+        /// </summary>
+        public enum IntegerMatchType
+        {
+            /// <summary>
+            /// '='
+            /// </summary>
+            Equal,
+            /// <summary>
+            /// '>'
+            /// </summary>
+            GreaterThan,
+            /// <summary>
+            /// '>='
+            /// </summary>
+            GreaterThanOrEqual,
+            /// <summary>
+            /// &lt;
+            /// </summary>
+            LessThan,
+            /// <summary>
+            /// &lt;=
+            /// </summary>
+            LessThanOrEqual,
+            /// <summary>
+            /// &lt;>, this flag can yield poor performance
+            /// </summary>
+            NotEqual,
+            /// <summary>
+            /// IS NULL
+            /// </summary>
+            None,
+        }
+
+        /// <summary>
+        /// Enumeration for a filter operator.
+        /// </summary>
+        public enum LogicalOperator
+        {
+            /// <summary>
+            /// AND
+            /// </summary>
+            And,
+            /// <summary>
+            /// OR
+            /// </summary>
+            Or,
+        }
+
+#region IDisposable Support
+        private bool disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                Log.Debug(Globals.LogTag, "Dispose :" + disposing);
+
+                int error = Interop.Calendar.Filter.Destroy(_filterHandle);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Destroy Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarFilter.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds a condition for the string type.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match valu</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, StringMatchType matchType, string matchValue)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddString(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for the integer type.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match valu</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, int matchValue)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddInteger(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for the long type.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match valu</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, long matchValue)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddLong(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for the double type.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match valu</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, double matchValue)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddDouble(_filterHandle, propertyId, matchType, matchValue);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for the CalendarTime type.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match valu</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, CalendarTime matchValue)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            Interop.Calendar.Record.DateTime time = CalendarRecord.ConvertCalendarTimeToStruct(matchValue);
+            error = Interop.Calendar.Filter.AddCalendarTime(_filterHandle, propertyId, matchType, time);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a child filter to a parent filter.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="filter">The child filter</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddFilter(LogicalOperator logicalOperator, CalendarFilter filter)
+        {
+            int error = Interop.Calendar.Filter.AddOperator(_filterHandle, logicalOperator);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
+            error = Interop.Calendar.Filter.AddFilter(_filterHandle, filter._filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs
new file mode 100644 (file)
index 0000000..fdcf2a9
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A list of records with the same type.
+    /// </summary>
+    public class CalendarList:IDisposable
+    {
+        private Int64 _memoryPressure = 20;
+        internal int _count = -1;
+        internal IntPtr _listHandle;
+
+        internal CalendarList(IntPtr handle)
+        {
+            _listHandle = handle;
+
+            _memoryPressure += this.Count * CalendarViews.AverageSizeOfRecord;
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        /// <summary>
+        /// Creates a calendar list.
+        /// </summary>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarList()
+        {
+            int error = Interop.Calendar.List.Create(out _listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarList Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        ~CalendarList()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The count of the calendar entity.
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                if (_count == -1)
+                {
+                    int count = -1;
+                    int error = Interop.Calendar.List.GetCount(_listHandle, out count);
+                    if (CalendarError.None != (CalendarError)error)
+                    {
+                        Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
+                    }
+                    _count = count;
+                }
+                return _count;
+            }
+        }
+
+#region IDisposable Support
+        private bool disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                Log.Debug(Globals.LogTag, "Dispose :" + disposing);
+
+                int error = Interop.Calendar.List.Destroy(_listHandle, true);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Destroy Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                disposedValue = true;
+                GC.RemoveMemoryPressure(_memoryPressure);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarList.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds a record to the calendar list.
+        /// </summary>
+        /// <param name="record">The record to be added</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddRecord(CalendarRecord record)
+        {
+            int error = Interop.Calendar.List.Add(_listHandle, record._recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddRecord Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            record._disposedValue = true;
+            _count = -1;
+            _memoryPressure += CalendarViews.AverageSizeOfRecord;
+        }
+
+        /// <summary>
+        /// Removes a record from the calendar list.
+        /// </summary>
+        /// <param name="record">The record to be removed</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void RemoveRecord(CalendarRecord record)
+        {
+            int error = Interop.Calendar.List.Remove(_listHandle, record._recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "RemoveRecord Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            record._disposedValue = false;
+            _count = -1;
+            _memoryPressure -= CalendarViews.AverageSizeOfRecord;
+        }
+
+        /// <summary>
+        /// Retrieves a record from the calendar list.
+        /// </summary>
+        /// <returns>
+        /// calendar record
+        /// </returns>
+        public CalendarRecord GetCurrentRecord()
+        {
+            IntPtr handle;
+            int error = Interop.Calendar.List.GetCurrentRecordP(_listHandle, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetCurrentRecord Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarRecord(handle, true);
+        }
+
+        /// <summary>
+        /// Moves a calendar list to the previous position.
+        /// </summary>
+        /// <returns>
+        /// if cursor is moved to the end, it returns false.
+        /// </returns>
+        public bool MovePrevious()
+        {
+            int error = Interop.Calendar.List.Prev(_listHandle);
+            if (CalendarError.None == (CalendarError)error)
+            {
+                return true;
+            }
+            else if (this.Count > 0 && CalendarError.NoData == (CalendarError)error)
+            {
+                Log.Debug(Globals.LogTag, "Nodata MovePrevious " + error);
+                return false;
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "MovePrevious Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a calendar list to the next position.
+        /// </summary>
+        /// <returns>
+        /// if cursor is moved to the end, it returns false.
+        /// </returns>
+        public bool MoveNext()
+        {
+            int error = Interop.Calendar.List.Next(_listHandle);
+            if (CalendarError.None == (CalendarError)error)
+            {
+                return true;
+            }
+            else if (this.Count > 0 && CalendarError.NoData == (CalendarError)error)
+            {
+                Log.Debug(Globals.LogTag, "Nodata MoveNext" + error);
+                return false;
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "MoveNext Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a calendar list to the first position.
+        /// </summary>
+        public void MoveFirst()
+        {
+            int error = Interop.Calendar.List.First(_listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a calendar list to the last position.
+        /// </summary>
+        public void MoveLast()
+        {
+            int error = Interop.Calendar.List.Last(_listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "MoveLast Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs
new file mode 100644 (file)
index 0000000..af6ef04
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using static Interop.Calendar.Service;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A class for managing calendar information. It allows applications to use calendar service.
+    /// </summary>
+    public class CalendarManager : IDisposable
+    {
+        private CalendarDatabase _db = null;
+
+        /// <summary>
+        /// Create a manager.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        public CalendarManager()
+        {
+            int error = Interop.Calendar.Service.Connect();
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Connect Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _db = new CalendarDatabase();
+        }
+
+        ~CalendarManager()
+        {
+            Dispose(false);
+        }
+
+#region IDisposable Support
+        /// To detect redundant calls
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                Log.Debug(Globals.LogTag, "Dispose :" + disposing);
+
+                int error = Interop.Calendar.Service.Disconnect();
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Disconnect Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarManager.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Get database.
+        /// </summary>
+        public CalendarDatabase Database
+        {
+            get
+            {
+                return _db;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs
new file mode 100644 (file)
index 0000000..941699a
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using static Interop.Calendar.Query;
+
+namespace Tizen.Pims.Calendar
+{
+    /// A query is used to retrieve data which satisfies given criteria.
+    /// </summary>
+    /// <remarks>
+    /// A query is used to retrieve calendar data which satisfies a given criteria,
+    /// such as an integer property being greater than a given value,
+    /// or a string property containing a given substring.
+    /// A query needs a filter which can set the conditions for the search.
+    /// </remarks>
+    public class CalendarQuery : IDisposable
+    {
+        internal IntPtr _queryHandle;
+
+        /// <summary>
+        /// Creates a query.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a query</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarQuery(string viewUri)
+        {
+            int error = Interop.Calendar.Query.Create(viewUri, out _queryHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarQuery Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        internal CalendarQuery(IntPtr handle)
+        {
+            _queryHandle = handle;
+        }
+
+        ~CalendarQuery()
+        {
+            Dispose(false);
+        }
+
+#region IDisposable Support
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                Log.Debug(Globals.LogTag, "Dispose :" + disposing);
+
+                int error = Interop.Calendar.Query.Destroy(_queryHandle);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "CalendarQueryDestroy Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarQuery.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds property IDs for projection.
+        /// </summary>
+        /// <param name="propertyIdArray">The property ID array </param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetProjection(uint[] propertyIdArray)
+        {
+            int error = Interop.Calendar.Query.SetProjection(_queryHandle, propertyIdArray, propertyIdArray.Length);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "SetProjection Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the "distinct" option for projection.
+        /// </summary>
+        /// <param name="set">If true it is set, otherwise if false it is unset</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetDistinct(bool set)
+        {
+            int error = Interop.Calendar.Query.SetDistinct(_queryHandle, set);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "SetDistinct Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the filter for a query.
+        /// </summary>
+        /// <param name="filter">The filter</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetFilter(CalendarFilter filter)
+        {
+            int error = Interop.Calendar.Query.SetFilter(_queryHandle, filter._filterHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "SetFilter Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the sort mode for a query.
+        /// </summary>
+        /// <param name="propertyId">The property ID to sort</param>
+        /// <param name="isAscending">If true it sorts in the ascending order, otherwise if false it sorts in the descending order</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetSort(uint propertyId, bool isAscending)
+        {
+            int error = Interop.Calendar.Query.SetSort(_queryHandle, propertyId, isAscending);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "SetSort Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs
new file mode 100644 (file)
index 0000000..224ff4e
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A record represents an actual record in the database
+    /// </summary>
+    /// <remarks>
+    /// A record represents an actual record in the database,
+    /// but you can also consider it a piece of information, such as an alarm, attendee and extended.
+    /// A record can be a complex set of data, containing other data.
+    /// For example, a calendar record contains the alarm property, which is a reference to an alarm record.
+    /// An alarm record could belong to a event record,
+    /// and its alarm id property is set to the identifier of the corresponding event.
+    /// In this case, the alarm is the child record of the event and the event is the parent record.
+    /// </remarks>
+    public class CalendarRecord : IDisposable
+    {
+        internal string _uri;
+        internal uint _id;
+        private Int64 _memoryPressure = CalendarViews.AverageSizeOfRecord;
+        internal IntPtr _recordHandle;
+
+        internal CalendarRecord(IntPtr handle)
+        {
+            _recordHandle = handle;
+
+            IntPtr viewUri;
+            int error = Interop.Calendar.Record.GetUriPointer(handle, out viewUri);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        internal CalendarRecord(IntPtr handle, bool disposedValue)
+        {
+            _recordHandle = handle;
+            _disposedValue = disposedValue;
+
+            IntPtr viewUri;
+            int error = Interop.Calendar.Record.GetUriPointer(handle, out viewUri);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+            if (!_disposedValue)
+                GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        internal CalendarRecord(IntPtr handle, int id)
+        {
+            _recordHandle = handle;
+            _id = (uint)id;
+
+            IntPtr viewUri;
+            int error = Interop.Calendar.Record.GetUriPointer(handle, out viewUri);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        /// <summary>
+        /// Creates a record.
+        /// </summary>
+        /// <param name="viewUri">The view URI</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarRecord(string viewUri)
+        {
+            int error = 0;
+            error = Interop.Calendar.Record.Create(viewUri, out _recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CalendarRecord Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            _uri = viewUri;
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        ~CalendarRecord()
+        {
+            Dispose(false);
+        }
+
+#region IDisposable Support
+        /// To detect redundant calls
+        internal bool _disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                Log.Debug(Globals.LogTag, "Dispose :" + disposing);
+
+                int error = Interop.Calendar.Record.Destroy(_recordHandle, false);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Destroy Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                _disposedValue = true;
+                GC.RemoveMemoryPressure(_memoryPressure);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarRecord.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        internal static Interop.Calendar.Record.DateTime ConvertCalendarTimeToStruct(CalendarTime value)
+        {
+            Interop.Calendar.Record.DateTime time = new Interop.Calendar.Record.DateTime();
+            time.type = value._type;
+
+            if ((int)CalendarTime.Type.Utc == value._type)
+            {
+                DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0);
+                time.utime = (value.UtcTime.Ticks - epoch.Ticks) / 10000000;
+            }
+            else
+            {
+                time.year = value.LocalTime.Year;
+                time.month = value.LocalTime.Month;
+                time.mday = value.LocalTime.Day;
+                time.hour = value.LocalTime.Hour;
+                time.minute = value.LocalTime.Minute;
+                time.second = value.LocalTime.Second;
+            }
+            return time;
+        }
+
+        internal static CalendarTime ConvertIntPtrToCalendarTime(Interop.Calendar.Record.DateTime time)
+        {
+            CalendarTime value;
+            if ((int)CalendarTime.Type.Utc == time.type)
+            {
+                DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0);
+                value = new CalendarTime(time.utime * 10000000 + epoch.Ticks);
+            }
+            else
+            {
+                value = new CalendarTime(time.year, time.month, time.mday, time.hour, time.minute, time.second);
+            }
+            value._type = time.type;
+            return value;
+        }
+
+        /// <summary>
+        /// Makes a clone of a record.
+        /// </summary>
+        /// <returns>
+        /// A cloned record
+        /// </returns>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarRecord Clone()
+        {
+            IntPtr _clonedRecordHandle;
+            int error = Interop.Calendar.Record.Clone(_recordHandle, out _clonedRecordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Clone Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarRecord(_clonedRecordHandle, (int)_id);
+        }
+
+        /// <summary>
+        /// The URI of the record
+        /// </summary>
+        public string Uri
+        {
+            get
+            {
+                return _uri;
+            }
+        }
+
+        /// <summary>
+        /// Gets a object from a record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// The value of the property corresponding to property id.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public T Get<T>(uint propertyId)
+        {
+            object parsedValue = null;
+            if (typeof(T) == typeof(string))
+            {
+                string val;
+                int error = Interop.Calendar.Record.GetString(_recordHandle, propertyId, out val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Get String Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val;
+                int error = Interop.Calendar.Record.GetInteger(_recordHandle, propertyId, out val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Get Intger Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(long))
+            {
+                long val;
+                int error = Interop.Calendar.Record.GetLli(_recordHandle, propertyId, out val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Get Long Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val;
+                int error = Interop.Calendar.Record.GetDouble(_recordHandle, propertyId, out val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Get Double Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(CalendarTime))
+            {
+                Interop.Calendar.Record.DateTime time;
+                int error = Interop.Calendar.Record.GetCalendarTime(_recordHandle, propertyId, out time);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Get CalendarTime Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                CalendarTime val = ConvertIntPtrToCalendarTime(time);
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Not supported Data T/ype");
+                throw CalendarErrorFactory.GetException((int)CalendarError.NotSupported);
+            }
+            return (T)parsedValue;
+        }
+
+        /// <summary>
+        /// Sets a value of the property to a record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="value">value</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void Set<T>(uint propertyId, T value)
+        {
+            if (typeof(T) == typeof(string))
+            {
+                string val = Convert.ToString(value);
+                int error = Interop.Calendar.Record.SetString(_recordHandle, propertyId, val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Set String Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val = Convert.ToInt32(value);
+                int error = Interop.Calendar.Record.SetInteger(_recordHandle, propertyId, val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Set Integer Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+            }
+            else if (typeof(T) == typeof(long))
+            {
+                long val = Convert.ToInt64(value);
+                int error = Interop.Calendar.Record.SetLli(_recordHandle, propertyId, val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Set Long Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val = Convert.ToDouble(value);
+                int error = Interop.Calendar.Record.SetDouble(_recordHandle, propertyId, val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Set Double Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+            }
+            else if (typeof(T) == typeof(CalendarTime))
+            {
+                CalendarTime time = (CalendarTime)Convert.ChangeType(value, typeof(CalendarTime));
+                Interop.Calendar.Record.DateTime val = ConvertCalendarTimeToStruct(time);
+                int error = Interop.Calendar.Record.SetCalendarTime(_recordHandle, propertyId, val);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Set CalendarTime Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                    throw CalendarErrorFactory.GetException(error);
+                }
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Not supported Data T/ype");
+                throw CalendarErrorFactory.GetException((int)CalendarError.NotSupported);
+            }
+        }
+
+        /// <summary>
+        /// Adds a child record to the parent record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="childRecord">The child record</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddChildRecord(uint propertyId, CalendarRecord childRecord)
+        {
+            int error = Interop.Calendar.Record.AddChildRecord(_recordHandle, propertyId, childRecord._recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "AddChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                throw CalendarErrorFactory.GetException(error);
+            }
+            childRecord._disposedValue = true;
+        }
+
+        /// <summary>
+        /// Removes a child record from the parent record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="childRecord">The child record</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void RemoveChildRecord(uint propertyId, CalendarRecord childRecord)
+        {
+            int error = Interop.Calendar.Record.RemoveChildRecord(_recordHandle, propertyId, childRecord._recordHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "RemoveChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                throw CalendarErrorFactory.GetException(error);
+            }
+            childRecord._disposedValue = false;
+        }
+
+        /// <summary>
+        /// Gets a child record from the parent record
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// The number of child records corresponding to property ID
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public int GetChildRecordCount(uint propertyId)
+        {
+            int count = 0;
+            int error = Interop.Calendar.Record.GetChildRecordCount(_recordHandle, propertyId, out count);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetChildRecordCount Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Gets a child record from the parent record
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="index">The child record index</param>
+        /// <returns>
+        /// The record
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public CalendarRecord GetChildRecord(uint propertyId, int index)
+        {
+            IntPtr handle;
+
+            int error = Interop.Calendar.Record.GetChildRecordPointer(_recordHandle, propertyId, index, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "GetChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId));
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarRecord(handle, true);
+        }
+
+        /// <summary>
+        /// Clones a child record list corresponding to property ID
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// the record list
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public CalendarList CloneChildRecordList(uint propertyId)
+        {
+            IntPtr listHandle;
+            int error = Interop.Calendar.Record.CloneChildRecordList(_recordHandle, propertyId, out listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "CloneChildRecordList Failed with [" + error + "]" + String.Format("{0:X}", propertyId));
+                throw CalendarErrorFactory.GetException(error);
+            }
+            CalendarList list = new CalendarList(listHandle);
+            return list;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs
new file mode 100644 (file)
index 0000000..f1193ef
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using static Interop.Calendar.Reminder;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A class for reminder for event.
+    /// </summary>
+    /// <remarks>
+    /// The client who wants to be alerted at specific time should register MIME("application/x-tizen.calendar.reminder") type in manifest.xml file.
+    /// </remarks>
+    public class CalendarReminder : IDisposable
+    {
+#region IDisposable Support
+        private bool disposedValue = false;
+
+        internal CalendarReminder()
+        {
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the CalendarReminder.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        private static readonly Interop.Calendar.Reminder.ReminderAlertedCallback _reminderAlertedCallback = (string param, IntPtr userData) =>
+        {
+            ReminderAlertedEventArgs args = new ReminderAlertedEventArgs(param);
+            s_reminderAlerted?.Invoke(null, args);
+        };
+
+        private static event EventHandler<ReminderAlertedEventArgs> s_reminderAlerted;
+
+        /// <summary>
+        /// Reminder event is triggered when the alarm is alerted.
+        /// </summary>
+        public static event EventHandler<ReminderAlertedEventArgs> ReminderAlerted
+        {
+            add
+            {
+                Log.Debug(Globals.LogTag, "Add Reminder");
+
+                if (s_reminderAlerted == null)
+                {
+                    int error = Interop.Calendar.Reminder.Add(_reminderAlertedCallback, IntPtr.Zero);
+                    if (CalendarError.None != (CalendarError)error)
+                    {
+                        Log.Error(Globals.LogTag, "Add reminder Failed with error " + error);
+                        throw CalendarErrorFactory.GetException(error);
+                    }
+                }
+                s_reminderAlerted += value;
+            }
+
+            remove
+            {
+                Log.Debug(Globals.LogTag, "Remove Reminder");
+
+                s_reminderAlerted -= value;
+                if (s_reminderAlerted == null)
+                {
+                    /// _reminderAlertedCallback is removed by .Net Core
+                    int error = Interop.Calendar.Reminder.Remove(_reminderAlertedCallback, IntPtr.Zero);
+                    if (CalendarError.None != (CalendarError)error)
+                    {
+                        Log.Error(Globals.LogTag, "Remove reminder Failed with error " + error);
+                        throw CalendarErrorFactory.GetException(error);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs
new file mode 100644 (file)
index 0000000..3ac883c
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A class for time to set, get or calcurate.
+    /// </summary>
+    public class CalendarTime : IComparable<CalendarTime>
+    {
+        internal int _type;
+        internal const int milliseconds = 10000000;
+
+        /// <summary>
+        /// Enumeration for the time type.
+        /// </summary>
+        public enum Type
+        {
+            /// <summary>
+            /// UTC time
+            /// </summary>
+            Utc,
+            /// <summary>
+            /// Local time
+            /// </summary>
+            Local
+        }
+
+        /// <summary>
+        /// Create UTC CalendarTime
+        /// </summary>
+        /// <param name="utcTime">UTC epoch time. 0 is 1971/01/01</param>
+        public CalendarTime(long utcTime)
+        {
+            _type = (int)Type.Utc;
+            utcTime -= utcTime % milliseconds; /* delete millisecond */
+            UtcTime = new DateTime(utcTime);
+        }
+
+        /// <summary>
+        /// Create Local CalendarTime
+        /// </summary>
+        /// <param name="year">year</param>
+        /// <param name="month">month</param>
+        /// <param name="day">day</param>
+        /// <param name="hour">hour</param>
+        /// <param name="minute">minute</param>
+        /// <param name="second">second</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public CalendarTime(int year, int month, int day, int hour, int minute, int second)
+        {
+            _type = (int)Type.Local;
+            LocalTime = new DateTime(year, month, day, hour, minute, second);
+        }
+
+        /// <summary>
+        /// Get utcTime
+        /// </summary>
+        public DateTime UtcTime
+        {
+            get;
+        }
+
+        /// <summary>
+        /// Get localTime
+        /// </summary>
+        public DateTime LocalTime
+        {
+            get;
+        }
+
+        /// <summary>
+        /// Compare CalendarTime
+        /// </summary>
+        /// <param name="t">The CalendarTime to be compared</param>
+        /// <returns>
+        /// A 32-bit signed integer that indicates the relative order of the objects being compared.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public int CompareTo(CalendarTime t)
+        {
+            if (_type != t._type)
+            {
+                Log.Error(Globals.LogTag, "Not to compare with different type");
+                throw CalendarErrorFactory.GetException((int)CalendarError.InvalidParameter);
+            }
+
+            if (_type == (int)Type.Utc)
+                return UtcTime.CompareTo(t.UtcTime);
+            else
+                return LocalTime.CompareTo(t.LocalTime);
+        }
+    }
+}
+
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs
new file mode 100644 (file)
index 0000000..560e898
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+       /// <summary>
+       /// </summary>
+       public static class CalendarTypes
+       {
+               /// <summary>
+               /// Enumeration for Default book
+               /// </summary>
+               public enum DefaultBook
+               {
+                       /// <summary>
+                       /// Default event calendar book.
+                       /// </summary>
+                       Event,
+                       /// <summary>
+                       /// Default Todo calendar book.
+                       /// </summary>
+                       Todo,
+                       /// <summary>
+                       /// Default Birthday calendar book.
+                       /// </summary>
+                       Birthday,
+               }
+
+               /// <summary>
+               /// Enumeration for Store type
+               /// </summary>
+               public enum StoreType
+               {
+                       /// <summary>
+                       /// Book type
+                       /// </summary>
+                       Book,
+                       /// <summary>
+                       /// Event type
+                       /// </summary>
+                       Event,
+                       /// <summary>
+                       /// Todo type
+                       /// </summary>
+                       Todo,
+               }
+
+               /// <summary>
+               /// Enumeration for the book mode.
+               /// </summary>
+               public enum BookMode
+               {
+                       /// <summary>
+                       /// All modules can read and write records of this calendar_book
+                       /// </summary>
+                       Default,
+                       /// <summary>
+                       /// All modules can only read records of this calendar book
+                       /// </summary>
+                       ReadOnly,
+               }
+
+               /// <summary>
+               /// Enumeration for the event status.
+               /// </summary>
+               public enum EventStatus
+               {
+                       /// <summary>
+                       /// No status
+                       /// </summary>
+                       None = 0x01,
+                       /// <summary>
+                       /// The event is tentative
+                       /// </summary>
+                       Tentative = 0x02,
+                       /// <summary>
+                       /// The event is confirmed
+                       /// </summary>
+                       Confirmed = 0x04,
+                       /// <summary>
+                       /// The event is canceled
+                       /// </summary>
+                       Cancelled = 0x08,
+               }
+
+               /// <summary>
+               /// Enumeration for for the status of a to-do.
+               /// </summary>
+               public enum TodoStatus
+               {
+                       /// <summary>
+                       /// No status
+                       /// </summary>
+                       None = 0x0100,
+                       /// <summary>
+                       /// Needs action status
+                       /// </summary>
+                       NeedAction = 0x0200,
+                       /// <summary>
+                       /// Completed status
+                       /// </summary>
+                       Completed = 0x0400,
+                       /// <summary>
+                       /// Work in process status
+                       /// </summary>
+                       InProcess = 0x0800,
+                       /// <summary>
+                       /// Canceled status
+                       /// </summary>
+                       Canceled = 0x1000,
+               }
+
+               /// <summary>
+               /// Enumeration for the busy status of an event.
+               /// </summary>
+               public enum BusyStatus
+               {
+                       /// <summary>
+                       /// The free status
+                       /// </summary>
+                       Free,
+                       /// <summary>
+                       /// The busy status
+                       /// </summary>
+                       Busy,
+                       /// <summary>
+                       /// The unavailable status
+                       /// </summary>
+                       Unavailable,
+                       /// <summary>
+                       /// The tentative status
+                       /// </summary>
+                       Tentative,
+               }
+
+               /// <summary>
+               /// Enumeration for the calendar sensitivity type.
+               /// </summary>
+               public enum Sensitivity
+               {
+                       /// <summary>
+                       /// Public Sensitivity
+                       /// </summary>
+                       Public,
+                       /// <summary>
+                       /// Private Sensitivity
+                       /// </summary>
+                       Private,
+                       /// <summary>
+                       /// Confidential Sensitivity
+                       /// </summary>
+                       Confidential,
+               }
+
+               /// <summary>
+               /// Enumeration for the meeting status.
+               /// </summary>
+               public enum MeetingStatus
+               {
+                       /// <summary>
+                       /// No meeting
+                       /// </summary>
+                       Notmeeting,
+                       /// <summary>
+                       /// Meeting exists
+                       /// </summary>
+                       Meeting,
+                       /// <summary>
+                       /// Meeting received
+                       /// </summary>
+                       Received,
+                       /// <summary>
+                       /// Meeting canceled
+                       /// </summary>
+                       Canceled,
+               }
+
+               /// <summary>
+               /// Enumeration for the calendar event item's priority
+               /// </summary>
+               public enum Priority
+               {
+                       /// <summary>
+                       /// No priority
+                       /// </summary>
+                       None = 0x01,
+                       /// <summary>
+                       /// Low priority
+                       /// </summary>
+                       High = 0x02,
+                       /// <summary>
+                       /// Normal priority
+                       /// </summary>
+                       Normal = 0x04,
+                       /// <summary>
+                       /// High priority
+                       /// </summary>
+                       Low = 0x08,
+               }
+
+               /// <summary>
+               /// Enumeration for the frequency of an event's recurrence.
+               /// </summary>
+               public enum Recurrence
+               {
+                       /// <summary>
+                       /// No recurrence event
+                       /// </summary>
+                       None,
+                       /// <summary>
+                       /// An event occurs every day
+                       /// </summary>
+                       Daily,
+                       /// <summary>
+                       /// An event occurs on the same day of every week. According to the week flag, the event will recur every day of the week
+                       /// </summary>
+                       Weekly,
+                       /// <summary>
+                       /// An event occurs on the same day of every month
+                       /// </summary>
+                       Monthly,
+                       /// <summary>
+                       /// An event occurs on the same day of every year
+                       /// </summary>
+                       Yearly,
+               }
+
+               /// <summary>
+               /// Enumeration for the range type.
+               /// </summary>
+               public enum RangeType
+               {
+                       /// <summary>
+                       /// Range until
+                       /// </summary>
+                       Until,
+                       /// <summary>
+                       /// Range count
+                       /// </summary>
+                       Count,
+                       /// <summary>
+                       /// No range
+                       /// </summary>
+                       None,
+               }
+
+               /// <summary>
+               /// Enumeration for the system type.
+               /// </summary>
+               public enum SystemType
+               {
+                       /// <summary>
+                       /// Locale's default calendar
+                       /// </summary>
+                       Default,
+                       /// <summary>
+                       /// Locale's default calendar
+                       /// </summary>
+                       Gregorian,
+                       /// <summary>
+                       /// East asian lunisolar calendar
+                       /// </summary>
+                       Lunisolar,
+               }
+
+               /// <summary>
+               /// Enumeration for the alarm time unit type of an event, such as minutes, hours, days, and so on.
+               /// </summary>
+               public enum TickUnit
+               {
+                       /// <summary>
+                       /// No reminder set
+                       /// </summary>
+                       None = -1,
+                       /// <summary>
+                       /// Specific in seconds
+                       /// </summary>
+                       Specific = 1,
+                       /// <summary>
+                       /// Alarm time unit in minutes
+                       /// </summary>
+                       Minute = 60,
+                       /// <summary>
+                       /// Alarm time unit in hours
+                       /// </summary>
+                       Hour = 3600,
+                       /// <summary>
+                       /// Alarm time unit in days
+                       /// </summary>
+                       Day = 86400,
+                       /// <summary>
+                       /// Alarm time unit in weeks
+                       /// </summary>
+                       Week = 604800,
+               }
+
+               /// <summary>
+               /// Enumeration for weekdays.
+               /// </summary>
+               public enum WeekDay
+               {
+                       /// <summary>
+                       /// Sunday
+                       /// </summary>
+                       Sunday = 1,
+                       /// <summary>
+                       /// Monday
+                       /// </summary>
+                       Monday,
+                       /// <summary>
+                       /// Tuesday
+                       /// </summary>
+                       Thuesday,
+                       /// <summary>
+                       /// Wednesday
+                       /// </summary>
+                       Wednesday,
+                       /// <summary>
+                       /// Thursday
+                       /// </summary>
+                       Thurday,
+                       /// <summary>
+                       /// Friday
+                       /// </summary>
+                       Friday,
+                       /// <summary>
+                       /// Saturday
+                       /// </summary>
+                       Saterday,
+               }
+
+               /// <summary>
+               /// Enumeration for the attendee cutype.
+               /// </summary>
+               public enum Cutype
+               {
+                       /// <summary>
+                       /// Individual cutype
+                       /// </summary>
+                       Individual,
+                       /// <summary>
+                       /// Group cutype
+                       /// </summary>
+                       Group,
+                       /// <summary>
+                       /// Resource cutype
+                       /// </summary>
+                       Recource,
+                       /// <summary>
+                       /// Room cutype
+                       /// </summary>
+                       Room,
+                       /// <summary>
+                       /// Unknown cutype
+                       /// </summary>
+                       Unknown,
+               }
+
+               /// <summary>
+               /// Enumeration for the attendee role.
+               /// </summary>
+               public enum AttendeeRole
+               {
+                       /// <summary>
+                       /// Participation is required
+                       /// </summary>
+                       ReqParticipant,
+                       /// <summary>
+                       /// Accepted status
+                       /// </summary>
+                       OptParticipant,
+                       /// <summary>
+                       /// Non-Participant
+                       /// </summary>
+                       NonParticipant,
+                       /// <summary>
+                       /// Chairperson
+                       /// </summary>
+                       Chair,
+               }
+
+               /// <summary>
+               /// Enumeration for the attendee status.
+               /// </summary>
+               public enum AttendeeStatus
+               {
+                       /// <summary>
+                       /// Pending status
+                       /// </summary>
+                       Pending,
+                       /// <summary>
+                       /// Accepted status
+                       /// </summary>
+                       Accepted,
+                       /// <summary>
+                       /// Declined status
+                       /// </summary>
+                       Declined,
+                       /// <summary>
+                       /// Tentative status
+                       /// </summary>
+                       Tentative,
+                       /// <summary>
+                       /// Delegated status
+                       /// </summary>
+                       Delegated,
+                       /// <summary>
+                       /// Completed status
+                       /// </summary>
+                       Completed,
+                       /// <summary>
+                       /// In process status
+                       /// </summary>
+                       InProcess,
+               }
+
+               /// <summary>
+               /// Enumeration for the alarm action.
+               /// </summary>
+               public enum Action
+               {
+                       /// <summary>
+                       /// Audio action
+                       /// </summary>
+                       Audio,
+                       /// <summary>
+                       /// Display action
+                       /// </summary>
+                       Display,
+                       /// <summary>
+                       /// Email action
+                       /// </summary>
+                       Email,
+               }
+       }
+}
+
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs
new file mode 100644 (file)
index 0000000..1a7a3a8
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// A class for parsing and composing vCalendar.
+    /// </summary>
+    /// <remarks>
+    /// It's based on the vCalendar v2.0 specification
+    /// </remarks>
+    public class CalendarVcalendar
+    {
+        internal CalendarVcalendar()
+        {
+        }
+
+        public delegate bool ParseDelegate(CalendarRecord record);
+
+        /// <summary>
+        /// Retrieves a vcalendar stream from a calendar list.
+        /// </summary>
+        /// <param name="list">The calendar list</param>
+        /// <returns>
+        /// The composed stream.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static string Compose(CalendarList list)
+        {
+            string stream;
+            int error = Interop.Calendar.Vcalendar.Compose(list._listHandle, out stream);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "MakeVcalendar Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return stream;
+        }
+
+        /// <summary>
+        /// Retrieves all calendars from a vcalendar stream.
+        /// </summary>
+        /// <param name="stream">The vcalendar stream</param>
+        /// <returns>
+        /// the record list
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static CalendarList Parse(string stream)
+        {
+            int error = 0;
+            IntPtr _listHandle;
+            error = Interop.Calendar.Vcalendar.Parse(stream, out _listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Parse Vcalendar Failed [" + error + "]");
+                throw CalendarErrorFactory.GetException(error);
+            }
+            return new CalendarList(_listHandle);
+        }
+
+        /// <summary>
+        /// Parse vcalendar file with foreach
+        /// </summary>
+        /// <param name="path">The file path of the vCalendar stream file</param>
+        /// <param name="callback">he callback function to invoke</param>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static void ParseForEach(string path, ParseDelegate callback)
+        {
+            int error = 0;
+
+            Interop.Calendar.Vcalendar.ParseCallback cb = (IntPtr handle, IntPtr data) =>
+            {
+                return callback(new CalendarRecord(handle, true));
+            };
+
+            error = Interop.Calendar.Vcalendar.ParseForEach(path, cb, IntPtr.Zero);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "Parse foreach Vcalendar Failed [" + error + "]");
+                throw CalendarErrorFactory.GetException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs
new file mode 100644 (file)
index 0000000..b4ddd17
--- /dev/null
@@ -0,0 +1,1448 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// This class provides information about views with properties.
+    /// </summary>
+    /// <remarks>
+    ///  A view is a class which describes properties of a record.
+    ///  A record can have basic properties of five types: integer, string, long, double, CalendarTime.
+    /// </remarks>
+    public static class CalendarViews
+    {
+        /// data type mask 0x0FF00000
+        private const uint ViewMask                          = 0xFF000000;
+        private const uint ViewBook                          = 0x01000000;
+        private const uint ViewEvent                         = 0x02000000;
+        private const uint ViewTodo                          = 0x03000000;
+        private const uint ViewTimezone                      = 0x04000000;
+        private const uint ViewAttendee                      = 0x05000000;
+        private const uint ViewAlarm                         = 0x06000000;
+        private const uint ViewInstanceUtimeBook             = 0x07000000;
+        private const uint ViewInstanceLocaltimeBook         = 0x08000000;
+        private const uint ViewUpdateInfo                    = 0x09000000;
+        private const uint ViewExtended                      = 0x0A000000;
+        private const uint ViewInstanceUtimeBookExtended     = 0x0B000000;
+        private const uint ViewInstanceLocaltimeBookExtended = 0x0C000000;
+
+        private const uint DataTypeMask    = 0x000FF000;
+        private const uint DataTypeInteger = 0x00001000;
+        private const uint DataTypeString  = 0x00002000;
+        private const uint DataTypeDouble  = 0x00003000;
+        private const uint DataTypeLong    = 0x00004000;
+        private const uint DataTypeCaltime = 0x00005000;
+        private const uint DataTypeRecord  = 0x00006000;
+
+        /// property : mask 0x0000F000
+        private const uint PropertyMask       = 0x00F00000;
+        private const uint PropertyFilter     = 0x00100000;
+        private const uint PropertyProjection = 0x00200000;
+        private const uint PropertyReadOnly   = 0x00300000;
+
+        private enum PropertyIds : uint
+        {
+            /// book
+            BookId          = (ViewBook|DataTypeInteger|PropertyReadOnly),
+            BookUid         = (ViewBook|DataTypeString) + 1,
+            BookName        = (ViewBook|DataTypeString) + 2,
+            BookDescription = (ViewBook|DataTypeString) + 3,
+            BookColor       = (ViewBook|DataTypeString) + 4,
+            BookLocation    = (ViewBook|DataTypeString) + 5,
+            BookVisibility  = (ViewBook|DataTypeInteger) + 6,
+            BookSyncEvent   = (ViewBook|DataTypeInteger) + 7,
+            BookAccountId   = (ViewBook|DataTypeInteger) + 8,
+            BookStoreType   = (ViewBook|DataTypeInteger) + 9,
+            BookSyncData1   = (ViewBook|DataTypeString) + 10,
+            BookSyncData2   = (ViewBook|DataTypeString) + 11,
+            BookSyncData3   = (ViewBook|DataTypeString) + 12,
+            BookSyncData4   = (ViewBook|DataTypeString) + 13,
+            BookMode        = (ViewBook|DataTypeInteger) + 14,
+
+            /// Event
+            EventId                 = (ViewEvent|DataTypeInteger|PropertyReadOnly),
+            EventBookId             = (ViewEvent|DataTypeInteger) + 1,
+            EventSummary            = (ViewEvent|DataTypeString) + 2,
+            EventDescription        = (ViewEvent|DataTypeString) + 3,
+            EventLocation           = (ViewEvent|DataTypeString) + 4,
+            EventCategories         = (ViewEvent|DataTypeString) + 5,
+            EventExdate             = (ViewEvent|DataTypeString) + 6,
+            EventEventStatus        = (ViewEvent|DataTypeInteger) + 7,
+            EventPriority           = (ViewEvent|DataTypeInteger) + 8,
+            EventTimezone           = (ViewEvent|DataTypeInteger) + 9,
+            EventContactId          = (ViewEvent|DataTypeInteger) + 10,
+            EventBusyStatus         = (ViewEvent|DataTypeInteger) + 11,
+            EventSensitivity        = (ViewEvent|DataTypeInteger) + 12,
+            EventUid                = (ViewEvent|DataTypeString) + 13,
+            EventOrganizerName      = (ViewEvent|DataTypeString) + 14,
+            EventOrganizerEmail     = (ViewEvent|DataTypeString) + 15,
+            EventMeetingStatus      = (ViewEvent|DataTypeInteger) + 16,
+            EventOriginalEventId    = (ViewEvent|DataTypeInteger) + 17,
+            EventLatitude           = (ViewEvent|DataTypeDouble) + 18,
+            EventLongitude          = (ViewEvent|DataTypeDouble) + 19,
+            EventEmailId            = (ViewEvent|DataTypeInteger) + 20,
+            EventCreatedTime        = (ViewEvent|DataTypeLong) + 21,
+            EventLastModifiedTime   = (ViewEvent|DataTypeLong|PropertyReadOnly) + 22,
+            EventIsDeleted          = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 23,
+            EventFreq               = (ViewEvent|DataTypeInteger) + 24,
+            EventRangeType          = (ViewEvent|DataTypeInteger) + 25,
+            EventUntil              = (ViewEvent|DataTypeCaltime) + 26,
+            EventCount              = (ViewEvent|DataTypeInteger) + 27,
+            EventInterval           = (ViewEvent|DataTypeInteger) + 28,
+            EventBysecond           = (ViewEvent|DataTypeString) + 29,
+            EventByminute           = (ViewEvent|DataTypeString) + 30,
+            EventByhour             = (ViewEvent|DataTypeString) + 31,
+            EventByday              = (ViewEvent|DataTypeString) + 32,
+            EventBymonthday         = (ViewEvent|DataTypeString) + 33,
+            EventByyearday          = (ViewEvent|DataTypeString) + 34,
+            EventByweekno           = (ViewEvent|DataTypeString) + 35,
+            EventBymonth            = (ViewEvent|DataTypeString) + 36,
+            EventBysetpos           = (ViewEvent|DataTypeString) + 37,
+            EventWkst               = (ViewEvent|DataTypeInteger) + 38,
+            EventRecurrenceId       = (ViewEvent|DataTypeString) + 39,
+            EventRdate              = (ViewEvent|DataTypeString) + 40,
+            EventHasAttendee        = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 41,
+            EventHasAlarm           = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 42,
+            EventSyncData1          = (ViewEvent|DataTypeString) + 43,
+            EventSyncData2          = (ViewEvent|DataTypeString) + 44,
+            EventSyncData3          = (ViewEvent|DataTypeString) + 45,
+            EventSyncData4          = (ViewEvent|DataTypeString) + 46,
+            EventStart              = (ViewEvent|DataTypeCaltime) + 47,
+            EventEnd                = (ViewEvent|DataTypeCaltime) + 48,
+            EventAlarm              = (ViewEvent|DataTypeRecord) + 49,
+            EventAttendee           = (ViewEvent|DataTypeRecord) + 50,
+            EventCalendarSystemType = (ViewEvent|DataTypeInteger) + 51,
+            EventStartTzid          = (ViewEvent|DataTypeString) + 52,
+            EventEndTzid            = (ViewEvent|DataTypeString) + 53,
+            EventException          = (ViewEvent|DataTypeRecord) + 54,
+            EventExtended           = (ViewEvent|DataTypeRecord) + 55,
+            EventIsAllday           = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 56,
+            EventLinkCount          = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 57,
+            EventLinkBaseId         = (ViewEvent|DataTypeInteger|PropertyReadOnly) + 58,
+
+            /// Todo
+            TodoId                   = (ViewTodo|DataTypeInteger|PropertyReadOnly),
+            TodoBookId               = (ViewTodo|DataTypeInteger) + 1,
+            TodoSummary              = (ViewTodo|DataTypeString) + 2,
+            TodoDescription          = (ViewTodo|DataTypeString) + 3,
+            TodoLocation             = (ViewTodo|DataTypeString) + 4,
+            TodoCategories           = (ViewTodo|DataTypeString) + 5,
+            TodoStatus               = (ViewTodo|DataTypeInteger) + 6,
+            TodoPriority             = (ViewTodo|DataTypeInteger) + 7,
+            TodoSensitivity          = (ViewTodo|DataTypeInteger) + 8,
+            TodoUid                  = (ViewTodo|DataTypeString) + 9,
+            TodoLatitude             = (ViewTodo|DataTypeDouble) + 10,
+            TodoLongitude            = (ViewTodo|DataTypeDouble) + 11,
+            TodoProgress             = (ViewTodo|DataTypeInteger) + 12,
+            TodoCreatedTime          = (ViewTodo|DataTypeLong) + 13,
+            TodoLastModifiedTime     = (ViewTodo|DataTypeLong|PropertyReadOnly) + 14,
+            TodoCompletedTime        = (ViewTodo|DataTypeLong) + 15,
+            TodoIsDeleted            = (ViewTodo|DataTypeInteger|PropertyReadOnly) + 16,
+            TodoFreq                 = (ViewTodo|DataTypeInteger) + 17,
+            TodoRangeType            = (ViewTodo|DataTypeInteger) + 18,
+            TodoUntil                = (ViewTodo|DataTypeCaltime) + 19,
+            TodoCount                = (ViewTodo|DataTypeInteger) + 20,
+            TodoIntegererval         = (ViewTodo|DataTypeInteger) + 21,
+            TodoBysecond             = (ViewTodo|DataTypeString) + 22,
+            TodoByminute             = (ViewTodo|DataTypeString) + 23,
+            TodoByhour               = (ViewTodo|DataTypeString) + 24,
+            TodoByday                = (ViewTodo|DataTypeString) + 25,
+            TodoBymonthday           = (ViewTodo|DataTypeString) + 26,
+            TodoByyearday            = (ViewTodo|DataTypeString) + 27,
+            TodoByweekno             = (ViewTodo|DataTypeString) + 28,
+            TodoBymonth              = (ViewTodo|DataTypeString) + 29,
+            TodoBysetpos             = (ViewTodo|DataTypeString) + 30,
+            TodoWkst                 = (ViewTodo|DataTypeInteger) + 31,
+            TodoHasAlarm             = (ViewTodo|DataTypeInteger|PropertyReadOnly) + 32,
+            TodoSyncData1            = (ViewTodo|DataTypeString) + 33,
+            TodoSyncData2            = (ViewTodo|DataTypeString) + 34,
+            TodoSyncData3            = (ViewTodo|DataTypeString) + 35,
+            TodoSyncData4            = (ViewTodo|DataTypeString) + 36,
+            TodoStart                = (ViewTodo|DataTypeCaltime) + 37,
+            TodoDue                  = (ViewTodo|DataTypeCaltime) + 38,
+            TodoAlarm                = (ViewTodo|DataTypeRecord) + 39,
+            TodoStartTzid            = (ViewTodo|DataTypeString) + 40,
+            TodoDueTzid              = (ViewTodo|DataTypeString) + 41,
+            TodoOrganizerName        = (ViewTodo|DataTypeString) + 42,
+            TodoOrganizerEmail       = (ViewTodo|DataTypeString) + 43,
+            TodoHasAttendee          = (ViewTodo|DataTypeInteger|PropertyReadOnly) + 44,
+            TodoAttendee             = (ViewTodo|DataTypeRecord) + 45,
+            TodoExtended             = (ViewTodo|DataTypeRecord) + 46,
+            TodoIsAllday             = (ViewTodo|DataTypeInteger|PropertyReadOnly) + 47,
+
+            /// Timezone
+            TimezoneId                          = (ViewTimezone|DataTypeInteger|PropertyReadOnly),
+            TimezoneTzOffsetFromGmt             = (ViewTimezone|DataTypeInteger) + 1,
+            TimezoneStandardName                = (ViewTimezone|DataTypeString) + 2,
+            TimezoneStdStartMonth               = (ViewTimezone|DataTypeInteger) + 3,
+            TimezoneStdStartPositionOfWeek      = (ViewTimezone|DataTypeInteger) + 4,
+            TimezoneStdStartDay                 = (ViewTimezone|DataTypeInteger) + 5,
+            TimezoneStdStartHour                = (ViewTimezone|DataTypeInteger) + 6,
+            TimezoneStandardBias                = (ViewTimezone|DataTypeInteger) + 7,
+            TimezoneDayLightName                = (ViewTimezone|DataTypeString) + 8,
+            TimezoneDayLightStartMonth          = (ViewTimezone|DataTypeInteger) + 9,
+            TimezoneDayLightStartPositionOfWeek = (ViewTimezone|DataTypeInteger) + 10,
+            TimezoneDayLightStartDay            = (ViewTimezone|DataTypeInteger) + 11,
+            TimezoneDayLightStartHour           = (ViewTimezone|DataTypeInteger) + 12,
+            TimezoneDayLightBias                = (ViewTimezone|DataTypeInteger) + 13,
+            TimezoneCalendarId                  = (ViewTimezone|DataTypeInteger) + 14,
+
+            AttendeeNumber       = (ViewAttendee|DataTypeString),
+            AttendeeCutype       = (ViewAttendee|DataTypeInteger) + 1,
+            AttendeeCtIndex      = (ViewAttendee|DataTypeInteger) + 2,
+            AttendeeUid          = (ViewAttendee|DataTypeString) + 3,
+            AttendeeGroup        = (ViewAttendee|DataTypeString) + 4,
+            AttendeeEmail        = (ViewAttendee|DataTypeString) + 5,
+            AttendeeRole         = (ViewAttendee|DataTypeInteger) + 6,
+            AttendeeStatus       = (ViewAttendee|DataTypeInteger) + 7,
+            AttendeeRsvp         = (ViewAttendee|DataTypeInteger) + 8,
+            AttendeeDelegateeUri = (ViewAttendee|DataTypeString) + 9,
+            AttendeeDelegatorUri = (ViewAttendee|DataTypeString) + 10,
+            AttendeeName         = (ViewAttendee|DataTypeString) + 11,
+            AttendeeMember       = (ViewAttendee|DataTypeString) + 12,
+            AttendeeParentId     = (ViewAttendee|DataTypeInteger|PropertyReadOnly) + 13,
+
+            AlarmTick            = (ViewAlarm|DataTypeInteger),
+            AlarmTickUnit        = (ViewAlarm|DataTypeInteger) + 1,
+            AlarmDescription     = (ViewAlarm|DataTypeString) + 2,
+            AlarmParentId        = (ViewAlarm|DataTypeInteger|PropertyReadOnly) + 3,
+            AlarmSummary         = (ViewAlarm|DataTypeString) + 4,
+            AlarmAction          = (ViewAlarm|DataTypeInteger) + 5,
+            AlarmAttach          = (ViewAlarm|DataTypeString) + 6,
+            AlarmAlarm           = (ViewAlarm|DataTypeCaltime) + 7,
+
+            InstanceUtimeBookEventId          = (ViewInstanceUtimeBook|DataTypeInteger),
+            InstanceUtimeBookStart            = (ViewInstanceUtimeBook|DataTypeCaltime) + 1,
+            InstanceUtimeBookEnd              = (ViewInstanceUtimeBook|DataTypeCaltime) + 2,
+            InstanceUtimeBookSummary          = (ViewInstanceUtimeBook|DataTypeString) + 3,
+            InstanceUtimeBookLocation         = (ViewInstanceUtimeBook|DataTypeString) + 4,
+            InstanceUtimeBookBookId           = (ViewInstanceUtimeBook|DataTypeInteger) + 5,
+            InstanceUtimeBookDescription      = (ViewInstanceUtimeBook|DataTypeString) + 6,
+            InstanceUtimeBookBusyStatus       = (ViewInstanceUtimeBook|DataTypeInteger) + 7,
+            InstanceUtimeBookEventStatus      = (ViewInstanceUtimeBook|DataTypeInteger) + 8,
+            InstanceUtimeBookPriority         = (ViewInstanceUtimeBook|DataTypeInteger) + 9,
+            InstanceUtimeBookSensitivity      = (ViewInstanceUtimeBook|DataTypeInteger) + 10,
+            InstanceUtimeBookHasRrule         = (ViewInstanceUtimeBook|DataTypeInteger) + 11,
+            InstanceUtimeBookLatitude         = (ViewInstanceUtimeBook|DataTypeDouble) + 12,
+            InstanceUtimeBookLongitude        = (ViewInstanceUtimeBook|DataTypeDouble) + 13,
+            InstanceUtimeBookHasAlarm         = (ViewInstanceUtimeBook|DataTypeInteger) + 14,
+            InstanceUtimeBookOriginalEventId  = (ViewInstanceUtimeBook|DataTypeInteger) + 15,
+            InstanceUtimeBookLastModifiedtime = (ViewInstanceUtimeBook|DataTypeLong) + 16,
+            InstanceUtimeBookSyncData1        = (ViewInstanceUtimeBook|DataTypeString) + 17,
+
+            InstanceLocaltimeBookEventId          = (ViewInstanceLocaltimeBook|DataTypeInteger),
+            InstanceLocaltimeBookStart            = (ViewInstanceLocaltimeBook|DataTypeCaltime) + 1,
+            InstanceLocaltimeBookEnd              = (ViewInstanceLocaltimeBook|DataTypeCaltime) + 2,
+            InstanceLocaltimeBookSummary          = (ViewInstanceLocaltimeBook|DataTypeString) + 3,
+            InstanceLocaltimeBookLocation         = (ViewInstanceLocaltimeBook|DataTypeString) + 4,
+            InstanceLocaltimeBookBookId           = (ViewInstanceLocaltimeBook|DataTypeInteger) + 5,
+            InstanceLocaltimeBookDescription      = (ViewInstanceLocaltimeBook|DataTypeString) + 6,
+            InstanceLocaltimeBookBusyStatus       = (ViewInstanceLocaltimeBook|DataTypeInteger) + 7,
+            InstanceLocaltimeBookEventStatus      = (ViewInstanceLocaltimeBook|DataTypeInteger) + 8,
+            InstanceLocaltimeBookPriority         = (ViewInstanceLocaltimeBook|DataTypeInteger) + 9,
+            InstanceLocaltimeBookSensitivity      = (ViewInstanceLocaltimeBook|DataTypeInteger) + 10,
+            InstanceLocaltimeBookHasRrule         = (ViewInstanceLocaltimeBook|DataTypeInteger) + 11,
+            InstanceLocaltimeBookLatitude         = (ViewInstanceLocaltimeBook|DataTypeDouble) + 12,
+            InstanceLocaltimeBookLongitude        = (ViewInstanceLocaltimeBook|DataTypeDouble) + 13,
+            InstanceLocaltimeBookHasAlarm         = (ViewInstanceLocaltimeBook|DataTypeInteger) + 14,
+            InstanceLocaltimeBookOriginalEventId  = (ViewInstanceLocaltimeBook|DataTypeInteger) + 15,
+            InstanceLocaltimeBookLastModifiedTime = (ViewInstanceLocaltimeBook|DataTypeLong) + 16,
+            InstanceLocaltimeBookSyncData1        = (ViewInstanceLocaltimeBook|DataTypeString) + 17,
+            InstanceLocaltimeBookIsAllday         = (ViewInstanceLocaltimeBook|DataTypeInteger|PropertyReadOnly) + 18,
+
+            InstanceUtimeBookExtendedEventId          = (ViewInstanceUtimeBookExtended|DataTypeInteger),
+            InstanceUtimeBookExtendedStart            = (ViewInstanceUtimeBookExtended|DataTypeCaltime) + 1,
+            InstanceUtimeBookExtendedEnd              = (ViewInstanceUtimeBookExtended|DataTypeCaltime) + 2,
+            InstanceUtimeBookExtendedSummary          = (ViewInstanceUtimeBookExtended|DataTypeString) + 3,
+            InstanceUtimeBookExtendedLocation         = (ViewInstanceUtimeBookExtended|DataTypeString) + 4,
+            InstanceUtimeBookExtendedBookId           = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 5,
+            InstanceUtimeBookExtendedDescription      = (ViewInstanceUtimeBookExtended|DataTypeString) + 6,
+            InstanceUtimeBookExtendedBusyStatus       = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 7,
+            InstanceUtimeBookExtendedEventStatus      = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 8,
+            InstanceUtimeBookExtendedPriority         = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 9,
+            InstanceUtimeBookExtendedSensitivity      = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 10,
+            InstanceUtimeBookExtendedHasRrule         = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 11,
+            InstanceUtimeBookExtendedLatitude         = (ViewInstanceUtimeBookExtended|DataTypeDouble) + 12,
+            InstanceUtimeBookExtendedLongitude        = (ViewInstanceUtimeBookExtended|DataTypeDouble) + 13,
+            InstanceUtimeBookExtendedHasAlarm         = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 14,
+            InstanceUtimeBookExtendedOriginalEventId  = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 15,
+            InstanceUtimeBookExtendedLastModifiedTime = (ViewInstanceUtimeBookExtended|DataTypeLong) + 16,
+            InstanceUtimeBookExtendedSyncData1        = (ViewInstanceUtimeBookExtended|DataTypeString) + 17,
+            InstanceUtimeBookExtendedOrganizerName    = (ViewInstanceUtimeBookExtended|DataTypeString) + 18,
+            InstanceUtimeBookExtendedCategories       = (ViewInstanceUtimeBookExtended|DataTypeString) + 19,
+            InstanceUtimeBookExtendedHasAttendee      = (ViewInstanceUtimeBookExtended|DataTypeInteger) + 20,
+            InstanceUtimeBookExtendedSyncData2        = (ViewInstanceUtimeBookExtended|DataTypeString) + 21,
+            InstanceUtimeBookExtendedSyncData3        = (ViewInstanceUtimeBookExtended|DataTypeString) + 22,
+            InstanceUtimeBookExtendedSyncData4        = (ViewInstanceUtimeBookExtended|DataTypeString) + 23,
+
+            InstanceLocaltimeBookExtendedEventId          = (ViewInstanceLocaltimeBookExtended|DataTypeInteger),
+            InstanceLocaltimeBookExtendedStart            = (ViewInstanceLocaltimeBookExtended|DataTypeCaltime) + 1,
+            InstanceLocaltimeBookExtendedEnd              = (ViewInstanceLocaltimeBookExtended|DataTypeCaltime) + 2,
+            InstanceLocaltimeBookExtendedSummary          = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 3,
+            InstanceLocaltimeBookExtendedLocation         = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 4,
+            InstanceLocaltimeBookExtendedBookId           = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 5,
+            InstanceLocaltimeBookExtendedDescription      = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 6,
+            InstanceLocaltimeBookExtendedBusyStatus       = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 7,
+            InstanceLocaltimeBookExtendedEventStatus      = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 8,
+            InstanceLocaltimeBookExtendedPriority         = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 9,
+            InstanceLocaltimeBookExtendedSensitivity      = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 10,
+            InstanceLocaltimeBookExtendedHasRrule         = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 11,
+            InstanceLocaltimeBookExtendedLatitude         = (ViewInstanceLocaltimeBookExtended|DataTypeDouble) + 12,
+            InstanceLocaltimeBookExtendedLongitude        = (ViewInstanceLocaltimeBookExtended|DataTypeDouble) + 13,
+            InstanceLocaltimeBookExtendedHasAlarm         = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 14,
+            InstanceLocaltimeBookExtendedOriginalEventId  = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 15,
+            InstanceLocaltimeBookExtendedLastModifiedTime = (ViewInstanceLocaltimeBookExtended|DataTypeLong) + 16,
+            InstanceLocaltimeBookExtendedSyncData1        = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 17,
+            InstanceLocaltimeBookExtendedOrganizerName    = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 18,
+            InstanceLocaltimeBookExtendedCategories       = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 19,
+            InstanceLocaltimeBookExtendedHasAttendee      = (ViewInstanceLocaltimeBookExtended|DataTypeInteger) + 20,
+            InstanceLocaltimeBookExtendedSyncData2        = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 21,
+            InstanceLocaltimeBookExtendedSyncData3        = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 22,
+            InstanceLocaltimeBookExtendedSyncData4        = (ViewInstanceLocaltimeBookExtended|DataTypeString) + 23,
+            InstanceLocaltimeBookExtendedIsAllday         = (ViewInstanceLocaltimeBookExtended|DataTypeInteger|PropertyReadOnly) + 24,
+
+            UpdateInfoId         = (ViewUpdateInfo|DataTypeInteger),
+            UpdateInfoCalendarId = (ViewUpdateInfo|DataTypeInteger) + 1,
+            UpdateInfoType       = (ViewUpdateInfo|DataTypeInteger) + 2,
+            UpdateInfoVersion    = (ViewUpdateInfo|DataTypeInteger) + 3,
+
+            ExtendedId           = (ViewExtended|DataTypeInteger|PropertyReadOnly),
+            ExtendedRecordId     = (ViewExtended|DataTypeInteger) + 1,
+            ExtendedRecordType   = (ViewExtended|DataTypeInteger) + 2,
+            ExtendedKey          = (ViewExtended|DataTypeString) + 3,
+            ExtendedValue        = (ViewExtended|DataTypeString) + 4,
+        }
+
+        ///average size
+        internal const uint AverageSizeOfRecord = 56;
+
+        public static class Book
+        {
+            /// <summary>
+            /// Identifier of this calendar book view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.book";
+            /// <summary>
+            /// DB record ID of the calendar book
+            /// </summary>
+            public const uint Id          = (uint)PropertyIds.BookId;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid         = (uint)PropertyIds.BookUid;
+            /// <summary>
+            /// Calendar book name
+            /// </summary>
+            public const uint Name        = (uint)PropertyIds.BookName;
+            /// <summary>
+            /// Calendar book description
+            /// </summary>
+            public const uint Description = (uint)PropertyIds.BookDescription;
+            /// <summary>
+            /// Calendar book color for UX
+            /// </summary>
+            public const uint Color       = (uint)PropertyIds.BookColor;
+            /// <summary>
+            /// Location of the event
+            /// </summary>
+            public const uint Location    = (uint)PropertyIds.BookLocation;
+            /// <summary>
+            /// Visibility of the calendar book for UX
+            /// </summary>
+            public const uint Visibility  = (uint)PropertyIds.BookVisibility;
+            /// <summary>
+            /// Currently NOT Used
+            /// </summary>
+            public const uint SyncEvent   = (uint)PropertyIds.BookSyncEvent;
+            /// <summary>
+            /// Account for this calendar
+            /// </summary>
+            public const uint AccountId   = (uint)PropertyIds.BookAccountId;
+            /// <summary>
+            /// Type of calendar contents(refer to the CalendarTypes.StoreType)
+            /// </summary>
+            public const uint StoreType   = (uint)PropertyIds.BookStoreType;
+            /// <summary>
+            /// Generic data for use by syncing
+            /// </summary>
+            public const uint SyncData1   = (uint)PropertyIds.BookSyncData1;
+            /// <summary>
+            /// Generic data for use by syncing
+            /// </summary>
+            public const uint SyncData2   = (uint)PropertyIds.BookSyncData2;
+            /// <summary>
+            /// Generic data for use by syncing
+            /// </summary>
+            public const uint SyncData3   = (uint)PropertyIds.BookSyncData3;
+            /// <summary>
+            /// Generic data for use by syncing
+            /// </summary>
+            public const uint SyncData4   = (uint)PropertyIds.BookSyncData4;
+            /// <summary>
+            /// Calendar book mode(refer to the CalendarTypes.BookMode)
+            /// </summary>
+            public const uint Mode        = (uint)PropertyIds.BookMode;
+        }
+
+        public static class Event
+        {
+            /// <summary>
+            /// Identifier of this event view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.event";
+            /// <summary>
+            /// DB record ID of the event
+            /// </summary>
+            public const uint Id                 = (uint)PropertyIds.EventId;
+            /// <summary>
+            /// ID of the calendar book to which the event belongs
+            /// </summary>
+            public const uint BookId             = (uint)PropertyIds.EventBookId;
+            /// <summary>
+            /// The short description of the event
+            /// </summary>
+            public const uint Summary            = (uint)PropertyIds.EventSummary;
+            /// <summary>
+            /// The description of the event
+            /// </summary>
+            public const uint Description        = (uint)PropertyIds.EventDescription;
+            /// <summary>
+            /// The location of the event
+            /// </summary>
+            public const uint Location           = (uint)PropertyIds.EventLocation;
+            /// <summary>
+            /// The category of the event. For example APPOINTMENT, BIRTHDAY
+            /// </summary>
+            public const uint Categories         = (uint)PropertyIds.EventCategories;
+            /// <summary>
+            /// The exception list of the event. If this event has a recurrence rule, the instance of the exdate is removed. Format is "YYYYMMDD"(allday event) or "YYYYMMDDTHHMMSS". Multiple exceptions can be included with a comma
+            /// </summary>
+            public const uint Exdate             = (uint)PropertyIds.EventExdate;
+            /// <summary>
+            /// The status of event(refer to the CalendarTypes.EventStatus).
+            /// </summary>
+            public const uint EventStatus        = (uint)PropertyIds.EventEventStatus;
+            /// <summary>
+            /// The priority of event(refer to the CalendarTypes.Priority).
+            /// </summary>
+            public const uint Priority           = (uint)PropertyIds.EventPriority;
+            /// <summary>
+            /// The timezone_id of the event if it exists.
+            /// </summary>
+            public const uint Timezone           = (uint)PropertyIds.EventTimezone;
+            /// <summary>
+            /// The person_id of the event if the event is a birthday. Refer to the contacts-service
+            /// </summary>
+            public const uint ContactId          = (uint)PropertyIds.EventContactId;
+            /// <summary>
+            /// The busy status of event(refer to the CalendarTypes.BusyStatus).
+            /// </summary>
+            public const uint BusyStatus         = (uint)PropertyIds.EventBusyStatus;
+            /// <summary>
+            /// The Sensitivity of event(refer to the CalendarTypes.Sensitivity).
+            /// </summary>
+            public const uint Sensitivity        = (uint)PropertyIds.EventSensitivity;
+            /// <summary>
+            /// The unique ID of the event
+            /// </summary>
+            public const uint Uid                = (uint)PropertyIds.EventUid;
+            /// <summary>
+            /// The name of organizer of the event
+            /// </summary>
+            public const uint OrganizerName      = (uint)PropertyIds.EventOrganizerName;
+            /// <summary>
+            /// The email address of the organizer of the event
+            /// </summary>
+            public const uint OrganizerEmail     = (uint)PropertyIds.EventOrganizerEmail;
+            /// <summary>
+            /// The meeting status of event(refer to the CalendarTypes.MeetingStatus).
+            /// </summary>
+            public const uint MeetingStatus      = (uint)PropertyIds.EventMeetingStatus;
+            /// <summary>
+            /// The ID of the original event if the event is an exception.
+            /// </summary>
+            public const uint OriginalEventId    = (uint)PropertyIds.EventOriginalEventId;
+            /// <summary>
+            /// The latitude of the location of the event
+            /// </summary>
+            public const uint Latitude           = (uint)PropertyIds.EventLatitude;
+            /// <summary>
+            /// The longitude of the location of the event
+            /// </summary>
+            public const uint Longitude          = (uint)PropertyIds.EventLongitude;
+            /// <summary>
+            /// ID of the email_id. Refer to the email-service.
+            /// </summary>
+            public const uint EmailId            = (uint)PropertyIds.EventEmailId;
+            /// <summary>
+            /// The time when the event is created
+            /// </summary>
+            public const uint CreatedTime        = (uint)PropertyIds.EventCreatedTime;
+            /// <summary>
+            /// The time when the event is updated
+            /// </summary>
+            public const uint LastModifiedTime   = (uint)PropertyIds.EventLastModifiedTime;
+            /// <summary>
+            ///  Whether or not the event is deleted
+            /// </summary>
+            public const uint IsDeleted          = (uint)PropertyIds.EventIsDeleted;
+            /// <summary>
+            /// The frequent type of event recurrence(refer to the CalendarTypes.Recurrence).
+            /// </summary>
+            public const uint Freq               = (uint)PropertyIds.EventFreq;
+            /// <summary>
+            /// The range type of event recurrence(refer to the CalendarTypes.RangeType).
+            /// </summary>
+            public const uint RangeType          = (uint)PropertyIds.EventRangeType;
+            /// <summary>
+            /// The end time of the event recurrence. Only if this is used with RangeType.Until.
+            /// </summary>
+            public const uint Until              = (uint)PropertyIds.EventUntil;
+            /// <summary>
+            /// The count of the event recurrence. Only if this is used with RangeType.Count.
+            /// </summary>
+            public const uint Count              = (uint)PropertyIds.EventCount;
+            /// <summary>
+            /// The interval of the event recurrence
+            /// </summary>
+            public const uint Interval           = (uint)PropertyIds.EventInterval;
+            /// <summary>
+            /// The second list of the event recurrence. The value can be from 0 to 59. The list is separated by comma
+            /// </summary>
+            public const uint Bysecond           = (uint)PropertyIds.EventBysecond;
+            /// <summary>
+            /// The minute list of the event recurrence. The value can be from 0 to 59. The list is separated by commas
+            /// </summary>
+            public const uint Byminute           = (uint)PropertyIds.EventByminute;
+            /// <summary>
+            /// The hour list of the event recurrence. The value can be from 0 to 23. The list is separated by commas
+            /// </summary>
+            public const uint Byhour             = (uint)PropertyIds.EventByhour;
+            /// <summary>
+            /// The day list of the event recurrence. The value can be SU, MO, TU, WE, TH, FR, SA. The list is separated by commas.
+            /// </summary>
+            public const uint Byday              = (uint)PropertyIds.EventByday;
+            /// <summary>
+            /// The month day list of the event recurrence. The value can be from 1 to 31 and from -31 to -1. The list is separated by commas.
+            /// </summary>
+            public const uint Bymonthday         = (uint)PropertyIds.EventBymonthday;
+            /// <summary>
+            /// The year day list of the event recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Byyearday          = (uint)PropertyIds.EventByyearday;
+            /// <summary>
+            /// The week number list of the event recurrence. The value can be from 1 to 53 and from -53 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Byweekno           = (uint)PropertyIds.EventByweekno;
+            /// <summary>
+            /// The month list of the event recurrence. The value can be from 1 to 12. The list is separated by commas
+            /// </summary>
+            public const uint Bymonth            = (uint)PropertyIds.EventBymonth;
+            /// <summary>
+            /// The position list of the event recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Bysetpos           = (uint)PropertyIds.EventBysetpos;
+            /// <summary>
+            /// The start day of the week(refer to the CalendarTypes.WeekDay).
+            /// </summary>
+            public const uint Wkst               = (uint)PropertyIds.EventWkst;
+            /// <summary>
+            /// RECURRENCE-ID of RFC #2445
+            /// </summary>
+            public const uint RecurrenceId       = (uint)PropertyIds.EventRecurrenceId;
+            /// <summary>
+            /// RDATE of RFC #2445
+            /// </summary>
+            public const uint Rdate              = (uint)PropertyIds.EventRdate;
+            /// <summary>
+            /// Whether or not the event has an attendee list
+            /// </summary>
+            public const uint HasAttendee        = (uint)PropertyIds.EventHasAttendee;
+            /// <summary>
+            /// Whether or not the event has an alarm list
+            /// </summary>
+            public const uint HasAlarm           = (uint)PropertyIds.EventHasAlarm;
+            /// <summary>
+            /// The sync data of the event. If developer need to save some information related to the event, they can use this property
+            /// </summary>
+            public const uint SyncData1          = (uint)PropertyIds.EventSyncData1;
+            /// <summary>
+            /// The sync data of the event. If developer need to save some information related to the event, they can use this property
+            /// </summary>
+            public const uint SyncData2          = (uint)PropertyIds.EventSyncData2;
+            /// <summary>
+            /// The sync data of the event. If developer need to save some information related to the event, they can use this property
+            /// </summary>
+            public const uint SyncData3          = (uint)PropertyIds.EventSyncData3;
+            /// <summary>
+            /// The sync data of the event. If developer need to save some information related to the event, they can use this property
+            /// </summary>
+            public const uint SyncData4          = (uint)PropertyIds.EventSyncData4;
+            /// <summary>
+            /// The start time of the event
+            /// </summary>
+            public const uint Start              = (uint)PropertyIds.EventStart;
+            /// <summary>
+            /// The end time of the event
+            /// </summary>
+            public const uint End                = (uint)PropertyIds.EventEnd;
+            /// <summary>
+            /// The alarm list of the event.
+            /// </summary>
+            public const uint Alarm              = (uint)PropertyIds.EventAlarm;
+            /// <summary>
+            /// The attendee list of the event.
+            /// </summary>
+            public const uint Attendee           = (uint)PropertyIds.EventAttendee;
+            /// <summary>
+            /// The Calendar system type(refer to the CalendarTypes.SystemType).
+            /// </summary>
+            public const uint CalendarSystemType = (uint)PropertyIds.EventCalendarSystemType;
+            /// <summary>
+            /// The timezone of the start_time
+            /// </summary>
+            public const uint StartTzid          = (uint)PropertyIds.EventStartTzid;
+            /// <summary>
+            /// The timezone of the end_time
+            /// </summary>
+            public const uint EndTzid            = (uint)PropertyIds.EventEndTzid;
+            /// <summary>
+            /// The exception mod event list of the event
+            /// </summary>
+            public const uint Exception          = (uint)PropertyIds.EventException;
+            /// <summary>
+            /// The extended property list of the event.
+            /// </summary>
+            public const uint Extended           = (uint)PropertyIds.EventExtended;
+            /// <summary>
+            /// The event is an allday event or not
+            /// </summary>
+            public const uint IsAllday           = (uint)PropertyIds.EventIsAllday;
+            /// <summary>
+            /// The linked event count
+            /// </summary>
+            public const uint LinkCount          = (uint)PropertyIds.EventLinkCount;
+            /// <summary>
+            /// The event is an base linked event
+            /// </summary>
+            public const uint LinkBaseId         = (uint)PropertyIds.EventLinkBaseId;
+        }
+
+        public static class Todo
+        {
+            /// <summary>
+            /// Identifier of this todo view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.todo";
+            /// <summary>
+            /// DB record ID of the todo
+            /// </summary>
+            public const uint Id                = (uint)PropertyIds.TodoId;
+            /// <summary>
+            /// ID of the calendar book to which the todo belongs
+            /// </summary>
+            public const uint BookId            = (uint)PropertyIds.TodoBookId;
+            /// <summary>
+            /// The short description of the todo
+            /// </summary>
+            public const uint Summary           = (uint)PropertyIds.TodoSummary;
+            /// <summary>
+            /// The description of the todo
+            /// </summary>
+            public const uint Description       = (uint)PropertyIds.TodoDescription;
+            /// <summary>
+            /// The location of the todo
+            /// </summary>
+            public const uint Location          = (uint)PropertyIds.TodoLocation;
+            /// <summary>
+            /// The category of the todo. i.g. APPOINTMENT, BIRTHDAY
+            /// </summary>
+            public const uint Categories        = (uint)PropertyIds.TodoCategories;
+            /// <summary>
+            /// The status of todo(refer to the CalendarTypes.TodoStatus).
+            /// </summary>
+            public const uint TodoStatus        = (uint)PropertyIds.TodoStatus;
+            /// <summary>
+            /// The Priority of todo(refer to the CalendarTypes.Priority).
+            /// </summary>
+            public const uint Priority          = (uint)PropertyIds.TodoPriority;
+            /// <summary>
+            /// The Sensitivity of todo(refer to the CalendarTypes.Sensitivity).
+            /// </summary>
+            public const uint Sensitivity       = (uint)PropertyIds.TodoSensitivity;
+            /// <summary>
+            /// The unique ID of the todo
+            /// </summary>
+            public const uint Uid               = (uint)PropertyIds.TodoUid;
+            /// <summary>
+            /// The latitude of the location of the todo
+            /// </summary>
+            public const uint Latitude          = (uint)PropertyIds.TodoLatitude;
+            /// <summary>
+            /// The longitude of the location of the todo
+            /// </summary>
+            public const uint Longitude         = (uint)PropertyIds.TodoLongitude;
+            /// <summary>
+            /// The progression of the todo. The value can be from 0 to 100
+            /// </summary>
+            public const uint Progress          = (uint)PropertyIds.TodoProgress;
+            /// <summary>
+            /// The time when the todo is create
+            /// </summary>
+            public const uint CreatedTime       = (uint)PropertyIds.TodoCreatedTime;
+            /// <summary>
+            /// The time when the todo is updated
+            /// </summary>
+            public const uint LastModifiedTime  = (uint)PropertyIds.TodoLastModifiedTime;
+            /// <summary>
+            /// The time when the todo is completed
+            /// </summary>
+            public const uint CompletedTime     = (uint)PropertyIds.TodoCompletedTime;
+            /// <summary>
+            ///  Whether or not the todo is deleted
+            /// </summary>
+            public const uint IsDeleted         = (uint)PropertyIds.TodoIsDeleted;
+            /// <summary>
+            /// The frequent type of todo recurrence(refer to the CalendarTypes.Recurrence).
+            /// </summary>
+            public const uint Freq              = (uint)PropertyIds.TodoFreq;
+            /// <summary>
+            /// The range type of todo recurrence(refer to the CalendarTypes.RangeType).
+            /// </summary>
+            public const uint RangeType         = (uint)PropertyIds.TodoRangeType;
+            /// <summary>
+            /// The end time of the todo recurrence. Only if this is used with RangeType.Until.
+            /// </summary>
+            public const uint Until             = (uint)PropertyIds.TodoUntil;
+            /// <summary>
+            /// The count of the todo recurrence. Only if this is used with RangeType.Count.
+            /// </summary>
+            public const uint Count             = (uint)PropertyIds.TodoCount;
+            /// <summary>
+            /// The interval of the todo recurrence
+            /// </summary>
+            public const uint Integererval      = (uint)PropertyIds.TodoIntegererval;
+            /// <summary>
+            /// The second list of the todo recurrence. The value can be from 0 to 59. The list is separated by commas
+            /// </summary>
+            public const uint Bysecond          = (uint)PropertyIds.TodoBysecond;
+            /// <summary>
+            /// The minute list of the todo recurrence. The value can be from 0 to 59. The list is separated by commas
+            /// </summary>
+            public const uint Byminute          = (uint)PropertyIds.TodoByminute;
+            /// <summary>
+            /// The hour list of the todo recurrence. The value can be from 0 to 23. The list is separated by commas
+            /// </summary>
+            public const uint Byhour            = (uint)PropertyIds.TodoByhour;
+            /// <summary>
+            /// The day list of the todo recurrence. The value can be SU, MO, TU, WE, TH, FR, SA. The list is separated by commas
+            /// </summary>
+            public const uint Byday             = (uint)PropertyIds.TodoByday;
+            /// <summary>
+            /// The month day list of the todo recurrence. The value can be from 1 to 31 and from -31 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Bymonthday        = (uint)PropertyIds.TodoBymonthday;
+            /// <summary>
+            /// The year day list of the todo recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Byyearday         = (uint)PropertyIds.TodoByyearday;
+            /// <summary>
+            /// The week number list of the todo recurrence. The value can be from 1 to 53 and from -53 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Byweekno          = (uint)PropertyIds.TodoByweekno;
+            /// <summary>
+            /// The month list of the todo recurrence. The value can be from 1 to 12. The list is separated by commas
+            /// </summary>
+            public const uint Bymonth           = (uint)PropertyIds.TodoBymonth;
+            /// <summary>
+            /// The position list of the todo recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas
+            /// </summary>
+            public const uint Bysetpos          = (uint)PropertyIds.TodoBysetpos;
+            /// <summary>
+            /// The start day of the week(refer to the CalendarTypes.WeekDay).
+            /// </summary>
+            public const uint Wkst              = (uint)PropertyIds.TodoWkst;
+            /// <summary>
+            /// Whether or not the todo has an alarm list
+            /// </summary>
+            public const uint HasAlarm          = (uint)PropertyIds.TodoHasAlarm;
+            /// <summary>
+            /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property
+            /// </summary>
+            public const uint SyncData1         = (uint)PropertyIds.TodoSyncData1;
+            /// <summary>
+            /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property
+            /// </summary>
+            public const uint SyncData2         = (uint)PropertyIds.TodoSyncData2;
+            /// <summary>
+            /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property
+            /// </summary>
+            public const uint SyncData3         = (uint)PropertyIds.TodoSyncData3;
+            /// <summary>
+            /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property
+            /// </summary>
+            public const uint SyncData4         = (uint)PropertyIds.TodoSyncData4;
+            /// <summary>
+            /// The start time of the todo
+            /// </summary>
+            public const uint Start             = (uint)PropertyIds.TodoStart;
+            /// <summary>
+            /// The due time of the todo
+            /// </summary>
+            public const uint Due               = (uint)PropertyIds.TodoDue;
+            /// <summary>
+            /// The alarm list of the todo.
+            /// </summary>
+            public const uint Alarm             = (uint)PropertyIds.TodoAlarm;
+            /// <summary>
+            /// The timezone of the start_time
+            /// </summary>
+            public const uint StartTzid         = (uint)PropertyIds.TodoStartTzid;
+            /// <summary>
+            /// The timezone of the due_time
+            /// </summary>
+            public const uint DueTzid           = (uint)PropertyIds.TodoDueTzid;
+            /// <summary>
+            /// The name of the organizer of the event
+            /// </summary>
+            public const uint OrganizerName     = (uint)PropertyIds.TodoOrganizerName;
+            /// <summary>
+            /// The email address of the organizer of the todo
+            /// </summary>
+            public const uint OrganizerEmail    = (uint)PropertyIds.TodoOrganizerEmail;
+            /// <summary>
+            /// Whether or not the todo has an attendee list
+            /// </summary>
+            public const uint HasAttendee       = (uint)PropertyIds.TodoHasAttendee;
+            /// <summary>
+            /// The attendee list of the todo.
+            /// </summary>
+            public const uint Attendee          = (uint)PropertyIds.TodoAttendee;
+            /// <summary>
+            /// The extended property list of the todo.
+            /// </summary>
+            public const uint Extended          = (uint)PropertyIds.TodoExtended;
+            /// <summary>
+            /// The todo is an allday event or not
+            /// </summary>
+            public const uint IsAllday          = (uint)PropertyIds.TodoIsAllday;
+        }
+
+        public static class Timezone
+        {
+            /// <summary>
+            /// Identifier of this timezone view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.timezone";
+            /// <summary>
+            /// DB record ID of the timezone
+            /// </summary>
+            public const uint Id                          = (uint)PropertyIds.TimezoneId;
+            /// <summary>
+            /// UTC offset which is in use when the onset of this time zone observance begins. Valid values are -720(-12:00) to 840(+14:00)
+            /// </summary>
+            public const uint TzOffsetFromGmt             = (uint)PropertyIds.TimezoneTzOffsetFromGmt;
+            /// <summary>
+            /// Name of the Standard Time
+            /// </summary>
+            public const uint StandardName                = (uint)PropertyIds.TimezoneStandardName;
+            /// <summary>
+            /// Starting month of the Standard Time. Month is 0-based. eg, 0 for January
+            /// </summary>
+            public const uint StdStartMonth               = (uint)PropertyIds.TimezoneStdStartMonth;
+            /// <summary>
+            /// Starting day-of-week-in-month of the Standard Time. Day is 1-based
+            /// </summary>
+            public const uint StdStartPositionOfWeek      = (uint)PropertyIds.TimezoneStdStartPositionOfWeek;
+            /// <summary>
+            /// Starting day-of-week of the Standard Time. Valid values are 1(SUNDAY) to 7(SATURDAY)
+            /// </summary>
+            public const uint StdStartDay                 = (uint)PropertyIds.TimezoneStdStartDay;
+            /// <summary>
+            /// Starting hour of the Standard Time. Valid values are 0 to 23
+            /// </summary>
+            public const uint StdStartHour                = (uint)PropertyIds.TimezoneStdStartHour;
+            /// <summary>
+            /// The number of minutes added during the Standard Time
+            /// </summary>
+            public const uint StandardBias                = (uint)PropertyIds.TimezoneStandardBias;
+            /// <summary>
+            /// Name of Daylight
+            /// </summary>
+            public const uint DayLightName                = (uint)PropertyIds.TimezoneDayLightName;
+            /// <summary>
+            /// Starting month of Daylight. Month is 0-based. eg, 0 for January
+            /// </summary>
+            public const uint DayLightStartMonth          = (uint)PropertyIds.TimezoneDayLightStartMonth;
+            /// <summary>
+            /// Starting day-of-week-in-month of Daylight. Day is 1-based
+            /// </summary>
+            public const uint DayLightStartPositionOfWeek = (uint)PropertyIds.TimezoneDayLightStartPositionOfWeek;
+            /// <summary>
+            /// Starting day-of-week of Daylight. Valid values are 1(SUNDAY) to 7(SATURDAY)
+            /// </summary>
+            public const uint DayLightStartDay            = (uint)PropertyIds.TimezoneDayLightStartDay;
+            /// <summary>
+            /// Starting hour of Daylight. Valid values are 0 to 23
+            /// </summary>
+            public const uint DayLightStartHour           = (uint)PropertyIds.TimezoneDayLightStartHour;
+            /// <summary>
+            /// The number of minutes added during Daylight Time
+            /// </summary>
+            public const uint DayLightBias                = (uint)PropertyIds.TimezoneDayLightBias;
+            /// <summary>
+            /// DB record ID of a related calendar book
+            /// </summary>
+            public const uint CalendarId                  = (uint)PropertyIds.TimezoneCalendarId;
+        }
+
+        public static class Attendee
+        {
+            /// <summary>
+            /// Identifier of this calendar attendee view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.attendee";
+            /// <summary>
+            /// The number of the attendee
+            /// </summary>
+            public const uint Number       = (uint)PropertyIds.AttendeeNumber;
+            /// <summary>
+            /// The type of attendee(refer to the CalendarTypes.Cutype).
+            /// </summary>
+            public const uint Cutype       = (uint)PropertyIds.AttendeeCutype;
+            /// <summary>
+            ///
+            /// </summary>
+            public const uint CtIndex      = (uint)PropertyIds.AttendeeCtIndex;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid          = (uint)PropertyIds.AttendeeUid;
+            /// <summary>
+            ///
+            /// </summary>
+            public const uint Group        = (uint)PropertyIds.AttendeeGroup;
+            /// <summary>
+            /// The email address of the attendee
+            /// </summary>
+            public const uint Email        = (uint)PropertyIds.AttendeeEmail;
+            /// <summary>
+            /// Attendee role(refer to the CalendarTypes.AttendeeRole).
+            /// </summary>
+            public const uint Role         = (uint)PropertyIds.AttendeeRole;
+            /// <summary>
+            /// Attendee status(refer to the CalendarTypes.AttendeeStatus).
+            /// </summary>
+            public const uint Status       = (uint)PropertyIds.AttendeeStatus;
+            /// <summary>
+            /// RSVP invitation reply (one of true, false)
+            /// </summary>
+            public const uint Rsvp         = (uint)PropertyIds.AttendeeRsvp;
+            /// <summary>
+            /// Delegatee (DELEGATED-TO)
+            /// </summary>
+            public const uint DelegateeUri = (uint)PropertyIds.AttendeeDelegateeUri;
+            /// <summary>
+            /// Delegator (DELEGATED-FROM)
+            /// </summary>
+            public const uint DelegatorUri = (uint)PropertyIds.AttendeeDelegatorUri;
+            /// <summary>
+            /// Attendee name
+            /// </summary>
+            public const uint Name         = (uint)PropertyIds.AttendeeName;
+            /// <summary>
+            /// Group that the attendee belongs to
+            /// </summary>
+            public const uint Member       = (uint)PropertyIds.AttendeeMember;
+            /// <summary>
+            /// Event/TODO that the attendee belongs to
+            /// </summary>
+            public const uint ParentId     = (uint)PropertyIds.AttendeeParentId;
+        }
+
+        public static class Alarm
+        {
+            /// <summary>
+            /// Identifier of this calendar alarm view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.alarm";
+            /// <summary>
+            /// The number of unit before start time. This MUST be used with one of TickUnit.
+            /// </summary>
+            public const uint Tick        = (uint)PropertyIds.AlarmTick;
+            /// <summary>
+            /// Reminder tick time unit(refer to the CalendarTypes.TickUnit).
+            /// </summary>
+            public const uint TickUnit    = (uint)PropertyIds.AlarmTickUnit;
+            /// <summary>
+            /// Alarm description
+            /// </summary>
+            public const uint Description = (uint)PropertyIds.AlarmDescription;
+            /// <summary>
+            /// Event that the alarm belongs to
+            /// </summary>
+            public const uint ParentId    = (uint)PropertyIds.AlarmParentId;
+            /// <summary>
+            /// Alarm summary
+            /// </summary>
+            public const uint Summary     = (uint)PropertyIds.AlarmSummary;
+            /// <summary>
+            /// Action of alarm(refer to the CalendarTypes.Action).
+            /// </summary>
+            public const uint Action      = (uint)PropertyIds.AlarmAction;
+            /// <summary>
+            /// Alarm tone path
+            /// </summary>
+            public const uint Attach      = (uint)PropertyIds.AlarmAttach;
+            /// <summary>
+            /// The alarm time
+            /// </summary>
+            public const uint AlarmTime   = (uint)PropertyIds.AlarmAlarm;
+        }
+
+        public static class InstanceUtimeBook
+        {
+            /// <summary>
+            /// Identifier of this instance utime book
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.instance_utime/book";
+            /// <summary>
+            /// Event id
+            /// </summary>
+            public const uint EventId          = (uint)PropertyIds.InstanceUtimeBookEventId;
+            /// <summary>
+            /// Start time
+            /// </summary>
+            public const uint Start            = (uint)PropertyIds.InstanceUtimeBookStart;
+            /// <summary>
+            /// End time
+            /// </summary>
+            public const uint End              = (uint)PropertyIds.InstanceUtimeBookEnd;
+            /// <summary>
+            /// Summary
+            /// </summary>
+            public const uint Summary          = (uint)PropertyIds.InstanceUtimeBookSummary;
+            /// <summary>
+            /// Location
+            /// </summary>
+            public const uint Location         = (uint)PropertyIds.InstanceUtimeBookLocation;
+            /// <summary>
+            /// Book id
+            /// </summary>
+            public const uint BookId           = (uint)PropertyIds.InstanceUtimeBookBookId;
+            /// <summary>
+            /// Description
+            /// </summary>
+            public const uint Description      = (uint)PropertyIds.InstanceUtimeBookDescription;
+            /// <summary>
+            /// BusyStatus
+            /// </summary>
+            public const uint BusyStatus       = (uint)PropertyIds.InstanceUtimeBookBusyStatus;
+            /// <summary>
+            /// EventStatus
+            /// </summary>
+            public const uint EventStatus      = (uint)PropertyIds.InstanceUtimeBookEventStatus;
+            /// <summary>
+            /// Priority
+            /// </summary>
+            public const uint Priority         = (uint)PropertyIds.InstanceUtimeBookPriority;
+            /// <summary>
+            /// Sensitivity
+            /// </summary>
+            public const uint Sensitivity      = (uint)PropertyIds.InstanceUtimeBookSensitivity;
+            /// <summary>
+            /// HasRrule
+            /// </summary>
+            public const uint HasRrule         = (uint)PropertyIds.InstanceUtimeBookHasRrule;
+            /// <summary>
+            /// Latitude
+            /// </summary>
+            public const uint Latitude         = (uint)PropertyIds.InstanceUtimeBookLatitude;
+            /// <summary>
+            /// Longitude
+            /// </summary>
+            public const uint Longitude        = (uint)PropertyIds.InstanceUtimeBookLongitude;
+            /// <summary>
+            /// HasAlarm
+            /// </summary>
+            public const uint HasAlarm         = (uint)PropertyIds.InstanceUtimeBookHasAlarm;
+            /// <summary>
+            /// OriginalEventId
+            /// </summary>
+            public const uint OriginalEventId  = (uint)PropertyIds.InstanceUtimeBookOriginalEventId;
+            /// <summary>
+            /// LastModifiedtime
+            /// </summary>
+            public const uint LastModifiedtime = (uint)PropertyIds.InstanceUtimeBookLastModifiedtime;
+            /// <summary>
+            /// SyncData1
+            /// </summary>
+            public const uint SyncData1        = (uint)PropertyIds.InstanceUtimeBookSyncData1;
+        }
+
+        public static class InstanceLocaltimeBook
+        {
+            /// <summary>
+            /// Uri
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.instance_localtime/book";
+            /// <summary>
+            /// EventId
+            /// </summary>
+            public const uint EventId          = (uint)PropertyIds.InstanceLocaltimeBookEventId;
+            /// <summary>
+            /// Start
+            /// </summary>
+            public const uint Start            = (uint)PropertyIds.InstanceLocaltimeBookStart;
+            /// <summary>
+            /// End
+            /// </summary>
+            public const uint End              = (uint)PropertyIds.InstanceLocaltimeBookEnd;
+            /// <summary>
+            /// Summary
+            /// </summary>
+            public const uint Summary          = (uint)PropertyIds.InstanceLocaltimeBookSummary;
+            /// <summary>
+            /// Location
+            /// </summary>
+            public const uint Location         = (uint)PropertyIds.InstanceLocaltimeBookLocation;
+            /// <summary>
+            /// BookId
+            /// </summary>
+            public const uint BookId           = (uint)PropertyIds.InstanceLocaltimeBookBookId;
+            /// <summary>
+            /// Description
+            /// </summary>
+            public const uint Description      = (uint)PropertyIds.InstanceLocaltimeBookDescription;
+            /// <summary>
+            /// BusyStatus
+            /// </summary>
+            public const uint BusyStatus       = (uint)PropertyIds.InstanceLocaltimeBookBusyStatus;
+            /// <summary>
+            /// EventStatus
+            /// </summary>
+            public const uint EventStatus      = (uint)PropertyIds.InstanceLocaltimeBookEventStatus;
+            /// <summary>
+            /// Priority
+            /// </summary>
+            public const uint Priority         = (uint)PropertyIds.InstanceLocaltimeBookPriority;
+            /// <summary>
+            /// Sensitivity
+            /// </summary>
+            public const uint Sensitivity      = (uint)PropertyIds.InstanceLocaltimeBookSensitivity;
+            /// <summary>
+            /// HasRrule
+            /// </summary>
+            public const uint HasRrule         = (uint)PropertyIds.InstanceLocaltimeBookHasRrule;
+            /// <summary>
+            /// Latitude
+            /// </summary>
+            public const uint Latitude         = (uint)PropertyIds.InstanceLocaltimeBookLatitude;
+            /// <summary>
+            /// Longitude
+            /// </summary>
+            public const uint Longitude        = (uint)PropertyIds.InstanceLocaltimeBookLongitude;
+            /// <summary>
+            /// HasAlarm
+            /// </summary>
+            public const uint HasAlarm         = (uint)PropertyIds.InstanceLocaltimeBookHasAlarm;
+            /// <summary>
+            /// OriginalEventId
+            /// </summary>
+            public const uint OriginalEventId  = (uint)PropertyIds.InstanceLocaltimeBookOriginalEventId;
+            /// <summary>
+            /// LastModifiedTime
+            /// </summary>
+            public const uint LastModifiedTime = (uint)PropertyIds.InstanceLocaltimeBookLastModifiedTime;
+            /// <summary>
+            /// SyncData1
+            /// </summary>
+            public const uint SyncData1        = (uint)PropertyIds.InstanceLocaltimeBookSyncData1;
+            /// <summary>
+            /// IsAllday
+            /// </summary>
+            public const uint IsAllday         = (uint)PropertyIds.InstanceLocaltimeBookIsAllday;
+        }
+
+        public static class InstanceUtimeBookExtended
+        {
+            /// <summary>
+            /// Uri
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.extended/instance_utime/book";
+            /// <summary>
+            /// EventId
+            /// </summary>
+            public const uint EventId           = (uint)PropertyIds.InstanceUtimeBookExtendedEventId;
+            /// <summary>
+            /// Start
+            /// </summary>
+            public const uint Start             = (uint)PropertyIds.InstanceUtimeBookExtendedStart;
+            /// <summary>
+            /// End
+            /// </summary>
+            public const uint End               = (uint)PropertyIds.InstanceUtimeBookExtendedEnd;
+            /// <summary>
+            /// Summary
+            /// </summary>
+            public const uint Summary           = (uint)PropertyIds.InstanceUtimeBookExtendedSummary;
+            /// <summary>
+            /// Location
+            /// </summary>
+            public const uint Location          = (uint)PropertyIds.InstanceUtimeBookExtendedLocation;
+            /// <summary>
+            /// BookId
+            /// </summary>
+            public const uint BookId            = (uint)PropertyIds.InstanceUtimeBookExtendedBookId;
+            /// <summary>
+            /// Description
+            /// </summary>
+            public const uint Description       = (uint)PropertyIds.InstanceUtimeBookExtendedDescription;
+            /// <summary>
+            /// BusyStatus
+            /// </summary>
+            public const uint BusyStatus        = (uint)PropertyIds.InstanceUtimeBookExtendedBusyStatus;
+            /// <summary>
+            /// EventStatus
+            /// </summary>
+            public const uint EventStatus       = (uint)PropertyIds.InstanceUtimeBookExtendedEventStatus;
+            /// <summary>
+            /// Priority
+            /// </summary>
+            public const uint Priority          = (uint)PropertyIds.InstanceUtimeBookExtendedPriority;
+            /// <summary>
+            /// Sensitivity
+            /// </summary>
+            public const uint Sensitivity       = (uint)PropertyIds.InstanceUtimeBookExtendedSensitivity;
+            /// <summary>
+            /// HasRrule
+            /// </summary>
+            public const uint HasRrule          = (uint)PropertyIds.InstanceUtimeBookExtendedHasRrule;
+            /// <summary>
+            /// Latitude
+            /// </summary>
+            public const uint Latitude          = (uint)PropertyIds.InstanceUtimeBookExtendedLatitude;
+            /// <summary>
+            /// Longitude
+            /// </summary>
+            public const uint Longitude         = (uint)PropertyIds.InstanceUtimeBookExtendedLongitude;
+            /// <summary>
+            /// HasAlarm
+            /// </summary>
+            public const uint HasAlarm          = (uint)PropertyIds.InstanceUtimeBookExtendedHasAlarm;
+            /// <summary>
+            /// OriginalEventId
+            /// </summary>
+            public const uint OriginalEventId   = (uint)PropertyIds.InstanceUtimeBookExtendedOriginalEventId;
+            /// <summary>
+            /// LastModifiedTime
+            /// </summary>
+            public const uint LastModifiedTime  = (uint)PropertyIds.InstanceUtimeBookExtendedLastModifiedTime;
+            /// <summary>
+            /// SyncData1
+            /// </summary>
+            public const uint SyncData1         = (uint)PropertyIds.InstanceUtimeBookExtendedSyncData1;
+            /// <summary>
+            /// OrganizerName
+            /// </summary>
+            public const uint OrganizerName     = (uint)PropertyIds.InstanceUtimeBookExtendedOrganizerName;
+            /// <summary>
+            /// Categories
+            /// </summary>
+            public const uint Categories        = (uint)PropertyIds.InstanceUtimeBookExtendedCategories;
+            /// <summary>
+            /// HasAttendee
+            /// </summary>
+            public const uint HasAttendee       = (uint)PropertyIds.InstanceUtimeBookExtendedHasAttendee;
+            /// <summary>
+            /// SyncData2
+            /// </summary>
+            public const uint SyncData2         = (uint)PropertyIds.InstanceUtimeBookExtendedSyncData2;
+            /// <summary>
+            /// SyncData3
+            /// </summary>
+            public const uint SyncData3         = (uint)PropertyIds.InstanceUtimeBookExtendedSyncData3;
+            /// <summary>
+            /// SyncData4
+            /// </summary>
+            public const uint SyncData4         = (uint)PropertyIds.InstanceUtimeBookExtendedSyncData4;
+        }
+
+        public static class InstanceLocaltimeBookExtended
+        {
+            /// <summary>
+            /// Uri
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.extended/instance_localtime/book";
+            /// <summary>
+            /// EventId
+            /// </summary>
+            public const uint EventId          = (uint)PropertyIds.InstanceLocaltimeBookExtendedEventId;
+            /// <summary>
+            /// Start
+            /// </summary>
+            public const uint Start            = (uint)PropertyIds.InstanceLocaltimeBookExtendedStart;
+            /// <summary>
+            /// End
+            /// </summary>
+            public const uint End              = (uint)PropertyIds.InstanceLocaltimeBookExtendedEnd;
+            /// <summary>
+            /// Summary
+            /// </summary>
+            public const uint Summary          = (uint)PropertyIds.InstanceLocaltimeBookExtendedSummary;
+            /// <summary>
+            /// Location
+            /// </summary>
+            public const uint Location         = (uint)PropertyIds.InstanceLocaltimeBookExtendedLocation;
+            /// <summary>
+            /// BookId
+            /// </summary>
+            public const uint BookId           = (uint)PropertyIds.InstanceLocaltimeBookExtendedBookId;
+            /// <summary>
+            /// </summary>
+            public const uint Description      = (uint)PropertyIds.InstanceLocaltimeBookExtendedDescription;
+            /// <summary>
+            /// </summary>
+            public const uint BusyStatus       = (uint)PropertyIds.InstanceLocaltimeBookExtendedBusyStatus;
+            /// <summary>
+            /// EventStatus
+            /// </summary>
+            public const uint EventStatus      = (uint)PropertyIds.InstanceLocaltimeBookExtendedEventStatus;
+            /// <summary>
+            /// Priority
+            /// </summary>
+            public const uint Priority         = (uint)PropertyIds.InstanceLocaltimeBookExtendedPriority;
+            /// <summary>
+            /// Sensitivity
+            /// </summary>
+            public const uint Sensitivity      = (uint)PropertyIds.InstanceLocaltimeBookExtendedSensitivity;
+            /// <summary>
+            /// HasRrule
+            /// </summary>
+            public const uint HasRrule         = (uint)PropertyIds.InstanceLocaltimeBookExtendedHasRrule;
+            /// <summary>
+            /// Latitude
+            /// </summary>
+            public const uint Latitude         = (uint)PropertyIds.InstanceLocaltimeBookExtendedLatitude;
+            /// <summary>
+            /// Longitude
+            /// </summary>
+            public const uint Longitude        = (uint)PropertyIds.InstanceLocaltimeBookExtendedLongitude;
+            /// <summary>
+            /// HasAlarm
+            /// </summary>
+            public const uint HasAlarm         = (uint)PropertyIds.InstanceLocaltimeBookExtendedHasAlarm;
+            /// <summary>
+            /// OriginalEventId
+            /// </summary>
+            public const uint OriginalEventId  = (uint)PropertyIds.InstanceLocaltimeBookExtendedOriginalEventId;
+            /// <summary>
+            /// LastModifiedTime
+            /// </summary>
+            public const uint LastModifiedTime = (uint)PropertyIds.InstanceLocaltimeBookExtendedLastModifiedTime;
+            /// <summary>
+            /// SyncData1
+            /// </summary>
+            public const uint SyncData1        = (uint)PropertyIds.InstanceLocaltimeBookExtendedSyncData1;
+            /// <summary>
+            /// OrganizerName
+            /// </summary>
+            public const uint OrganizerName    = (uint)PropertyIds.InstanceLocaltimeBookExtendedOrganizerName;
+            /// <summary>
+            /// Categories
+            /// </summary>
+            public const uint Categories       = (uint)PropertyIds.InstanceLocaltimeBookExtendedCategories;
+            /// <summary>
+            /// HasAttendee
+            /// </summary>
+            public const uint HasAttendee      = (uint)PropertyIds.InstanceLocaltimeBookExtendedHasAttendee;
+            /// <summary>
+            /// SyncData2
+            /// </summary>
+            public const uint SyncData2        = (uint)PropertyIds.InstanceLocaltimeBookExtendedSyncData2;
+            /// <summary>
+            /// SyncData3
+            /// </summary>
+            public const uint SyncData3        = (uint)PropertyIds.InstanceLocaltimeBookExtendedSyncData3;
+            /// <summary>
+            /// SyncData4
+            /// </summary>
+            public const uint SyncData4        = (uint)PropertyIds.InstanceLocaltimeBookExtendedSyncData4;
+            /// <summary>
+            /// IsAllday
+            /// </summary>
+            public const uint IsAllday         = (uint)PropertyIds.InstanceLocaltimeBookExtendedIsAllday;
+        }
+
+        public static class UpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this updatedInfo view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.updated_info";
+            /// <summary>
+            /// Modified event(or todo) record ID
+            /// </summary>
+            public const uint Id         = (uint)PropertyIds.UpdateInfoId;
+            /// <summary>
+            /// Calendar book ID of the modified event(or todo) record
+            /// </summary>
+            public const uint CalendarId = (uint)PropertyIds.UpdateInfoCalendarId;
+            /// <summary>
+            /// Enumeration value of the modified status.
+            /// </summary>
+            public const uint Type       = (uint)PropertyIds.UpdateInfoType;
+            /// <summary>
+            /// Version after change
+            /// </summary>
+            public const uint Version    = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        public static class Extended
+        {
+            /// <summary>
+            /// Identifier of this extended_property view
+            /// </summary>
+            public const string Uri = "tizen.calendar_view.extended_property";
+            /// <summary>
+            /// DB record ID of the extended_property
+            /// </summary>
+            public const uint Id         = (uint)PropertyIds.ExtendedId;
+            /// <summary>
+            /// Related record ID
+            /// </summary>
+            public const uint RecordId   = (uint)PropertyIds.ExtendedRecordId;
+            /// <summary>
+            /// Enumeration value of the record type.
+            /// </summary>
+            public const uint RecordType = (uint)PropertyIds.ExtendedRecordType;
+            /// <summary>
+            /// The key of the property
+            /// </summary>
+            public const uint Key        = (uint)PropertyIds.ExtendedKey;
+            /// <summary>
+            /// The value of the property
+            /// </summary>
+            public const uint Value      = (uint)PropertyIds.ExtendedValue;
+        }
+    }
+}
+
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs
new file mode 100644 (file)
index 0000000..2d090bd
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+/// <summary>
+/// The Tizen.Pims.Calendar namespace provides classes for managing calendar information for schedule.
+/// </summary>
+/// <remarks>
+/// The Tizen.Pims.Calendar namespace provides classes for managing calendar information for schedule.
+/// </remarks>
+namespace Tizen.Pims.Calendar {}
+
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs
new file mode 100644 (file)
index 0000000..678a093
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// Event arguments passed when alarm is alerted.
+    /// </summary>
+    public class ReminderAlertedEventArgs : EventArgs
+    {
+        internal ReminderAlertedEventArgs(string param)
+        {
+            Param = param;
+            Log.Debug(Globals.LogTag, "[TEST]" + param);
+        }
+
+        /// <summary>
+        /// The paramter which data is combinded(Value string like id=value&amp;time=value&amp;tick=value&amp;unit=value&amp;type=value)
+        /// </summary>
+        public string Param
+        {
+            get;
+            internal set;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs
new file mode 100755 (executable)
index 0000000..ccff505
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    internal static class Activity
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_activity_delete_by_contact_id")]
+        internal static extern int DeleteByContactId(int contactId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_activity_delete_by_account_id")]
+        internal static extern int DeleteByAccountId(int accountId);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Contacts.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Contacts.cs
new file mode 100755 (executable)
index 0000000..7efa40f
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Contacts Interop Class
+    /// </summary>
+    internal static class Contacts
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect")]
+        internal static extern int Connect();
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_disconnect")]
+        internal static extern int Disconnect();
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect_on_thread")]
+        internal static extern int OnThreadConnect();
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_disconnect_on_thread")]
+        internal static extern int OnThreadDisconnect();
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect_with_flags")]
+        internal static extern int DisconnectWithFlags(uint flags);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Database.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Database.cs
new file mode 100644 (file)
index 0000000..787baaa
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal enum ContactsChanged
+    {
+        Inserted,
+        Updated,
+        Deleted
+    }
+
+    internal static partial class Database
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_insert_record")]
+        internal static extern int Insert(IntPtr recordHandle, out int recordId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_record")]
+        internal static extern int Get(string uri, int recordId, out IntPtr recordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_update_record")]
+        internal static extern int Update(IntPtr recordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_delete_record")]
+        internal static extern int Delete(string uri, int recordId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_replace_record")]
+        internal static extern int Replace(IntPtr recordHandle, int recordId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_all_records")]
+        internal static extern int GetRecords(string uri, int offset, int limit, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_records_with_query")]
+        internal static extern int GetRecords(IntPtr queryHandle, int offset, int limit, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_insert_records")]
+        internal static extern int InsertRecords(IntPtr listHandle, out IntPtr ids, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_update_records")]
+        internal static extern int UpdateRecords(IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_delete_records")]
+        internal static extern int DeleteRecords(string uri, int[] recordIdArray, int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_replace_records")]
+        internal static extern int ReplaceRecords(IntPtr listHandle, int[] recordIdArray, int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_current_version")]
+        internal static extern int GetVersion(out int contactsDBVersion);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_add_changed_cb")]
+        internal static extern int AddChangedCb(string uri, ContactsDBChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_remove_changed_cb")]
+        internal static extern int RemoveChangedCb(string uri, ContactsDBChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_changes_by_version")]
+        internal static extern int GetChangesByVersion(string uri, int addressBookId, int contactsDBVersion, out IntPtr changeRecordList, out int currentContactsDBVersion);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records")]
+        internal static extern int Search(string uri, string keyword, int offset, int limit, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_query")]
+        internal static extern int Search(IntPtr queryHandle, string keyword, int offset, int limit, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_range")]
+        internal static extern int Search(string uri, string keyword, int offset, int limit, int range, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_for_snippet")]
+        internal static extern int Search(string uri, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_query_for_snippet")]
+        internal static extern int Search(IntPtr queryHandle, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_range_for_snippet")]
+        internal static extern int Search(string uri, string keyword, int offset, int limit, int range, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_count")]
+        internal static extern int GetCount(string uri, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_count_with_query")]
+        internal static extern int GetCount(IntPtr queryHandle, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_last_change_version")]
+        internal static extern int GetLastChangeVersion(out int version);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_status")]
+        internal static extern int GetStatus(out Tizen.Pims.Contacts.ContactsDatabase.DBStatus status);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_add_changed_cb")]
+        internal static extern int AddStatusChangedCb(ContactsDBStatusChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_remove_changed_cb")]
+        internal static extern int RemoveStatusChangedCb(ContactsDBStatusChangedCallback callback, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void ContactsDBChangedCallback(string uri, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void ContactsDBStatusChangedCallback(Tizen.Pims.Contacts.ContactsDatabase.DBStatus status, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs
new file mode 100644 (file)
index 0000000..8435ef8
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using static Tizen.Pims.Contacts.ContactsFilter;
+
+internal static partial class Interop
+{
+    internal static partial class Filter
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_create")]
+        internal static extern int ContactsFilterCreate(string uri, out IntPtr filterHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_destroy")]
+        internal static extern int ContactsFilterDestroy(IntPtr filterHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_str")]
+        internal static extern int ContactsFilterAddStr(IntPtr filterHandle, uint propertyId, StringMatchType match, string matchValue);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_int")]
+        internal static extern int ContactsFilterAddInt(IntPtr filterHandle, uint propertyId, IntegerMatchType match, int matchValue);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_lli")]
+        internal static extern int ContactsFilterAddLli(IntPtr filterHandle, uint propertyId, IntegerMatchType match, long matchValue);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_double")]
+        internal static extern int ContactsFilterAddDouble(IntPtr filterHandle, uint propertyId, IntegerMatchType match, double matchValue);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_bool")]
+        internal static extern int ContactsFilterAddBool(IntPtr filterHandle, uint propertyId, bool matchValue);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_operator")]
+        internal static extern int ContactsFilterAddOperator(IntPtr filterHandle, LogicalOperator operatorType);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_filter")]
+        internal static extern int ContactsFilterAddFilter(IntPtr parentFilter, IntPtr childFilter);
+
+
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Group.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Group.cs
new file mode 100755 (executable)
index 0000000..a028fb5
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    /// <summary>
+    /// Contacts Interop Class
+    /// </summary>
+    internal static class Group
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_add_contact")]
+        internal static extern int AddContact(int groupId, int contactId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_remove_contact")]
+        internal static extern int RemoveContact(int groupId, int contactId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_set_group_order")]
+        internal static extern int SetGroupOrder(int groupId, int previousGroupId, int nextGroupId);
+    }
+}
\ No newline at end of file
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs
new file mode 100755 (executable)
index 0000000..b916131
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Contacts = "libcontacts-service2.so.0";
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.List.cs b/src/Tizen.Pims.Contacts/Interop/Interop.List.cs
new file mode 100755 (executable)
index 0000000..67454cb
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class List
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_create")]
+        internal static extern int ContactsListCreate(out IntPtr contactsList);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_destroy")]
+        internal static extern int ContactsListDestroy(IntPtr contactsList, bool deleteChild);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_get_count")]
+        internal static extern int ContactsListGetCount(IntPtr contactsList, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_add")]
+        internal static extern int ContactsListAdd(IntPtr contactsList, IntPtr recordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_remove")]
+        internal static extern int ContactsListRemove(IntPtr contactsList, IntPtr recordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_get_current_record_p")]
+        internal static extern int ContactsListGetCurrentRecordP(IntPtr contactsList, out IntPtr recordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_prev")]
+        internal static extern int ContactsListPrev(IntPtr contactsList);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_next")]
+        internal static extern int ContactsListNext(IntPtr contactsList);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_first")]
+        internal static extern int ContactsListFirst(IntPtr contactsList);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_last")]
+        internal static extern int ContactsListLast(IntPtr contactsList);
+
+
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Person.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Person.cs
new file mode 100755 (executable)
index 0000000..7dd177f
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal enum ContactsPersonProperty
+    {
+        NameContact, // Default contacts record
+        Number, // Default number record
+        Email, // Default Email record
+        Image // Default image record
+    };
+
+    internal enum  ContactsUsageType
+    {
+        None,          /**< None */
+        OutgoingCall, /**< Outgoing Call */
+        OutgoingMsg,   /**< Outgoing message */
+        OutgoingEmail, /**< Outgoing Email (Since 3.0) */
+        IncomingCall, /**< Incoming Call (Since 3.0) */
+        IncomingMsg,  /**< Incoming message (Since 3.0) */
+        IncomingEmail,/**< Incoming Email (Since 3.0) */
+        MissedCall,     /**< Missed Call (Since 3.0) */
+        RejectedCall, /**< Rejected Call (Since 3.0) */
+        BlockedCall, /**< Blocked Call (Since 3.0) */
+        BlockedMsg /**< Blocked message (Since 3.0) */
+    };
+
+    internal static partial class Person
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_link_person")]
+        internal static extern int ContactsPersonLinkPerson(int basePersonId, int personId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_unlink_contact")]
+        internal static extern int ContactsPersonUnlinkContact(int personId, int contactId, out int unlinkedPersonId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_reset_usage")]
+        internal static extern int ContactsPersonResetUsage(int personId, ContactsUsageType type);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_set_favorite_order")]
+        internal static extern int ContactsPersonSetFavoriteOrder(int personId, int previousPersonId, int nextPersonId);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_set_default_property")]
+        internal static extern int ContactsPersonSetDefaultProperty(ContactsPersonProperty property, int personId, int id);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_get_default_property")]
+        internal static extern int ContactsPersonGetDefaultProperty(ContactsPersonProperty property, int personId, out int id);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_get_aggregation_suggestions")]
+        internal static extern int ContactsPersonGetAggregationSuggestions(int personId, int limit, out IntPtr listHandle);
+
+
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs b/src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs
new file mode 100755 (executable)
index 0000000..f530c5f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    internal static class PhoneLog
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_phone_log_reset_statistics")]
+        internal static extern int resetStatistics();
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_phone_log_reset_statistics_by_sim")]
+        internal static extern int resetStatisticsBySim(int simSlotNo);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Query.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Query.cs
new file mode 100755 (executable)
index 0000000..7c23038
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Query
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_create")]
+        internal static extern int ContactsQueryCreate(string uri, out IntPtr queryHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_destroy")]
+        internal static extern int ContactsQueryDestroy(IntPtr queryHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_projection")]
+        internal static extern int ContactsQuerySetProjection(IntPtr queryHandle, uint[] propertyIdArray, int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_distinct")]
+        internal static extern int ContactsQuerySetDistinct(IntPtr queryHandle, bool set);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_filter")]
+        internal static extern int ContactsQuerySetFilter(IntPtr queryHandle, IntPtr filterHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_sort")]
+        internal static extern int ContactsQuerySetSort(IntPtr queryHandle, uint propertyId, bool isAscending);
+
+
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Record.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Record.cs
new file mode 100644 (file)
index 0000000..82f67a1
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Record
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_create")]
+        internal static extern int Create(string uri, out IntPtr recordIdHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_destroy")]
+        internal static extern int Destroy(IntPtr recordHandle, bool deleteChild);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_clone")]
+        internal static extern int Clone(IntPtr recordHandle, out IntPtr clonedRecordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_str")]
+        internal static extern int GetStr(IntPtr recordHandle, uint propertyId, out string value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_str_p")]
+        internal static extern int GetStrP(IntPtr recordHandle, uint propertyId, out string value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_str")]
+        internal static extern int SetStr(IntPtr recordHandle, uint propertyId, string value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_int")]
+        internal static extern int GetInt(IntPtr recordHandle, uint propertyId, out int value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_int")]
+        internal static extern int SetInt(IntPtr recordHandle, uint propertyId, int value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_lli")]
+        internal static extern int GetLli(IntPtr recordHandle, uint propertyId, out long value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_lli")]
+        internal static extern int SetLli(IntPtr recordHandle, uint propertyId, long value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_bool")]
+        internal static extern int GetBool(IntPtr recordHandle, uint propertyId, out bool value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_bool")]
+        internal static extern int SetBool(IntPtr recordHandle, uint propertyId, bool value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_double")]
+        internal static extern int GetDouble(IntPtr recordHandle, uint propertyId, out double value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_double")]
+        internal static extern int SetDouble(IntPtr recordHandle, uint propertyId, double value);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_add_child_record")]
+        internal static extern int AddChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childRecordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_remove_child_record")]
+        internal static extern int RemoveChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childRecordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_child_record_count")]
+        internal static extern int GetChildRecordCount(IntPtr recordHandle, uint propertyId, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_child_record_at_p")]
+        internal static extern int GetChildRecordAtP(IntPtr recordHandle, uint propertyId, int index, out IntPtr childRecordHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_clone_child_record_list")]
+        internal static extern int CloneChildRecordList(IntPtr recordHandle, uint propertyId, out IntPtr clonedListHandle);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_uri_p")]
+        internal static extern int GetUriP(IntPtr recordHandle, out IntPtr uri);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs
new file mode 100755 (executable)
index 0000000..902d7e3
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Pims.Contacts;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    internal static class Setting
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_get_name_display_order")]
+        internal static extern int GetNameDisplayOrder(out ContactDisplayOrder nameDisplayOrder);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_set_name_display_order")]
+        internal static extern int SetNameDisplayOrder(ContactDisplayOrder nameDisplayOrder);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_get_name_sorting_order")]
+        internal static extern int GetNameSortingOrder(out ContactSortingOrder nameSortingOrder);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_set_name_sorting_order")]
+        internal static extern int SetNameSortingOrder(ContactSortingOrder nameSortingOrder);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_add_name_display_order_changed_cb")]
+        internal static extern int AddNameDisplayOrderChangedCB(DisplayOrderChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_remove_name_display_order_changed_cb")]
+        internal static extern int RemoveNameDisplayOrderChangedCB(DisplayOrderChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_add_name_sorting_order_changed_cb")]
+        internal static extern int AddNameSortingOrderChangedCB(SortingOrderChangedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_remove_name_sorting_order_changed_cb")]
+        internal static extern int RemoveNameSortingOrderChangedCB(SortingOrderChangedCallback callback, IntPtr userData);
+
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void DisplayOrderChangedCallback(ContactDisplayOrder nameDisplayOrder, IntPtr userData);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void SortingOrderChangedCallback(ContactSortingOrder nameSortingOrder, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs
new file mode 100755 (executable)
index 0000000..488a5f6
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Partial Interop Class
+/// </summary>
+internal static partial class Interop
+{
+    internal static class Sim
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_sim_import_all_contacts_by_sim_slot_no")]
+        internal static extern int ImportAllContactsBySimSlotNo(int sim_slot_no, ContactsSimImportProgressCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_sim_get_initialization_status_by_sim_slot_no")]
+        internal static extern int GetInitializatOnStatusBySimSlotNo(int sim_slot_no, out bool completed);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void ContactsSimImportProgressCallback(string uri, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs
new file mode 100755 (executable)
index 0000000..47f135b
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Vcard
+    {
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_parse_to_contact_foreach")]
+        internal static extern int ContactsVcardParseToContactForeach(string vcardFilePath, ContactsVcardParseCallback callback, IntPtr /* void */ userData);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_parse_to_contacts")]
+        internal static extern int ContactsVcardParseToContacts(string vcardStream, out IntPtr contactsList);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_contact")]
+        internal static extern int ContactsVcardMakeFromContact(IntPtr contact, out string vcardStream);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_my_profile")]
+        internal static extern int ContactsVcardMakeFromMyProfile(IntPtr myProfile, out string vcardStream);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_person")]
+        internal static extern int ContactsVcardMakeFromPerson(IntPtr person, out string vcardStream);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_get_entity_count")]
+        internal static extern int ContactsVcardGetEntityCount(string vcardFilePath, out int count);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_get_limit_size_of_photo")]
+        internal static extern int ContactsVcardGetLimitSizeOfPhoto(out uint limitSize);
+
+        [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_set_limit_size_of_photo")]
+        internal static extern int ContactsVcardSetLimitSizeOfPhoto(uint limitSize);
+
+        [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate bool ContactsVcardParseCallback(IntPtr recordHandle, IntPtr /* void */ userData);
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj
new file mode 100644 (file)
index 0000000..ff51c60
--- /dev/null
@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Contacts Service API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs
new file mode 100644 (file)
index 0000000..bae4710
--- /dev/null
@@ -0,0 +1,709 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// ContactsDatabase provides methods to manage contacts information from/to the database.
+    /// </summary>
+    /// <remarks>
+    /// This class allows user to access/create/update db operations for contacts information.
+    /// </remarks>
+    public class ContactsDatabase
+    {
+        private Object thisLock = new Object();
+        private Interop.Database.ContactsDBStatusChangedCallback _contactsDBStatusChangedCallback;
+        private event EventHandler<DBStatusChangedEventArgs> _dbStatusChanged;
+        private Dictionary<string, ContactsDBChangedDelegate> _callbackMap = new Dictionary<string, ContactsDBChangedDelegate>();
+        private Dictionary<string, Interop.Database.ContactsDBChangedCallback> _delegateMap = new Dictionary<string, Interop.Database.ContactsDBChangedCallback>();
+        private Interop.Database.ContactsDBChangedCallback _dbChangedDelegate;
+        /// <summary>
+        /// Delegete for detecting the contacts database changes
+        /// </summary>
+        /// <param name="uri">The contacts view URI</param>
+        /// <remarks>
+        /// The delegate must be registered using AddDBChangedDelegate.
+        /// It's invoked when the designated view changes.
+        /// </remarks>
+        /// <see cref="AddDBChangedDelegate"/>
+        public delegate void ContactsDBChangedDelegate(string uri);
+
+        internal ContactsDatabase()
+        {
+            ///To be created in ContactsManager only.
+        }
+
+        /// <summary>
+        /// Enumeration for contacts database status.
+        /// </summary>
+        public enum DBStatus
+        {
+            /// <summary>
+            /// Normal
+            /// </summary>
+            Normal,
+            /// <summary>
+            /// Changing collation.
+            /// </summary>
+            ChangingCollation
+        }
+
+        /// <summary>
+        /// Enumeration for Contacts search range.
+        /// </summary>
+        public enum SearchRange
+        {
+            /// <summary>
+            /// Search record from name
+            /// </summary>
+            Name = 0x00000001,
+            /// <summary>
+            /// Search record from number
+            /// </summary>
+            Number = 0x00000002,
+            /// <summary>
+            /// Search record from data
+            /// </summary>
+            Data = 0x00000004,
+            /// <summary>
+            /// Search record from email. Now, support only PersonEmail view
+            /// </summary>
+            Email = 0x00000008,
+        }
+
+        /// <summary>
+        /// Occurs when contacts database status is changed.
+        /// </summary>
+        public event EventHandler<DBStatusChangedEventArgs> DBStatusChanged
+        {
+            add
+            {
+                lock (thisLock)
+                {
+                    _contactsDBStatusChangedCallback = (DBStatus status, IntPtr userData) =>
+                    {
+                        DBStatusChangedEventArgs args = new DBStatusChangedEventArgs(status);
+                        _dbStatusChanged?.Invoke(this, args);
+                    };
+
+                    int error = Interop.Database.AddStatusChangedCb(_contactsDBStatusChangedCallback, IntPtr.Zero);
+                    if ((int)ContactsError.None != error)
+                    {
+                        Log.Error(Globals.LogTag, "Add StatusChanged Failed with error " + error);
+                    }
+                    else
+                    {
+                        _dbStatusChanged += value;
+                    }
+                }
+
+            }
+
+            remove
+            {
+                lock (thisLock)
+                {
+                    int error = Interop.Database.RemoveStatusChangedCb(_contactsDBStatusChangedCallback, IntPtr.Zero);
+                    if ((int)ContactsError.None != error)
+                    {
+                        Log.Error(Globals.LogTag, "Remove StatusChanged Failed with error " + error);
+                    }
+
+                    _dbStatusChanged -= value;
+                }
+            }
+
+        }
+
+        /// <summary>
+        /// The current contacts database version.
+        /// </summary>
+        public int Version
+        {
+            get
+            {
+                int version = -1;
+                int error = Interop.Database.GetVersion(out version);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Version Failed with error " + error);
+                }
+                return version;
+            }
+        }
+
+        /// <summary>
+        /// The last successful changed contacts database version on the current connection.
+        /// </summary>
+        public int LastChangeVersion
+        {
+            get
+            {
+                int version = -1;
+                int error = Interop.Database.GetLastChangeVersion(out version);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "LastChangeVersion Failed with error " + error);
+                }
+                return version;
+            }
+        }
+
+        /// <summary>
+        /// The contacts database status.
+        /// </summary>
+        public DBStatus Status
+        {
+            get
+            {
+                DBStatus status = DBStatus.Normal;
+                int error = Interop.Database.GetStatus(out status);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "GetStatus Failed with error " + error);
+                }
+                return status;
+            }
+        }
+
+        /// <summary>
+        /// Inserts a record into the contacts database.
+        /// </summary>
+        /// <param name="record">The record to insert</param>
+        /// <returns>The ID of inserted record</returns>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public int Insert(ContactsRecord record)
+        {
+            int id = -1;
+            int error = Interop.Database.Insert(record._recordHandle, out id);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Insert Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return id;
+        }
+
+        /// <summary>
+        /// Inserts multiple records into the contacts database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <returns>The inserted record ID array</returns>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public int[] Insert(ContactsList list)
+        {
+            IntPtr ids;
+            int count;
+            int error = Interop.Database.InsertRecords(list._listHandle, out ids, out count);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Insert Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            int[] idArr = new int[count];
+            Marshal.Copy(ids, idArr, 0, count);
+
+            return idArr;
+        }
+
+        /// <summary>
+        /// Gets a record from the contacts database.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a record</param>
+        /// <param name="recordId">The record ID</param>
+        /// <returns>The record associated with the record ID</returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public ContactsRecord Get(string viewUri, int recordId)
+        {
+            IntPtr handle;
+            int error = Interop.Database.Get(viewUri, recordId, out handle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Get Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsRecord(handle);
+        }
+
+        /// <summary>
+        /// Updates a record in the contacts database.
+        /// </summary>
+        /// <param name="record">The record to update</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Update(ContactsRecord record)
+        {
+            int error = Interop.Database.Update(record._recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Update Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Updates multiple records in the contacts database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Update(ContactsList list)
+        {
+            int error = Interop.Database.UpdateRecords(list._listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Update Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Deletes a record from the contacts database with related child records.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a record</param>
+        /// <param name="recordId">The record ID to delete</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Delete(string viewUri, int recordId)
+        {
+            int error = Interop.Database.Delete(viewUri, recordId);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Delete Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Deletes multiple records with related child records from the contacts database as a batch operation.
+        /// </summary>
+        /// <param name="viewUri">The view URI of the records to delete</param>
+        /// <param name="idArray">The record IDs to delete</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Delete(string viewUri, int[] idArray)
+        {
+            int error = Interop.Database.DeleteRecords(viewUri, idArray, idArray.Length);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Delete Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Replaces a record in the contacts database.
+        /// </summary>
+        /// <param name="record">The record to replace</param>
+        /// <param name="recordId">the record ID to be replaced</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Replace(ContactsRecord record, int recordId)
+        {
+            int error = Interop.Database.Replace(record._recordHandle, recordId);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Replace Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Replaces multiple records in the contacts database as a batch operation.
+        /// </summary>
+        /// <param name="list">The record list to replace</param>
+        /// <param name="idArray">The record IDs to be replaced</param>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.write</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public void Replace(ContactsList list, int[] idArray)
+        {
+            int error = Interop.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Replace Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Retrieves all records as a list.
+        /// </summary>
+        /// <param name="viewUri">The view URI to get records</param>
+        /// <param name="offset">The index from which results</param>
+        /// <param name="limit">The number to limit results(value 0 is used for all records)</param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public ContactsList GetAll(string viewUri, int offset, int limit)
+        {
+            IntPtr handle;
+            int error = Interop.Database.GetRecords(viewUri, offset, limit, out handle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetAll Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(handle);
+        }
+
+        /// <summary>
+        /// Retrieves records using a query.
+        /// </summary>
+        /// <param name="query">The query to filter the results</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 is used for get all records)</param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <privilege>http://tizen.org/privilege/callhistory.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public ContactsList GetRecordsWithQuery(ContactsQuery query, int offset, int limit)
+        {
+            IntPtr handle;
+            int error = Interop.Database.GetRecords(query._queryHandle, offset, limit, out handle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetAllWithQuery Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(handle);
+        }
+
+        /// <summary>
+        /// Retrieves records changes since the given database version.
+        /// </summary>
+        /// <param name="viewUri">The view URI to get records</param>
+        /// <param name="addressbookId">The address book ID to filter</param>
+        /// <param name="contactsDBVersion">The contacts database version</param>
+        /// <param name="currentDBVersion">The current contacts database version</param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
+        public ContactsList GetChangesByVersion(string viewUri, int addressbookId, int contactsDBVersion, out int currentDBVersion)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.GetChangesByVersion(viewUri, addressbookId, contactsDBVersion, out recordList,out currentDBVersion);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetChangesByVersion Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on a given keyword.
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned.
+        /// </remarks>
+        /// <param name="viewUri">The view URI to find records</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 is used for get all records)</param>
+        /// <returns></returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        public ContactsList Search(string viewUri, string keyword, int offset, int limit)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(viewUri, keyword, offset, limit, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on given query and keyword.
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned.
+        /// </remarks>
+        /// <param name="query">The query to filter</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 used for get all records)</param>
+        /// <returns>The record list</returns>
+        public ContactsList Search(ContactsQuery query, string keyword, int offset, int limit)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(query._queryHandle, keyword, offset, limit, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on a keyword and range.
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned, PersonGroupNotAssigned, PersonNumber and PersonEmail
+        /// </remarks>
+        /// <param name="viewUri">The view URI</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 is used for get all records)</param>
+        /// <param name="range">The search range, it should be a element of SearchRange or bitwise OR operation of them</param>
+        /// <returns>The record list</returns>
+        public ContactsList Search(string viewUri, string keyword, int offset, int limit, int range)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(viewUri, keyword, offset, limit, range, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on a given keyword for snippet
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned.
+        /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(string viewUri, string keyword, int offset, int limit).
+        /// </remarks>
+        /// <param name="viewUri">The view URI to find records</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 used for get all records)</param>
+        /// <param name="startMatch">The text which is inserted into the fragment before the keyword(If NULL, default is "[")</param>
+        /// <param name="endMatch">The text which is inserted into the fragment after the keyword(If NULL, default is "]")</param>
+        /// <param name="tokenNumber">The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home")</param>
+        /// <returns>The record list</returns>
+        public ContactsList Search(string viewUri, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(viewUri, keyword, offset, limit, startMatch, endMatch, tokenNumber, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on given query and keyword for snippet.
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned.
+        /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(ContactsQuery query, string keyword, int offset, int limit).
+        /// </remarks>
+        /// <param name="query">The query to filter</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 used for get all records)</param>
+        /// <param name="startMatch">The text which is inserted into the fragment before the keyword(If NULL, default is "[")</param>
+        /// <param name="endMatch">The text which is inserted into the fragment after the keyword(If NULL, default is "]")</param>
+        /// <param name="tokenNumber">The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home")</param>
+        /// <returns>The record list</returns>
+        public ContactsList Search(ContactsQuery query, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(query._queryHandle, keyword, offset, limit, startMatch, endMatch, tokenNumber, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Finds records based on a keyword and range for snippet.
+        /// </summary>
+        /// <remarks>
+        /// This API works only for the Views below.
+        /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned, PersonGroupNotAssigned, PersonNumber and PersonEmail
+        /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(string viewUri, string keyword, int offset, int limit, int range).
+        /// </remarks>
+        /// <param name="viewUri">The view URI</param>
+        /// <param name="keyword">The keyword</param>
+        /// <param name="offset">The index from which to get results</param>
+        /// <param name="limit">The number to limit results(value 0 is used for get all records)</param>
+        /// <param name="range">The search range, it should be a element of SearchRange or bitwise OR operation of them</param>
+        /// <param name="startMatch">The text which is inserted into the fragment before the keyword(If NULL, default is "[")</param>
+        /// <param name="endMatch">The text which is inserted into the fragment after the keyword(If NULL, default is "]")</param>
+        /// <param name="tokenNumber">The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home")</param>
+        /// <returns>The record list</returns>
+        public ContactsList Search(string viewUri, string keyword, int offset, int limit, int range, string startMatch, string endMatch, int tokenNumber)
+        {
+            IntPtr recordList;
+            int error = Interop.Database.Search(viewUri, keyword, offset, limit, range, startMatch, endMatch, tokenNumber, out recordList);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Search Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsList(recordList);
+        }
+
+        /// <summary>
+        /// Gets the number of records in a specific view
+        /// </summary>
+        /// <param name="viewUri">The view URI</param>
+        /// <returns>The count of records</returns>
+        public int GetCount(string viewUri)
+        {
+            int count = -1;
+            int error = Interop.Database.GetCount(viewUri, out count);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Gets the number of records matching a query.
+        /// </summary>
+        /// <param name="query">The query used for filtering the results</param>
+        /// <returns>The count of records</returns>
+        public int GetCount(ContactsQuery query)
+        {
+            int count = -1;
+            int error = Interop.Database.GetCount(query._queryHandle, out count);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Registers a callback function to be invoked when a record changes.
+        /// </summary>
+        /// <param name="viewUri">The view URI of records whose changes are monitored</param>
+        /// <param name="callback">The callback function to register</param>
+        public void AddDBChangedDelegate(string viewUri, ContactsDBChangedDelegate callback)
+        {
+            _dbChangedDelegate = (string uri, IntPtr userData) =>
+            {
+                _callbackMap[uri](uri);
+            };
+            int error = Interop.Database.AddChangedCb(viewUri, _dbChangedDelegate, IntPtr.Zero);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _callbackMap[viewUri] = callback;
+            _delegateMap[viewUri] = _dbChangedDelegate;
+        }
+
+        /// <summary>
+        /// Unregisters a callback function.
+        /// </summary>
+        /// <param name="viewUri">The view URI of records whose changes are monitored</param>
+        /// <param name="callback">The callback function to register</param>
+        public void RemoveDBChangedDelegate(string viewUri, ContactsDBChangedDelegate callback)
+        {
+            int error = Interop.Database.RemoveChangedCb(viewUri, _delegateMap[viewUri], IntPtr.Zero);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _callbackMap.Remove(viewUri);
+            _delegateMap.Remove(viewUri);
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs
new file mode 100644 (file)
index 0000000..b542c57
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Pims.Contacts
+{
+    internal enum ContactsError
+    {
+        None = (int)ErrorCode.None,
+        InvalidParameter = (int)ErrorCode.InvalidParameter,
+        NotSupported = (int)ErrorCode.NotSupported,
+        PermissionDenied = (int)ErrorCode.PermissionDenied,
+        OutOfMemory = (int)ErrorCode.OutOfMemory,
+        FileNoSpaceOnDevice = (int)ErrorCode.FileNoSpaceOnDevice,
+        NoData = (int)ErrorCode.NoData,
+
+        DatabaseLocked = -0x02010000 | 0x81,
+        Database = -0x02010000 | 0x9F,
+        IpcNotAvaliable = -0x02010000 | 0xB1,
+        Ipc = -0x02010000 | 0xBF,
+        System = -0x02010000 | 0xEF
+    }
+
+    internal static class Globals
+    {
+        internal const string LogTag = "Tizen.Pims.Contacts";
+    }
+
+    internal static class ContactsErrorFactory
+    {
+        static internal Exception CheckAndCreateException(int error)
+        {
+            ContactsError e = (ContactsError)error;
+            switch (e)
+            {
+                case ContactsError.None:
+                    return null;
+                case ContactsError.InvalidParameter:
+                    return new ArgumentException("Invalid Parameters Provided");
+                case ContactsError.NotSupported:
+                    return new NotSupportedException("Not Supported");
+                case ContactsError.PermissionDenied:
+                    return new UnauthorizedAccessException("Permission Denied");
+                case ContactsError.OutOfMemory:
+                    return new OutOfMemoryException("Out of Memory");
+                case ContactsError.FileNoSpaceOnDevice:
+                    return new InvalidOperationException("File System is Full");
+                case ContactsError.NoData:
+                    return new InvalidOperationException("No Data");
+                case ContactsError.DatabaseLocked:
+                    return new InvalidOperationException("Database Locked");
+                case ContactsError.Database:
+                    return new InvalidOperationException("Database Failed");
+                case ContactsError.IpcNotAvaliable:
+                    return new InvalidOperationException("IPC Not Avaliable");
+                case ContactsError.Ipc:
+                    return new InvalidOperationException("IPC failed");
+                case ContactsError.System:
+                    return new InvalidOperationException("Internal system error");
+                default:
+                    return new InvalidOperationException("Unknown Error Code");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs
new file mode 100644 (file)
index 0000000..18880ac
--- /dev/null
@@ -0,0 +1,424 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using static Interop.Contacts;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// A filter includes the conditions for the search
+    /// </summary>
+    public class ContactsFilter:IDisposable
+    {
+        internal IntPtr _filterHandle;
+
+        /// <summary>
+        /// Creates a filter with a condition for a string type property.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsFilter(string viewUri, uint propertyId, StringMatchType matchType, string matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddStr(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for an integer type property.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, int matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddInt(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for a long type property.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, long matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddLli(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for a double type property.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, double matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddDouble(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Creates a filter with a condition for a boolean type property.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a filter</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsFilter(string viewUri, uint propertyId, bool matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddBool(_filterHandle, propertyId, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        ~ContactsFilter()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// Enumeration for the filter match type of a string.
+        /// </summary>
+        public enum StringMatchType
+        {
+            /// <summary>
+            /// Full string, case-sensitive
+            /// </summary>
+            Exactly,
+            /// <summary>
+            /// Full string, case-insensitive
+            /// </summary>
+            FullString,
+            /// <summary>
+            /// Sub string, case-insensitive
+            /// </summary>
+            Contains,
+            /// <summary>
+            /// Start with, case-insensitive
+            /// </summary>
+            StartsWith,
+            /// <summary>
+            /// End with, case-insensitive
+            /// </summary>
+            EndsWith,
+            /// <summary>
+            /// IS NOT NUL
+            /// </summary>
+            Exists,
+        }
+
+        /// <summary>
+        /// Enumeration for the filter match type of an integer.
+        /// </summary>
+        public enum IntegerMatchType
+        {
+            /// <summary>
+            /// =
+            /// </summary>
+            Equal,
+            /// <summary>
+            /// &gt;
+            /// </summary>
+            GreaterThan,
+            /// <summary>
+            /// &gt;=
+            /// </summary>
+            GreaterThanOrEqual,
+            /// <summary>
+            /// &lt;
+            /// </summary>
+            LessThan,
+            /// <summary>
+            /// &lt;=
+            /// </summary>
+            LessThanOrEqual,
+            /// <summary>
+            /// &lt;&gt;, this flag can yield poor performance
+            /// </summary>
+            NotEqual,
+            /// <summary>
+            /// IS NULL
+            /// </summary>
+            None,
+        }
+
+        /// <summary>
+        /// Enumeration for a filter operator.
+        /// </summary>
+        public enum LogicalOperator
+        {
+            And,
+            Or,
+        }
+
+        #region IDisposable Support
+        private bool disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                int error = Interop.Filter.ContactsFilterDestroy(_filterHandle);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "ContactsFilterDestroy Failed with error " + error);
+                }
+
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ContactsFilter.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+        #endregion
+
+        /// <summary>
+        /// Adds a condition for a string type property.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, StringMatchType matchType, string matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddStr(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for a integer type property.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, int matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddInt(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for a long type property.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, long matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddLli(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for a double type property.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchType">The match flag</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, double matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddDouble(_filterHandle, propertyId, matchType, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a condition for a boolean type property.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="propertyId">The property ID to add a condition</param>
+        /// <param name="matchValue">The match value</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddCondition(LogicalOperator logicalOperator, uint propertyId, bool matchValue)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddBool(_filterHandle, propertyId, matchValue);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddCondition Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Adds a child filter to a parent filter.
+        /// </summary>
+        /// <param name="logicalOperator">The operator type</param>
+        /// <param name="filter">The child filter</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddFilter(LogicalOperator logicalOperator, ContactsFilter filter)
+        {
+            int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            error = Interop.Filter.ContactsFilterAddFilter(_filterHandle, filter._filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs
new file mode 100644 (file)
index 0000000..d0965eb
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// A list of records with the same type
+    /// </summary>
+    public class ContactsList:IDisposable
+    {
+        private Int64 _memoryPressure = 20;
+        internal IntPtr _listHandle;
+        internal ContactsList(IntPtr handle)
+        {
+            int count;
+
+            _listHandle = handle;
+            int error = Interop.List.ContactsListGetCount(_listHandle, out count);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsList Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _memoryPressure += count * ContactsViews.AverageSizeOfRecord;
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        /// <summary>
+        /// Creates a contacts record list.
+        /// </summary>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsList()
+        {
+            int error = Interop.List.ContactsListCreate(out _listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsList Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        ~ContactsList()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The count of contact entity.
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                int count = -1;
+                int error = Interop.List.ContactsListGetCount(_listHandle, out count);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "ContactsList Count Failed with error " + error);
+                }
+                return count;
+            }
+        }
+
+        #region IDisposable Support
+        private bool disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                int error = Interop.List.ContactsListDestroy(_listHandle, true);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "ContactsListDestroy Failed with error " + error);
+                }
+
+                disposedValue = true;
+                GC.RemoveMemoryPressure(_memoryPressure);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ContactsList.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+        #endregion
+
+        /// <summary>
+        /// Adds a record to the contacts list.
+        /// </summary>
+        /// <param name="record">The record to add</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddRecord(ContactsRecord record)
+        {
+            int error = Interop.List.ContactsListAdd(_listHandle, record._recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            record._disposedValue = true;
+            _memoryPressure += ContactsViews.AverageSizeOfRecord;
+        }
+
+        /// <summary>
+        /// Removes a record from the contacts list.
+        /// </summary>
+        /// <param name="record">The record to remove</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void RemoveRecord(ContactsRecord record)
+        {
+            int error = Interop.List.ContactsListRemove(_listHandle, record._recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "RemoveRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            record._disposedValue = false;
+            _memoryPressure -= ContactsViews.AverageSizeOfRecord;
+        }
+
+        /// <summary>
+        /// Retrieves a record from the contacts list.
+        /// </summary>
+        /// <returns>
+        /// contacts record
+        /// </returns>
+        public ContactsRecord GetCurrentRecord()
+        {
+            IntPtr handle;
+            int error = Interop.List.ContactsListGetCurrentRecordP(_listHandle, out handle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetCurrentRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsRecord(handle, true);
+        }
+
+        /// <summary>
+        /// Moves a contacts list to the previous position.
+        /// </summary>
+        /// <returns>
+        /// When the cursor is already at the first position, it returns false.
+        /// </returns>
+        public bool MovePrevious()
+        {
+            int error = Interop.List.ContactsListPrev(_listHandle);
+
+            if ((int)ContactsError.None == error)
+            {
+                return true;
+            }
+            else if (Count > 0 && (int)ContactsError.NoData == error)
+            {
+                Log.Debug(Globals.LogTag, "Nodata MovePrevious" + error);
+                return false;
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "MovePrevious Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a contacts list to the next position.
+        /// </summary>
+        /// <returns>
+        /// When the cursor is already at the last position, it returns false.
+        /// </returns>
+        public bool MoveNext()
+        {
+            int error = Interop.List.ContactsListNext(_listHandle);
+
+            if ((int)ContactsError.None == error)
+            {
+                return true;
+            }
+            else if (Count > 0 && (int)ContactsError.NoData == error)
+            {
+                Log.Debug(Globals.LogTag, "Nodata MoveNext" + error);
+                return false;
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "MoveNext Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a contacts list to the first position.
+        /// </summary>
+        public void MoveFirst()
+        {
+            int error = Interop.List.ContactsListFirst(_listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Moves a contacts list to the last position.
+        /// </summary>
+        public void MoveLast()
+        {
+            int error = Interop.List.ContactsListLast(_listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs
new file mode 100644 (file)
index 0000000..cde2fff
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using static Interop.Contacts;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// Enumeration for name display order.
+    /// </summary>
+    public enum ContactDisplayOrder
+    {
+        /// <summary>
+        /// First name comes at the first
+        /// </summary>
+        FirstLast,
+        /// <summary>
+        /// First name comes at the last
+        /// </summary>
+        LastFirst
+    };
+
+    /// <summary>
+    /// Enumeration for name sorting order.
+    /// </summary>
+    public enum ContactSortingOrder
+    {
+        /// <summary>
+        /// Contacts are first sorted based on the first name
+        /// </summary>
+        FirstLast,
+        /// <summary>
+        /// Contacts are first sorted based on the last name
+        /// </summary>
+        LastFirst
+    };
+
+    /// <summary>
+    /// A class for managing contact information. It allows applications to access contacts database.
+    /// </summary>
+    public class ContactsManager : IDisposable
+    {
+        private ContactsDatabase _db = null;
+        private Object thisLock = new Object();
+        private Interop.Setting.DisplayOrderChangedCallback _displayOrderDelegate;
+        private Interop.Setting.SortingOrderChangedCallback _sortingOrderDelegate;
+
+        /// <summary>
+        /// Creates a ContactsManager.
+        /// </summary>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        public ContactsManager()
+        {
+            int error = Interop.Contacts.Connect();
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Connect Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _db = new ContactsDatabase();
+        }
+
+        ~ContactsManager()
+        {
+            Dispose(false);
+        }
+
+        #region IDisposable Support
+        private bool disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                int error = Interop.Contacts.Disconnect();
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Disconnect Failed with error " + error);
+                }
+
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ContactsManager.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+        #endregion
+
+        private event EventHandler<NameDisplayOrderChangedEventArgs> _nameDisplayOrderChanged;
+        private event EventHandler<NameSortingOrderChangedEventArgs> _nameSortingOrderChanged;
+
+        /// <summary>
+        /// (event) NameDisplayOrderChanged is raised when changing setting value of contacts name display order
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        public event EventHandler<NameDisplayOrderChangedEventArgs> NameDisplayOrderChanged
+        {
+            add
+            {
+                lock (thisLock)
+                {
+                    if (_displayOrderDelegate == null)
+                    {
+                        _displayOrderDelegate = (ContactDisplayOrder nameDisplayOrder, IntPtr userData) =>
+                        {
+                            NameDisplayOrderChangedEventArgs args = new NameDisplayOrderChangedEventArgs(nameDisplayOrder);
+                            _nameDisplayOrderChanged?.Invoke(this, args);
+                        };
+                    }
+
+                    if (_nameDisplayOrderChanged == null)
+                    {
+                        int error = Interop.Setting.AddNameDisplayOrderChangedCB(_displayOrderDelegate, IntPtr.Zero);
+                        if ((int)ContactsError.None != error)
+                        {
+                            Log.Error(Globals.LogTag, "Add NameDisplayOrderChangedCB Failed with error " + error);
+                        }
+                    }
+
+                    _nameDisplayOrderChanged += value;
+                }
+            }
+
+            remove
+            {
+                lock (thisLock)
+                {
+                    _nameDisplayOrderChanged -= value;
+
+                    if (_nameDisplayOrderChanged == null)
+                    {
+                        int error = Interop.Setting.RemoveNameDisplayOrderChangedCB(_displayOrderDelegate, IntPtr.Zero);
+                        if ((int)ContactsError.None != error)
+                        {
+                            Log.Error(Globals.LogTag, "Remove StateChanged Failed with error " + error);
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// (event) NameSortingOrderChanged is raised when changing setting value of contacts name sorting order
+        /// </summary>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        public event EventHandler<NameSortingOrderChangedEventArgs> NameSortingOrderChanged
+        {
+            add
+            {
+                lock (thisLock)
+                {
+                    if (_sortingOrderDelegate == null)
+                    {
+                        _sortingOrderDelegate = (ContactSortingOrder nameSortingOrder, IntPtr userData) =>
+                        {
+                            NameSortingOrderChangedEventArgs args = new NameSortingOrderChangedEventArgs(nameSortingOrder);
+                            _nameSortingOrderChanged?.Invoke(this, args);
+                        };
+                    }
+
+                    if (_nameSortingOrderChanged == null)
+                    {
+                        int error = Interop.Setting.AddNameSortingOrderChangedCB(_sortingOrderDelegate, IntPtr.Zero);
+                        if ((int)ContactsError.None != error)
+                        {
+                            Log.Error(Globals.LogTag, "Add NameSortingOrderChangedCB Failed with error " + error);
+                        }
+                    }
+
+                    _nameSortingOrderChanged += value;
+                }
+            }
+
+            remove
+            {
+                lock (thisLock)
+                {
+                    _nameSortingOrderChanged -= value;
+
+                    if (_nameSortingOrderChanged == null)
+                    {
+                        int error = Interop.Setting.RemoveNameSortingOrderChangedCB(_sortingOrderDelegate, IntPtr.Zero);
+                        if ((int)ContactsError.None != error)
+                        {
+                            Log.Error(Globals.LogTag, "Remove StateChanged Failed with error " + error);
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// A ContactsDatabase
+        /// </summary>
+        public ContactsDatabase Database
+        {
+            get
+            {
+                return _db;
+            }
+        }
+
+        /// <summary>
+        /// A setting value of contacts name display order
+        /// </summary>
+        /// <remarks>
+        /// DisplayName of contacts returned from database are determined by this property
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        public ContactDisplayOrder NameDisplayOrder
+        {
+            get
+            {
+                ContactDisplayOrder contactDisplayOrder;
+                int error = Interop.Setting.GetNameDisplayOrder(out contactDisplayOrder);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get NameDisplayOrder Failed with error " + error);
+                }
+                return contactDisplayOrder;
+            }
+            set
+            {
+                int error = Interop.Setting.SetNameDisplayOrder(value);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set NameDisplayOrder Failed with error " + error);
+                }
+            }
+        }
+
+        /// <summary>
+        /// A setting value of contacts name sorting order
+        /// </summary>
+        /// <remarks>
+        /// Contacts returned from database are first sorted based on the first name or last name by this property
+        /// </remarks>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <privilege>http://tizen.org/privilege/contact.write</privilege>
+        public ContactSortingOrder NameSortingOrder
+        {
+            get
+            {
+                ContactSortingOrder contactsSortingOrder;
+                int error = Interop.Setting.GetNameSortingOrder(out contactsSortingOrder);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get NameSortingOrder Failed with error " + error);
+                }
+                return contactsSortingOrder;
+            }
+            set
+            {
+                int error = Interop.Setting.SetNameSortingOrder(value);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set NameSortingOrder Failed with error " + error);
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs
new file mode 100644 (file)
index 0000000..6754700
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using static Interop.Contacts;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// A query is used to retrieve data which satisfies given criteria
+    /// </summary>
+    /// <remarks>
+    /// A query is used to retrieve person, group, speed dial, and log data which satisfies a given criteria, such as an integer property being greater than a given value, or a string property containing a given substring. 
+    /// A query needs a filter which can set the conditions for the search.
+    /// </remarks>
+    public class ContactsQuery : IDisposable
+    {
+        internal IntPtr _queryHandle;
+
+        /// <summary>
+        /// Creates a query.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a query</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsQuery(string viewUri)
+        {
+            int error = Interop.Query.ContactsQueryCreate(viewUri, out _queryHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsQuery Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        internal ContactsQuery(IntPtr handle)
+        {
+            _queryHandle = handle;
+        }
+
+        ~ContactsQuery()
+        {
+            Dispose(false);
+        }
+        #region IDisposable Support
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                int error = Interop.Query.ContactsQueryDestroy(_queryHandle);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "ContactsQueryDestroy Failed with error " + error);
+                }
+
+                disposedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ContactsQuery.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+        #endregion
+
+        /// <summary>
+        /// Adds property IDs for projection.
+        /// </summary>
+        /// <param name="propertyIdArray">The property ID array </param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetProjection(uint[] propertyIdArray)
+        {
+            int error = Interop.Query.ContactsQuerySetProjection(_queryHandle, propertyIdArray, propertyIdArray.Length);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "SetProjection Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the "distinct" option for projection.
+        /// </summary>
+        /// <param name="set">If true it is set, otherwise if false it is unset</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetDistinct(bool set)
+        {
+            int error = Interop.Query.ContactsQuerySetDistinct(_queryHandle, set);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "SetDistinct Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the filter for a query.
+        /// </summary>
+        /// <param name="filter">The filter</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetFilter(ContactsFilter filter)
+        {
+            int error = Interop.Query.ContactsQuerySetFilter(_queryHandle, filter._filterHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "SetFilter Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+
+        /// <summary>
+        /// Sets the sort mode for a query.
+        /// </summary>
+        /// <param name="propertyId">The property ID to sort</param>
+        /// <param name="isAscending">If true it sorts in the ascending order, otherwise if false it sorts in the descending order</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void SetSort(uint propertyId, bool isAscending)
+        {
+            int error = Interop.Query.ContactsQuerySetSort(_queryHandle, propertyId, isAscending);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "SetSort Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs
new file mode 100644 (file)
index 0000000..dd8c592
--- /dev/null
@@ -0,0 +1,396 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// A record represents an actual record in the database
+    /// </summary>
+    /// <remarks>
+    /// A record represents an actual record in the database, but you can also consider it a piece of information, such as an address, a phone number, or a group of contacts. 
+    /// A record can be a complex set of data, containing other data. For example, a contact record contains the address property, which is a reference to an address record. 
+    /// An address record belongs to a contact record, and its ContactId property is set to the identifier of the corresponding contact. In this case, the address is the child record of the contact and the contact is the parent record.
+    /// </remarks>
+    public class ContactsRecord : IDisposable
+    {
+        private string _uri = null;
+        private uint _id;
+        private Int64 _memoryPressure = ContactsViews.AverageSizeOfRecord;
+        internal IntPtr _recordHandle;
+
+        internal ContactsRecord(IntPtr handle)
+        {
+            _recordHandle = handle;
+            IntPtr viewUri;
+            int error = Interop.Record.GetUriP(handle, out viewUri);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            GC.AddMemoryPressure(_memoryPressure);
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+        }
+
+        internal ContactsRecord(IntPtr handle, bool disposedValue)
+        {
+            _recordHandle = handle;
+            _disposedValue = disposedValue;
+            IntPtr viewUri;
+            int error = Interop.Record.GetUriP(handle, out viewUri);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            if (!_disposedValue)
+                GC.AddMemoryPressure(_memoryPressure);
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+        }
+
+        internal ContactsRecord(IntPtr handle, int id)
+        {
+            _recordHandle = handle;
+            _id = (uint)id;
+            IntPtr viewUri;
+            int error = Interop.Record.GetUriP(handle, out viewUri);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _uri = Marshal.PtrToStringAnsi(viewUri);
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        /// <summary>
+        /// Creates a record.
+        /// </summary>
+        /// <param name="viewUri">The view URI</param>
+        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsRecord(string viewUri)
+        {
+            int error = Interop.Record.Create(viewUri, out _recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            _uri = viewUri;
+            GC.AddMemoryPressure(_memoryPressure);
+        }
+
+        ~ContactsRecord()
+        {
+            Dispose(false);
+        }
+
+        /// <summary>
+        /// The URI of the record
+        /// </summary>
+        public string Uri
+        {
+            get
+            {
+                return _uri;
+            }
+        }
+
+        #region IDisposable Support
+        internal bool _disposedValue = false; // To detect redundant calls
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!_disposedValue)
+            {
+                int error = Interop.Record.Destroy(_recordHandle, true);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Dispose Failed with error " + error);
+                }
+                _disposedValue = true;
+                GC.RemoveMemoryPressure(_memoryPressure);
+            }
+        }
+
+        /// <summary>
+        /// Releases all resources used by the ContactsRecord.
+        /// It should be called after finished using of the object.
+        /// </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+        #endregion
+
+        /// <summary>
+        /// Makes a clone of a record.
+        /// </summary>
+        /// <returns>A cloned record</returns>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public ContactsRecord Clone()
+        {
+            IntPtr _clonedRecordHandle;
+            int error = Interop.Record.Clone(_recordHandle, out _clonedRecordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Clone Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsRecord(_clonedRecordHandle, (int)_id);
+        }
+
+        /// <summary>
+        /// Gets a value of the property from a record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// The value of the property corresponding to property id.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public T Get<T>(uint propertyId)
+        {
+            object parsedValue = null;
+            if (typeof(T) == typeof(string))
+            {
+                string val;
+                int error = Interop.Record.GetStr(_recordHandle, propertyId, out val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get String Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val;
+                int error = Interop.Record.GetInt(_recordHandle, propertyId, out val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get Int Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(bool))
+            {
+                bool val;
+                int error = Interop.Record.GetBool(_recordHandle, propertyId, out val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get Bool Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(long))
+            {
+                long val;
+                int error = Interop.Record.GetLli(_recordHandle, propertyId, out val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get Long Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val;
+                int error = Interop.Record.GetDouble(_recordHandle, propertyId, out val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get Long Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+                parsedValue = Convert.ChangeType(val, typeof(T));
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Not Supported Data Type");
+                throw ContactsErrorFactory.CheckAndCreateException((int)ContactsError.NotSupported);
+            }
+            return (T)parsedValue;
+        }
+
+        /// <summary>
+        /// Sets a value of the property to a record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="value">The value to set</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void Set<T>(uint propertyId, T value)
+        {
+            if (typeof(T) == typeof(string))
+            {
+                string val = Convert.ToString(value);
+                int error = Interop.Record.SetStr(_recordHandle, propertyId, val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set String Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val = Convert.ToInt32(value);
+                int error = Interop.Record.SetInt(_recordHandle, propertyId, val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set Int Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+            }
+            else if (typeof(T) == typeof(bool))
+            {
+                bool val = Convert.ToBoolean(value);
+                int error = Interop.Record.SetBool(_recordHandle, propertyId, val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set Bool Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+            }
+            else if (typeof(T) == typeof(long))
+            {
+                long val = Convert.ToInt64(value);
+                int error = Interop.Record.SetLli(_recordHandle, propertyId, val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Set Long Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val = Convert.ToDouble(value);
+                int error = Interop.Record.SetDouble(_recordHandle, propertyId, val);
+                if ((int)ContactsError.None != error)
+                {
+                    Log.Error(Globals.LogTag, "Get Long Failed with error " + error);
+                    throw ContactsErrorFactory.CheckAndCreateException(error);
+                }
+            }
+            else
+            {
+                Log.Error(Globals.LogTag, "Not Supported Data Type");
+                throw ContactsErrorFactory.CheckAndCreateException((int)ContactsError.NotSupported);
+            }
+        }
+
+        /// <summary>
+        /// Adds a child record to the parent record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="childRecord">The child record to add to parent record</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void AddChildRecord(uint propertyId, ContactsRecord childRecord)
+        {
+            int error = Interop.Record.AddChildRecord(_recordHandle, propertyId, childRecord._recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "AddChildRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            childRecord._disposedValue = true;
+        }
+
+        /// <summary>
+        /// Removes a child record from the parent record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="childRecord">The child record to remove from parent record</param>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public void RemoveChildRecord(uint propertyId, ContactsRecord childRecord)
+        {
+            int error = Interop.Record.RemoveChildRecord(_recordHandle, propertyId, childRecord._recordHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "RemoveChildRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            childRecord._disposedValue = false;
+        }
+
+        /// <summary>
+        /// Gets the number of child records of a parent record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>The number of child records corresponding to property ID</returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public int GetChildRecordCount(uint propertyId)
+        {
+            int count = 0;
+            int error = Interop.Record.GetChildRecordCount(_recordHandle, propertyId, out count);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetChildRecordCount Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return count;
+        }
+
+        /// <summary>
+        /// Gets a child record from the parent record
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="index">The index of child record</param>
+        /// <returns>The record </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public ContactsRecord GetChildRecord(uint propertyId, int index)
+        {
+            IntPtr handle;
+
+            int error = Interop.Record.GetChildRecordAtP(_recordHandle, propertyId, index, out handle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "GetChildRecord Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            return new ContactsRecord(handle, true);
+        }
+
+        /// <summary>
+        /// Clones a child record list corresponding to property ID
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// The record list
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        public ContactsList CloneChildRecordList(uint propertyId)
+        {
+            IntPtr listHandle;
+
+            int error = Interop.Record.CloneChildRecordList(_recordHandle, propertyId, out listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "CloneChildRecordList Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+            ContactsList list = new ContactsList(listHandle);
+            return list;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs
new file mode 100644 (file)
index 0000000..c02cc4f
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using static Interop.Contacts;
+
+namespace Tizen.Pims.Contacts
+{
+    using static ContactsViews;
+    /// <summary>
+    /// A class for parsing and making vCards.
+    /// </summary>
+    /// <remarks>
+    /// It's based on the vCard v3.0 specification
+    /// </remarks>
+    public static class ContactsVcard
+    {
+        public delegate bool ParseDelegate(ContactsRecord record);
+
+        /// <summary>
+        /// Retrieves the vCard stream from a contacts record.
+        /// </summary>
+        /// <param name="record">The contacts record</param>
+        /// <returns>
+        /// The vCard stream.
+        /// </returns>
+        /// <privilege>http://tizen.org/privilege/contact.read</privilege>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static string Compose(ContactsRecord record)
+        {
+            int error = 0;
+            string stream = null;
+
+            if (record.Uri.Equals(Person.Uri))
+            {
+                error = Interop.Vcard.ContactsVcardMakeFromPerson(record._recordHandle, out stream);
+            }
+            else if (record.Uri.Equals(Contact.Uri))
+            {
+                error = Interop.Vcard.ContactsVcardMakeFromContact(record._recordHandle, out stream);
+            }
+            else if (record.Uri.Equals(MyProfile.Uri))
+            {
+                error = Interop.Vcard.ContactsVcardMakeFromMyProfile(record._recordHandle, out stream);
+            }
+            else
+            {
+                throw new ArgumentException("Invalid Parameters Provided");
+            }
+
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Compose Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            return stream;
+        }
+
+        /// <summary>
+        /// Retrieves all contacts with a contacts list from a vCard stream
+        /// </summary>
+        /// <param name="stream">The vCard stream</param>
+        /// <returns>
+        /// The contacts list
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static ContactsList Parse(string stream)
+        {
+            IntPtr listHandle;
+
+            int error = Interop.Vcard.ContactsVcardParseToContacts(stream, out listHandle);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "Parse Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+
+            return new ContactsList(listHandle);
+        }
+
+        /// <summary>
+        /// Retrieves all contacts with a record from a vCard file.
+        /// </summary>
+        /// <param name="path">The file path of vCard stream file</param>
+        /// <param name="callback">The callback function to invoke</param>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        public static void ParseForEach(string path, ParseDelegate callback)
+        {
+            Interop.Vcard.ContactsVcardParseCallback cb = (IntPtr handle, IntPtr data) =>
+            {
+                return callback(new ContactsRecord(handle, true));
+            };
+
+            int error = Interop.Vcard.ContactsVcardParseToContactForeach(path, cb, IntPtr.Zero);
+            if ((int)ContactsError.None != error)
+            {
+                Log.Error(Globals.LogTag, "ParseForEach Failed with error " + error);
+                throw ContactsErrorFactory.CheckAndCreateException(error);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs
new file mode 100644 (file)
index 0000000..82ed5fe
--- /dev/null
@@ -0,0 +1,3236 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// This class provides information about views with properties.
+    /// </summary>
+    /// <remarks>
+    ///  Views are provided to access and handle entities. A view is a structure, which has property elements.
+    ///  A view is almost the same as a database "VIEW", which limits access and guarantees performance.
+    ///  A "record" represents a single row of the views.
+    ///  A record can have basic properties of five types: integer, string, boolean, long, double.
+    /// </remarks>
+    public static class ContactsViews
+    {
+        private const uint PropertyAddressBook = 0x00100000;
+        private const uint PropertyGroup = 0x00200000;
+        private const uint PropertyPerson = 0x00300000;
+        private const uint PropertyData = 0x00600000;
+        private const uint PropertySpeedDial =  0x00700000;
+        private const uint PropertyPhonelog = 0x00800000;
+        private const uint PropertyUpdateInfo = 0x00900000;
+        private const uint PropertyPhonelogStat = 0x00B00000;
+
+        private const uint PropertyContact = 0x01000000;
+        private const uint PropertyName = 0x01100000;
+        private const uint PropertyNumber = 0x01200000;
+        private const uint PropertyEmail = 0x01300000;
+        private const uint PropertyAddress = 0x01400000;
+        private const uint PropertyUrl = 0x01500000;
+        private const uint PropertyEvent = 0x01600000;
+        private const uint PropertyGroupRelation = 0x01700000;
+        private const uint PropertyRelationship = 0x01800000;
+        private const uint PropertyCompany = 0x01900000;
+        private const uint PropertyNickname = 0x01A00000;
+        private const uint PropertyMessenger = 0x01B00000;
+        private const uint PropertyNote = 0x01C00000;
+        private const uint PropertyProfile = 0x01D00000;
+        private const uint PropertyImage = 0x01E00000;
+        private const uint PropertyExtension = 0x01F00000;
+        private const uint PropertyMyProfile = 0x02000000;
+        private const uint PropertyActivityPhoto = 0x02100000;
+        private const uint PropertySip = 0x02200000;
+
+       /* data_type mask 0x000FF000 */
+        private const uint DataTypeBool = 0x00010000;
+        private const uint DataTypeInt = 0x00020000;
+        private const uint DataTypeLong = 0x00030000;
+        private const uint DataTypeString = 0x00040000;
+        private const uint DataTypeDouble = 0x00050000;
+        private const uint DataTypeRecord = 0x00060000;
+
+        private const uint ReadOnly = 0x00001000;
+
+        private enum PropertyIds : uint
+        {
+            /* addressbook */
+            AddressbookId = (PropertyAddressBook | DataTypeInt | ReadOnly),
+            AddressbookAccountId = (PropertyAddressBook | DataTypeInt) + 1,
+            AddressbookName = (PropertyAddressBook | DataTypeString) + 2,
+            AddressbookMode = (PropertyAddressBook | DataTypeInt) + 3,
+
+            /* group */
+            GroupId = (PropertyGroup | DataTypeInt | ReadOnly),
+            GroupAddressbookId = (PropertyGroup | DataTypeInt) + 1,
+            GroupName = (PropertyGroup | DataTypeString) + 2,
+            GroupRingtone = (PropertyGroup | DataTypeString) + 3,
+            GroupImage = (PropertyGroup | DataTypeString) + 4,
+            GroupVibration = (PropertyGroup | DataTypeString) + 5,
+            GroupExtraData = (PropertyGroup | DataTypeString) + 6,
+            GroupIsReadOnly = (PropertyGroup | DataTypeBool) + 7,
+            GroupMessageAlert = (PropertyGroup | DataTypeString) + 8,
+
+            /* person */
+            PersonId = (PropertyPerson | DataTypeInt | ReadOnly),
+            PersonDisplayName = (PropertyPerson | DataTypeString | ReadOnly) + 1,
+            PersonDisplayContactId = (PropertyPerson | DataTypeInt) + 2,
+            PersonRingtone = (PropertyPerson | DataTypeString) + 3,
+            PersonThumbnail = (PropertyPerson | DataTypeString | ReadOnly) + 4,
+            PersonVibration = (PropertyPerson | DataTypeString) + 5,
+            PersonIsFavorite = (PropertyPerson | DataTypeBool) + 6,
+            PersonFavoritePriority = (PropertyPerson | DataTypeDouble | ReadOnly) + 7,
+            PersonLinkCount = (PropertyPerson | DataTypeInt | ReadOnly) + 8,
+            PersonAddressbookIds = (PropertyPerson | DataTypeString | ReadOnly) + 9,
+            PersonHasPhoneNumber = (PropertyPerson | DataTypeBool | ReadOnly) + 10,
+            PersonHasEmail = (PropertyPerson | DataTypeBool | ReadOnly) + 11,
+            PersonDisplayNameIndex = (PropertyPerson | DataTypeString | ReadOnly) + 12,
+            PersonStatus = (PropertyPerson | DataTypeString | ReadOnly) + 13,
+            PersonMessageAlert = (PropertyPerson | DataTypeString) + 14,
+            PersonSnippetType = (PropertyPerson | DataTypeInt | ReadOnly) + 15,
+            PersonSnippetString = (PropertyPerson | DataTypeString | ReadOnly) + 16,
+
+            /* person-stat */
+            PersonUsageType = (PropertyPerson | DataTypeInt) + 100,
+            PersonTimesUsed = (PropertyPerson | DataTypeInt) + 101,
+
+            /* simple contact : read only */
+            /* contact */
+            ContactId = (PropertyContact | DataTypeInt | ReadOnly),
+            ContactDisplayName = (PropertyContact | DataTypeString | ReadOnly) + 1,
+            ContactDisplaySourceDataId = (PropertyContact | DataTypeInt | ReadOnly) + 2,
+            ContactAddressbookId = (PropertyContact | DataTypeInt) + 3,
+            ContactRingtone = (PropertyContact | DataTypeString) + 4,
+            ContactImage = (PropertyContact | DataTypeRecord) + 5,
+            ContactThumbnail = (PropertyContact | DataTypeString | ReadOnly) + 6,
+            ContactIsFavorite = (PropertyContact | DataTypeBool) + 7,
+            ContactHasPhoneNumber = (PropertyContact | DataTypeBool | ReadOnly) + 8,
+            ContactHasEmail = (PropertyContact | DataTypeBool | ReadOnly) + 9,
+            ContactPersonId = (PropertyContact | DataTypeInt) + 10,
+            ContactUid = (PropertyContact | DataTypeString) + 11,
+            ContactVibration = (PropertyContact | DataTypeString) + 12,
+            ContactChangedTime = (PropertyContact | DataTypeInt | ReadOnly) + 13,
+            ContactName = (PropertyContact | DataTypeRecord) + 14,
+            ContactCompany = (PropertyContact | DataTypeRecord) + 15,
+            ContactNote = (PropertyContact | DataTypeRecord) + 16,
+            ContactNumber = (PropertyContact | DataTypeRecord) + 17,
+            ContactEmail = (PropertyContact | DataTypeRecord) + 18,
+            ContactEvent = (PropertyContact | DataTypeRecord) + 19,
+            ContactMessenger = (PropertyContact | DataTypeRecord) + 20,
+            ContactAddress = (PropertyContact | DataTypeRecord) + 21,
+            ContactUrl = (PropertyContact | DataTypeRecord) + 22,
+            ContactNickname = (PropertyContact | DataTypeRecord) + 23,
+            ContactProfile = (PropertyContact | DataTypeRecord) + 24,
+            ContactRelationship = (PropertyContact | DataTypeRecord) + 25,
+            ContactGroupRelation = (PropertyContact | DataTypeRecord) + 26,
+            ContactExtension = (PropertyContact | DataTypeRecord) + 27,
+            ContactLinkMode = (PropertyContact | DataTypeInt) + 28,
+            ContactMessageAlert = (PropertyContact | DataTypeString) + 29,
+            ContactSip = (PropertyContact | DataTypeRecord) + 30,
+
+            /* my_profile */
+            MyProfileId = (PropertyMyProfile | DataTypeInt | ReadOnly),
+            MyProfileDisplayName = (PropertyMyProfile | DataTypeString | ReadOnly) + 1,
+            MyProfileAddressbookId = (PropertyMyProfile | DataTypeInt) + 2,
+            MyProfileImage = (PropertyMyProfile | DataTypeRecord) + 3,
+            MyProfileThumbnail = (PropertyMyProfile | DataTypeString | ReadOnly) + 4,
+            MyProfileUid = (PropertyMyProfile | DataTypeString) + 5,
+            MyProfileChangedTime = (PropertyMyProfile | DataTypeInt) + 6,
+            MyProfileName = (PropertyMyProfile | DataTypeRecord) + 7,
+            MyProfileCompany = (PropertyMyProfile | DataTypeRecord) + 8,
+            MyProfileNote = (PropertyMyProfile | DataTypeRecord) + 9,
+            MyProfileNumber = (PropertyMyProfile | DataTypeRecord) + 10,
+            MyProfileEmail = (PropertyMyProfile | DataTypeRecord) + 11,
+            MyProfileEvent = (PropertyMyProfile | DataTypeRecord) + 12,
+            MyProfileMessenger = (PropertyMyProfile | DataTypeRecord) + 13,
+            MyProfileAddress = (PropertyMyProfile | DataTypeRecord) + 14,
+            MyProfileUrl = (PropertyMyProfile | DataTypeRecord) + 15,
+            MyProfileNickname = (PropertyMyProfile | DataTypeRecord) + 16,
+            MyProfileProfile = (PropertyMyProfile | DataTypeRecord) + 17,
+            MyProfileRelationship = (PropertyMyProfile | DataTypeRecord) + 18,
+            MyProfileExtension = (PropertyMyProfile | DataTypeRecord) + 19,
+            MyProfileSip = (PropertyMyProfile | DataTypeRecord) + 20,
+
+            /* data */
+            DataId = (PropertyData | DataTypeInt),
+            DataContactId = (PropertyData | DataTypeInt) + 1,
+            DataType = (PropertyData | DataTypeInt) + 2,
+            DataIsPrimaryDefault = (PropertyData | DataTypeBool) + 3,
+            DataIsDefault = (PropertyData | DataTypeBool) + 4,
+            DataData1 = (PropertyData | DataTypeInt) + 5,
+            DataData2 = (PropertyData | DataTypeString) + 6,
+            DataData3 = (PropertyData | DataTypeString) + 7,
+            DataData4 = (PropertyData | DataTypeString) + 8,
+            DataData5 = (PropertyData | DataTypeString) + 9,
+            DataData6 = (PropertyData | DataTypeString) + 10,
+            DataData7 = (PropertyData | DataTypeString) + 11,
+            DataData8 = (PropertyData | DataTypeString) + 12,
+            DataData9 = (PropertyData | DataTypeString) + 13,
+            DataData10 = (PropertyData | DataTypeString) + 14,
+
+            /* contact_name */
+            NameId = (PropertyName | DataTypeInt | ReadOnly),
+            NameContactId = (PropertyName | DataTypeInt) + 1,
+            NameFirst = (PropertyName | DataTypeString) + 2,
+            NameLast = (PropertyName | DataTypeString) + 3,
+            NameAddition = (PropertyName | DataTypeString) + 4,
+            NameSuffix = (PropertyName | DataTypeString) + 5,
+            NamePrefix = (PropertyName | DataTypeString) + 6,
+            NamePhoneticFirst = (PropertyName | DataTypeString) + 7,
+            NamePhoneticMiddle = (PropertyName | DataTypeString) + 8,
+            NamePhoneticLast = (PropertyName | DataTypeString) + 9,
+
+            /* contact_number */
+            NumberId = (PropertyNumber | DataTypeInt | ReadOnly),
+            NumberContactId = (PropertyNumber | DataTypeInt) + 1,
+            NumberType = (PropertyNumber | DataTypeInt) + 2,
+            NumberLabel = (PropertyNumber | DataTypeString) + 3,
+            NumberIsDefault = (PropertyNumber | DataTypeBool) + 4,
+            NumberNumber = (PropertyNumber | DataTypeString) + 5,
+            NumberNumberFilter = (PropertyNumber | DataTypeString) + 6,
+            NumberNormalizedNumber = (PropertyNumber | DataTypeString | ReadOnly) + 7,
+            NumberCleanedNumber = (PropertyNumber | DataTypeString | ReadOnly) + 8,
+
+            /* contact_email */
+            EmailId = (PropertyEmail | DataTypeInt | ReadOnly),
+            EmailContactId = (PropertyEmail | DataTypeInt) + 1,
+            EmailType = (PropertyEmail | DataTypeInt) + 2,
+            EmailLabel = (PropertyEmail | DataTypeString) + 3,
+            EmailIsDefault = (PropertyEmail | DataTypeBool) + 4,
+            EmailEmail = (PropertyEmail | DataTypeString) + 5,
+
+            /* contact_address */
+            AddressId = (PropertyAddress | DataTypeInt | ReadOnly),
+            AddressContactId = (PropertyAddress | DataTypeInt) + 1,
+            AddressType = (PropertyAddress | DataTypeInt) + 2,
+            AddressLabel = (PropertyAddress | DataTypeString) + 3,
+            AddressPostbox = (PropertyAddress | DataTypeString) + 4,
+            AddressPostalCode = (PropertyAddress | DataTypeString) + 5,
+            AddressRegion = (PropertyAddress | DataTypeString) + 6,
+            AddressLocality = (PropertyAddress | DataTypeString) + 7,
+            AddressStreet = (PropertyAddress | DataTypeString) + 8,
+            AddressCountry = (PropertyAddress | DataTypeString) + 9,
+            AddressExtended = (PropertyAddress | DataTypeString) + 10,
+            AddressIsDefault = (PropertyAddress | DataTypeBool) + 11,
+
+            /* contact_url */
+            UrlId = (PropertyUrl | DataTypeInt | ReadOnly),
+            UrlContactId = (PropertyUrl | DataTypeInt) + 1,
+            UrlType = (PropertyUrl | DataTypeInt) + 2,
+            UrlLabel = (PropertyUrl | DataTypeString) + 3,
+            UrlUrl = (PropertyUrl | DataTypeString) + 4,
+
+            /* contact_event */
+            EventId = (PropertyEvent | DataTypeInt | ReadOnly),
+            EventContactId = (PropertyEvent | DataTypeInt) + 1,
+            EventType = (PropertyEvent | DataTypeInt) + 2,
+            EventLabel = (PropertyEvent | DataTypeString) + 3,
+            EventDate = (PropertyEvent | DataTypeInt) + 4,
+            EventCalendarType = (PropertyEvent | DataTypeInt) + 5,
+            EventIsLeapMonth = (PropertyEvent | DataTypeBool) + 6,
+
+            /* contact_grouprelation */
+            GroupRelationId = (PropertyGroupRelation | DataTypeInt | ReadOnly),
+            GroupRelationGroupId = (PropertyGroupRelation | DataTypeInt) + 1,
+            GroupRelationContactId = (PropertyGroupRelation | DataTypeInt) + 2,
+            GroupRelationGroupName = (PropertyGroupRelation | DataTypeString) + 3,
+
+            /* contact_relationship */
+            RelationshipId = (PropertyRelationship | DataTypeInt | ReadOnly),
+            RelationshipContactId = (PropertyRelationship | DataTypeInt) + 1,
+            RelationshipType = (PropertyRelationship | DataTypeInt) + 2,
+            RelationshipLabel = (PropertyRelationship | DataTypeString) + 3,
+            RelationshipName = (PropertyRelationship | DataTypeString) + 4,
+
+            /* contact_image */
+            ImageId = (PropertyImage | DataTypeInt | ReadOnly),
+            ImageContactId = (PropertyImage | DataTypeInt) + 1,
+            ImageType = (PropertyImage | DataTypeInt) + 2,
+            ImageLabel = (PropertyImage | DataTypeString) + 3,
+            ImagePath = (PropertyImage | DataTypeString) + 4,
+            ImageIsDefault = (PropertyImage | DataTypeBool) + 5,
+
+            /* contact_company */
+            CompanyId = (PropertyCompany | DataTypeInt | ReadOnly),
+            CompanyContactId = (PropertyCompany | DataTypeInt) + 1,
+            CompanyType = (PropertyCompany | DataTypeInt) + 2,
+            CompanyLabel = (PropertyCompany | DataTypeString) + 3,
+            CompanyName = (PropertyCompany | DataTypeString) + 4,
+            CompanyDepartment = (PropertyCompany | DataTypeString) + 5,
+            CompanyJobTitle = (PropertyCompany | DataTypeString) + 6,
+            CompanyRole = (PropertyCompany | DataTypeString) + 7,
+            CompanyAssistantName = (PropertyCompany | DataTypeString) + 8,
+            CompanyLogo = (PropertyCompany | DataTypeString) + 9,
+            CompanyLocation = (PropertyCompany | DataTypeString) + 10,
+            CompanyDescription = (PropertyCompany | DataTypeString) + 11,
+            CompanyPhoneticName = (PropertyCompany | DataTypeString) + 12,
+
+            /* contact_nickname */
+            NicknameId = (PropertyNickname | DataTypeInt | ReadOnly),
+            NicknameContactId = (PropertyNickname | DataTypeInt) + 1,
+            NicknameName = (PropertyNickname | DataTypeString) + 2,
+
+            /* contact_messenger */
+            MessengerId = (PropertyMessenger | DataTypeInt | ReadOnly),
+            MessengerContactId = (PropertyMessenger | DataTypeInt) + 1,
+            MessengerType = (PropertyMessenger | DataTypeInt) + 2,
+            MessengerLabel = (PropertyMessenger | DataTypeString) + 3,
+            MessengerIMId = (PropertyMessenger | DataTypeString) + 4,
+
+            /* contact_note */
+            NoteId = (PropertyNote | DataTypeInt | ReadOnly),
+            NoteContactId = (PropertyNote | DataTypeInt) + 1,
+            NoteNote = (PropertyNote | DataTypeString) + 2,
+
+            /* contact sip */
+            SipId = (PropertySip | DataTypeInt | ReadOnly),
+            SipContactId = (PropertySip | DataTypeInt) + 1,
+            SipAddress = (PropertySip | DataTypeString) + 2,
+            SipType = (PropertySip | DataTypeInt) + 3,
+            SipLabel = (PropertySip | DataTypeString) + 4,
+
+            /* contact_profile */
+            ProfileId = (PropertyProfile | DataTypeInt | ReadOnly),
+            ProfileContactId = (PropertyProfile | DataTypeInt) + 1,
+            ProfileUid = (PropertyProfile | DataTypeString) + 2,
+            ProfileText = (PropertyProfile | DataTypeString) + 3,
+            ProfileOrder = (PropertyProfile | DataTypeInt) + 4,
+            ProfileServiceOperation = (PropertyProfile | DataTypeString) + 5,
+            ProfileMIME = (PropertyProfile | DataTypeString) + 6,
+            ProfileAppId = (PropertyProfile | DataTypeString) + 7,
+            ProfileUri = (PropertyProfile | DataTypeString) + 8,
+            ProfileCategory = (PropertyProfile | DataTypeString) + 9,
+            ProfileExtraData = (PropertyProfile | DataTypeString) + 10,
+
+            ExtensionId = (PropertyExtension | DataTypeInt | ReadOnly),
+            ExtensionContactId = (PropertyExtension | DataTypeInt) +1,
+            ExtensionData1 = (PropertyExtension | DataTypeInt) +2,
+            ExtensionData2 = (PropertyExtension | DataTypeString) +3,
+            ExtensionData3 = (PropertyExtension | DataTypeString) +4,
+            ExtensionData4 = (PropertyExtension | DataTypeString) +5,
+            ExtensionData5 = (PropertyExtension | DataTypeString) +6,
+            ExtensionData6 = (PropertyExtension | DataTypeString) +7,
+            ExtensionData7 = (PropertyExtension | DataTypeString) +8,
+            ExtensionData8 = (PropertyExtension | DataTypeString) +9,
+            ExtensionData9 = (PropertyExtension | DataTypeString) +10,
+            ExtensionData10 = (PropertyExtension | DataTypeString) +11,
+            ExtensionData11 = (PropertyExtension | DataTypeString) +12,
+            ExtensionData12 = (PropertyExtension | DataTypeString) +13,
+
+            /* speeddial */
+            SpeedDialDialNumber = (PropertySpeedDial | DataTypeInt),
+            SpeedDialNumberId = (PropertySpeedDial | DataTypeInt) +1,
+            SpeedDialNumber = (PropertySpeedDial | DataTypeString | ReadOnly) +2,
+            SpeedDialNumberLabel = (PropertySpeedDial | DataTypeString | ReadOnly) +3,
+            SpeedDialNumberType = (PropertySpeedDial | DataTypeInt | ReadOnly) +4,
+            SpeedDialPersonId = (PropertySpeedDial | DataTypeInt | ReadOnly) +5,
+            SpeedDialDisplayName = (PropertySpeedDial | DataTypeString | ReadOnly) +6,
+            SpeedDialThumbnail = (PropertySpeedDial | DataTypeString | ReadOnly) +7,
+            SpeedDialNormalizedNumber = (PropertySpeedDial | DataTypeString | ReadOnly) +8,
+            SpeedDialCleanedNumber = (PropertySpeedDial | DataTypeString | ReadOnly) +9,
+            SpeedDialNumberFilter = (PropertySpeedDial | DataTypeString | ReadOnly) +10,
+
+            /* phonelog */
+            PhonelogId = (PropertyPhonelog | DataTypeInt | ReadOnly),
+            PhonelogPersonId = (PropertyPhonelog | DataTypeInt) + 1,
+            PhonelogAddress = (PropertyPhonelog | DataTypeString) + 2,
+            PhonelogLogTime = (PropertyPhonelog | DataTypeInt) + 3,
+            PhonelogLogType = (PropertyPhonelog | DataTypeInt) + 4,
+            PhonelogExtraData1 = (PropertyPhonelog | DataTypeInt) + 5,   /* duration, message_id, email_id */
+            PhonelogExtraData2 = (PropertyPhonelog | DataTypeString) + 6,   /* short message, subject */
+            PhonelogNormalizedAddress = (PropertyPhonelog | DataTypeString | ReadOnly) + 7,   /* for search by calllog number */
+            PhonelogCleanedAddress = (PropertyPhonelog | DataTypeString | ReadOnly) + 8,   /* for search by calllog number */
+            PhonelogAddressFilter = (PropertyPhonelog | DataTypeString | ReadOnly) + 9,   /* for search by calllog number */
+            PhonelogSIMSlotNo = (PropertyPhonelog | DataTypeInt) + 10,
+
+            /* phonelog_stat */
+            PhonelogStatLogCount = (PropertyPhonelogStat | DataTypeInt | ReadOnly),
+            PhonelogStatLogType = (PropertyPhonelogStat | DataTypeInt | ReadOnly) + 1,
+            PhonelogStatSIMSlotNo = (PropertyPhonelogStat | DataTypeInt | ReadOnly) + 2,
+
+            /* updated_info : read only */
+            UpdateInfoId = (PropertyUpdateInfo | DataTypeInt),
+            UpdateInfoAddressbookId = (PropertyUpdateInfo | DataTypeInt) +1,
+            UpdateInfoType = (PropertyUpdateInfo | DataTypeInt) +2,
+            UpdateInfoVersion = (PropertyUpdateInfo | DataTypeInt) +3,
+            UpdateInfoImageChanged = (PropertyUpdateInfo | DataTypeBool) +4,
+            UpdateInfoLastChangedType = (PropertyUpdateInfo | DataTypeInt)+5,   /* now, it is used for _contacts_my_profile_updated_info */
+        }
+
+        /// <summary>
+        /// Enumeration for contact change state.
+        /// </summary>
+        public enum ChangeTypes
+        {
+            /// <summary>
+            /// Inserted
+            /// </summary>
+            Inserted,
+            /// <summary>
+            /// Updated
+            /// </summary>
+            Updated,
+            /// <summary>
+            /// Deleted
+            /// </summary>
+            Deleted,
+        }
+
+        internal const uint AverageSizeOfRecord = 120;  /* average size of person record */
+
+        /// <summary>
+        /// Describes properies of a Address book record.
+        /// </summary>
+        public static class Addressbook
+        {
+            /// <summary>
+            /// Identifier of this contacts addressbook view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.addressbook";
+            /// <summary>
+            /// integer, read only,  DB record ID of the addressbook
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.AddressbookId;
+            /// <summary>
+            /// integer, read/write once, Account ID that the addressbook belongs to
+            /// </summary>
+            public const uint AccountId = (uint)PropertyIds.AddressbookAccountId;
+            /// <summary>
+            /// string, read/write, It cannot be NULL. Duplicate names are not allowed.
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.AddressbookName;
+            /// <summary>
+            /// integer, read/write, Addressbook mode, refer to the Modes
+            /// </summary>
+            public const uint Mode = (uint)PropertyIds.AddressbookMode;
+
+            /// <summary>
+            /// Enumeration for Address book mode.
+            /// </summary>
+            public enum Modes
+            {
+                /// <summary>
+                /// All module can read and write contacts of this address_book
+                /// </summary>
+                None,
+                /// <summary>
+                /// All module can only read contacts of this address_book
+                /// </summary>
+                ReadOnly,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Group record.
+        /// </summary>
+        public static class Group
+        {
+            /// <summary>
+            /// Identifier of this contacts group view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.group";
+            /// <summary>
+            /// DB record ID of the group
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.GroupId;
+            /// <summary>
+            /// Addressbook ID that the group belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.GroupAddressbookId;
+            /// <summary>
+            /// Group name
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.GroupName;
+            /// <summary>
+            /// Ringtone path of the group
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.GroupRingtone;
+            /// <summary>
+            /// Image path of the group
+            /// </summary>
+            public const uint ImagePath = (uint)PropertyIds.GroupImage;
+            /// <summary>
+            /// Vibration path of the group
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.GroupVibration;
+            /// <summary>
+            /// Extra data for default group name
+            /// </summary>
+            public const uint ExtraData = (uint)PropertyIds.GroupExtraData;
+            /// <summary>
+            /// The group is read only or not
+            /// </summary>
+            public const uint IsReadOnly = (uint)PropertyIds.GroupIsReadOnly;
+            /// <summary>
+            /// Message alert path of the group
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.GroupMessageAlert;
+        }
+
+        /// <summary>
+        /// Describes properies of a Person record.
+        /// </summary>
+        public static class Person
+        {
+            /// <summary>
+            /// Identifier of this contacts person view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// Status of social account
+            /// </summary>
+            public const uint Status = (uint)PropertyIds.PersonStatus;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The priority of favorite contacts. it can be used as sorting key
+            /// </summary>
+            public const uint FavoritePriority = (uint)PropertyIds.PersonFavoritePriority;
+            /// <summary>
+            /// Link count of contact records (projection)
+            /// </summary>
+            public const uint LinkCount = (uint)PropertyIds.PersonLinkCount;
+            /// <summary>
+            /// Addressbook IDs that the person belongs to (projection)
+            /// </summary>
+            public const uint AddressbookIds = (uint)PropertyIds.PersonAddressbookIds;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// kerword matched data type
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        }
+
+        /// <summary>
+        /// Describes properies of a Contact record.
+        /// </summary>
+        public static class Contact
+        {
+            /// <summary>
+            /// Identifier of this contact view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.contact";
+            /// <summary>
+            /// DB record ID of the contact
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Display name of the contact
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.ContactDisplayName;
+            /// <summary>
+            /// The source type of display name, refer to the DisplayNameSourceTypes
+            /// </summary>
+            public const uint DisplaySourceType = (uint)PropertyIds.ContactDisplaySourceDataId;
+            /// <summary>
+            /// Addressbook ID that the contact belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Ringtone path of the contact
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.ContactRingtone;
+            /// <summary>
+            /// Image thumbnail path of the contact
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.ContactThumbnail;
+            /// <summary>
+            /// The contact is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.ContactIsFavorite;
+            /// <summary>
+            /// The contact has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.ContactHasPhoneNumber;
+            /// <summary>
+            /// The contact has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.ContactHasEmail;
+            /// <summary>
+            /// Person ID that the contact belongs to. If set when inserting, a contact will be linked to person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.ContactPersonId;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid = (uint)PropertyIds.ContactUid;
+            /// <summary>
+            /// Vibration path of the contact
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.ContactVibration;
+            /// <summary>
+            /// Message alert path of the contact
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.ContactMessageAlert;
+            /// <summary>
+            /// Last changed contact time
+            /// </summary>
+            public const uint ChangedTime = (uint)PropertyIds.ContactChangedTime;
+            /// <summary>
+            /// The link mode, refer to the LinkModes. If the person_id was set, this value will be ignored
+            /// </summary>
+            public const uint LinkMode = (uint)PropertyIds.ContactLinkMode;
+            /// <summary>
+            /// Name child record (single)
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.ContactName;
+            /// <summary>
+            /// Company child record (multiple)
+            /// </summary>
+            public const uint Company = (uint)PropertyIds.ContactCompany;
+            /// <summary>
+            /// Note child record (multiple)
+            /// </summary>
+            public const uint Note = (uint)PropertyIds.ContactNote;
+            /// <summary>
+            /// Number child record (multiple)
+            /// </summary>
+            public const uint Number = (uint)PropertyIds.ContactNumber;
+            /// <summary>
+            /// Email child record (multiple)
+            /// </summary>
+            public const uint Email = (uint)PropertyIds.ContactEmail;
+            /// <summary>
+            /// Event child record (multiple)
+            /// </summary>
+            public const uint Event = (uint)PropertyIds.ContactEvent;
+            /// <summary>
+            /// Messenger child record (multiple)
+            /// </summary>
+            public const uint Messenger = (uint)PropertyIds.ContactMessenger;
+            /// <summary>
+            /// Address child record (multiple)
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.ContactAddress;
+            /// <summary>
+            /// Url child record (multiple)
+            /// </summary>
+            public const uint Url = (uint)PropertyIds.ContactUrl;
+            /// <summary>
+            /// Nickname child record (multiple)
+            /// </summary>
+            public const uint Nickname = (uint)PropertyIds.ContactNickname;
+            /// <summary>
+            /// Profile child record (multiple)
+            /// </summary>
+            public const uint Profile = (uint)PropertyIds.ContactProfile;
+            /// <summary>
+            /// Relationship child record (multiple)
+            /// </summary>
+            public const uint Relationship = (uint)PropertyIds.ContactRelationship;
+            /// <summary>
+            /// Image child record (multiple)
+            /// </summary>
+            public const uint Image = (uint)PropertyIds.ContactImage;
+            /// <summary>
+            /// GroupRelation child record (multiple)
+            /// </summary>
+            public const uint GroupRelation = (uint)PropertyIds.ContactGroupRelation;
+            /// <summary>
+            /// Extension child record (multiple)
+            /// </summary>
+            public const uint Extension = (uint)PropertyIds.ContactExtension;
+            /// <summary>
+            /// Sip child record (multiple)
+            /// </summary>
+            public const uint Sip = (uint)PropertyIds.ContactSip;
+
+            /// <summary>
+            /// Enumeration for link mode when inserting contact.
+            /// </summary>
+            public enum LinkModes
+            {
+                /// <summary>
+                /// Auto link immediately
+                /// </summary>
+                Auto,
+                /// <summary>
+                /// Do not auto link when the contact is inserted
+                /// </summary>
+                None
+            }
+
+            /// <summary>
+            /// Enumeration for Contact display name source type.
+            /// </summary>
+            public enum DisplayNameSourceTypes
+            {
+                /// <summary>
+                /// Invalid source of display name
+                /// </summary>
+                Invalid,
+                /// <summary>
+                /// Produced display name from email record
+                /// </summary>
+                Email,
+                /// <summary>
+                /// Produced display name from number record
+                /// </summary>
+                Number,
+                /// <summary>
+                /// Produced display name from nickname record
+                /// </summary>
+                Nickname,
+                /// <summary>
+                /// Produced display name from company record
+                /// </summary>
+                Company,
+                /// <summary>
+                /// Produced display name from name record
+                /// </summary>
+                Name,
+            }
+
+            /// <summary>
+            /// Enumeration for contacts data type.
+            /// </summary>
+            public enum DataTypes
+            {
+                Name = 1,
+                Address = 2,
+                Messenger = 3,
+                Url = 4,
+                Event = 5,
+                Company = 6,
+                Nickname = 7,
+                Number = 8,
+                Email = 9,
+                Profile = 10,
+                Relationsip = 11,
+                Note = 12,
+                Image = 13,
+                Sip = 14,
+                Extension = 100
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Simple contact record.
+        /// </summary>
+        public static class SimpleContact
+        {
+            /// <summary>
+            /// Identifier of this simple contact view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.simple_contact";
+            /// <summary>
+            /// DB record ID of the contact
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Display name of the contact
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.ContactDisplayName;
+            /// <summary>
+            /// The source type of display name, refer to the Contact.DisplayNameSourceTypes
+            /// </summary>
+            public const uint DisplaySourceType = (uint)PropertyIds.ContactDisplaySourceDataId;
+            /// <summary>
+            /// Addressbook that the contact belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Ringtone path of the contact
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.ContactRingtone;
+            /// <summary>
+            /// Image thumbnail path of the contact
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.ContactThumbnail;
+            /// <summary>
+            /// The contact is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.ContactIsFavorite;
+            /// <summary>
+            /// The contact has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.ContactHasPhoneNumber;
+            /// <summary>
+            /// The contact has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.ContactHasEmail;
+            /// <summary>
+            /// Person ID that the contact belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.ContactPersonId;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid = (uint)PropertyIds.ContactUid;
+            /// <summary>
+            /// Vibration path of the contact
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.ContactVibration;
+            /// <summary>
+            /// Message alert path of the contact
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.ContactMessageAlert;
+            /// <summary>
+            /// Last changed contact time
+            /// </summary>
+            public const uint ChangedTime = (uint)PropertyIds.ContactChangedTime;
+        }
+
+        /// <summary>
+        /// Describes properies of a My profile record.
+        /// </summary>
+        public static class MyProfile
+        {
+            /// <summary>
+            /// Identifier of this my profile view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.my_profile";
+            /// <summary>
+            /// DB record ID of the my profile
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.MyProfileId;
+            /// <summary>
+            /// Display name of the profile
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.MyProfileDisplayName;
+            /// <summary>
+            /// Addressbook ID that the profile belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.MyProfileAddressbookId;
+            /// <summary>
+            /// Image thumbnail path of the profile
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.MyProfileThumbnail;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid = (uint)PropertyIds.MyProfileUid;
+            /// <summary>
+            /// Last changed profile time
+            /// </summary>
+            public const uint ChangedTime = (uint)PropertyIds.MyProfileChangedTime;
+            /// <summary>
+            /// Name child record (single)
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.MyProfileName;
+            /// <summary>
+            /// Company child record (multiple)
+            /// </summary>
+            public const uint Company = (uint)PropertyIds.MyProfileCompany;
+            /// <summary>
+            /// Note child record (multiple)
+            /// </summary>
+            public const uint Note = (uint)PropertyIds.MyProfileNote;
+            /// <summary>
+            /// Number child record (multiple)
+            /// </summary>
+            public const uint Number = (uint)PropertyIds.MyProfileNumber;
+            /// <summary>
+            /// Email child record (multiple)
+            /// </summary>
+            public const uint Email = (uint)PropertyIds.MyProfileEmail;
+            /// <summary>
+            /// Event child record (multiple)
+            /// </summary>
+            public const uint Event = (uint)PropertyIds.MyProfileEvent;
+            /// <summary>
+            /// Messenger child record (multiple)
+            /// </summary>
+            public const uint Messenger = (uint)PropertyIds.MyProfileMessenger;
+            /// <summary>
+            /// Address child record (multiple)
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.MyProfileAddress;
+            /// <summary>
+            /// Url child record (multiple)
+            /// </summary>
+            public const uint Url = (uint)PropertyIds.MyProfileUrl;
+            /// <summary>
+            /// Nickname child record (multiple)
+            /// </summary>
+            public const uint Nickname = (uint)PropertyIds.MyProfileNickname;
+            /// <summary>
+            /// Profile child record (multiple)
+            /// </summary>
+            public const uint Profile = (uint)PropertyIds.MyProfileProfile;
+            /// <summary>
+            /// Relationship child record (multiple)
+            /// </summary>
+            public const uint Relationship = (uint)PropertyIds.MyProfileRelationship;
+            /// <summary>
+            /// Image child record (multiple)
+            /// </summary>
+            public const uint Image = (uint)PropertyIds.MyProfileImage;
+            /// <summary>
+            /// Extension child record (multiple)
+            /// </summary>
+            public const uint Extension = (uint)PropertyIds.MyProfileExtension;
+            /// <summary>
+            /// Sip child record (multiple)
+            /// </summary>
+            public const uint Sip = (uint)PropertyIds.MyProfileSip;
+        }
+
+        /// <summary>
+        /// Describes properies of a Name record.
+        /// </summary>
+        public static class Name
+        {
+            /// <summary>
+            /// Identifier of this contacts name view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.name";
+            /// <summary>
+            /// DB record ID of the name
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.NameId;
+            /// <summary>
+            /// Contacts ID that the name record belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.NameContactId;
+            /// <summary>
+            /// First name
+            /// </summary>
+            public const uint First = (uint)PropertyIds.NameFirst;
+            /// <summary>
+            /// Last name
+            /// </summary>
+            public const uint Last = (uint)PropertyIds.NameLast;
+            /// <summary>
+            /// Middle name
+            /// </summary>
+            public const uint Addition = (uint)PropertyIds.NameAddition;
+            /// <summary>
+            /// Suffix
+            /// </summary>
+            public const uint Suffix = (uint)PropertyIds.NameSuffix;
+            /// <summary>
+            /// Prefix
+            /// </summary>
+            public const uint Prefix = (uint)PropertyIds.NamePrefix;
+            /// <summary>
+            /// Pronounce the first name
+            /// </summary>
+            public const uint PhoneticFirst = (uint)PropertyIds.NamePhoneticFirst;
+            /// <summary>
+            /// Pronounce the middle name
+            /// </summary>
+            public const uint PhoneticMiddle = (uint)PropertyIds.NamePhoneticMiddle;
+            /// <summary>
+            /// Pronounce the last name
+            /// </summary>
+            public const uint PhoneticLast = (uint)PropertyIds.NamePhoneticLast;
+        }
+
+        /// <summary>
+        /// Describes properies of a Number record.
+        /// </summary>
+        public static class Number
+        {
+            /// <summary>
+            /// Identifier of this contacts number view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.number";
+            /// <summary>
+            /// DB record ID of the number
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.NumberId;
+            /// <summary>
+            /// Contact ID that the number belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.NumberContactId;
+            /// <summary>
+            /// Number type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.NumberType;
+            /// <summary>
+            /// Custom number type label, when the number type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.NumberLabel;
+            /// <summary>
+            /// The number is default number or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.NumberIsDefault;
+            /// <summary>
+            /// Number
+            /// </summary>
+            public const uint NumberData = (uint)PropertyIds.NumberNumber;
+            /// <summary>
+            /// You can only use this property for search filter.
+            /// </summary>
+            public const uint NormalizedNumber = (uint)PropertyIds.NumberNormalizedNumber;
+            /// <summary>
+            /// You can only use this property for search filter.
+            /// </summary>
+            public const uint CleanedNumber = (uint)PropertyIds.NumberCleanedNumber;
+            /// <summary>
+            /// You can only use this property for search filter.
+            /// </summary>
+            public const uint NumberFilter = (uint)PropertyIds.NumberNumberFilter;
+
+            /// <summary>
+            /// Enumeration for number type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other number type
+                /// </summary>
+                Other = 0,
+                /// <summary>
+                /// Custom number type
+                /// </summary>
+                Custom = 1 << 0,
+                /// <summary>
+                /// A telephone number associated with a residence
+                /// </summary>
+                Home = 1 << 1,
+                /// <summary>
+                /// A telephone number associated with a place of work
+                /// </summary>
+                Work = 1 << 2,
+                /// <summary>
+                /// A voice telephone number
+                /// </summary>
+                Voice = 1 << 3,
+                /// <summary>
+                /// A facsimile telephone number
+                /// </summary>
+                Fax = 1 << 4,
+                /// <summary>
+                /// The telephone number has voice messaging support
+                /// </summary>
+                Message = 1 << 5,
+                /// <summary>
+                /// A cellular telephone number
+                /// </summary>
+                Cell = 1 << 6,
+                /// <summary>
+                /// A paging device telephone number
+                /// </summary>
+                Pager = 1 << 7,
+                /// <summary>
+                /// A bulletin board system telephone number
+                /// </summary>
+                BBS = 1 << 8,
+                /// <summary>
+                /// A MODEM connected telephone number
+                /// </summary>
+                Modem = 1 << 9,
+                /// <summary>
+                /// A car-phone telephone number
+                /// </summary>
+                Car = 1 << 10,
+                /// <summary>
+                /// An ISDN service telephone number
+                /// </summary>
+                ISDN = 1 << 11,
+                /// <summary>
+                /// A video conferencing telephone number
+                /// </summary>
+                Video = 1 << 12,
+                /// <summary>
+                /// A personal communication services telephone number
+                /// </summary>
+                PCS = 1 << 13,
+                /// <summary>
+                /// A company main number
+                /// </summary>
+                Company = 1 << 14,
+                /// <summary>
+                /// A radio phone number
+                /// </summary>
+                Radio = 1 << 15,
+                /// <summary>
+                /// An additional type for main
+                /// </summary>
+                Main = 1 << 29,
+                /// <summary>
+                /// An additional type for assistant
+                /// </summary>
+                Assistant = 1 << 30,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Email record.
+        /// </summary>
+        public static class Email
+        {
+            /// <summary>
+            /// Identifier of this contacts email view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.email";
+            /// <summary>
+            /// DB record ID of the email
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.EmailId;
+            /// <summary>
+            /// Contact ID that the email belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.EmailContactId;
+            /// <summary>
+            /// Email type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.EmailType;
+            /// <summary>
+            /// Custom mail type label, when the email type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.EmailLabel;
+            /// <summary>
+            /// The email is default email or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.EmailIsDefault;
+            /// <summary>
+            /// Email address
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.EmailEmail;
+
+            /// <summary>
+            /// Enumeration for Contact email type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other email type
+                /// </summary>
+                Other = 0,
+                /// <summary>
+                /// Custom email type
+                /// </summary>
+                Custom = 1 << 0,
+                /// <summary>
+                /// An email address associated with a residence
+                /// </summary>
+                Home = 1 << 1,
+                /// <summary>
+                /// An email address associated with a place of work
+                /// </summary>
+                Work = 1 << 2,
+                /// <summary>
+                /// A mobile email address
+                /// </summary>
+                Mobile = 1 << 3,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Address record.
+        /// </summary>
+        public static class Address
+        {
+            /// <summary>
+            /// Identifier of this contacts address view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.address";
+            /// <summary>
+            /// DB record ID of the address
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.AddressId;
+            /// <summary>
+            /// Contact ID that the address belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.AddressContactId;
+            /// <summary>
+            /// Address type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.AddressType;
+            /// <summary>
+            /// Address type label, when the address type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.AddressLabel;
+            /// <summary>
+            /// Post office box
+            /// </summary>
+            public const uint Postbox = (uint)PropertyIds.AddressPostbox;
+            /// <summary>
+            /// Postal code
+            /// </summary>
+            public const uint PostalCode = (uint)PropertyIds.AddressPostalCode;
+            /// <summary>
+            /// Region
+            /// </summary>
+            public const uint Region = (uint)PropertyIds.AddressRegion;
+            /// <summary>
+            /// Locality
+            /// </summary>
+            public const uint Locality = (uint)PropertyIds.AddressLocality;
+            /// <summary>
+            /// Street
+            /// </summary>
+            public const uint Street = (uint)PropertyIds.AddressStreet;
+            /// <summary>
+            /// Country
+            /// </summary>
+            public const uint Country = (uint)PropertyIds.AddressCountry;
+            /// <summary>
+            /// Extended address
+            /// </summary>
+            public const uint Extended = (uint)PropertyIds.AddressExtended;
+            /// <summary>
+            /// The address is default or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.AddressIsDefault;
+
+            /// <summary>
+            /// Enumeration for Contact address type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other address type
+                /// </summary>
+                Other = 0,
+                /// <summary>
+                /// Custom address type
+                /// </summary>
+                Custom = 1 << 0,
+                /// <summary>
+                /// A delivery address for a residence
+                /// </summary>
+                Home = 1 << 1,
+                /// <summary>
+                /// A delivery address for a place of work
+                /// </summary>
+                Work = 1 << 2,
+                /// <summary>
+                /// A domestic delivery address
+                /// </summary>
+                Domestic = 1 << 3,
+                /// <summary>
+                /// An international delivery address
+                /// </summary>
+                International = 1 << 4,
+                /// <summary>
+                /// A postal delivery address
+                /// </summary>
+                Postal = 1 << 5,
+                /// <summary>
+                /// A parcel delivery address
+                /// </summary>
+                Parcel = 1 << 6,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Note record.
+        /// </summary>
+        public static class Note
+        {
+            /// <summary>
+            /// Identifier of this contacts note view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.note";
+            /// <summary>
+            /// DB record ID of the note
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.NoteId;
+            /// <summary>
+            /// Contact ID that the note belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.NoteContactId;
+            /// <summary>
+            /// Note contents
+            /// </summary>
+            public const uint Contents = (uint)PropertyIds.NoteNote;
+        }
+
+        /// <summary>
+        /// Describes properies of a Url record.
+        /// </summary>
+        public static class Url
+        {
+            /// <summary>
+            /// Identifier of this contacts URL view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.url";
+            /// <summary>
+            /// DB record ID of the URL
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.UrlId;
+            /// <summary>
+            /// Contact ID that the URL belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.UrlContactId;
+            /// <summary>
+            /// URL type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.UrlType;
+            /// <summary>
+            /// Custom URL type label, when the URL type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.UrlLabel;
+            /// <summary>
+            /// URL
+            /// </summary>
+            public const uint UrlData = (uint)PropertyIds.UrlUrl;
+
+            /// <summary>
+            /// Enumeration for Contact URL type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other URL type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Custom URL type
+                /// </summary>
+                Custom,
+                /// <summary>
+                /// Home URL type
+                /// </summary>
+                Home,
+                /// <summary>
+                /// Work URL type
+                /// </summary>
+                Work,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Event record.
+        /// </summary>
+        public static class Event
+        {
+            /// <summary>
+            /// Identifier of this contacts event view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.event";
+            /// <summary>
+            /// DB record ID of the event
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.EventId;
+            /// <summary>
+            /// Contact ID that the event belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.EventContactId;
+            /// <summary>
+            /// Event type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.EventType;
+            /// <summary>
+            /// Custom event type label, when the event type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.EventLabel;
+            /// <summary>
+            /// Event date(YYYYMMDD). e.g. 2014/1/1 : 20140101. Even if the calendar_type is set as CONTACTS_EVENT_CALENDAR_TYPE_CHINESE, you SHOULD set Gregorian date
+            /// </summary>
+            public const uint Date = (uint)PropertyIds.EventDate;
+            /// <summary>
+            /// Calendar type, refer to the CalendarTypes
+            /// </summary>
+            public const uint IsLeapMonth = (uint)PropertyIds.EventIsLeapMonth;
+
+            /// <summary>
+            /// Enumeration for Contact event type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other event type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Custom event type
+                /// </summary>
+                Custom,
+                /// <summary>
+                /// Birthday event type
+                /// </summary>
+                Birthday,
+                /// <summary>
+                /// Anniversary event type
+                /// </summary>
+                Anniversary
+            }
+
+            /// <summary>
+            /// Enumeration for Contact event calendar type.
+            /// </summary>
+            public enum CalendarTypes
+            {
+                /// <summary>
+                /// Gregorian calendar
+                /// </summary>
+                Gregorian,
+                /// <summary>
+                /// Chinese calenadr
+                /// </summary>
+                Chinese
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Relationship record.
+        /// </summary>
+        public static class Relationship
+        {
+            /// <summary>
+            /// Identifier of this relationship view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.relationship";
+            /// <summary>
+            /// DB record ID of the relationship
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.RelationshipId;
+            /// <summary>
+            /// Contact ID that the relationship belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.RelationshipContactId;
+            /// <summary>
+            /// Relationship type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.RelationshipType;
+            /// <summary>
+            /// Custom relationship type label, when the relationship type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.RelationshipLabel;
+            /// <summary>
+            /// Selected contact name that the relationship belongs to
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.RelationshipName;
+
+            /// <summary>
+            /// Enumeration for Contact relationship type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other relationship type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Assistant type
+                /// </summary>
+                Assistant,
+                /// <summary>
+                /// Brother type
+                /// </summary>
+                Brother,
+                /// <summary>
+                /// Child type
+                /// </summary>
+                Child,
+                /// <summary>
+                /// Domestic Partner type
+                /// </summary>
+                DomesticPartner,
+                /// <summary>
+                /// Father type
+                /// </summary>
+                Father,
+                /// <summary>
+                /// Friend type
+                /// </summary>
+                Friend,
+                /// <summary>
+                /// Manager type
+                /// </summary>
+                Manager,
+                /// <summary>
+                /// Mother type
+                /// </summary>
+                Mother,
+                /// <summary>
+                /// Parent type
+                /// </summary>
+                Parent,
+                /// <summary>
+                /// Partner type
+                /// </summary>
+                Partner,
+                /// <summary>
+                /// Referred by type
+                /// </summary>
+                ReferredBy,
+                /// <summary>
+                /// Relative type
+                /// </summary>
+                Relative,
+                /// <summary>
+                /// Sister type
+                /// </summary>
+                Sister,
+                /// <summary>
+                /// Spouse type
+                /// </summary>
+                Spouse,
+                /// <summary>
+                /// Custom type
+                /// </summary>
+                Custom,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Image record.
+        /// </summary>
+        public static class Image
+        {
+            /// <summary>
+            /// Identifier of this contacts image view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.image";
+            /// <summary>
+            /// DB record ID of the image
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.ImageId;
+            /// <summary>
+            /// Contact ID that the image belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ImageContactId;
+            /// <summary>
+            /// Image type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.ImageType;
+            /// <summary>
+            /// Custom image type label, when the image type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.ImageLabel;
+            /// <summary>
+            /// Image thumbnail path
+            /// </summary>
+            public const uint Path = (uint)PropertyIds.ImagePath;
+            /// <summary>
+            /// The Image is default or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.ImageIsDefault;
+
+            /// <summary>
+            /// Enumeration for Contact image type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Custom type
+                /// </summary>
+                Custom,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Company record.
+        /// </summary>
+        public static class Company
+        {
+            /// <summary>
+            /// Identifier of this contacts company view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.company";
+            /// <summary>
+            /// DB record ID of the company
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.CompanyId;
+            /// <summary>
+            /// Contact ID that the company belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.CompanyContactId;
+            /// <summary>
+            /// Company type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.CompanyType;
+            /// <summary>
+            /// Custom company type label, when the company type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.CompanyLabel;
+            /// <summary>
+            /// Company name
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.CompanyName;
+            /// <summary>
+            /// Department
+            /// </summary>
+            public const uint Department = (uint)PropertyIds.CompanyDepartment;
+            /// <summary>
+            /// Job title
+            /// </summary>
+            public const uint JobTitle = (uint)PropertyIds.CompanyJobTitle;
+            /// <summary>
+            /// Assistant name
+            /// </summary>
+            public const uint AssistantName = (uint)PropertyIds.CompanyAssistantName;
+            /// <summary>
+            /// Role
+            /// </summary>
+            public const uint Role = (uint)PropertyIds.CompanyRole;
+            /// <summary>
+            /// Company logo image file path
+            /// </summary>
+            public const uint Logo = (uint)PropertyIds.CompanyLogo;
+            /// <summary>
+            /// Company location
+            /// </summary>
+            public const uint Location = (uint)PropertyIds.CompanyLocation;
+            /// <summary>
+            /// Description
+            /// </summary>
+            public const uint Description = (uint)PropertyIds.CompanyDescription;
+            /// <summary>
+            /// Pronounce the company name
+            /// </summary>
+            public const uint PhoneticName = (uint)PropertyIds.CompanyPhoneticName;
+
+            /// <summary>
+            /// Enumeration for Contact company type.
+            /// </summary>
+            public enum Types
+            {
+                Other = 0, /**< Other company type */
+                Custom = 1 << 0, /**< Custom company type */
+                Work = 1 << 1, /**< Work company type */
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Nickname record.
+        /// </summary>
+        public static class Nickname
+        {
+            /// <summary>
+            /// Identifier of this contacts nickname view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.nickname";
+            /// <summary>
+            /// DB record ID of the nickname
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.NicknameId;
+            /// <summary>
+            /// Contact ID that the nickname belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.NicknameContactId;
+            /// <summary>
+            /// Nickname
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.NicknameName;
+        }
+
+        /// <summary>
+        /// Describes properies of a Messenger record.
+        /// </summary>
+        public static class Messenger
+        {
+            /// <summary>
+            /// Identifier of this contacts messenger view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.messenger";
+            /// <summary>
+            /// DB record ID of the messenger
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.MessengerId;
+            /// <summary>
+            /// Contact ID that the messenger belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.MessengerContactId;
+            /// <summary>
+            /// Messenger type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.MessengerType;
+            /// <summary>
+            /// Custom messenger type label, when the messenger type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.MessengerLabel;
+            /// <summary>
+            /// Messenger ID (email address or email ID...)
+            /// </summary>
+            public const uint IMId = (uint)PropertyIds.MessengerIMId;
+
+            /// <summary>
+            /// Enumeration for Contact messenger type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other messenger type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Custom messenger type
+                /// </summary>
+                Custom,
+                /// <summary>
+                /// Google messenger type
+                /// </summary>
+                Google,
+                /// <summary>
+                /// Windows live messenger type
+                /// </summary>
+                WindowsLive,
+                /// <summary>
+                /// Yahoo messenger type
+                /// </summary>
+                Yahoo,
+                /// <summary>
+                /// Facebook messenger type
+                /// </summary>
+                Facebook,
+                /// <summary>
+                /// ICQ type
+                /// </summary>
+                ICQ,
+                /// <summary>
+                /// AOL instance messenger type
+                /// </summary>
+                AOL,
+                /// <summary>
+                /// QQ type
+                /// </summary>
+                QQ,
+                /// <summary>
+                /// Jabber type
+                /// </summary>
+                Jabber,
+                /// <summary>
+                /// Skype type
+                /// </summary>
+                Skype,
+                /// <summary>
+                /// IRC type
+                /// </summary>
+                IRC,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Profile record.
+        /// </summary>
+        public static class Profile
+        {
+            /// <summary>
+            /// Identifier of this contacts profile view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.profile";
+            /// <summary>
+            /// DB record ID of profile
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.ProfileId;
+            /// <summary>
+            /// Contacts ID that the profile belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ProfileContactId;
+            /// <summary>
+            /// Unique identifier
+            /// </summary>
+            public const uint Uid = (uint)PropertyIds.ProfileUid;
+            /// <summary>
+            /// Profile contents
+            /// </summary>
+            public const uint Text = (uint)PropertyIds.ProfileText;
+            /// <summary>
+            /// Priority to display the profile
+            /// </summary>
+            public const uint Order = (uint)PropertyIds.ProfileOrder;
+            /// <summary>
+            /// Data for app_control_set_operation
+            /// </summary>
+            public const uint ServiceOperation = (uint)PropertyIds.ProfileServiceOperation;
+            /// <summary>
+            /// Data for app_control_set_mime
+            /// </summary>
+            public const uint Mime = (uint)PropertyIds.ProfileMIME;
+            /// <summary>
+            /// Data for app_control_set_app_id
+            /// </summary>
+            public const uint AppId = (uint)PropertyIds.ProfileAppId;
+            /// <summary>
+            /// Data for app_control_set_uri
+            /// </summary>
+            public const uint ProfileUri = (uint)PropertyIds.ProfileUri;
+            /// <summary>
+            /// Data for app_control_set_category
+            /// </summary>
+            public const uint Category = (uint)PropertyIds.ProfileCategory;
+            /// <summary>
+            /// It includes "key:value,key:value," pairs. You should parse it. And you must base64 encode each key and value
+            /// </summary>
+            public const uint ExtraData = (uint)PropertyIds.ProfileExtraData;
+        }
+
+        /// <summary>
+        /// Describes properies of a Sip record.
+        /// </summary>
+        public static class Sip
+        {
+            /// <summary>
+            /// Identifier of this contacts sip view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.sip";
+            /// <summary>
+            /// DB record ID of the sip
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.SipId;
+            /// <summary>
+            /// Contact ID that the sip belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.SipContactId;
+            /// <summary>
+            /// SIP address
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.SipAddress;
+            /// <summary>
+            /// sip type, refer to the Types
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.SipType;
+            /// <summary>
+            /// Custom sip type label, when the sip type is Types.Custom
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.SipLabel;
+
+            /// <summary>
+            /// Enumeration for Contact SIP type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// Other SIP type
+                /// </summary>
+                Other,
+                /// <summary>
+                /// Custom SIP type
+                /// </summary>
+                Custom,
+                /// <summary>
+                /// Home SIP type
+                /// </summary>
+                Home,
+                /// <summary>
+                /// Work SIP type
+                /// </summary>
+                Work,
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Extension record.
+        /// </summary>
+        public static class Extension
+        {
+            /// <summary>
+            /// Identifier of this contacts extension view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.extension";
+            /// <summary>
+            /// DB record ID of the contact extension
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.ExtensionId;
+            /// <summary>
+            /// Contact ID that the contact extension belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ExtensionContactId;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data1 = (uint)PropertyIds.ExtensionData1;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data2 = (uint)PropertyIds.ExtensionData2;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data3 = (uint)PropertyIds.ExtensionData3;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data4 = (uint)PropertyIds.ExtensionData4;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data5 = (uint)PropertyIds.ExtensionData5;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data6 = (uint)PropertyIds.ExtensionData6;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data7 = (uint)PropertyIds.ExtensionData7;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data8 = (uint)PropertyIds.ExtensionData8;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data9 = (uint)PropertyIds.ExtensionData9;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data10 = (uint)PropertyIds.ExtensionData10;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data11 = (uint)PropertyIds.ExtensionData11;
+            /// <summary>
+            /// The extra child record format for non-provided from contacts-service
+            /// </summary>
+            public const uint Data12 = (uint)PropertyIds.ExtensionData12;
+        }
+
+        /// <summary>
+        /// Describes properies of a Group relation record.
+        /// </summary>
+        public static class GroupRelation
+        {
+            /// <summary>
+            /// Identifier of this relationship view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.group_relation";
+            /// <summary>
+            /// DB record ID of the group relation (can not be used as filter)
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.GroupRelationId;
+            /// <summary>
+            /// DB record ID of the group
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.GroupRelationGroupId;
+            /// <summary>
+            /// DB record ID of the contact
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.GroupRelationContactId;
+            /// <summary>
+            /// Group name
+            /// </summary>
+            public const uint Name = (uint)PropertyIds.GroupRelationGroupName;
+        }
+
+        /// <summary>
+        /// Describes properies of a Speed dial record.
+        /// </summary>
+        public static class SpeedDial
+        {
+            /// <summary>
+            /// Identifier of this contact speed dial view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.speeddial";
+            /// <summary>
+            /// Stored speed dial number
+            /// </summary>
+            public const uint SpeedDialNumber = (uint)PropertyIds.SpeedDialDialNumber;
+            /// <summary>
+            /// Number ID that the speed dial belongs to
+            /// </summary>
+            public const uint NumberId = (uint)PropertyIds.SpeedDialNumberId;
+            /// <summary>
+            /// Contact number of specified speed dial
+            /// </summary>
+            public const uint Number = (uint)PropertyIds.SpeedDialNumber;
+            /// <summary>
+            /// Contact number label of specified speed dial, when the number type is Number.Types.Custom
+            /// </summary>
+            public const uint NumberLabel = (uint)PropertyIds.SpeedDialNumberLabel;
+            /// <summary>
+            /// Contact number type, refer to the Number.Types
+            /// </summary>
+            public const uint NumberType = (uint)PropertyIds.SpeedDialNumberType;
+            /// <summary>
+            ///        Person ID that the speed dial belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.SpeedDialPersonId;
+            /// <summary>
+            /// Display name that the speed dial belongs to
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.SpeedDialDisplayName;
+            /// <summary>
+            /// Image thumbnail path that the speed dial belongs to
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.SpeedDialThumbnail;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint NormalizedNumber = (uint)PropertyIds.SpeedDialNormalizedNumber;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint CleanedNumber = (uint)PropertyIds.SpeedDialCleanedNumber;
+            /// <summary>
+            /// If you add filter with this property, the string will be normalized as minmatch length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly
+            /// </summary>
+            public const uint NumberFilter = (uint)PropertyIds.SpeedDialNumberFilter;
+        }
+
+        /// <summary>
+        /// Describes properies of a Phone log record.
+        /// </summary>
+        public static class PhoneLog
+        {
+            /// <summary>
+            /// Identifier of this phone log view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.phonelog";
+            /// <summary>
+            /// DB record ID of phone log
+            /// </summary>
+            public const uint Id = (uint)PropertyIds.PhonelogId;
+            /// <summary>
+            /// Person ID that the phone log belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PhonelogPersonId;
+            /// <summary>
+            /// Number or Email that the phone log displays
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.PhonelogAddress;
+            /// <summary>
+            /// Call end time. The value means number of seconds since 1970-01-01 00:00:00 (UTC)
+            /// </summary>
+            public const uint LogTime = (uint)PropertyIds.PhonelogLogTime;
+            /// <summary>
+            /// Log type, refer to the Types
+            /// </summary>
+            public const uint LogType = (uint)PropertyIds.PhonelogLogType;
+            /// <summary>
+            /// You can set the related integer data (e.g. message_id, email_id or duration(seconds) of call)
+            /// </summary>
+            public const uint ExtraData1 = (uint)PropertyIds.PhonelogExtraData1;
+            /// <summary>
+            /// You can set the related string data (e.g. short message, subject)
+            /// </summary>
+            public const uint ExtraData2 = (uint)PropertyIds.PhonelogExtraData2;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint NormalizedAddress = (uint)PropertyIds.PhonelogNormalizedAddress;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint CleanedAddress = (uint)PropertyIds.PhonelogCleanedAddress;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint AddressFilter = (uint)PropertyIds.PhonelogAddressFilter;
+            /// <summary>
+            /// You can set the related SIM slot number. sim_slot_no 0 means first SIM card, sim_slot_no 1 means second SIM. It is same with handle index of telephony handle list. Refer to the telephony_init()
+            /// </summary>
+            public const uint SimSlotNo = (uint)PropertyIds.PhonelogSIMSlotNo;
+
+            /// <summary>
+            /// Enumeration for Phone log type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// None
+                /// </summary>
+                None,
+                /// <summary>
+                /// Incoming call
+                /// </summary>
+                VoiceIncoming = 1,
+                /// <summary>
+                /// Outgoing call
+                /// </summary>
+                VoiceOutgoing = 2,
+                /// <summary>
+                /// Incoming video call
+                /// </summary>
+                VideoIncoming = 3,
+                /// <summary>
+                /// Outgoing video call
+                /// </summary>
+                VideoOutgoing = 4,
+                /// <summary>
+                /// Not confirmed missed call
+                /// </summary>
+                VoiceMissedUnseen = 5,
+                /// <summary>
+                /// Confirmed missed call
+                /// </summary>
+                VoiceMissedSeen = 6,
+                /// <summary>
+                /// Not confirmed missed video call
+                /// </summary>
+                VideoMissedUnseen = 7,
+                /// <summary>
+                /// Confirmed missed video call
+                /// </summary>
+                VidoeMissedSeen = 8,
+                /// <summary>
+                /// Rejected call
+                /// </summary>
+                VoiceRejected = 9,
+                /// <summary>
+                /// Rejected video call
+                /// </summary>
+                VideoRejected = 10,
+                /// <summary>
+                /// Blocked call
+                /// </summary>
+                VoiceBlocked = 11,
+                /// <summary>
+                /// Blocked video call
+                /// </summary>
+                VideoBlocked = 12,
+                /// <summary>
+                /// Incoming MMS
+                /// </summary>
+                MmsIncoming = 101,
+                /// <summary>
+                /// Outgoing MMS
+                /// </summary>
+                MmsOutgoing = 102,
+                /// <summary>
+                /// Incoming SMS
+                /// </summary>
+                SmsIncoming = 103,
+                /// <summary>
+                /// Outgoing SMS
+                /// </summary>
+                SmsOutgoing = 104,
+                /// <summary>
+                /// Blocked SMS
+                /// </summary>
+                SmsBlocked = 105,
+                /// <summary>
+                /// Blocked MMS
+                /// </summary>
+                MmsBlocked = 106,
+                /// <summary>
+                /// Received email
+                /// </summary>
+                EmailReceived = 201,
+                /// <summary>
+                /// Sent email
+                /// </summary>
+                EmailSent = 202,
+
+            }
+        }
+
+        /// <summary>
+        /// Describes properies of a Contact updated information record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class ContactUpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this contact updated info view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.contacts_updated_info";
+            /// <summary>
+            /// Updated contact ID
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.UpdateInfoId;
+            /// <summary>
+            /// Addressbook ID that the updated contact belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.UpdateInfoAddressbookId;
+            /// <summary>
+            /// Contact change type, refer to the ContactsViews.ChangeTypes
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.UpdateInfoType;
+            /// <summary>
+            /// Updated version
+            /// </summary>
+            public const uint Version = (uint)PropertyIds.UpdateInfoVersion;
+            /// <summary>
+            /// Contact image is changed or not
+            /// </summary>
+            public const uint ImageChanged = (uint)PropertyIds.UpdateInfoImageChanged;
+        }
+
+        /// <summary>
+        /// Describes properies of a My profile updated information record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class MyProfileUpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this my profile updated info view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.my_profile_updated_info";
+            /// <summary>
+            /// Address book ID that the updated my profile belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.UpdateInfoAddressbookId;
+            /// <summary>
+            /// MyProfile change type, refer to the ContactsViews.ChangeTypes
+            /// </summary>
+            public const uint LastChangedType = (uint)PropertyIds.UpdateInfoLastChangedType;
+            /// <summary>
+            /// Updated version
+            /// </summary>
+            public const uint Version = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        /// <summary>
+        /// Describes properies of a Group updated information record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class GroupUpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this group updated info view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.groups_updated_info";
+            /// <summary>
+            /// Updated group ID
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.UpdateInfoId;
+            /// <summary>
+            /// Address book ID that the updated group belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.UpdateInfoAddressbookId;
+            /// <summary>
+            /// Group change type, refer to the ContactsViews.ChangeTypes
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.UpdateInfoType;
+            /// <summary>
+            /// Updated version
+            /// </summary>
+            public const uint Version = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        /// <summary>
+        /// Describes properies of a Group Member updated information record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class GroupMemberUpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this group member updated info view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.groups_member_updated_info";
+            /// <summary>
+            /// Updated group ID
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.UpdateInfoId;
+            /// <summary>
+            /// Address book ID that the updated group belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.UpdateInfoAddressbookId;
+            /// <summary>
+            /// Updated version
+            /// </summary>
+            public const uint Version = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        /// <summary>
+        /// Describes properies of a Relation updated information record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class GroupRelationUpdatedInfo
+        {
+            /// <summary>
+            /// Identifier of this group relation updated info view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.group_relations_updated_info";
+            /// <summary>
+            /// Group ID of group relation
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.GroupId;
+            /// <summary>
+            /// Contact ID of the updated group relation
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Address book ID of contact that the updated group relation
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.AddressbookId;
+            /// <summary>
+            /// Group relation change type, refer to the ContactsViews.ChangeTypes
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.UpdateInfoType;
+            /// <summary>
+            /// Updated version
+            /// </summary>
+            public const uint Version = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        /// <summary>
+        /// Describes properies of a Person & Contact record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonContact
+        {
+            /// <summary>
+            /// Identifier of this person contact view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// Status of social account (projection)
+            /// </summary>
+            public const uint Status = (uint)PropertyIds.PersonStatus;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// Link count of contact records (projection)
+            /// </summary>
+            public const uint LinkCount = (uint)PropertyIds.PersonLinkCount;
+            /// <summary>
+            /// Contact ID that the person belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Addressbook IDs that the person belongs to (projection)
+            /// </summary>
+            public const uint AddressbookIds = (uint)PropertyIds.PersonAddressbookIds;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Addressbook ID that the person belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Addressbook mode, refer to the Addressbook.Modes
+            /// </summary>
+            public const uint AddressbookMode = (uint)PropertyIds.AddressbookMode;
+            /// <summary>
+            ///        Addressbook name that the person belongs to
+            /// </summary>
+            public const uint AddressbookName = (uint)PropertyIds.AddressbookName;
+            /// <summary>
+            /// kerword matched data type, refer to the Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Number record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonNumber
+        {
+            /// <summary>
+            /// Identifier of this person number view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/number";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Number ID that the person belongs to
+            /// </summary>
+            public const uint NumberId = (uint)PropertyIds.NumberId;
+            /// <summary>
+            /// Number type, refer to the Number.Types (projection)
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.NumberType;
+            /// <summary>
+            /// Custom number type label, when the number type is Number.Types.Custom (projection)
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.NumberLabel;
+            /// <summary>
+            /// The number is default number or not
+            /// </summary>
+            public const uint IsPrimaryDefault = (uint)PropertyIds.DataIsPrimaryDefault;
+            /// <summary>
+            /// Number
+            /// </summary>
+            public const uint Number = (uint)PropertyIds.NumberNumber;
+            /// <summary>
+            /// If you add filter with this property, the string will be normalized as minmatch length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly.
+            /// </summary>
+            public const uint NumberFilter = (uint)PropertyIds.NumberNumberFilter;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint NormalizedNumber = (uint)PropertyIds.NumberNormalizedNumber;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint CleanedNumber = (uint)PropertyIds.NumberCleanedNumber;
+            /// <summary>
+            /// kerword matched data type, refer to they Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Email record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonEmail
+        {
+            /// <summary>
+            /// Identifier of this person email view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/email";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Email ID that the person belongs to
+            /// </summary>
+            public const uint EmailId = (uint)PropertyIds.EmailId;
+            /// <summary>
+            /// Email type, refer to the Email.Types (projection)
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.EmailType;
+            /// <summary>
+            /// Custom mail type label, when the email type is Email.Types.Custom (projection)
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.EmailLabel;
+            /// <summary>
+            /// The email is default email or not
+            /// </summary>
+            public const uint IsPrimaryDefault = (uint)PropertyIds.DataIsPrimaryDefault;
+            /// <summary>
+            /// Email address
+            /// </summary>
+            public const uint Email = (uint)PropertyIds.EmailEmail;
+            /// <summary>
+            /// kerword matched data type, refer to they Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Group Relation record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonGroupRelation
+        {
+            /// <summary>
+            /// Identifier of this person group relation view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/group";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// Status of social account (projection)
+            /// </summary>
+            public const uint Status = (uint)PropertyIds.PersonStatus;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Link count of contat records (projection)
+            /// </summary>
+            public const uint LinkCount = (uint)PropertyIds.PersonLinkCount;
+            /// <summary>
+            /// Addressbook IDs that the person belongs to (projection)
+            /// </summary>
+            public const uint AddressbookIds = (uint)PropertyIds.PersonAddressbookIds;
+            /// <summary>
+            /// Addressbook ID that the person belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Addressbook name that the person belongs to
+            /// </summary>
+            public const uint AddressbookName = (uint)PropertyIds.AddressbookName;
+            /// <summary>
+            /// Addressbook mode, refer to the Addressbook.Modes
+            /// </summary>
+            public const uint AddressbookMode = (uint)PropertyIds.AddressbookMode;
+            /// <summary>
+            /// Group ID that the person belongs to
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.GroupRelationGroupId;
+            /// <summary>
+            /// Contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.GroupRelationContactId;
+            /// <summary>
+            /// kerword matched data type, refer to they Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Group Assigned record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonGroupAssigned
+        {
+            /// <summary>
+            /// Identifier of this person group assigned view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/group_assigned";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// Status of social account (projection)
+            /// </summary>
+            public const uint Status = (uint)PropertyIds.PersonStatus;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Link count of contact records (projection)
+            /// </summary>
+            public const uint LinkCount = (uint)PropertyIds.PersonLinkCount;
+            /// <summary>
+            /// Addressbook IDs that the linked person belongs to (projection)
+            /// </summary>
+            public const uint AddressbookIds = (uint)PropertyIds.PersonAddressbookIds;
+            /// <summary>
+            /// Addressbook ID that the person belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Addressbook mode, refer to the Addressbook.Modes
+            /// </summary>
+            public const uint AddressbookMode = (uint)PropertyIds.AddressbookMode;
+            /// <summary>
+            /// Group ID that the person belongs to
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.GroupRelationGroupId;
+            /// <summary>
+            /// Contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.GroupRelationContactId;
+            /// <summary>
+            /// kerword matched data type, refer to they Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Group Not Assigned record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonGroupNotAssigned
+        {
+            /// <summary>
+            /// Identifier of this person group not assigned view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/group_not_assigned";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// Status of social account (projection)
+            /// </summary>
+            public const uint Status = (uint)PropertyIds.PersonStatus;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Link count of contact records (projection)
+            /// </summary>
+            public const uint LinkCount = (uint)PropertyIds.PersonLinkCount;
+            /// <summary>
+            /// Addressbook IDs that the linked person belongs to (projection)
+            /// </summary>
+            public const uint AddressbookIds = (uint)PropertyIds.PersonAddressbookIds;
+            /// <summary>
+            /// Addressbook ID that the person belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Addressbook mode, refer to the Addressbook.Modes
+            /// </summary>
+            public const uint AddressbookMode = (uint)PropertyIds.AddressbookMode;
+            /// <summary>
+            /// Contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// kerword matched data type, refer to they Contact.DataTypes
+            /// </summary>
+            public const uint SnippetType = (uint)PropertyIds.PersonSnippetType;
+            /// <summary>
+            /// keyword matched data string
+            /// </summary>
+            public const uint SnippetString = (uint)PropertyIds.PersonSnippetString;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person & Phone Log record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonPhonelog
+        {
+            /// <summary>
+            /// Identifier of this phone log view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/simple_contact/phonelog";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// DB record ID of phone log
+            /// </summary>
+            public const uint LogId = (uint)PropertyIds.PhonelogId;
+            /// <summary>
+            /// Number or Email that the phone log displays
+            /// </summary>
+            public const uint Address = (uint)PropertyIds.PhonelogAddress;
+            /// <summary>
+            /// Number or Email type (projection)
+            /// </summary>
+            public const uint AddressType = (uint)PropertyIds.DataData1;
+            /// <summary>
+            /// Call end time. The value means number of seconds since 1970-01-01 00:00:00 (UTC)
+            /// </summary>
+            public const uint LogTime = (uint)PropertyIds.PhonelogLogTime;
+            /// <summary>
+            /// Log type, refer to the PhoneLog.Types
+            /// </summary>
+            public const uint LogType = (uint)PropertyIds.PhonelogLogType;
+            /// <summary>
+            /// You can set the related integer data (e.g. message_id, email_id or duration(seconds) of call) (projection)
+            /// </summary>
+            public const uint ExtraData1 = (uint)PropertyIds.PhonelogExtraData1;
+            /// <summary>
+            /// You can set the related string data (e.g. short message, subject) (projection)
+            /// </summary>
+            public const uint ExtraData2 = (uint)PropertyIds.PhonelogExtraData2;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint NormalizedAddress = (uint)PropertyIds.PhonelogNormalizedAddress;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint CleanedAddress = (uint)PropertyIds.PhonelogCleanedAddress;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint AddressFilter = (uint)PropertyIds.PhonelogAddressFilter;
+            /// <summary>
+            /// It is related to the SIM slot number. sim_slot_no 0 means first SIM card, sim_slot_no 1 means second SIM. It is same with handle index of telephony handle list. Refer to the telephony_init()
+            /// </summary>
+            public const uint SIMSlotNo = (uint)PropertyIds.PhonelogSIMSlotNo;
+        };
+
+        /// <summary>
+        /// Describes properies of a Person Usage record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PersonUsage
+        {
+            /// <summary>
+            /// Identifier of this person usage view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.person/usag";
+            /// <summary>
+            /// DB record ID of the person
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.PersonId;
+            /// <summary>
+            /// Display name of the person
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.PersonDisplayName;
+            /// <summary>
+            /// The first character of first string for grouping. This is normalized using icu (projection)
+            /// </summary>
+            public const uint DisplayNameIndex = (uint)PropertyIds.PersonDisplayNameIndex;
+            /// <summary>
+            /// Display contact ID that the person belongs to (projection)
+            /// </summary>
+            public const uint DisplayContactId = (uint)PropertyIds.PersonDisplayContactId;
+            /// <summary>
+            /// Ringtone path of the person (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.PersonRingtone;
+            /// <summary>
+            /// Image thumbnail path of the person (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.PersonThumbnail;
+            /// <summary>
+            /// Vibration path of the person (projection)
+            /// </summary>
+            public const uint Vibration = (uint)PropertyIds.PersonVibration;
+            /// <summary>
+            /// Message alert path of the person (projection)
+            /// </summary>
+            public const uint MessageAlert = (uint)PropertyIds.PersonMessageAlert;
+            /// <summary>
+            /// The person is favorite or not
+            /// </summary>
+            public const uint IsFavorite = (uint)PropertyIds.PersonIsFavorite;
+            /// <summary>
+            /// The person has phone number or not
+            /// </summary>
+            public const uint HasPhoneNumber = (uint)PropertyIds.PersonHasPhoneNumber;
+            /// <summary>
+            /// The person has email or not
+            /// </summary>
+            public const uint HasEmail = (uint)PropertyIds.PersonHasEmail;
+            /// <summary>
+            /// Usage type, refer to the UsageTypes
+            /// </summary>
+            public const uint UsageType = (uint)PropertyIds.PersonUsageType;
+            /// <summary>
+            /// Usage number of person
+            /// </summary>
+            public const uint TimesUsed = (uint)PropertyIds.PersonTimesUsed;
+
+            /// <summary>
+            /// Enumeration for Person usage type.
+            /// </summary>
+            public enum Types
+            {
+                /// <summary>
+                /// None
+                /// </summary>
+                None,
+                /// <summary>
+                /// Outgoing call
+                /// </summary>
+                OutgoingCall,
+                /// <summary>
+                /// Outgoing message
+                /// </summary>
+                OutgoingMessage,
+                /// <summary>
+                /// Outgoing email
+                /// </summary>
+                OutgoingEmail,
+                /// <summary>
+                /// Incoming call
+                /// </summary>
+                IncomingCall,
+                /// <summary>
+                /// Incoming message
+                /// </summary>
+                IncomingMessage,
+                /// <summary>
+                /// Incoming email
+                /// </summary>
+                IncomingEmail,
+                /// <summary>
+                /// Missed call
+                /// </summary>
+                MissedCall,
+                /// <summary>
+                /// Rejected call
+                /// </summary>
+                RejectedCall,
+                /// <summary>
+                /// Blocked call
+                /// </summary>
+                BlockedCall,
+                /// <summary>
+                /// Blocked message
+                /// </summary>
+                BlockedMessage
+            }
+        };
+
+        /// <summary>
+        /// Describes properies of a Contact & Number record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class ContactNumber
+        {
+            /// <summary>
+            /// Identifier of this contacts number view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.simple_contact/number";
+            /// <summary>
+            /// Contact ID that the number belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Display name of contact that the number belongs to
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.ContactDisplayName;
+            /// <summary>
+            /// The source type of display name, refer to the Contact.DisplayNameSourceTypes (projection)
+            /// </summary>
+            public const uint DisplaySourceType = (uint)PropertyIds.ContactDisplaySourceDataId;
+            /// <summary>
+            /// Addressbook ID that the number belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Person ID that the number belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.ContactPersonId;
+            /// <summary>
+            /// Ringtone path that the number belongs to (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.ContactRingtone;
+            /// <summary>
+            /// Image thumbnail path that the number belongs to (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.ContactThumbnail;
+            /// <summary>
+            /// DB record ID of the number
+            /// </summary>
+            public const uint NumberId = (uint)PropertyIds.NumberId;
+            /// <summary>
+            /// Number type, refer to the Number.Types (projection)
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.NumberType;
+            /// <summary>
+            /// Custom number type label, when the number type is Number.Types.Custom (projection)
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.NumberLabel;
+            /// <summary>
+            /// The number is default number or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.NumberIsDefault;
+            /// <summary>
+            /// Number
+            /// </summary>
+            public const uint Number = (uint)PropertyIds.NumberNumber;
+            /// <summary>
+            /// If you add filter with this property, the string will be normalized as minmatch length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly
+            /// </summary>
+            public const uint NumberFilter = (uint)PropertyIds.NumberNumberFilter;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint NormalizedNumber = (uint)PropertyIds.NumberNormalizedNumber;
+            /// <summary>
+            /// You can only use this property for search filter
+            /// </summary>
+            public const uint CleanedNumber = (uint)PropertyIds.NumberCleanedNumber;
+        };
+
+        /// <summary>
+        /// Describes properies of a Contact & Email record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class ContactEmail
+        {
+            /// <summary>
+            /// Identifier of this contacts email view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.simple_contact/email";
+            /// <summary>
+            /// Contact ID that the number belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Display name of contact that the number belongs to
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.ContactDisplayName;
+            /// <summary>
+            /// The source type of display name, refer to the Contact.DisplayNameSourceTypes (projection)
+            /// </summary>
+            public const uint DisplaySourceType = (uint)PropertyIds.ContactDisplaySourceDataId;
+            /// <summary>
+            /// Addressbook ID that the number belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Person ID that the number belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.ContactPersonId;
+            /// <summary>
+            /// Ringtone path that the number belongs to (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.ContactRingtone;
+            /// <summary>
+            /// Image thumbnail path that the number belongs to (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.ContactThumbnail;
+            /// <summary>
+            /// DB record ID of the email
+            /// </summary>
+            public const uint EmailId = (uint)PropertyIds.EmailId;
+            /// <summary>
+            /// Email type, refer to the Email.Types (projection)
+            /// </summary>
+            public const uint Type = (uint)PropertyIds.EmailType;
+            /// <summary>
+            /// Custom mail type label, when the email type is Email.Types.Custom (projection)
+            /// </summary>
+            public const uint Label = (uint)PropertyIds.EmailLabel;
+            /// <summary>
+            /// Email is default email or not
+            /// </summary>
+            public const uint IsDefault = (uint)PropertyIds.EmailIsDefault;
+            /// <summary>
+            /// Email address
+            /// </summary>
+            public const uint Email = (uint)PropertyIds.EmailEmail;
+        };
+
+        /// <summary>
+        /// Describes properies of a Contact & Group Relation record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class ContactGroupRelation
+        {
+            /// <summary>
+            /// Identifier of this contact grouprel view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.simple_contact/group";
+            /// <summary>
+            /// Contact ID that the number belongs to
+            /// </summary>
+            public const uint ContactId = (uint)PropertyIds.ContactId;
+            /// <summary>
+            /// Display name of contact that the number belongs to
+            /// </summary>
+            public const uint DisplayName = (uint)PropertyIds.ContactDisplayName;
+            /// <summary>
+            /// The source type of display name, refer to the Contact.DisplayNameSourceTypes (projection)
+            /// </summary>
+            public const uint DisplaySourceType = (uint)PropertyIds.ContactDisplaySourceDataId;
+            /// <summary>
+            /// Addressbook ID that the number belongs to
+            /// </summary>
+            public const uint AddressbookId = (uint)PropertyIds.ContactAddressbookId;
+            /// <summary>
+            /// Person ID that the number belongs to
+            /// </summary>
+            public const uint PersonId = (uint)PropertyIds.ContactPersonId;
+            /// <summary>
+            /// Ringtone path that the number belongs to (projection)
+            /// </summary>
+            public const uint RingtonePath = (uint)PropertyIds.ContactRingtone;
+            /// <summary>
+            /// Image thumbnail path that the number belongs to (projection)
+            /// </summary>
+            public const uint ThumbnailPath = (uint)PropertyIds.ContactThumbnail;
+            /// <summary>
+            /// DB record ID of the group relation
+            /// </summary>
+            public const uint GroupId = (uint)PropertyIds.GroupRelationGroupId;
+            /// <summary>
+            /// Group name (projection)
+            /// </summary>
+            public const uint GroupName = (uint)PropertyIds.GroupRelationGroupName;
+        };
+
+        /// <summary>
+        /// Describes properies of a Phone Log Statistics record.
+        /// </summary>
+        /// <remarks>Read only view</remarks>
+        public static class PhonelogStatistics
+        {
+            /// <summary>
+            /// Identifier of this log statistics view
+            /// </summary>
+            public const string Uri = "tizen.contacts_view.phonelog_stat";
+            /// <summary>
+            /// Log count (projection)
+            /// </summary>
+            public const uint LogCount = (uint)PropertyIds.PhonelogStatLogCount;
+            /// <summary>
+            /// Log type, see the contacts_phone_log_type_e
+            /// </summary>
+            public const uint LogType = (uint)PropertyIds.PhonelogStatLogType;
+            /// <summary>
+            /// It is related to the SIM slot number. sim_slot_no 0 means first SIM card, sim_slot_no 1 means second SIM. It is same with handle index of telephony handle list. Refer to the telephony_init()
+            /// </summary>
+            public const uint SIMSlotNo = (uint)PropertyIds.PhonelogStatSIMSlotNo;
+        };
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs
new file mode 100644 (file)
index 0000000..4029e35
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using static Tizen.Pims.Contacts.ContactsDatabase;
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// Event arguments passed when contacts database status is changed
+    /// </summary>
+    public class DBStatusChangedEventArgs
+    {
+        internal DBStatusChangedEventArgs(DBStatus status)
+        {
+            this.Status = status;
+        }
+
+        public DBStatus Status
+        {
+            get;
+            internal set;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs
new file mode 100644 (file)
index 0000000..71ce4d3
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// Event arguments passed when setting value of contacts name display order is changed
+    /// </summary>
+    public class NameDisplayOrderChangedEventArgs
+    {
+        internal NameDisplayOrderChangedEventArgs(ContactDisplayOrder displayOrder)
+        {
+            this.NameDisplayOrder = displayOrder;
+        }
+
+        public ContactDisplayOrder NameDisplayOrder
+        {
+            get;
+            internal set;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs
new file mode 100644 (file)
index 0000000..1f9b663
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+namespace Tizen.Pims.Contacts
+{
+    /// <summary>
+    /// Event arguments passed when setting value of contacts name sorting order is changed
+    /// </summary>
+    public class NameSortingOrderChangedEventArgs
+    {
+        internal NameSortingOrderChangedEventArgs(ContactSortingOrder SortingOrder)
+        {
+            this.NameSortingOrder = SortingOrder;
+        }
+
+        public ContactSortingOrder NameSortingOrder
+        {
+            get;
+            internal set;
+        }
+    }
+}
diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs
new file mode 100644 (file)
index 0000000..487113c
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+/// <summary>
+/// The Tizen.Pims.Contacts namespace provides classes for managing contact information for people.
+/// </summary>
+/// <remarks>
+/// The Tizen.Pims.Contacts namespace provides classes for managing contact information for people.
+/// </remarks>
+namespace Tizen.Pims.Contacts {}
diff --git a/src/Tizen.Security.TEEC/.gitignore b/src/Tizen.Security.TEEC/.gitignore
new file mode 100644 (file)
index 0000000..a6c57f5
--- /dev/null
@@ -0,0 +1 @@
+*.json
diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Errors.cs b/src/Tizen.Security.TEEC/Interop/Interop.Errors.cs
new file mode 100644 (file)
index 0000000..eb86422
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Interop.Errors.cs
+ *
+ *  Created on: Apr 4, 2017
+ *      Author: k.dynowski
+ */
+
+using System;
+
+internal static partial class Interop
+{
+
+    private const string LogTag = "Tizen.Security.Libteec";
+    internal enum LibteecError : uint
+    {
+        None = 0,
+        NotImplemented = 0xFFFF0009,
+        CommunicationFailed = 0xFFFF000E,
+    };
+
+    internal static void CheckNThrowException(int err, string msg)
+    {
+        switch ((uint)err)
+        {
+            case (uint)LibteecError.None:
+                return ;
+            case (uint)LibteecError.NotImplemented:
+                throw new NotSupportedException(string.Format("[{0}] {1} error=0x{2}",
+                        LogTag, msg, err.ToString("X")));
+            case (uint)LibteecError.CommunicationFailed:
+                throw new Exception(string.Format("[{0}] {1} error=0x{2}",
+                        LogTag, msg, err.ToString("X")));
+            default:
+                throw new InvalidOperationException(string.Format("[{0}] {1}, error=0x{2}",
+                        LogTag, msg, err.ToString("X")));
+
+        }
+    }
+}
diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs b/src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..25c903e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Libteec = "libteec.so";
+    }
+}
diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs b/src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs
new file mode 100644 (file)
index 0000000..1c1f969
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ *  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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
+ */
+
+using System;
+using System.Runtime.InteropServices;
+//using Interop.Liibteec.Types;
+
+internal static partial class Interop
+{
+    internal static partial class Libteec
+    {
+        /// <summary>
+        /// This function initializes a new TEE Context, forming a connection between this Client Application and the
+        /// TEE identified by the string identifier name.
+        /// The Client Application MAY pass name with a value of NULL, which means that the Implementation MUST
+        /// select a default TEE to connect to. The supported name strings, the mapping of these names to a specific
+        /// TEE, and the nature of the default TEE are implementation-defined.
+        /// </summary>
+        //TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_InitializeContext", CallingConvention = CallingConvention.Cdecl)]
+        static public extern int InitializeContext(string name, ref TEEC_Context context);
+
+        /// <summary>
+        /// This function destroys an initialized TEE Context, closing the connection between the Client Application
+        /// and the TEE. The Client Application MUST only call this function when all Sessions inside this TEE
+        /// Context have been closed and all Shared Memory blocks have been released.
+        /// The implementation of this function MUST NOT be able to fail; after this function returns the Client
+        /// Application must be able to consider that the Context has been closed.
+        /// The function implementation MUST do nothing if the value of the context pointer is NULL.
+        /// </summary>
+        //void TEEC_FinalizeContext(TEEC_Context *context);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_FinalizeContext", CallingConvention = CallingConvention.Cdecl)]
+        static public extern void FinalizeContext(ref TEEC_Context context);
+
+        /// <summary>
+        /// This function registers a block of existing Client Application memory as a block of Shared Memory within
+        /// the scope of the specified TEE Context, in accordance with the parameters which have been set by the
+        /// Client Application inside the sharedMem structure.
+        /// The input context MUST point to an initialized TEE Context.
+        /// The input sharedMem MUST point to the Shared Memory structure defining the memory region to register
+        /// </summary>
+        //EEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RegisterSharedMemory", CallingConvention = CallingConvention.Cdecl)]
+        static public extern int RegisterSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem);
+
+        /// <summary>
+        /// This function allocates a new block of memory as a block of Shared Memory within the scope of the
+        /// specified TEE Context, in accordance with the parameters which have been set by the Client Application
+        /// inside the sharedMem structure.
+        /// The input context MUST point to an initialized TEE Context.
+        /// The input sharedMem MUST point to the Shared Memory structure defining the region to allocate.
+        /// </summary>
+        //TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_AllocateSharedMemory", CallingConvention = CallingConvention.Cdecl)]
+        static public extern int AllocateSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem);
+
+        /// <summary>
+        /// This function deregisters or deallocates a previously initialized block of Shared Memory.
+        /// For a memory buffer allocated using AllocateSharedMemory the Implementation MUST free the
+        /// underlying memory and the Client Application MUST NOT access this region after this function has been
+        /// called. In this case the Implementation MUST set the buffer and size fields of the sharedMem
+        /// structure to NULL and 0 respectively before returning.
+        /// For memory registered using RegisterSharedMemory the implementation MUST deregister the
+        /// underlying memory from the TEE, but the memory region will stay available to the Client Application for
+        /// other purposes as the memory is owned by it.
+        /// The implementation MUST do nothing if the value of the sharedMem parameter is NULL.
+        /// </summary>
+        //void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_ReleaseSharedMemory", CallingConvention = CallingConvention.Cdecl)]
+        static public extern void ReleaseSharedMemory(ref TEEC_SharedMemory sharedMem);
+
+        /// <summary>
+        /// This function opens a new Session between the Client Application and the specified Trusted Application.
+        /// The Implementation MUST assume that all fields of this session structure are in an undefined state.
+        /// When this function returns TEEC_SUCCESS the Implementation MUST have populated this structure with
+        /// any information necessary for subsequent operations within the Session.
+        /// The target Trusted Application is identified by a UUID passed in the parameter destination.
+        /// </summary>
+        //TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint connectionMethod, const void *connectionData, TEEC_Operation *operation, uint *returnOrigin);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_OpenSession", CallingConvention = CallingConvention.Cdecl)]
+        static public extern int OpenSession(ref TEEC_Context context, ref TEEC_Session session, TEEC_UUID destination, uint connectionMethod, byte[] connectionData, ref TEEC_Operation operation, out uint returnOrigin);
+
+        /// <summary>
+        /// This function closes a Session which has been opened with a Trusted Application.
+        /// All Commands within the Session MUST have completed before this function can be called.
+        /// The Implementation MUST do nothing if the input session parameter is NULL.
+        /// The implementation of this function MUST NOT be able to fail; after this function returns the Client
+        /// Application must be able to consider that the Session has been closed.
+        /// </summary>
+        //void TEEC_CloseSession(TEEC_Session *session);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_CloseSession", CallingConvention = CallingConvention.Cdecl)]
+        static public extern void CloseSession(ref TEEC_Session session);
+
+        /// <summary>
+        /// This function invokes a Command within the specified Session.
+        /// The parameter session MUST point to a valid open Session.
+        /// The parameter commandID is an identifier that is used to indicate which of the exposed Trusted
+        /// Application functions should be invoked. The supported command identifier values are defined by the
+        /// Trusted Application‟s protocol.
+        /// </summary>
+        //TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint commandID, TEEC_Operation *operation, uint *returnOrigin);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_InvokeCommand", CallingConvention = CallingConvention.Cdecl)]
+        static public extern int InvokeCommand(ref TEEC_Session session, uint commandID, ref TEEC_Operation operation, out uint returnOrigin);
+
+        /// <summary>
+        /// This function requests the cancellation of a pending open Session operation or a Command invocation
+        /// operation. As this is a synchronous API, this function must be called from a thread other than the one
+        /// executing the OpenSession or InvokeCommand function.
+        /// This function just sends a cancellation signal to the TEE and returns immediately; the operation is not
+        /// guaranteed to have been cancelled when this function returns. In addition, the cancellation request is just
+        /// a hint; the TEE or the Trusted Application MAY ignore the cancellation request.
+        /// </summary>
+        //void TEEC_RequestCancellation(TEEC_Operation *operation);
+        [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RequestCancellation", CallingConvention = CallingConvention.Cdecl)]
+        static public extern void RequestCancellation(ref TEEC_Operation operation);
+    }
+}
diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Types.cs b/src/Tizen.Security.TEEC/Interop/Interop.Types.cs
new file mode 100644 (file)
index 0000000..75955d1
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ *  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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
+ */
+
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_Context
+    {
+        public readonly IntPtr imp;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_Session
+    {
+        public readonly IntPtr imp;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_UUID
+    {
+        public UInt32 timeLow;
+        public UInt16 timeMid;
+        public UInt16 timeHiAndVersion;
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
+        public byte[] clockSeqAndNode;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct sTEEC_SharedMemoryImp
+    {
+        public IntPtr context;
+        public IntPtr context_imp;
+        public UInt32 flags;
+        public UInt32 memid;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_SharedMemory
+    {
+        public IntPtr buffer;
+        public UInt32 size;
+        public UInt32 flags;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_Parameter
+    {
+        public UInt32 a;
+        public UInt32 b;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    internal struct TEEC_Operation
+    {
+        public UInt32 started;
+        public UInt32 paramTypes;
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
+        public TEEC_Parameter[] paramlist;
+        public IntPtr imp;
+    }
+}
+
diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj b/src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj
new file mode 100644 (file)
index 0000000..bae5e7d
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.0</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Security TEEC API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.6</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.Security.TEEC.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+  
+</Project>
diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.snk b/src/Tizen.Security.TEEC/Tizen.Security.TEEC.snk
new file mode 100755 (executable)
index 0000000..eff1940
Binary files /dev/null and b/src/Tizen.Security.TEEC/Tizen.Security.TEEC.snk differ
diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs
new file mode 100644 (file)
index 0000000..5393400
--- /dev/null
@@ -0,0 +1,608 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  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
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Tizen.Security.TEEC
+{
+    /// <summary>
+    /// This type denotes Session Login Method used in OpenSession
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public class LoginMethod
+    {
+        /// <summary>No login data is provided.</summary>
+        public const uint Public      = 0x00000000;
+        /// <summary>Login data about the user running the Client Application process is provided.</summary>
+        public const uint User        = 0x00000001;
+        /// <summary>Login data about the group running the Client Application process is provided.</summary>
+        public const uint Group       = 0x00000002;
+        /// <summary>Login data about the running Client Application itself is provided.</summary>
+        public const uint Application = 0x00000003;
+    }
+
+    /// <summary>
+    /// This type denotes Value parameter
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum TEFValueType : UInt32
+    {
+        /// <summary>The Parameter is a ValueType tagged as input.</summary>
+        Input  = 0x00000001,
+        /// <summary>The Parameter is a ValueType tagged as output.</summary>
+        Output = 0x00000002,
+        /// <summary>The Parameter is a ValueType tagged as both as input and output.</summary>
+        InOut  = 0x00000003,
+    }
+
+    /// <summary>
+    /// This type denotes TempMemoryReference parameter
+    /// describing a region of memory which needs to be temporarily registered for the duration of the operation.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum TEFTempMemoryType : UInt32
+    {
+        /// <summary>The Parameter is a TempMemoryType and is tagged as input.</summary>
+        Input  = 0x00000005,
+        /// <summary>Same as Input, but the Memory Reference is tagged as output.</summary>
+        Output = 0x00000006,
+        /// <summary>A Temporary Memory Reference tagged as both input and output.</summary>
+        InOut  = 0x00000007,
+    }
+
+    /// <summary>
+    /// This type denotes SharedMemoryReference parameter
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum TEFRegisteredMemoryType : UInt32
+    {
+        /// <summary>The Parameter is a Registered Memory Reference that refers to the entirety of its parent Shared Memory block.</summary>
+        Whole         = 0x0000000C,
+        /// <summary>A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as input.</summary>
+        PartialInput  = 0x0000000D,
+        /// <summary>A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as output.</summary>
+        PartialOutput = 0x0000000E,
+        /// <summary>A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as both input and output.</summary>
+        PartialInOut  = 0x0000000F,
+    }
+
+    /// <summary>
+    /// This type denotes SharedMemory access direction
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    [Flags]
+    public enum SharedMemoryFlags : UInt32
+    {
+        /// <summary>A flag indicates Shared Memory can be read.</summary>
+        Input  = 0x00000001,
+        /// <summary>A flag indicates Shared Memory can be written.</summary>
+        Output = 0x00000002,
+        /// <summary>A flag indicates Shared Memory can be read and written.</summary>
+        InOut = Input | Output,
+    }
+
+    /// <summary>
+    /// This type denotes a Shared Memory block which has either been registered
+    /// with the implementation or allocated by it.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class SharedMemory
+    {
+        internal Interop.TEEC_SharedMemory shm;
+        internal SharedMemory(Interop.TEEC_SharedMemory shm)
+        {
+            this.shm=shm;
+        }
+        /// <summary>
+        /// This property represents shared memory size in bytes.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public UInt32 Size
+        {
+            get { return shm.size; }
+        }
+        /// <summary>
+        /// This property represents start address of shared memory block.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public IntPtr Address
+        {
+            get { return shm.buffer; }
+        }
+
+        /// <summary>
+        /// This function makes a copy and is designed for convenient operations on small buffers.
+        /// For large buffers direct address should be used.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="data">Source data buffer to copy data from</param>
+        /// <param name="dstOffs">Starting offset in destination shared memory</param>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public void SetData(byte[] data, int dstOffs)
+        {
+            if ((shm.flags & (uint)SharedMemoryFlags.Output) == 0) throw new InvalidOperationException("No write access");
+            //TODO copy data into shared memory starting at given offset
+        }
+        /// <summary>
+        /// This function makes a copy and is designed for convenient operations on small buffers.
+        /// For large buffers direct address should be used.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="data">Destination data buffer to copy data into</param>
+        /// <param name="srcOffs">Starting offset in source shared memory</param>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public void GetData(byte[] data, int srcOffs)
+        {
+            if ((shm.flags & (uint)SharedMemoryFlags.Input) == 0) throw new InvalidOperationException("No read access");
+            //TODO copy data from shared memory starting at given offset
+        }
+    };
+
+    /// <summary>
+    /// This type defines the payload of either an open Session operation or an invoke Command operation. It is
+    /// also used for cancellation of operations, which may be desirable even if no payload is passed.
+    /// Parameters are used to exchange data between CA and TA
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public abstract class Parameter
+    {
+        internal Parameter(uint t)
+        {
+            this.NativeType = t;
+        }
+        internal uint NativeType { get; }
+    };
+
+    /// <summary>
+    /// This type defines a template for parameter types.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public abstract class BaseParameter<TEnum> : Parameter where TEnum : struct, IComparable, IFormattable, IConvertible // as close to Enum as possible
+    {
+        internal BaseParameter(TEnum t) : base((uint)(object)t)
+        {
+            Type = t;
+        }
+
+        /// <summary>
+        /// This property represents access type to this parameter.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public TEnum Type { get; }
+    }
+
+    /// <summary>
+    /// This type defines a temporary memory reference.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class TempMemoryReference : BaseParameter<TEFTempMemoryType>
+    {
+        /// <summary>
+        /// Constructs Prameter object which holds info about temporary memory copied to/from TA
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="buffer">Address of allocated memory buffer</param>
+        /// <param name="size">Size of the buffer</param>
+        /// <param name="type">Kind of access allowed for TA <see cref="TEFTempMemoryType"/></param>
+        public TempMemoryReference(IntPtr buffer, uint size, TEFTempMemoryType type) :
+                base(type)
+        {
+            this.Buffer = buffer;
+            this.Size = size;
+        }
+        /// <summary>
+        /// This property represents memory address of buffer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public IntPtr Buffer { get; }
+        /// <summary>
+        /// This property represents size of buffer.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public uint Size { get; }
+    };
+
+    /// <summary>
+    /// This type defines a memory reference that uses a pre-registered or pre-allocated Shared Memory block.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class RegisteredMemoryReference : BaseParameter<TEFRegisteredMemoryType>
+    {
+        /// <summary>
+        /// Constructs Prameter object which holds info about registered memory shared with TA
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="parent">Shared memory - registered or allocated</param>
+        /// <param name="size">Size of the buffer part</param>
+        /// <param name="offset">Offset of buffer in shared memory</param>
+        /// <param name="type">Kind of access allowed for TA <see cref="TEFRegisteredMemoryType"/></param>
+        public RegisteredMemoryReference(SharedMemory parent, uint size, uint offset, TEFRegisteredMemoryType type) :
+                base(type)
+        {
+            this.Parent = parent;
+            this.Size = size;
+            this.Offset = offset;
+        }
+        /// <summary>
+        /// This property represents SharedMemory that is referred to.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public SharedMemory Parent { get; }
+        /// <summary>
+        /// This property represents size (in bytes) of SharedMemory.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public uint Size { get; }
+        /// <summary>
+        /// This property represents offset (in bytes) from the begin of SharedMemory.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public uint Offset { get; }
+    };
+
+    /// <summary>
+    /// This type defines a parameter that is not referencing shared memory, but carries instead small raw data
+    /// passed by value.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class Value : BaseParameter<TEFValueType>
+    {
+        /// <summary>
+        /// Constructs Prameter object which holds info about int values copied to/from TA
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="a">User paramter A</param>
+        /// <param name="b">User paramter B</param>
+        /// <param name="type">Kind of access allowed for TA <see cref="TEFValueType"/></param>
+        public Value(uint a, uint b, TEFValueType type) :
+                base(type)
+        {
+            this.A = a;
+            this.B = b;
+        }
+        /// <summary>
+        /// This property represents unsigned integer A.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public uint A { get; }
+        /// <summary>
+        /// This property represents unsigned integer B.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public uint B { get; }
+    };
+
+
+    /// <summary>
+    /// This type denotes a TEE Session, the logical container linking a Client Application with a particular Trusted Application.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class Session
+    {
+        private Interop.TEEC_Context context;
+        private Interop.TEEC_Session session;
+
+        internal Session(Interop.TEEC_Context context) {
+            this.context = context;
+            this.session = new Interop.TEEC_Session();
+        }
+
+        ~Session()
+        {
+            Close();
+        }
+
+        internal void Open(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist)
+        {
+            Interop.TEEC_UUID uuid = new Interop.TEEC_UUID();
+            Interop.TEEC_Operation op = new Interop.TEEC_Operation();
+            uint ro;
+
+            int ret = Interop.Libteec.OpenSession(ref context, ref session, uuid, loginMethod, connectionData, ref op, out ro);
+            //MAYBE map origin of return code to specyfic Exception
+            Interop.CheckNThrowException(ret, string.Format("OpenSession('{0}')", destination));
+        }
+
+        /// <summary>
+        /// This function closes a Session which has been opened with a Trusted Application.
+        /// All Commands within the Session MUST have completed before this function can be called.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public void Close() {
+            Interop.Libteec.CloseSession(ref session);
+            //session = null;
+        }
+
+        /// <summary>
+        /// This function invokes a Command within the specified Session.
+        /// The parameter commandID is an identifier that is used to indicate which of the exposed Trusted
+        /// Application functions should be invoked. The supported command identifier values are defined by the
+        /// Trusted Application's protocol.
+        /// There can be up to four Parameter objects given in the <paramref name="paramlist"/> array
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="commandID">The command</param>
+        /// <param name="paramlist">The array of parameters</param>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">The argument <paramref name="paramlist"/> is wrong</exception>
+        public void InvokeCommand(uint commandID, Parameter[] paramlist)
+        {
+            Interop.TEEC_Operation op = new Interop.TEEC_Operation();
+            op.started=0;
+            op.paramTypes=0;
+
+            for (int i=0; i < 4; ++i) {
+                Parameter p = paramlist[i];
+                //TODO fill TEEC_Operation struct
+            }
+
+            uint ro;
+            int ret = Interop.Libteec.InvokeCommand(ref session, commandID, ref op, out ro);
+            //MAYBE map origin of return code to specific Exception
+            Interop.CheckNThrowException(ret, string.Format("InvokeCommand({0})", commandID));
+        }
+
+        /// <summary>
+        /// Asynchronous version of InvokeCommand
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="commandID">The command</param>
+        /// <param name="paramlist">The array of parameters</param>
+        /// <param name="token">The token for task manipulation</param>
+        /// <returns>Returns Task executing invoke command in backgroung</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">One of arguments is wrong</exception>
+        public async Task InvokeCommandAsync(uint commandID, Parameter[] paramlist, CancellationToken token = default(CancellationToken))
+        {
+            await Task.Factory.StartNew(() => InvokeCommand(commandID, paramlist));
+        }
+
+    };
+
+    /// <summary>
+    /// This type denotes a TEE Context, the main logical container linking a Client Application with a particular TEE.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public sealed class Context : IDisposable
+    {
+        private Interop.TEEC_Context context;
+
+        /// <summary>
+        /// This function (constructor) initializes a new TEE Context, forming a connection between this Client Application and the
+        /// TEE identified by the string identifier name (empty or null name denotes default TEE).
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="name">The TEE name</param>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public Context(string name)
+        {
+            context = new Interop.TEEC_Context();
+            int ret = Interop.Libteec.InitializeContext(name, ref context);
+            Interop.CheckNThrowException(ret, string.Format("InititalizeContext('{0}')", name));
+        }
+
+        ~Context()
+        {
+            Dispose();
+        }
+
+        /// <summary>
+        /// This function implements IDisposable interface
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        public void Dispose() {
+            Interop.Libteec.FinalizeContext(ref context);
+            //context.imp = null;
+        }
+
+        /// <summary>
+        /// This function opens a new Session between the Client Application and the specified Trusted Application.
+        /// The target Trusted Application is identified by a UUID passed in the parameter destination.
+        /// There can be up to four Parameter objects given in the <paramref name="paramlist"/> array
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="destination">The UUID of destination TA</param>
+        /// <param name="loginMethod">The authentication algorithm <see cref="LoginMethod" /></param>
+        /// <param name="connectionData">The data to be verified by given login method</param>
+        /// <param name="paramlist">The parameters to be passed to TA open-session-callback</param>
+        /// <returns>Returns opened session</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">One of arguments is wrong</exception>
+        public Session OpenSession(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist)
+        {
+            Session ses = new Session(context);
+            ses.Open(destination, loginMethod, connectionData, paramlist);
+            return ses;
+        }
+        /// <summary>
+        /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="destination">The UUID of destination TA</param>
+        /// <returns>Returns opened session</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public Session OpenSession(Guid destination)
+        {
+            Session ses = new Session(context);
+            ses.Open(destination, LoginMethod.Public, null, null);
+            return ses;
+        }
+
+        /// <summary>
+        /// Asynchronous version of OpenSession
+        /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="destination">The UUID of destination TA</param>
+        /// <param name="loginMethod">The authentication algorithm <see cref="LoginMethod" /></param>
+        /// <param name="connectionData">The data to be verified by given login method</param>
+        /// <param name="paramlist">The parameters to be passed to TA open-session-callback</param>
+        /// <param name="token">The token for task manipulation</param>
+        /// <returns>Returns Task executing session open in backgroung</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">One of arguments is wrong</exception>
+        public async Task<Session> OpenSessionAsync(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token = default(CancellationToken))
+        {
+            Task<Session> task = Task<Session>.Factory.StartNew(() =>
+            {
+                return OpenSession(destination, loginMethod, connectionData, paramlist);
+            });
+            return await task;
+        }
+        /// <summary>
+        /// Asynchronous version of OpenSession
+        /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="destination">The UUID of destination TA</param>
+        /// <param name="token">The token for task manipulation</param>
+        /// <returns>Returns Task executing session open in backgroung</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public async Task<Session> OpenSessionAsync(Guid destination, CancellationToken token = default(CancellationToken))
+        {
+            Task<Session> task = Task<Session>.Factory.StartNew(() =>
+            {
+                return OpenSession(destination);
+            });
+            return await task;
+        }
+
+        /// <summary>
+        /// This function registers a block of existing Client Application memory as a block of Shared Memory within
+        /// the scope of the specified Context, in accordance with the parameters.
+        /// The input <paramref name="memaddr"/> MUST point to the shared memory region to register
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="memaddr">The address of shared memory</param>
+        /// <param name="size">The size of shared memory</param>
+        /// <param name="flags">The flags describing access modes (Input and/or Output)</param>
+        /// <returns>Returns SharedMemory handler</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">The argument <paramref name="memaddr"/> is wrong</exception>
+        public SharedMemory RegisterSharedMemory(IntPtr memaddr, UInt32 size, SharedMemoryFlags flags)
+        {
+            Interop.TEEC_SharedMemory shm = new Interop.TEEC_SharedMemory();
+            shm.buffer = memaddr;
+            shm.size = size;
+            shm.flags = (UInt32)flags;
+            int ret = Interop.Libteec.RegisterSharedMemory(ref context, ref shm);
+            Interop.CheckNThrowException(ret, "RegisterSharedMemory");
+            return new SharedMemory(shm);
+        }
+
+        /// <summary>
+        /// This function allocates a new block of memory as a block of Shared Memory within the scope of the
+        /// specified Context, in accordance with the parameters.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="size">The size of shared memory</param>
+        /// <param name="flags">The flags describing access modes (Input and/or Output)</param>
+        /// <returns>Returns SharedMemory handler</returns>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        public SharedMemory AllocateSharedMemory(UInt32 size, SharedMemoryFlags flags)
+        {
+            Interop.TEEC_SharedMemory shm = new Interop.TEEC_SharedMemory();
+            shm.size = size;
+            shm.flags = (UInt32)flags;
+            int ret = Interop.Libteec.AllocateSharedMemory(ref context, ref shm);
+            Interop.CheckNThrowException(ret, "AllocateSharedMemory");
+            return new SharedMemory(shm);
+        }
+
+        /// <summary>
+        /// This function deregisters or deallocates a previously initialized block of Shared Memory.
+        /// </summary>
+        /// <remarks>
+        /// For a memory buffer allocated using AllocateSharedMemory the Implementation MUST free the
+        /// underlying memory and the Client Application MUST NOT access this region after this function has been
+        /// called. In this case the Implementation MUST clear the buffer and size fields of the sharedMem
+        /// structure before returning.
+        /// For memory registered using RegisterSharedMemory the implementation MUST deregister the
+        /// underlying memory from the TEE, but the memory region will stay available to the Client Application for
+        /// other purposes as the memory is owned by it.
+        /// </remarks>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="shm">The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory</param>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
+        /// <feature>http://tizen.org/feature/security.tee</feature>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
+        /// <exception cref="ArgumentException">The argument is wrong</exception>
+        public void ReleaseSharedMemory(SharedMemory shm)
+        {
+            Interop.Libteec.ReleaseSharedMemory(ref shm.shm);
+        }
+    };
+}
diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs
new file mode 100644 (file)
index 0000000..36e1b15
--- /dev/null
@@ -0,0 +1,78 @@
+/**
+<summary>
+The communication API for connecting Client Applications running in a rich operating environment
+with security related Trusted Applications running inside a Trusted Execution Environment (TEE).
+</summary>
+
+<remarks>
+<h2>Overview</h2>
+<para>
+A TEE provides an execution environment with security capabilities, which are either available to Trusted Applications
+running inside the TEE or exposed externally to Client Applications.
+The TEE Client API concentrates on the interface to enable efficient communications between
+a Client Application and a Trusted Application running inside the TEE.
+Higher level standards and protocol layers may be built on top of the foundation
+provided by the TEE Client API – for example, to cover common tasks such as secure storage,
+cryptography, and run-time installation of new Trusted Applications.
+The separation between the rich environment and the TEE is guaranted.
+</para>
+<para>
+The key design principles of the TEE Client API are:
+<list type="bullet">
+<item>
+       <term>Client-side memory allocations</term>
+       <description>
+       Where possible the design of the TEE Client API has placed the responsibility for memory
+       allocation on the calling Client Application code. This gives the Client developer choice of
+       memory allocation locations, enabling simple optimizations such as stack-based allocation
+       or enhanced flexibility using placements in static global memory or thread-local storage.<br />
+       This design choice is evident in the API by the use of pointers to structures rather than
+       opaque handles to represent any manipulated objects.
+       </description>
+</item>
+<item>
+       <term>Aim for zero-copy data transfer</term>
+       <description>
+       The features of the TEE Client API are chosen to maximize the possibility of zero-copy
+       data transfer between the Client Application and the Trusted Application.<br />
+       However, short messages can also be passed by copy, which avoids the overhead of
+       sharing memory.
+       </description>
+</item>
+<item>
+       <term>Support memory sharing by pointers</term>
+       <description>
+       The TEE Client API will be used to implement higher-level APIs, such as cryptography or
+       secure storage, where the caller will often provide memory buffers for input or output data
+       using simple C pointers. The TEE Client API must allow efficient sharing of this type of
+       memory, and as such does not rely on the Client Application being able to use bulk
+       memory buffers allocated by the TEE Client API.
+       </description>
+</item>
+<item>
+       <term>Specify only communication mechanisms</term>
+       <description>
+       This API focuses on defining the underlying communications channel. It does not define
+       the format of the messages which pass over the channel, or the protocols used by specific
+       Trusted Applications.
+       </description>
+</item>
+
+</list>
+</para>
+</remarks>
+
+<example>
+The following example demonstrates how to invoke command on Trused Application.
+<code>
+    Guid ta_uuid = new Guid("TA-guid-put-here");
+    Context ctx = new Context(null);
+    Session ses = ctx.OpenSession(ta_uuid);
+    Parameter[] p = { new Value(1,2,TEFValueType.In) };
+    ses.InvokeCommand(1, p);
+    ses.Close();
+    ctx.Dispose();
+</code>
+</example>
+*/
+namespace Tizen.Security.TEEC {}
diff --git a/src/Tizen.System.Feedback/Feedback/Feedback.cs b/src/Tizen.System.Feedback/Feedback/Feedback.cs
new file mode 100644 (file)
index 0000000..5bd1d0c
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// Class for constants
+    /// </summary>
+    internal static class Constants
+    {
+        internal const int NumberOfPattern = 39;
+    }
+
+    /// <summary>
+    /// The Feedback API provides functions to control haptic and sound.
+    /// The Feedback API provides the way to play and stop feedback and get the information whether specific pattern is supported.
+    /// Below is supported pattern string.
+    /// Tap
+    /// SoftInputPanel
+    /// Key0
+    /// Key1
+    /// Key2
+    /// Key3
+    /// Key4
+    /// Key5
+    /// Key6
+    /// Key7
+    /// Key8
+    /// Key9
+    /// KeyStar
+    /// KeySharp
+    /// KeyBack
+    /// Hold
+    /// HardwareKeyPressed
+    /// HardwareKeyHold
+    /// Message
+    /// Email
+    /// WakeUp
+    /// Schedule
+    /// Timer
+    /// General
+    /// PowerOn
+    /// PowerOff
+    /// ChargerConnected
+    /// ChargingError
+    /// FullyCharged
+    /// LowBattery
+    /// Lock
+    /// UnLock
+    /// VibrationModeAbled
+    /// SilentModeDisabled
+    /// BluetoothDeviceConnected
+    /// BluetoothDeviceDisconnected
+    /// ListReorder
+    /// ListSlider
+    /// VolumeKeyPressed
+    /// </summary>
+    /// <privilege>
+    /// For controlling haptic device:
+    /// http://tizen.org/privilege/haptic
+    /// For controlling sound, previlege is not needed.
+    /// </privilege>
+    /// <code>
+    /// Feedback feedback = new Feedback();
+    /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
+    /// </code>
+    public class Feedback
+    {
+        private const string LogTag = "Tizen.System.Feedback";
+
+        private readonly FeedbackPattern[] Pattern = new FeedbackPattern[39];
+        public Feedback()
+        {
+            Pattern[0].PatternNumber = 0;
+            Pattern[0].PatternString = "Tap";
+            Pattern[1].PatternNumber = 1;
+            Pattern[1].PatternString = "SoftInputPanel";
+            Pattern[2].PatternNumber = 6;
+            Pattern[2].PatternString = "Key0";
+            Pattern[3].PatternNumber = 7;
+            Pattern[3].PatternString = "Key1";
+            Pattern[4].PatternNumber = 8;
+            Pattern[4].PatternString = "Key2";
+            Pattern[5].PatternNumber = 9;
+            Pattern[5].PatternString = "Key3";
+            Pattern[6].PatternNumber = 10;
+            Pattern[6].PatternString = "Key4";
+            Pattern[7].PatternNumber = 11;
+            Pattern[7].PatternString = "Key5";
+            Pattern[8].PatternNumber = 12;
+            Pattern[8].PatternString = "Key6";
+            Pattern[9].PatternNumber = 13;
+            Pattern[9].PatternString = "Key7";
+            Pattern[10].PatternNumber = 14;
+            Pattern[10].PatternString = "Key8";
+            Pattern[11].PatternNumber = 15;
+            Pattern[11].PatternString = "Key9";
+            Pattern[12].PatternNumber = 16;
+            Pattern[12].PatternString = "KeyStar";
+            Pattern[13].PatternNumber = 17;
+            Pattern[13].PatternString = "KeySharp";
+            Pattern[14].PatternNumber = 18;
+            Pattern[14].PatternString = "KeyBack";
+            Pattern[15].PatternNumber = 19;
+            Pattern[15].PatternString = "Hold";
+            Pattern[16].PatternNumber = 21;
+            Pattern[16].PatternString = "HardwareKeyPressed";
+            Pattern[17].PatternNumber = 22;
+            Pattern[17].PatternString = "HardwareKeyHold";
+            Pattern[18].PatternNumber = 23;
+            Pattern[18].PatternString = "Message";
+            Pattern[19].PatternNumber = 25;
+            Pattern[19].PatternString = "Email";
+            Pattern[20].PatternNumber = 27;
+            Pattern[20].PatternString = "WakeUp";
+            Pattern[21].PatternNumber = 29;
+            Pattern[21].PatternString = "Schedule";
+            Pattern[22].PatternNumber = 31;
+            Pattern[22].PatternString = "Timer";
+            Pattern[23].PatternNumber = 33;
+            Pattern[23].PatternString = "General";
+            Pattern[24].PatternNumber = 36;
+            Pattern[24].PatternString = "PowerOn";
+            Pattern[25].PatternNumber = 37;
+            Pattern[25].PatternString = "PowerOff";
+            Pattern[26].PatternNumber = 38;
+            Pattern[26].PatternString = "ChargerConnected";
+            Pattern[27].PatternNumber = 40;
+            Pattern[27].PatternString = "ChargingError";
+            Pattern[28].PatternNumber = 42;
+            Pattern[28].PatternString = "FullyCharged";
+            Pattern[29].PatternNumber = 44;
+            Pattern[29].PatternString = "LowBattery";
+            Pattern[30].PatternNumber = 46;
+            Pattern[30].PatternString = "Lock";
+            Pattern[31].PatternNumber = 47;
+            Pattern[31].PatternString = "UnLock";
+            Pattern[32].PatternNumber = 55;
+            Pattern[32].PatternString = "VibrationModeAbled";
+            Pattern[33].PatternNumber = 56;
+            Pattern[33].PatternString = "SilentModeDisabled";
+            Pattern[34].PatternNumber = 57;
+            Pattern[34].PatternString = "BluetoothDeviceConnected";
+            Pattern[35].PatternNumber = 58;
+            Pattern[35].PatternString = "BluetoothDeviceDisconnected";
+            Pattern[36].PatternNumber = 62;
+            Pattern[36].PatternString = "ListReorder";
+            Pattern[37].PatternNumber = 63;
+            Pattern[37].PatternString = "ListSlider";
+            Pattern[38].PatternNumber = 64;
+            Pattern[38].PatternString = "VolumeKeyPressed";
+
+            Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Initialize();
+            if (res != Interop.Feedback.FeedbackError.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to initialize feedback. err = {0}", res));
+                switch (res)
+                {
+                    case Interop.Feedback.FeedbackError.NotSupported:
+                        throw new NotSupportedException("Device is not supported");
+                    default:
+                        throw new InvalidOperationException("Failed to initialize");
+                }
+            }
+        }
+
+        ~Feedback()
+        {
+            Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Deinitialize();
+            if (res != Interop.Feedback.FeedbackError.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to deinitialize feedback. err = {0}", res));
+                switch (res)
+                {
+                    case Interop.Feedback.FeedbackError.NotInitialized:
+                        throw new Exception("Not initialized");
+                    default:
+                        throw new InvalidOperationException("Failed to initialize");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Get supported information about specific type and pattern
+        /// </summary>
+        /// <remarks>
+        /// Now, IsSupportedPattern is not working for FeedbackType.All.
+        /// This API is working for FeedbackType.Sound and FeedbackType.Vibration only.
+        /// If you use FeedbackType.All for type parameter, this API will throw ArgumentException.
+        /// To get supported information for Vibration type, app should have http://tizen.org/privilege/haptic privilege.
+        /// </remarks>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">Feedback type</param>
+        /// <param name="pattern">Feedback pattern string</param>
+        /// <returns>Information whether pattern is supported</returns>
+        /// <exception cref="Exception">Thrown when failed because feedback is not initialized</exception>
+        /// <exception cref="ArgumentException">Thrown when failed because of a invalid arguament</exception>
+        /// <exception cref="NotSupportedException">Thrown when failed becuase device(haptic, sound) is not supported</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when failed because access is not granted(No privilege)</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of system error</exception>
+        /// <privilege>http://tizen.org/privilege/haptic</privilege>
+        /// <example>
+        /// <code>
+           /// Feedback feedback = new Feedback();
+        /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
+        /// </code>
+        /// </example>
+        public bool IsSupportedPattern(FeedbackType type, String pattern)
+        {
+            bool supported = false;
+            bool found = false;
+            int i = 0;
+            Interop.Feedback.FeedbackError res;
+
+            for (i = 0; i < Constants.NumberOfPattern; i++)
+            {
+                if (String.Compare(pattern, Pattern[i].PatternString) == 0)
+                {
+                    found = true;
+                    break;
+                }
+            }
+
+            if (!found)
+                throw new ArgumentException("Invalid Arguments");
+
+            res = (Interop.Feedback.FeedbackError)Interop.Feedback.IsSupportedPattern((Interop.Feedback.FeedbackType)type, Pattern[i].PatternNumber, out supported);
+
+
+            if (res != Interop.Feedback.FeedbackError.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get supported information. err = {0}", res));
+                switch (res)
+                {
+                    case Interop.Feedback.FeedbackError.NotInitialized:
+                        throw new Exception("Not initialized");
+                    case Interop.Feedback.FeedbackError.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.Feedback.FeedbackError.NotSupported:
+                        throw new NotSupportedException("Device is not supported");
+                    case Interop.Feedback.FeedbackError.PermissionDenied:
+                        throw new UnauthorizedAccessException("Access is not granted");
+                    case Interop.Feedback.FeedbackError.OperationFailed:
+                    default:
+                        throw new InvalidOperationException("Failed to get supported information");
+                }
+            }
+            return supported;
+        }
+
+        /// <summary>
+        /// Play specific feedback pattern
+        /// </summary>
+        /// <remarks>
+        /// To play Vibration type, app should have http://tizen.org/privilege/haptic privilege.
+        /// </remarks>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="type">Feedback type</param>
+        /// <param name="pattern">Feedback pattern string</param>
+        /// <exception cref="Exception">Thrown when failed because feedback is not initialized</exception>
+        /// <exception cref="ArgumentException">Thrown when failed because of a invalid arguament</exception>
+        /// <exception cref="NotSupportedException">Thrown when failed because device(haptic, sound) or specific pattern is not supported</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when failed because access is not granted(No privilege)</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of system error</exception>
+        /// <privilege>http://tizen.org/privilege/haptic</privilege>
+        /// <example>
+        /// <code>
+        /// Feedback feedback = new Feedback();
+        /// feedback.Play(FeedbackType.All, "Tap");
+        /// </code>
+        /// </example>
+        public void Play(FeedbackType type, String pattern)
+        {
+            bool found = false;
+            int i = 0;
+            Interop.Feedback.FeedbackError res;
+
+            for (i = 0; i < Constants.NumberOfPattern; i++)
+            {
+                if (String.Compare(pattern, Pattern[i].PatternString) == 0)
+                {
+                    found = true;
+                    break;
+                }
+            }
+
+            if (!found)
+                throw new ArgumentException("Invalid Arguments");
+
+            if (type == FeedbackType.All)
+                res = (Interop.Feedback.FeedbackError)Interop.Feedback.Play(Pattern[i].PatternNumber);
+            else
+                res = (Interop.Feedback.FeedbackError)Interop.Feedback.PlayType((Interop.Feedback.FeedbackType)type, Pattern[i].PatternNumber);
+
+            if (res != Interop.Feedback.FeedbackError.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to play feedback. err = {0}", res));
+                switch (res)
+                {
+                    case Interop.Feedback.FeedbackError.NotInitialized:
+                        throw new Exception("Not initialized");
+                    case Interop.Feedback.FeedbackError.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.Feedback.FeedbackError.NotSupported:
+                        throw new NotSupportedException("Not supported");
+                    case Interop.Feedback.FeedbackError.PermissionDenied:
+                        throw new UnauthorizedAccessException("Access is not granted");
+                    case Interop.Feedback.FeedbackError.OperationFailed:
+                    default:
+                        throw new InvalidOperationException("Failed to play pattern");
+                }
+            }
+        }
+
+        /// <summary>
+        /// Stop to play feedback
+        /// </summary>
+        /// <remarks>
+        /// To stop vibration, app should have http://tizen.org/privilege/haptic privilege.
+        /// </remarks>
+        /// <since_tizen> 3 </since_tizen>
+        /// <exception cref="Exception">Thrown when failed because feedback is not initialized</exception>
+        /// <exception cref="ArgumentException">Thrown when failed because of a invalid arguament</exception>
+        /// <exception cref="NotSupportedException">Thrown when failed because device(haptic, sound) or specific pattern is not supported</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when failed because access is not granted(No privilege)</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of system error</exception>
+        /// <privilege>http://tizen.org/privilege/haptic</privilege>
+        /// <example>
+        /// <code>
+        /// Feedback Feedback1 = new Feedback();
+        /// Feedback1.Stop();
+        /// </code>
+        /// </example>
+        public void Stop()
+        {
+            Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Stop();
+
+            if (res != Interop.Feedback.FeedbackError.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to stop feedback. err = {0}", res));
+                switch (res)
+                {
+                    case Interop.Feedback.FeedbackError.NotInitialized:
+                        throw new Exception("Not initialized");
+                    case Interop.Feedback.FeedbackError.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.Feedback.FeedbackError.NotSupported:
+                        throw new NotSupportedException("Not supported");
+                    case Interop.Feedback.FeedbackError.PermissionDenied:
+                        throw new UnauthorizedAccessException("Access is not granted");
+                    case Interop.Feedback.FeedbackError.OperationFailed:
+                    default:
+                        throw new InvalidOperationException("Failed to stop pattern");
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs b/src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs
new file mode 100644 (file)
index 0000000..2ebc82f
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// String and Enumeration for feedback patterns.
+    /// </summary>
+    internal struct FeedbackPattern
+    {
+        internal int PatternNumber;
+        internal string PatternString;
+
+        internal FeedbackPattern(int n, string s)
+        {
+            PatternNumber = n;
+            PatternString = s;
+        }
+    }
+}
diff --git a/src/Tizen.System.Feedback/Feedback/FeedbackType.cs b/src/Tizen.System.Feedback/Feedback/FeedbackType.cs
new file mode 100644 (file)
index 0000000..e387b1c
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// Enumeration for feedback device types.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    public enum FeedbackType
+    {
+        /// <summary>
+        ///  Sound and Vibration
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        All = 0,
+        /// <summary>
+        /// Sound feedback
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Sound = Interop.Feedback.FeedbackType.Sound,
+        /// <summary>
+        /// Vibration
+        /// /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        Vibration = Interop.Feedback.FeedbackType.Vibration,
+    }
+}
diff --git a/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs b/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs
new file mode 100644 (file)
index 0000000..6b3e572
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Feedback
+    {
+        internal enum FeedbackError
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            OperationFailed = Tizen.Internals.Errors.ErrorCode.NotPermitted,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            NotInitialized = -0x00020000 | 0x12,
+        }
+
+        // Any change here might require changes in Tizen.System.FeedbackType enum
+        internal enum FeedbackType
+        {
+            Sound = 1,
+            Vibration = 2,
+        }
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_initialize")]
+        internal static extern int Initialize();
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_deinitialize")]
+        internal static extern int Deinitialize();
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_play")]
+        internal static extern int Play(int pattern);
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type")]
+        internal static extern int PlayType(FeedbackType type, int pattern);
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop")]
+        internal static extern int Stop();
+
+        [DllImport(Libraries.Feedback, EntryPoint = "feedback_is_supported_pattern")]
+        internal static extern int IsSupportedPattern(FeedbackType type, int pattern, out bool supported);
+    }
+}
diff --git a/src/Tizen.System.Feedback/Interop/Interop.Libraries.cs b/src/Tizen.System.Feedback/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..c84daae
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        internal const string Feedback = "libfeedback.so.0";
+    }
+}
diff --git a/src/Tizen.System.Feedback/Tizen.System.Feedback.csproj b/src/Tizen.System.Feedback/Tizen.System.Feedback.csproj
new file mode 100644 (file)
index 0000000..8bc23f8
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Version>1.0.3</Version>
+    <Authors>Samsung Electronics</Authors>
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>
+    <Description>Provides the Feedback API for Tizen .NET</Description>
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Tizen.System.Feedback.snk</AssemblyOriginatorKeyFile>
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen" Version="1.0.5" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Tizen.System.Feedback/Tizen.System.Feedback.snk b/src/Tizen.System.Feedback/Tizen.System.Feedback.snk
new file mode 100755 (executable)
index 0000000..27de4ab
Binary files /dev/null and b/src/Tizen.System.Feedback/Tizen.System.Feedback.snk differ
diff --git a/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo b/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo
new file mode 100644 (file)
index 0000000..e542b89
Binary files /dev/null and b/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo differ
diff --git a/src/Tizen.System.Information/Interop/Interop.Libraries.cs b/src/Tizen.System.Information/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..ddb1884
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        internal const string RuntimeInfo = "libcapi-system-runtime-info.so.0";
+        internal const string SystemInfo = "libcapi-system-info.so.0";
+    }
+}
diff --git a/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs b/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs
new file mode 100644 (file)
index 0000000..21ab05e
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.System;
+
+internal static partial class Interop
+{
+    internal static partial class RuntimeInfo
+    {
+        public delegate void RuntimeInformationChangedCallback(RuntimeInformationKey key, IntPtr userData);
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct MemoryInfo
+        {
+            public readonly int Total;
+            public readonly int Used;
+            public readonly int Free;
+            public readonly int Cache;
+            public readonly int Swap;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct ProcessMemoryInfo
+        {
+            public readonly int Vsz;
+            public readonly int Rss;
+            public readonly int Pss;
+            public readonly int SharedClean;
+            public readonly int SharedDirty;
+            public readonly int PrivateClean;
+            public readonly int PrivateDirty;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct CpuUsage
+        {
+            public readonly double User;
+            public readonly double System;
+            public readonly double Nice;
+            public readonly double IoWait;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct ProcessCpuUsage
+        {
+            public readonly uint UTime;
+            public readonly uint STime;
+        }
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_int")]
+        public static extern int GetValue(RuntimeInformationKey key, out int status);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_bool")]
+        public static extern int GetValue(RuntimeInformationKey key, out bool status);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_double")]
+        public static extern int GetValue(RuntimeInformationKey key, out double status);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_string")]
+        public static extern int GetValue(RuntimeInformationKey key, out string status);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_system_memory_info")]
+        public static extern int GetSystemMemoryInfo(out MemoryInfo memoryInfo);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_memory_info")]
+        public static extern int GetProcessMemoryInfo(int[] pid, int size, out ProcessMemoryInfo[] array);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_cpu_usage")]
+        public static extern int GetCpuUsage(out CpuUsage cpuUsage);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_cpu_usage")]
+        public static extern int GetProcessCpuUsage(int[] pid, int size, out ProcessCpuUsage[] array);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_count")]
+        public static extern int GetProcessorCount(out int processorCount);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_current_frequency")]
+        public static extern int GetProcessorCurrentFrequency(int coreId, out int cpuFreq);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_max_frequency")]
+        public static extern int GetProcessorMaxFrequency(int coreId, out int cpuFreq);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_set_changed_cb")]
+        public static extern int SetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey, RuntimeInformationChangedCallback cb, IntPtr userData);
+
+        [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_unset_changed_cb")]
+        public static extern int UnsetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey);
+    }
+}
diff --git a/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs b/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs
new file mode 100644 (file)
index 0000000..de7282e
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class SystemInfo
+    {
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice,
+        }
+
+        internal enum SystemInfoValueType
+        {
+            Bool = 0,
+            Int = 1,
+            Double = 2,
+            String = 3,
+        }
+
+        internal enum SystemInfoType
+        {
+            platform,
+            Custom,
+            None,
+        }
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_type")]
+        internal static extern ErrorCode SystemInfoGetPlatformType(string key, out SystemInfoValueType type);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_type")]
+        internal static extern ErrorCode SystemInfoGetCustomType(string key, out SystemInfoValueType type);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_bool")]
+        internal static extern ErrorCode SystemInfoGetPlatformBool(string key, out bool value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_int")]
+        internal static extern ErrorCode SystemInfoGetPlatformInt(string key, out int value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_double")]
+        internal static extern ErrorCode SystemInfoGetPlatformDouble(string key, out double value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_string")]
+        internal static extern ErrorCode SystemInfoGetPlatformString(string key, out string value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_bool")]
+        internal static extern ErrorCode SystemInfoGetCustomBool(string key, out bool value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_int")]
+        internal static extern ErrorCode SystemInfoGetCustomInt(string key, out int value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_double")]
+        internal static extern ErrorCode SystemInfoGetCustomDouble(string key, out double value);
+
+        [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_string")]
+        internal static extern ErrorCode SystemInfoGetCustomString(string key, out string value);
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs b/src/Tizen.System.Information/RuntimeInfo/CpuUsage.cs
new file mode 100755 (executable)
index 0000000..35ceb90
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// The structure for CPU usage.
+    /// </summary>
+    public class CpuUsage
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal CpuUsage(Interop.RuntimeInfo.CpuUsage usage)
+        {
+            IoWait = usage.IoWait;
+            Nice = usage.IoWait;
+            System = usage.System;
+            User = usage.User;
+        }
+        /// <summary>
+        /// Running time of un-niced user processes (Percent).
+        /// </summary>
+        public double User { get; internal set; }
+        /// <summary>
+        /// Running time of kernel processes (Percent).
+        /// </summary>
+        public double System { get; internal set; }
+        /// <summary>
+        /// Running time of niced user processes (Percent).
+        /// </summary>
+        public double Nice { get; internal set; }
+        /// <summary>
+        /// Time waiting for I/O completion (Percent).
+        /// </summary>
+        public double IoWait { get; internal set; }
+    }
+
+    /// <summary>
+    /// The structure for CPU usage per process.
+    /// </summary>
+    public class ProcessCpuUsage
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal ProcessCpuUsage(Interop.RuntimeInfo.ProcessCpuUsage usage)
+        {
+            UTime = usage.UTime;
+            STime = usage.STime;
+        }
+        /// <summary>
+        /// The amount of time this process has been scheduled in user mode (clock ticks).
+        /// </summary>
+        public uint UTime { get; internal set; }
+        /// <summary>
+        /// The amount of time this process has been scheduled in kernel mode (clock ticks).
+        /// </summary>
+        public uint STime { get; internal set; }
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs b/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs
new file mode 100755 (executable)
index 0000000..8b2fcf0
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// Enumeration for the runtime information key.
+    /// </summary>
+    public enum RuntimeInformationKey
+    {
+        /// <summary>
+        /// Indicates whether Bluetooth is enabled.
+        /// </summary>
+        Bluetooth = 2,
+        /// <summary>
+        /// Indicates whether Wi-Fi hotspot is enabled.
+        /// <see cref="WifiStatus"/>
+        /// </summary>
+        WifiHotspot = 3,
+        /// <summary>
+        /// Indicates whether Bluetooth tethering is enabled.
+        /// </summary>
+        BluetoothTethering = 4,
+        /// <summary>
+        /// Indicates whether USB tethering is enabled.
+        /// </summary>
+        UsbTethering = 5,
+        /// <summary>
+        /// Indicates whether packet data through 3G network is enabled.
+        /// </summary>
+        PacketData = 9,
+        /// <summary>
+        /// Indicates whether data roaming is enabled.
+        /// </summary>
+        DataRoaming = 10,
+        /// <summary>
+        /// Indicates whether vibration is enabled.
+        /// </summary>
+        Vibration = 12,
+        /// <summary>
+        /// Indicates whether audio jack is connected.
+        /// </summary>
+        AudioJack = 17,
+        /// <summary>
+        /// Indicates the current status of GPS.
+        /// <see cref="GpsStatus"/>
+        /// </summary>
+        Gps = 18,
+        /// <summary>
+        /// Indicates whether the battery is currently charging.
+        /// </summary>
+        BatteryIsCharging = 19,
+        /// <summary>
+        /// Indicates whether TV out is connected.
+        /// </summary>
+        TvOut = 20,
+        /// <summary>
+        /// Indicates change in the audio jack connector type.
+        /// <see cref="AudioJackConnectionType"/>
+        /// </summary>
+        AudioJackConnector = 21,
+        /// <summary>
+        /// Indicates whether the charger is connected.
+        /// </summary>
+        Charger = 24,
+        /// <summary>
+        /// Indicates whether auto rotation is enabled.
+        /// </summary>
+        AutoRotation = 26
+    }
+
+    /// <summary>
+    /// Enumeration for the Wi-Fi status.
+    /// </summary>
+    public enum WifiStatus
+    {
+        /// <summary>
+        /// The Wi-Fi is disabled.
+        /// </summary>
+        Disabled,
+        /// <summary>
+        /// The Wi-Fi is enabled and the network connection is not established.
+        /// </summary>
+        Unconnected,
+        /// <summary>
+        /// The network connection is established in a Wi-Fi network.
+        /// </summary>
+        Connected
+    }
+
+    /// <summary>
+    /// Enumeration for the GPS status.
+    /// </summary>
+    public enum GpsStatus
+    {
+        /// <summary>
+        /// The GPS is disabled.
+        /// </summary>
+        Disabled,
+        /// <summary>
+        /// The GPS is searching for satellites.
+        /// </summary>
+        Searching,
+        /// <summary>
+        /// The GPS connection is established.
+        /// </summary>
+        Connected
+    }
+
+    /// <summary>
+    /// Enumeration for the type of audio jack connected.
+    /// </summary>
+    public enum AudioJackConnectionType
+    {
+        /// <summary>
+        /// The audio jack is not connected.
+        /// </summary>
+        Unconnected,
+        /// <summary>
+        /// The 3-conductor wire is connected.
+        /// </summary>
+        ThreeWireConnected,
+        /// <summary>
+        /// The 4-conductor wire is connected.
+        /// </summary>
+        FourWireConnected
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs b/src/Tizen.System.Information/RuntimeInfo/MemoryInformation.cs
new file mode 100755 (executable)
index 0000000..fa38d06
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// Memory information.
+    /// </summary>
+    public class SystemMemoryInformation
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal SystemMemoryInformation(Interop.RuntimeInfo.MemoryInfo info)
+        {
+            Total = info.Total;
+            Used = info.Used;
+            Cache = info.Cache;
+            Free = info.Free;
+            Swap = info.Swap;
+        }
+        /// <summary>
+        /// Total memory (KiB).
+        /// </summary>
+        public int Total { get; internal set; }
+        /// <summary>
+        /// Used memory (KiB).
+        /// </summary>
+        public int Used { get; internal set; }
+        /// <summary>
+        /// Free memory (KiB).
+        /// </summary>
+        public int Free { get; internal set; }
+        /// <summary>
+        /// Cache memory (KiB).
+        /// </summary>
+        public int Cache { get; internal set; }
+        /// <summary>
+        /// Swap memory (KiB).
+        /// </summary>
+        public int Swap { get; internal set; }
+    }
+
+    /// <summary>
+    /// Memory information per process.
+    /// </summary>
+    public class ProcessMemoryInformation
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal ProcessMemoryInformation(Interop.RuntimeInfo.ProcessMemoryInfo info)
+        {
+            PrivateClean = info.PrivateClean;
+            PrivateDirty = info.PrivateDirty;
+            Pss = info.Pss;
+            Rss = info.Rss;
+            SharedClean = info.SharedClean;
+            SharedDirty = info.SharedDirty;
+            Vsz = info.Vsz;
+        }
+        /// <summary>
+        /// Virtual memory size (KiB).
+        /// </summary>
+        public int Vsz { get; internal set; }
+        /// <summary>
+        /// Resident set size (KiB).
+        /// </summary>
+        public int Rss { get; internal set; }
+        /// <summary>
+        /// Proportional set size (KiB).
+        /// </summary>
+        public int Pss { get; internal set; }
+        /// <summary>
+        /// Not modified and mapped by other processes (KiB).
+        /// </summary>
+        public int SharedClean { get; internal set; }
+        /// <summary>
+        /// Modified and mapped by other processes (KiB).
+        /// </summary>
+        public int SharedDirty { get; internal set; }
+        /// <summary>
+        /// Not modified and available only to that process (KiB).
+        /// </summary>
+        public int PrivateClean { get; internal set; }
+        /// <summary>
+        /// Modified and available only to that process (KiB).
+        /// </summary>
+        public int PrivateDirty { get; internal set; }
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoErrorFactory.cs
new file mode 100644 (file)
index 0000000..e9fee57
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.IO;
+using System.ComponentModel;
+using Tizen.Internals.Errors;
+
+namespace Tizen.System
+{
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal enum RuntimeInfoError
+    {
+        None = ErrorCode.None,
+        InvalidParameter = ErrorCode.InvalidParameter,
+        OutOfMemory = ErrorCode.OutOfMemory,
+        Io = ErrorCode.IoError,
+        RemoteIo = ErrorCode.RemoteIo,
+        PermissionDenied = ErrorCode.PermissionDenied,
+        NotSupported = ErrorCode.NotSupported,
+        NoData = ErrorCode.NoData
+    }
+
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal static class RuntimeInfoErrorFactory
+    {
+        internal const string LogTag = "Tizen.System.RuntimeInformation";
+
+        internal static void ThrowException(int err)
+        {
+            RuntimeInfoError error = (RuntimeInfoError)err;
+            if (error == RuntimeInfoError.InvalidParameter)
+            {
+                throw new ArgumentException("Invalid parameter");
+            }
+            else if (error == RuntimeInfoError.OutOfMemory)
+            {
+                throw new OutOfMemoryException("Out of memory");
+            }
+            else if (error == RuntimeInfoError.Io)
+            {
+                throw new IOException("I/O Error");
+            }
+            else if (error == RuntimeInfoError.RemoteIo)
+            {
+                throw new IOException("Remote I/O Error");
+            }
+            else if (error == RuntimeInfoError.PermissionDenied)
+            {
+                throw new UnauthorizedAccessException("Permission denied");
+            }
+            else if (error == RuntimeInfoError.NotSupported)
+            {
+                throw new NotSupportedException("Not supported");
+            }
+            else if (error == RuntimeInfoError.NoData)
+            {
+                throw new NotSupportedException("No data");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs
new file mode 100755 (executable)
index 0000000..7611d0f
--- /dev/null
@@ -0,0 +1,891 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// The RuntimeInformation provides functions to obtain the runtime information of various system preferences.
+    /// </summary>
+    public static class RuntimeInformation
+    {
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_bluetoothEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_wifiHotspotEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_bluetoothTetheringEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_usbTetheringEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_packetDataEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_dataRoamingEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_vibrationEnabled;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_audioJackConnected;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_gpsStatusChanged;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_batteryIsCharging;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_tvOutConnected;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_audioJackConnectorChanged;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_chargerConnected;
+        private static event EventHandler<RuntimeKeyStatusChangedEventArgs> s_autoRotationEnabled;
+
+        private static readonly Interop.RuntimeInfo.RuntimeInformationChangedCallback s_runtimeInfoChangedCallback = (RuntimeInformationKey key, IntPtr userData) =>
+        {
+            RuntimeKeyStatusChangedEventArgs eventArgs = new RuntimeKeyStatusChangedEventArgs()
+            {
+                Key = key
+            };
+            switch (key)
+            {
+                case RuntimeInformationKey.Bluetooth:
+                    {
+                        s_bluetoothEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.WifiHotspot:
+                    {
+                        s_wifiHotspotEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.BluetoothTethering:
+                    {
+                        s_bluetoothTetheringEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.UsbTethering:
+                    {
+                        s_usbTetheringEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.PacketData:
+                    {
+                        s_packetDataEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.DataRoaming:
+                    {
+                        s_dataRoamingEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.Vibration:
+                    {
+                        s_vibrationEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.AudioJack:
+                    {
+                        s_audioJackConnected?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.Gps:
+                    {
+                        s_gpsStatusChanged?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.BatteryIsCharging:
+                    {
+                        s_batteryIsCharging?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.TvOut:
+                    {
+                        s_tvOutConnected?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.AudioJackConnector:
+                    {
+                        s_audioJackConnectorChanged?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.Charger:
+                    {
+                        s_chargerConnected?.Invoke(null, eventArgs);
+                        break;
+                    };
+                case RuntimeInformationKey.AutoRotation:
+                    {
+                        s_autoRotationEnabled?.Invoke(null, eventArgs);
+                        break;
+                    };
+                default:
+                    break;
+            };
+        };
+
+        internal static readonly Dictionary<RuntimeInformationKey, Type> s_keyDataTypeMapping = new Dictionary<RuntimeInformationKey, Type>
+        {
+            [RuntimeInformationKey.Bluetooth] = typeof(bool),
+            [RuntimeInformationKey.WifiHotspot] = typeof(bool),
+            [RuntimeInformationKey.BluetoothTethering] = typeof(bool),
+            [RuntimeInformationKey.UsbTethering] = typeof(bool),
+            [RuntimeInformationKey.PacketData] = typeof(bool),
+            [RuntimeInformationKey.DataRoaming] = typeof(bool),
+            [RuntimeInformationKey.Vibration] = typeof(bool),
+            [RuntimeInformationKey.AudioJack] = typeof(bool),
+            [RuntimeInformationKey.BatteryIsCharging] = typeof(bool),
+            [RuntimeInformationKey.TvOut] = typeof(bool),
+            [RuntimeInformationKey.Charger] = typeof(bool),
+            [RuntimeInformationKey.AutoRotation] = typeof(bool),
+            [RuntimeInformationKey.Gps] = typeof(int),
+            [RuntimeInformationKey.AudioJackConnector] = typeof(int)
+        };
+
+        internal static readonly Dictionary<RuntimeInformationKey, int> s_keyTVkeyMapping = new Dictionary<RuntimeInformationKey, int>\r
+        {\r
+            [RuntimeInformationKey.Bluetooth] = 5,
+            [RuntimeInformationKey.WifiHotspot] = 6,
+            [RuntimeInformationKey.BluetoothTethering] = 7,
+            [RuntimeInformationKey.UsbTethering] = 8,
+            [RuntimeInformationKey.PacketData] = 13,
+            [RuntimeInformationKey.DataRoaming] = 14,
+            [RuntimeInformationKey.Vibration] = 16,
+            [RuntimeInformationKey.AudioJack] = 20,
+            [RuntimeInformationKey.BatteryIsCharging] = 22,
+            [RuntimeInformationKey.TvOut] = 18,
+            [RuntimeInformationKey.Charger] = 26,
+            [RuntimeInformationKey.AutoRotation] = 28,
+            [RuntimeInformationKey.Gps] = 21,
+            [RuntimeInformationKey.AudioJackConnector] = 20\r
+        };
+
+        internal static int is_TV_product = -1;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// This function is for a TV product. It will be removed.
+        internal static RuntimeInformationKey ConvertKeyIfTvProduct(RuntimeInformationKey key)\r
+        {\r
+            bool is_key_existed = false;\r
+            string profile;\r
+            int key_TV = -1;
+
+            if (is_TV_product == -1)\r
+            {\r
+                is_key_existed = SystemInfo.TryGetValue<string>("http://com.samsung/build_config/product_type", out profile);\r
+                if (is_key_existed && String.Compare(profile, "TV") == 0)\r
+                {\r
+                    is_TV_product = 1;\r
+                }\r
+                else\r
+                {\r
+                    is_TV_product = 0;\r
+                }\r
+            }\r
+\r
+            if (is_TV_product == 0)\r
+            {\r
+                return key;\r
+            }\r
+            else\r
+            {\r
+                if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV))\r
+                {\r
+                    RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter);\r
+                }\r
+                return (RuntimeInformationKey)key_TV;\r
+            }\r
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal static object GetStatus(RuntimeInformationKey key)
+        {
+            Type value;
+            if (!s_keyDataTypeMapping.TryGetValue(key, out value))
+            {
+                RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter);
+            }
+
+            if (s_keyDataTypeMapping[key] == typeof(int))
+            {
+                int status;
+                int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
+                if (ret != (int)RuntimeInfoError.None)
+                {
+                    Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
+                    RuntimeInfoErrorFactory.ThrowException(ret);
+                }
+
+                return status;
+            }
+            else
+            {
+                bool status;
+                int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
+                if (ret != (int)RuntimeInfoError.None)
+                {
+                    Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
+                    RuntimeInfoErrorFactory.ThrowException(ret);
+                }
+
+                return status;
+            }
+        }
+
+        /// <summary>
+        /// Validates the data type of the status represented by the runtime key.
+        /// Note that this is a generic method.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <typeparam name="T">The generic type to validate.</typeparam>
+        /// <param name="key">The runtime information key for which the status type is validated.</param>
+        /// <returns>True if the data type matches.</returns>
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="key"/> is invalid.</exception>
+        public static bool Is<T>(RuntimeInformationKey key)
+        {
+            if (!s_keyDataTypeMapping.ContainsKey(key))
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Invalid data type");
+                throw new ArgumentException("Invalid parameter");
+            }
+
+            return s_keyDataTypeMapping[key] == typeof(T);
+        }
+
+        /// <summary>
+        /// Gets the status of runtime key.
+        /// Note that this is a generic method.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <typeparam name="T">The generic type to return.</typeparam>
+        /// <param name="key">The runtime information key for which the current should be read.</param>
+        /// <returns>The current status of the given key.</returns>.
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="key"/> is invalid.</exception>
+        /// <exception cref="IOException">Thrown when I/O error occurs while reading from the system.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the feature related <paramref name="key"/> is not supported.</exception>
+        public static T GetStatus<T>(RuntimeInformationKey key)
+        {\r
+            return (T)GetStatus(key);
+        }
+
+        /// <summary>
+        /// Gets the system memory information.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The system memory information structure.</returns>
+        /// <exception cref="IOException">Thrown when I/O error occurs while reading from the system.</exception>
+        public static SystemMemoryInformation GetSystemMemoryInformation()
+        {
+            Interop.RuntimeInfo.MemoryInfo info = new Interop.RuntimeInfo.MemoryInfo();
+            int ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out info);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get System memory information");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+
+            return new SystemMemoryInformation(info);
+        }
+
+        /// <summary>
+        /// Gets the memory information per process.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="pid">List of unique process ids.</param>
+        /// <returns>List of memory information per process.</returns>
+        /// <privilege>http://tizen.org/privilege/systemmonitor</privilege>
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="pid"/> is empty.</exception>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the memory is not enough to allocate.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the caller does not have privilege to use this method.</exception>
+        public static IDictionary<int, ProcessMemoryInformation> GetProcessMemoryInformation(IEnumerable<int> pid)
+        {
+            int[] processArray = pid.ToArray<int>();
+            Interop.RuntimeInfo.ProcessMemoryInfo[] processMemoryArray = new Interop.RuntimeInfo.ProcessMemoryInfo[pid.Count<int>()];
+            Dictionary<int, ProcessMemoryInformation> map = new Dictionary<int, ProcessMemoryInformation>();
+            int ret = Interop.RuntimeInfo.GetProcessMemoryInfo(processArray, pid.Count<int>(), out processMemoryArray);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process memory information");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+
+            int idx = 0;
+            foreach (Interop.RuntimeInfo.ProcessMemoryInfo cur in processMemoryArray)
+            {
+                ProcessMemoryInformation processMemory = new ProcessMemoryInformation(cur);
+                map.Add(processArray[idx], processMemory);
+                idx++;
+            }
+
+            return map;
+        }
+
+        /// <summary>
+        /// Gets the system CPU usage time.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <returns>The system CPU usage time structure.</returns>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from the system.</exception>
+        public static CpuUsage GetCpuUsage()
+        {
+            Interop.RuntimeInfo.CpuUsage usage = new Interop.RuntimeInfo.CpuUsage();
+            int ret = Interop.RuntimeInfo.GetCpuUsage(out usage);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get cpu usage");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+            return new CpuUsage(usage);
+        }
+
+        /// <summary>
+        /// Gets the CPU usage time per process.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="pid">List of unique process ids.</param>
+        /// <returns>List of CPU usage information per process.</returns>
+        /// <privilege>http://tizen.org/privilege/systemmonitor</privilege>
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="pid"/> is empty.</exception>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the memory is not enough to allocate.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the caller does not have privilege to use this method.</exception>
+        public static IDictionary<int, ProcessCpuUsage> GetProcessCpuUsage(IEnumerable<int> pid)
+        {
+            int[] processArray = pid.ToArray<int>();
+            Interop.RuntimeInfo.ProcessCpuUsage[] processCpuUsageArray = new Interop.RuntimeInfo.ProcessCpuUsage[pid.Count<int>()];
+            Dictionary<int, ProcessCpuUsage> map = new Dictionary<int, ProcessCpuUsage>();
+            int ret = Interop.RuntimeInfo.GetProcessCpuUsage(processArray, pid.Count<int>(), out processCpuUsageArray);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process cpu usage");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+
+            int idx = 0;
+            foreach (Interop.RuntimeInfo.ProcessCpuUsage cur in processCpuUsageArray)
+            {
+                ProcessCpuUsage processUsage = new ProcessCpuUsage(cur);
+                map.Add(processArray[idx], processUsage);
+                idx++;
+            }
+
+            return map;
+        }
+
+        /// <summary>
+        /// Gets the number of processors.
+        /// </summary>
+        /// <value>The number of processors.</value>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from system.</exception>
+        public static int ProcessorCount
+        {
+            get
+            {
+                int count;
+                int ret = Interop.RuntimeInfo.GetProcessorCount(out count);
+                if (ret != (int)RuntimeInfoError.None)
+                {
+                    Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor count");
+                    RuntimeInfoErrorFactory.ThrowException(ret);
+                }
+
+                return count;
+            }
+        }
+
+        /// <summary>
+        /// Gets the current frequency of the processor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="coreId">The index (from 0) of the CPU core that you want to know the frequency of.</param>
+        /// <returns>The current frequency(MHz) of processor.</returns>
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="coreid"/> is invalid.</exception>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from system.</exception>
+        /// <exception cref="NotSupportedException">Thrown when this system does not store the current CPU frequency.</exception>
+        public static int GetProcessorCurrentFrequency(int coreId)
+        {
+            int frequency;
+            int ret = Interop.RuntimeInfo.GetProcessorCurrentFrequency(coreId, out frequency);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor current frequency");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+            return frequency;
+        }
+
+        /// <summary>
+        /// Gets the max frequency of the processor.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="coreId">The index (from 0) of CPU core that you want to know the frequency of.</param>
+        /// <returns>The max frequency(MHz) of processor.</returns>
+        /// <exception cref="ArgumentException">Thrown when the <paramref name="coreid"/> is invalid.</exception>
+        /// <exception cref="IOException">Thrown when an I/O error occurs while reading from system.</exception>
+        /// <exception cref="NotSupportedException">Thrown when this system does not store the max CPU frequency.</exception>
+        public static int GetProcessorMaxFrequency(int coreId)
+        {
+            int frequency;
+            int ret = Interop.RuntimeInfo.GetProcessorMaxFrequency(coreId, out frequency);
+            if (ret != (int)RuntimeInfoError.None)
+            {
+                Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get  Processor max frequency");
+                RuntimeInfoErrorFactory.ThrowException(ret);
+            }
+            return frequency;
+        }
+
+        /// <summary>
+        /// (event) BluetoothEnabled is raised when the system preference for Bluetooth is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> BluetoothEnabled
+        {
+            add
+            {
+                if (s_bluetoothEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_bluetoothEnabled += value;
+            }
+            remove
+            {
+                s_bluetoothEnabled -= value;
+                if (s_bluetoothEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) WifiHotspotEnabled is raised when the system preference for Wi-Fi is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> WifiHotspotEnabled
+        {
+            add
+            {
+                if (s_wifiHotspotEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_wifiHotspotEnabled += value;
+            }
+            remove
+            {
+                s_wifiHotspotEnabled -= value;
+                if (s_wifiHotspotEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) BluetoothTetheringEnabled is raised when the system preference for bluetooth tethering is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> BluetoothTetheringEnabled
+        {
+            add
+            {
+                if (s_bluetoothTetheringEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_bluetoothTetheringEnabled += value;
+            }
+            remove
+            {
+                s_bluetoothTetheringEnabled -= value;
+                if (s_bluetoothTetheringEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) UsbTetheringEnabled is raised when the system preference for USB tethering is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> UsbTetheringEnabled
+        {
+            add
+            {
+                if (s_usbTetheringEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_usbTetheringEnabled += value;
+            }
+            remove
+            {
+                s_usbTetheringEnabled -= value;
+                if (s_usbTetheringEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) PacketDataEnabled is raised when the system preference for package data through 3G network is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> PacketDataEnabled
+        {
+            add
+            {
+                if (s_packetDataEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_packetDataEnabled += value;
+            }
+            remove
+            {
+                s_packetDataEnabled -= value;
+                if (s_packetDataEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) DataRoamingEnabled is raised when the system preference for data roaming is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> DataRoamingEnabled
+        {
+            add
+            {
+                if (s_dataRoamingEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_dataRoamingEnabled += value;
+            }
+            remove
+            {
+                s_dataRoamingEnabled -= value;
+                if (s_dataRoamingEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) VibrationEnabled is raised when the system preference for vibration is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> VibrationEnabled
+        {
+            add
+            {
+                if (s_vibrationEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_vibrationEnabled += value;
+            }
+            remove
+            {
+                s_vibrationEnabled -= value;
+                if (s_vibrationEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) AudioJackConnected is raised when the audio jack is connected/disconnected.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> AudioJackConnected
+        {
+            add
+            {
+                if (s_audioJackConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_audioJackConnected += value;
+            }
+            remove
+            {
+                s_audioJackConnected -= value;
+                if (s_audioJackConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) GpsStatusChanged is raised when the status of GPS is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> GpsStatusChanged
+        {
+            add
+            {
+                if (s_gpsStatusChanged == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_gpsStatusChanged += value;
+            }
+            remove
+            {
+                s_gpsStatusChanged -= value;
+                if (s_gpsStatusChanged == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) BatteryIsCharging is raised when the battery is currently charging.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> BatteryIsCharging
+        {
+            add
+            {
+                if (s_batteryIsCharging == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_batteryIsCharging += value;
+            }
+            remove
+            {
+                s_batteryIsCharging -= value;
+                if (s_batteryIsCharging == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) TvOutConnected is raised when TV out is connected/disconnected.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> TvOutConnected
+        {
+            add
+            {
+                if (s_tvOutConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_tvOutConnected += value;
+            }
+            remove
+            {
+                s_tvOutConnected -= value;
+                if (s_tvOutConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) AudioJackConnectorChanged is raised when the audio jack connection changes.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> AudioJackConnectorChanged
+        {
+            add
+            {
+                if (s_audioJackConnectorChanged == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_audioJackConnectorChanged += value;
+            }
+            remove
+            {
+                s_audioJackConnectorChanged -= value;
+                if (s_audioJackConnectorChanged == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) ChargerConnected is raised when the charger is connected/disconnected.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> ChargerConnected
+        {
+            add
+            {
+                if (s_chargerConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_chargerConnected += value;
+            }
+            remove
+            {
+                s_chargerConnected -= value;
+                if (s_chargerConnected == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// (event) AutoRotationEnabled is raised when the system preference for auto rotation is changed.
+        /// </summary>
+        public static event EventHandler<RuntimeKeyStatusChangedEventArgs> AutoRotationEnabled
+        {
+            add
+            {
+                if (s_autoRotationEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation), s_runtimeInfoChangedCallback, IntPtr.Zero);
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+                s_autoRotationEnabled += value;
+            }
+            remove
+            {
+                s_autoRotationEnabled -= value;
+                if (s_autoRotationEnabled == null)
+                {
+                    int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation));
+                    if (ret != (int)RuntimeInfoError.None)
+                    {
+                        Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
+                        RuntimeInfoErrorFactory.ThrowException(ret);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs
new file mode 100755 (executable)
index 0000000..c145c93
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// RuntimeInfoChangedEventArgs is an extended EventArgs class. This class contains event arguments for runtime event listeners.
+    /// </summary>
+    public class RuntimeKeyStatusChangedEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The key indicating the runtime system preference which was changed.
+        /// </summary>
+        public RuntimeInformationKey Key { get; internal set; }
+    }
+}
diff --git a/src/Tizen.System.Information/SystemInfo/SystemInfo.cs b/src/Tizen.System.Information/SystemInfo/SystemInfo.cs
new file mode 100755 (executable)
index 0000000..b551c1b
--- /dev/null
@@ -0,0 +1,272 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
+
+using System;
+using System.ComponentModel;
+
+namespace Tizen.System
+{
+    /// <summary>
+    /// System Information class. This class has methods which can be used to obtain device information.
+    /// </summary>
+    public static class SystemInfo
+    {
+        private const string LogTag = "Tizen.System";
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private static Interop.SystemInfo.SystemInfoType GetValueType(string key, out Interop.SystemInfo.SystemInfoValueType valueType)
+        {
+            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType);
+            if (err == Interop.SystemInfo.ErrorCode.None)
+            {
+                return Interop.SystemInfo.SystemInfoType.platform;
+            }
+
+            Log.Debug(LogTag, string.Format("Key {0} not in platform system info", key));
+            err = Interop.SystemInfo.SystemInfoGetCustomType(key, out valueType);
+            if (err == Interop.SystemInfo.ErrorCode.None)
+            {
+                return Interop.SystemInfo.SystemInfoType.Custom;
+            }
+
+            Log.Debug(LogTag, string.Format("Key {0} not in custom system info", key));
+            return Interop.SystemInfo.SystemInfoType.None;
+        }
+
+        /// <summary>
+        /// Checks if the type of value for the given feature is T.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <typeparam name="T">Type of value for the feature key.</typeparam>
+        /// <param name="key">The name of the feature.</param>
+        /// <returns>True if type of value for the given feature is T, otherwise false.</returns>
+        public static bool Is<T>(string key)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
+            if (keyType == Interop.SystemInfo.SystemInfoType.None)
+            {
+                return false;
+            }
+
+            switch (valueType)
+            {
+                case Interop.SystemInfo.SystemInfoValueType.Bool:
+                    return typeof(T) == typeof(bool);
+                case Interop.SystemInfo.SystemInfoValueType.Double:
+                    return typeof(T) == typeof(double);
+                case Interop.SystemInfo.SystemInfoValueType.Int:
+                    return typeof(T) == typeof(int);
+                case Interop.SystemInfo.SystemInfoValueType.String:
+                    return typeof(T) == typeof(string);
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// Checks if the given key is a valid feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The name of the feature.</param>
+        /// <returns>True if the key is valid, otherwise false.</returns>
+        public static bool IsValidKey(string key)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            return GetValueType(key, out valueType) != Interop.SystemInfo.SystemInfoType.None;
+        }
+
+        /// <summary>
+        /// Gets the value of the feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <typeparam name="T">Type of key value.</typeparam>
+        /// <param name="key">The name of the feature.</param>
+        /// <param name="value">The value of the given feature.</param>
+        /// <returns>Returns true on success, otherwise false.</returns>
+        public static bool TryGetValue<T>(string key, out T value)
+        {
+            bool res = false;
+            if (typeof(T) == typeof(bool))
+            {
+                bool val;
+                res = TryGetValue(key, out val);
+                value = (T)(object)val;
+            }
+            else if (typeof(T) == typeof(int))
+            {
+                int val;
+                res = TryGetValue(key, out val);
+                value = (T)(object)val;
+            }
+            else if (typeof(T) == typeof(double))
+            {
+                double val;
+                res = TryGetValue(key, out val);
+                value = (T)(object)val;
+            }
+            else if (typeof(T) == typeof(string))
+            {
+                string val;
+                res = TryGetValue(key, out val);
+                value = (T)(object)val;
+            }
+            else
+            {
+                value = default(T);
+            }
+            return res;
+        }
+
+        /// <summary>
+        /// Gets the bool value of the feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The name of the feature.</param>
+        /// <param name="value">The value of the given feature.</param>
+        /// <returns>Returns true on success, otherwise false.</returns>
+        public static bool TryGetValue(string key, out bool value)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
+
+            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            if (keyType == Interop.SystemInfo.SystemInfoType.platform)
+            {
+                err = Interop.SystemInfo.SystemInfoGetPlatformBool(key, out value);
+            }
+            else if (keyType == Interop.SystemInfo.SystemInfoType.Custom)
+            {
+                err = Interop.SystemInfo.SystemInfoGetCustomBool(key, out value);
+            } else
+            {
+                value = false;
+            }
+
+            if (err != Interop.SystemInfo.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// Gets the int value of the feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The name of the feature.</param>
+        /// <param name="value">The value of the given feature.</param>
+        /// <returns>Returns true on success, otherwise false.</returns>
+        public static bool TryGetValue(string key, out int value)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
+
+            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            if (keyType == Interop.SystemInfo.SystemInfoType.platform)
+            {
+                err = Interop.SystemInfo.SystemInfoGetPlatformInt(key, out value);
+            }
+            else if (keyType == Interop.SystemInfo.SystemInfoType.Custom)
+            {
+                err = Interop.SystemInfo.SystemInfoGetCustomInt(key, out value);
+            }
+            else
+            {
+                value = 0;
+            }
+
+            if (err != Interop.SystemInfo.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// Gets the double value of the feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The name of the feature.</param>
+        /// <param name="value">The value of the given feature.</param>
+        /// <returns>Returns true on success, otherwise false.</returns>
+        public static bool TryGetValue(string key, out double value)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
+
+            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            if (keyType == Interop.SystemInfo.SystemInfoType.platform)
+            {
+                err = Interop.SystemInfo.SystemInfoGetPlatformDouble(key, out value);
+            }
+            else if (keyType == Interop.SystemInfo.SystemInfoType.Custom)
+            {
+                err = Interop.SystemInfo.SystemInfoGetCustomDouble(key, out value);
+            }
+            else
+            {
+                value = 0;
+            }
+
+            if (err != Interop.SystemInfo.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// Gets the string value of the feature.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <param name="key">The name of the feature.</param>
+        /// <param name="value">The value of the given feature.</param>
+        /// <returns>Returns true on success, otherwise false.</returns>
+        public static bool TryGetValue(string key, out string value)
+        {
+            Interop.SystemInfo.SystemInfoValueType valueType;
+            Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
+
+            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            if (keyType == Interop.SystemInfo.SystemInfoType.platform)
+            {
+                err = Interop.SystemInfo.SystemInfoGetPlatformString(key, out value);
+            }
+            else if (keyType == Interop.SystemInfo.SystemInfoType.Custom)
+            {
+                err = Interop.SystemInfo.SystemInfoGetCustomString(key, out value);
+            }
+            else
+            {
+                value = string.Empty;
+            }
+
+            if (err != Interop.SystemInfo.ErrorCode.None)
+            {
+                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                return false;
+            }
+
+            return true;
+        }
+    }
+}
diff --git a/src/Tizen.System.Information/Tizen.System.Information.csproj b/src/Tizen.System.Information/Tizen.System.Information.csproj
new file mode 100644 (file)
index 0000000..595d8ae
--- /dev/null
@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+  <PropertyGroup>\r
+    <Version>1.0.5</Version>\r
+    <Authors>Samsung Electronics</Authors>\r
+    <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>\r
+    <Description>Provide classes for SystemInformation and RuntimeInformation APIs</Description>\r
+    <PackageProjectUrl>https://www.tizen.org/</PackageProjectUrl>\r
+    <PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>\r
+    <PackageIconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</PackageIconUrl>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup>\r
+    <TargetFramework>netstandard1.3</TargetFramework>\r
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r
+    <SignAssembly>True</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>Tizen.System.Information.snk</AssemblyOriginatorKeyFile>\r
+    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>\r
+  </PropertyGroup>\r
+\r
+  <ItemGroup>\r
+    <PackageReference Include="Tizen" Version="1.0.5" />\r
+  </ItemGroup>\r
+\r
+</Project>\r
diff --git a/src/Tizen.System.Information/Tizen.System.Information.snk b/src/Tizen.System.Information/Tizen.System.Information.snk
new file mode 100644 (file)
index 0000000..bb2de4a
Binary files /dev/null and b/src/Tizen.System.Information/Tizen.System.Information.snk differ
diff --git a/src/filelist.lst b/src/filelist.lst
new file mode 100644 (file)
index 0000000..bbd0939
--- /dev/null
@@ -0,0 +1 @@
+<Compile Include="*/*.cs"/>
diff --git a/test/ElmSharp.Test/ElmSharp.Test.csproj b/test/ElmSharp.Test/ElmSharp.Test.csproj
new file mode 100644 (file)
index 0000000..7de2ba7
--- /dev/null
@@ -0,0 +1,296 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ProjectGuid>{E901BB06-632D-489E-86AC-66AD2EF85BCC}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ElmSharp.Test</RootNamespace>
+    <AssemblyName>ElmSharp.Test</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701;1702</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Log.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TC\AccessibilityRelationTest.cs" />
+    <Compile Include="TC\AccessibilityRoleTest.cs" />
+    <Compile Include="TC\AccessibilityTest.cs" />
+    <Compile Include="TC\BackgroundTest1.cs" />
+    <Compile Include="TC\BackgroundTest2.cs" />
+    <Compile Include="TC\BackgroundTest3.cs" />
+    <Compile Include="TC\FocusAutoScrollModeTest.cs" />
+    <Compile Include="TC\KeyEventTest1.cs" />
+    <Compile Include="TC\GestureLayerTest1.cs" />
+    <Compile Include="TC\ProgressBarTest2.cs" />
+    <Compile Include="TC\ScrollerTest3.cs" />
+    <Compile Include="TC\Wearable\CircleTool.cs" />
+    <Compile Include="TC\TransitTest.cs" />
+    <Compile Include="TC\EcoreTimerTest1.cs" />
+    <Compile Include="TC\EntryTest3.cs" />
+    <Compile Include="TC\EvasMapTest2.cs" />
+    <Compile Include="TC\GenListTest10.cs" />
+    <Compile Include="TC\ImageTest4.cs" />
+    <Compile Include="TC\LabelTest4.cs" />
+    <Compile Include="TC\LabelTest5.cs" />
+    <Compile Include="TC\MultibuttonEntryTest1.cs" />
+    <Compile Include="TC\DateTimeSelectorTest2.cs" />
+    <Compile Include="TC\EntryTest2.cs" />
+    <Compile Include="TC\FlipSelectorTest.cs" />
+    <Compile Include="TC\FloatingButtonTest.cs" />
+    <Compile Include="TC\GenListTest9.cs" />
+    <Compile Include="TC\FocusTest1.cs" />
+    <Compile Include="TC\HoverselTest1.cs" />
+    <Compile Include="TC\MultibuttonEntryTest2.cs" />
+    <Compile Include="TC\NaviframeTest3.cs" />
+    <Compile Include="TC\ScreenInformationTest.cs" />
+    <Compile Include="TC\BoxLayoutTest1.cs" />
+    <Compile Include="TC\BoxTest1.cs" />
+    <Compile Include="TC\BackgroundColorTest1.cs" />
+    <Compile Include="TC\ButtonTest1.cs" />
+    <Compile Include="TC\CalendarTest1.cs" />
+    <Compile Include="TC\CheckTest1.cs" />
+    <Compile Include="TC\ClipperTest1.cs" />
+    <Compile Include="TC\ColorSelectorTest1.cs" />
+    <Compile Include="TC\ContextPopupTest1.cs" />
+    <Compile Include="TC\DateTimeSelectorTest1.cs" />
+    <Compile Include="TC\EvasMapTest1.cs" />
+    <Compile Include="TC\EntryTest1.cs" />
+    <Compile Include="TC\GenGridTest1.cs" />
+    <Compile Include="TC\GenGridTest2.cs" />
+    <Compile Include="TC\GenListTest7.cs" />
+    <Compile Include="TC\GenListTest1.cs" />
+    <Compile Include="TC\GenListTest2.cs" />
+    <Compile Include="TC\GenListTest3.cs" />
+    <Compile Include="TC\GenListTest4.cs" />
+    <Compile Include="TC\GenListTest6.cs" />
+    <Compile Include="TC\LabelTest3.cs" />
+    <Compile Include="TC\ImageTest3.cs" />
+    <Compile Include="TC\ImageTest2.cs" />
+    <Compile Include="TC\LabelTest2.cs" />
+    <Compile Include="TC\TableTest1.cs" />
+    <Compile Include="TC\GenListTest8.cs" />
+    <Compile Include="TC\PerformanceTest.cs" />
+    <Compile Include="TC\GenListTest5.cs" />
+    <Compile Include="TC\IconTest1.cs" />
+    <Compile Include="TC\ImageTest1.cs" />
+    <Compile Include="TC\IndexTest1.cs" />
+    <Compile Include="TC\IndexTest2.cs" />
+    <Compile Include="TC\LabelTest1.cs" />
+    <Compile Include="TC\LabelValignTest1.cs" />
+    <Compile Include="TC\ListTest1.cs" />
+    <Compile Include="TC\NaviframeTest1.cs" />
+    <Compile Include="TC\NaviframeTest2.cs" />
+    <Compile Include="TC\PanelTest1.cs" />
+    <Compile Include="TC\PanelTest2.cs" />
+    <Compile Include="TC\PanesTest1.cs" />
+    <Compile Include="TC\PolygonTest1.cs" />
+    <Compile Include="TC\PopupTest1.cs" />
+    <Compile Include="TC\ProgressBarTest1.cs" />
+    <Compile Include="TC\RadioTest1.cs" />
+    <Compile Include="TC\RectangleTest1.cs" />
+    <Compile Include="TC\ScrollerTest1.cs" />
+    <Compile Include="TC\ScrollerTest2.cs" />
+    <Compile Include="TC\SliderTest1.cs" />
+    <Compile Include="TC\SliderTest2.cs" />
+    <Compile Include="TC\SpinnerTest1.cs" />
+    <Compile Include="TC\ToolbarTest1.cs" />
+    <Compile Include="TC\ToolbarTest2.cs" />
+    <Compile Include="TC\ToolbarTest3.cs" />
+    <Compile Include="TC\ToolbarTest4.cs" />
+    <Compile Include="TC\Wearable\BackgroundColorTest1.cs" />
+    <Compile Include="TC\Wearable\BackgroundTest1.cs" />
+    <Compile Include="TC\Wearable\BackgroundTest2.cs" />
+    <Compile Include="TC\Wearable\BoxLayoutTest1.cs" />
+    <Compile Include="TC\Wearable\ButtonTest1.cs" />
+    <Compile Include="TC\Wearable\ButtonTest2.cs" />
+    <Compile Include="TC\Wearable\CheckTest1.cs" />
+    <Compile Include="TC\Wearable\ClipperTest1.cs" />
+    <Compile Include="TC\Wearable\ContextPopupTest1.cs" />
+    <Compile Include="TC\Wearable\DateTimeSelectorTest1.cs" />
+    <Compile Include="TC\Wearable\DateTimeSelectorTest2.cs" />
+    <Compile Include="TC\Wearable\EcoreTimerTest1.cs" />
+    <Compile Include="TC\Wearable\EntryTest1.cs" />
+    <Compile Include="TC\Wearable\EntryTest2.cs" />
+    <Compile Include="TC\Wearable\EntryTest3.cs" />
+    <Compile Include="TC\Wearable\EntryTest4.cs" />
+    <Compile Include="TC\Wearable\EvasMapTest1.cs" />
+    <Compile Include="TC\Wearable\EvasMapTest2.cs" />
+    <Compile Include="TC\Wearable\FocusTest1.cs" />
+    <Compile Include="TC\Wearable\GenGridTest1.cs" />
+    <Compile Include="TC\Wearable\GenGridTest2.cs" />
+    <Compile Include="TC\Wearable\GenListTest1.cs" />
+    <Compile Include="TC\Wearable\GenListTest10.cs" />
+    <Compile Include="TC\Wearable\GenListTest9.cs" />
+    <Compile Include="TC\Wearable\GenListTest2.cs" />
+    <Compile Include="TC\Wearable\GenListTest3.cs" />
+    <Compile Include="TC\Wearable\GenListTest4.cs" />
+    <Compile Include="TC\Wearable\GenListTest5.cs" />
+    <Compile Include="TC\Wearable\GenListTest6.cs" />
+    <Compile Include="TC\Wearable\GenListTest7.cs" />
+    <Compile Include="TC\Wearable\GenListTest8.cs" />
+    <Compile Include="TC\Wearable\GestureLayerTest1.cs" />
+    <Compile Include="TC\Wearable\IconTest1.cs" />
+    <Compile Include="TC\Wearable\ImageTest1.cs" />
+    <Compile Include="TC\Wearable\ImageTest2.cs" />
+    <Compile Include="TC\Wearable\ImageTest3.cs" />
+    <Compile Include="TC\Wearable\ImageTest4.cs" />
+    <Compile Include="TC\Wearable\IndexTest1.cs" />
+    <Compile Include="TC\Wearable\IndexTest2.cs" />
+    <Compile Include="TC\LabelTest6.cs" />
+    <Compile Include="TC\Wearable\ListTest1.cs" />
+    <Compile Include="TC\Wearable\NaviframeTest1.cs" />
+    <Compile Include="TC\Wearable\NaviframeTest2.cs" />
+    <Compile Include="TC\Wearable\NaviframeTest3.cs" />
+    <Compile Include="TC\Wearable\PanelTest1.cs" />
+    <Compile Include="TC\Wearable\PanelTest2.cs" />
+    <Compile Include="TC\Wearable\PanesTest1.cs" />
+    <Compile Include="TC\Wearable\PerformanceTest.cs" />
+    <Compile Include="TC\Wearable\PolygonTest1.cs" />
+    <Compile Include="TC\Wearable\PopupTest1.cs" />
+    <Compile Include="TC\Wearable\ProgressBarTest1.cs" />
+    <Compile Include="TC\Wearable\ProgressBarTest2.cs" />
+    <Compile Include="TC\Wearable\RadioTest1.cs" />
+    <Compile Include="TC\Wearable\RectangleTest1.cs" />
+    <Compile Include="TC\Wearable\ScreenInformationTest.cs" />
+    <Compile Include="TC\Wearable\ScrollerTest1.cs" />
+    <Compile Include="TC\Wearable\ScrollerTest2.cs" />
+    <Compile Include="TC\Wearable\ScrollerTest3.cs" />
+    <Compile Include="TC\Wearable\SliderTest1.cs" />
+    <Compile Include="TC\Wearable\SliderTest2.cs" />
+    <Compile Include="TC\Wearable\SpinnerTest1.cs" />
+    <Compile Include="TC\Wearable\TransitTest.cs" />
+    <Compile Include="TC\Wearable\WindowInternalTest.cs" />
+    <Compile Include="TC\Wearable\LabelTest1.cs" />
+    <Compile Include="TC\Wearable\LabelTest2.cs" />
+    <Compile Include="TC\Wearable\LabelTest3.cs" />
+    <Compile Include="TC\Wearable\LabelTest4.cs" />
+    <Compile Include="TC\Wearable\LabelTest5.cs" />
+    <Compile Include="TC\Wearable\LabelValignTest1.cs" />
+    <Compile Include="TC\Wearable\TableTest1.cs" />
+    <Compile Include="TC\WindowInternalTest.cs" />
+    <Compile Include="TestCaseBase.cs" />
+    <Compile Include="TestRunner.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ElmSharp.Test.project.json" />
+    <None Include="test.sh" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="res\btn_delete.png" />
+    <Content Include="res\picture.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\app_icn_ted.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\a.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\b.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\c.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\d.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\e.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\f.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\g.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\a.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\b.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\c.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\d.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\e.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\f.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\g.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="shared\res\ElmSharp.Test.png" />
+    <Content Include="tizen-manifest.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="ElmSharp, Version=1.2.0.0, Culture=neutral, PublicKeyToken=3836ec6cd2c91e8b, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\ElmSharp\bin\Debug\netstandard1.3\ElmSharp.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+    -->
+    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+       to prevent it from outputting a warning (MSB3644).
+    -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
diff --git a/test/ElmSharp.Test/ElmSharp.Test.project.json b/test/ElmSharp.Test/ElmSharp.Test.project.json
new file mode 100755 (executable)
index 0000000..4bd5e6c
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "dependencies": {
+    "Microsoft.NETCore.App": "1.0.0",
+    "Tizen.Applications.Common": "1.5.8",
+    "Tizen.Applications.UI": "1.5.8"
+  },
+  "frameworks": {
+    "netcoreapp1.0": {}
+  },
+  "runtimes": {
+    "win": {}
+  }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/Log.cs b/test/ElmSharp.Test/Log.cs
new file mode 100644 (file)
index 0000000..37313aa
--- /dev/null
@@ -0,0 +1,60 @@
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace ElmSharp.Test
+{
+    internal static class Log
+    {
+        const string Library = "libdlog.so.0";
+        const string TAG = "ElmSharp.Test";
+
+        public static void Debug(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        public static void Info(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        public static void Error(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        internal enum LogPriority
+        {
+            DLOG_UNKNOWN = 0,
+            DLOG_DEFAULT,
+            DLOG_VERBOSE,
+            DLOG_DEBUG,
+            DLOG_INFO,
+            DLOG_WARN,
+            DLOG_ERROR,
+            DLOG_FATAL,
+            DLOG_SILENT,
+            DLOG_PRIO_MAX,
+        }
+
+        private static void Print(LogPriority priority, string tag, string message, string file, string func, int line)
+        {
+            FileInfo finfo = new FileInfo(file);
+            Print(priority, tag, "%s: %s(%d) > %s", finfo.Name, func, line, message);
+        }
+
+        [DllImportAttribute(Library, EntryPoint = "dlog_print")]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+    }
+}
diff --git a/test/ElmSharp.Test/Properties/AssemblyInfo.cs b/test/ElmSharp.Test/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..fa3b23e
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ElmSharp.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("ElmSharp.Test")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2e1a161a-baa9-40ef-a8b4-082ce7c813b8")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/test/ElmSharp.Test/TC/AccessibilityRelationTest.cs b/test/ElmSharp.Test/TC/AccessibilityRelationTest.cs
new file mode 100644 (file)
index 0000000..53ccf2c
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+    class AccessibilityRelationTest : TestCaseBase
+    {
+        public override string TestName => "AccessibilityRelationTest";
+        public override string TestDescription => "Accessibility Relation API test";
+
+        public override void Run(Window win)
+        {
+            Conformant conformant = new Conformant(win);
+            conformant.Show();
+
+            Box box = new Box(win);
+            box.Show();
+            conformant.SetContent(box);
+
+            Button button1 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "LabelledBy" };
+            Label label1 = new Label(win) { Text = "LabelFor" };
+
+            button1.Show();
+            label1.Show();
+
+            box.PackEnd(button1);
+            box.PackEnd(label1);
+
+            ((IAccessibleObject)button1).AppendRelation(new LabelledBy() { Target = label1 });
+            ((IAccessibleObject)label1).AppendRelation(new LabelFor() { Target = button1 });
+
+            button1.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)button1).RemoveRelation(new LabelledBy() { Target = label1 });
+                ((IAccessibleObject)label1).RemoveRelation(new LabelFor() { Target = button1 });
+            };
+
+            Label label8 = new Label(win) { WeightX = 1, AlignmentX = -1,  Text = "ControlledBy" };
+            Button button3 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "ControllerFor" };
+
+            label8.Show();
+            button3.Show();
+
+            box.PackEnd(label8);
+            box.PackEnd(button3);
+
+            ((IAccessibleObject)label8).AppendRelation(new ControlledBy() { Target = button3 });
+            ((IAccessibleObject)button3).AppendRelation(new ControllerFor() { Target = label8 });
+
+            button3.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)label8).RemoveRelation(new ControlledBy() { Target = button3 });
+                ((IAccessibleObject)button3).RemoveRelation(new ControllerFor() { Target = label8 });
+            };
+
+            Box box2 = new Box(win) { WeightX = 1, AlignmentX = -1};
+            Label label2 = new Label(win) { Text = "Group" };
+            Button button4 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "Member" };
+
+            box2.Show();
+            label2.Show();
+            button4.Show();
+
+            ((IAccessibleObject)label2).AppendRelation(new LabelFor() { Target = box2 });
+            ((IAccessibleObject)label2).AppendRelation(new MemberOf() { Target = box2 });
+            ((IAccessibleObject)box2).AppendRelation(new LabelledBy() { Target = label2 });
+            ((IAccessibleObject)button4).AppendRelation(new MemberOf() { Target = box2 });
+
+            box2.PackEnd(label2);
+            box2.PackEnd(button4);
+            box.PackEnd(box2);
+
+            button4.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)label2).RemoveRelation(new LabelFor() { Target = box2 });
+                ((IAccessibleObject)label2).RemoveRelation(new MemberOf() { Target = box2 });
+                ((IAccessibleObject)box2).RemoveRelation(new LabelledBy() { Target = label2 });
+                ((IAccessibleObject)button4).RemoveRelation(new MemberOf() { Target = box2 });
+            };
+
+            Button button6 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "Xbutton" };
+            Label label3 = new Label(win) { Text = "Tooltip of Xbutton" };
+
+            button6.Show();
+            label3.Show();
+
+            ((IAccessibleObject)label3).AppendRelation(new TooltipFor() { Target = button6 });
+
+            box.PackEnd(button6);
+            box.PackEnd(label3);
+
+            button6.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)label3).RemoveRelation(new TooltipFor() { Target = button6 });
+            };
+
+            Box box3 = new Box(win) { WeightX = 1, AlignmentX = -1};
+            Label label4 = new Label(win) { Text = "Child of inner box" };
+            Button button7 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "child of inner box" };
+
+            box3.Show();
+            label4.Show();
+            button7.Show();
+
+            ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = label4 });
+            ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = button7 });
+            ((IAccessibleObject)label4).AppendRelation(new ChildOf() { Target = box3 });
+            ((IAccessibleObject)button7).AppendRelation(new ChildOf() { Target = box3 });
+
+            box3.PackEnd(label4);
+            box3.PackEnd(button7);
+            box.PackEnd(box3);
+
+            button7.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = label4 });
+                ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = button7 });
+                ((IAccessibleObject)label4).RemoveRelation(new ChildOf() { Target = box3 });
+                ((IAccessibleObject)button7).RemoveRelation(new ChildOf() { Target = box3 });
+            };
+
+            Label label6 = new Label(win) { Text = "Extended" };
+            Button button12 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Not Extended" };
+
+            label6.Show();
+            button12.Show();
+
+            ((IAccessibleObject)label6).AppendRelation(new Extended() { Target = button12 });
+
+            box.PackEnd(button12);
+            box.PackEnd(label6);
+
+            button12.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)label6).RemoveRelation(new Extended() { Target = button12 });
+            };
+
+            Button button8 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "FlowsTo" };
+            Button button9 = new Button(win) { WeightX = 1, AlignmentX = -1,  Text = "FlowsFrom" };
+
+            button8.Show();
+            button9.Show();
+
+            ((IAccessibleObject)button8).AppendRelation(new FlowsTo() { Target = button9 });
+            ((IAccessibleObject)button9).AppendRelation(new FlowsFrom() { Target = button8 });
+
+            box.PackEnd(button8);
+            box.PackEnd(button9);
+
+            button8.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)button8).RemoveRelation(new FlowsTo() { Target = button9 });
+            };
+
+            button9.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)button9).RemoveRelation(new FlowsFrom() { Target = button8 });
+            };
+
+            Button button10 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "EmbeddedBy" };
+
+            button10.Show();
+
+            ((IAccessibleObject)button10).AppendRelation(new EmbeddedBy() { Target = box });
+            ((IAccessibleObject)box).AppendRelation(new Embeds() { Target = button10 });
+
+            box.PackEnd(button10);
+
+            button10.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)button10).RemoveRelation(new EmbeddedBy() { Target = box });
+                ((IAccessibleObject)box).RemoveRelation(new Embeds() { Target = button10 });
+            };
+
+            Button button11 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "popup" };
+
+            button11.Show();
+
+            Popup popup = new Popup(win)
+            {
+                Orientation = PopupOrientation.Top,
+                Timeout = 5
+            };
+            popup.Append("Popup!!");
+
+            ((IAccessibleObject)popup).AppendRelation(new PopupFor() { Target = button11 });
+            ((IAccessibleObject)popup).AppendRelation(new SubwindowOf() { Target = box });
+            ((IAccessibleObject)box).AppendRelation(new ParentWindowOf() { Target = popup });
+
+            popup.OutsideClicked += (s, e) =>
+            {
+                popup.Hide();
+            };
+
+
+            button11.Clicked += (s, e) =>
+            {
+                popup.Show();
+            };
+
+            box.PackEnd(button11);
+
+            Button button13 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Popup Relation"};
+
+            button13.Show();
+
+            box.PackEnd(button13);
+
+            button13.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)popup).RemoveRelation(new PopupFor() { Target = button11 });
+                ((IAccessibleObject)popup).RemoveRelation(new SubwindowOf() { Target = box });
+                ((IAccessibleObject)box).RemoveRelation(new ParentWindowOf() { Target = popup });
+            };
+
+            Label label7 = new Label(win) { WeightX = 1, AlignmentX = -1,
+                Text = "This is Test for Accessibility Relation Append Test"};
+            label7.Show();
+
+            ((IAccessibleObject)label7).AppendRelation(new DescriptionFor() { Target = box });
+            ((IAccessibleObject)box).AppendRelation(new DescribedBy() { Target = label7 });
+
+            box.PackEnd(label7);
+
+            Button button14 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Description Relation"};
+            button14.Show();
+            box.PackEnd(button14);
+
+            button14.Clicked += (s, e) =>
+            {
+                ((IAccessibleObject)label7).RemoveRelation(new DescriptionFor() { Target = box });
+                ((IAccessibleObject)box).RemoveRelation(new DescribedBy() { Target = label7 });
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/AccessibilityRoleTest.cs b/test/ElmSharp.Test/TC/AccessibilityRoleTest.cs
new file mode 100644 (file)
index 0000000..216ee3d
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+    class AccessibilityRoleTest : TestCaseBase
+    {
+        public override string TestName => "AccessibilityRoleTest";
+        public override string TestDescription => "Accessibility Role API test";
+
+        public override void Run(Window win)
+        {
+            Conformant conformant = new Conformant(win);
+            conformant.Show();
+
+            Box box = new Box(win);
+            box.Show();
+
+            // AcceleratorLabel
+            Label acceleratorLabel = new Label(win)
+            {
+                Text = "AcceleratorLabel"
+            };
+
+            Label alertLabel = new Label(win)
+            {
+                Text = "Alert"
+            };
+
+            Label Animation = new Label(win)
+            {
+            };
+
+            conformant.SetContent(conformant);
+        }
+    }
+}
+
diff --git a/test/ElmSharp.Test/TC/AccessibilityTest.cs b/test/ElmSharp.Test/TC/AccessibilityTest.cs
new file mode 100644 (file)
index 0000000..3072f1b
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+    class AccessibilityTest : TestCaseBase
+    {
+        public override string TestName => "AccessibilityTest";
+        public override string TestDescription => "Accessibility API test";
+
+        int sequence = 0;
+        Naviframe navi;
+
+        Array accessRoleValues;
+
+        public override void Run(Window window)
+        {
+            accessRoleValues = Enum.GetValues(typeof(AccessRole));
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+
+            navi.Push(CreatePage(window, "Main page"), "first page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        static string StatusStr(ReadingStatus status)
+        {
+            if (status == ReadingStatus.Unknown)
+            {
+                return "Unknown";
+            }
+            else if (status == ReadingStatus.Cancelled)
+            {
+                return "Cancelled";
+            }
+            else if (status == ReadingStatus.Stoppped)
+            {
+                return "Stopped";
+            }
+            else if (status == ReadingStatus.Skipped)
+            {
+                return "Skipped";
+            }
+            else
+            {
+                return "invalid";
+            }
+        }
+
+        Widget CreatePage(Window win, string pageName)
+        {
+            Box box = new Box(win);
+            ((IAccessibleObject)box).Name = pageName;
+
+            box.Show();
+
+            Button abutton = new Button(win)
+            {
+                Text = "Accessibility-normal",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            ((IAccessibleObject)abutton).TranslationDomain = "kr";
+            ((IAccessibleObject)abutton).Name = "Accessibility";
+            ((IAccessibleObject)abutton).Description = "Description for Accessibility";
+
+            Label abutton_label = new Label(win)
+            {
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            abutton_label.Text =
+                "domain : " + ((IAccessibleObject)abutton).TranslationDomain +
+                ", name : " + ((IAccessibleObject)abutton).Name +
+                ", desc : " + ((IAccessibleObject)abutton).Description;
+
+            Button bbutton = new Button(win)
+            {
+                Text = "Accessibility-provider",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            ((IAccessibleObject)bbutton).NameProvider = (obj) => "Name-provider";
+            ((IAccessibleObject)bbutton).DescriptionProvider = (obj) => "Description-provider";
+
+            Label bbutton_label = new Label(win)
+            {
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            bbutton_label.Text =
+                "name : " + ((IAccessibleObject)bbutton).Name +
+                ", desc : " + ((IAccessibleObject)bbutton).Description;
+
+            Button cbutton = new Button(win)
+            {
+                Text = "Readingtype,CanHighlight",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            ((IAccessibleObject)cbutton).ReadingInfoType =
+                ReadingInfoType.Name | ReadingInfoType.Role | ReadingInfoType.Description;
+            ((IAccessibleObject)cbutton).Name = "FooFoo";
+            ((IAccessibleObject)cbutton).Role = AccessRole.Text;
+            ((IAccessibleObject)cbutton).Description = "FooFooButton";
+            Label name_onoff_label = new Label(win)
+            {
+                Text = "ReadingInfoType.Name : " +
+                    ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Name) != 0 ? "on" : "off"),
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            Label role_onoff_label = new Label(win)
+            {
+                Text = "ReadingInfoType.Role : " +
+                    ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Role) != 0 ? "on" : "off"),
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            Label description_onoff_label = new Label(win)
+            {
+                Text = "ReadingInfoType.Description : " +
+                    ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Description) != 0 ? "on" : "off"),
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            Label state_onoff_label = new Label(win)
+            {
+                Text = "ReadingInfoType.State : " +
+                    ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.State) != 0 ? "on" : "off"),
+                WeightX = 1,
+                AlignmentX = -1
+            };
+
+            Button saybutton = new Button(win)
+            {
+                Text = "HHGG with false",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+
+            Button saybutton2 = new Button(win)
+            {
+                Text = "HHGG with true",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+
+            int labelIndex = 0;
+            Button roleButton = new Button(win)
+            {
+                WeightX = 1,
+                AlignmentX = -1
+            };
+
+            roleButton.Clicked += (s, e) =>
+            {
+                if (labelIndex >= accessRoleValues.Length)
+                {
+                    labelIndex = 0;
+                }
+
+                IAccessibleObject obj = roleButton as IAccessibleObject;
+                AccessRole role = (AccessRole) accessRoleValues.GetValue(labelIndex);
+                obj.Role = role;
+                roleButton.Text = Enum.GetName(typeof(AccessRole), obj.Role);
+
+                labelIndex++;
+            };
+
+            Label label = new Label(win)
+            {
+                Text = string.Format("{0} Apple", sequence++),
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            ((IAccessibleObject)label).Name = "Apple";
+
+            Button push = new Button(win)
+            {
+                Text = "Push",
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            ((IAccessibleObject)push).Name = "PushButton";
+
+            Button pop = new Button(win)
+            {
+                Text = "pop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            ((IAccessibleObject)pop).Name = "PopButton";
+
+            abutton.Show();
+            abutton_label.Show();
+            bbutton.Show();
+            bbutton_label.Show();
+            cbutton.Show();
+            name_onoff_label.Show();
+            role_onoff_label.Show();
+            description_onoff_label.Show();
+            state_onoff_label.Show();
+            saybutton.Show();
+            saybutton2.Show();
+            roleButton.Show();
+            label.Show();
+            push.Show();
+            pop.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                NaviItem item = navi.Push(CreatePage(win, string.Format("Apple {0}", sequence -1)), string.Format("Page {0}", sequence -1));
+            };
+
+            Label statusLog = new Label(win)
+            {
+                WeightX = 1,
+                AlignmentX = -1
+            };
+            statusLog.Show();
+
+            saybutton.Clicked += (s, e) =>
+            {
+                    AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", false)
+                        .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); });
+            };
+            saybutton2.Clicked += (s, e) =>
+            {
+                    AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", true)
+                        .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); });
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = navi.NavigationStack.LastOrDefault();
+                navi.Pop();
+            };
+
+            box.PackEnd(abutton);
+            box.PackEnd(abutton_label);
+            box.PackEnd(bbutton);
+            box.PackEnd(bbutton_label);
+            box.PackEnd(cbutton);
+            box.PackEnd(name_onoff_label);
+            box.PackEnd(role_onoff_label);
+            box.PackEnd(description_onoff_label);
+            box.PackEnd(state_onoff_label);
+            box.PackEnd(saybutton);
+            box.PackEnd(saybutton2);
+            box.PackEnd(roleButton);
+            box.PackEnd(label);
+            box.PackEnd(push);
+            box.PackEnd(pop);
+            box.PackEnd(statusLog);
+
+            return box;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/BackgroundColorTest1.cs b/test/ElmSharp.Test/TC/BackgroundColorTest1.cs
new file mode 100644 (file)
index 0000000..c8073f3
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class BackgroundColorTest1 : TestCaseBase
+    {
+        public override string TestName => "BackgroundColorTest1";
+        public override string TestDescription => "To test basic operation of Widget's background Color";
+
+        
+
+        public override void Run(Window window)
+        {
+            Button button1 = new Button(window) {
+                Text = "Target Button",
+            };
+            button1.Resize(window.ScreenSize.Width, 100);
+            button1.Move(0, 0);
+            button1.Show();
+
+            Label label1 = new Label(window) {
+                Text = button1.BackgroundColor.ToString(),
+                BackgroundColor = Color.Black,
+                Color = Color.White
+            };
+            label1.Resize(window.ScreenSize.Width, 100);
+            label1.Move(0, 100);
+            label1.Show();
+
+            Button button2 = new Button(window) {
+                Text = "Set Color.Red",
+                BackgroundColor = Color.Red,
+            };
+            button2.Clicked += (e, o) =>
+            {
+                button1.BackgroundColor = Color.Red;
+                label1.Text = button1.BackgroundColor.ToString();
+            };
+            button2.Resize(window.ScreenSize.Width, 100);
+            button2.Move(0, 400);
+            button2.Show();
+
+            Button button3 = new Button(window) {
+                Text = "Set Color(125,200,255, 150)",
+                BackgroundColor = new Color(125,200,255, 150)
+            };
+            button3.Clicked += (e, o) =>
+            {
+                button1.BackgroundColor = button3.BackgroundColor;
+                label1.Text = button1.BackgroundColor.ToString();
+            };
+            button3.Resize(window.ScreenSize.Width, 100);
+            button3.Move(0, 500);
+            button3.Show();
+
+            Button button4 = new Button(window) {
+                Text = "Set Color(125, 200, 255, 10)",
+                BackgroundColor = new Color(125, 200, 255, 10)
+            };
+            button4.Clicked += (e,o) =>
+            {
+                button1.BackgroundColor = button4.BackgroundColor;
+                label1.Text = button1.BackgroundColor.ToString();
+            };
+            button4.Resize(window.ScreenSize.Width, 100);
+            button4.Move(0, 600);
+            button4.Show();
+
+            Button button5 = new Button(window) {
+                Text = "Set Color.Default",
+                BackgroundColor = Color.Default
+            };
+            button5.Clicked += (e, o) =>
+            {
+                button1.BackgroundColor = button5.BackgroundColor;
+                label1.Text = button1.BackgroundColor.ToString();
+            };
+            button5.Resize(window.ScreenSize.Width, 100);
+            button5.Move(0, 700);
+            button5.Show();
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/BackgroundTest1.cs b/test/ElmSharp.Test/TC/BackgroundTest1.cs
new file mode 100644 (file)
index 0000000..ed2a447
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class BackgroundTest1 : TestCaseBase
+    {
+        public override string TestName => "BackgroundTest1";
+        public override string TestDescription => "To test basic operation of Background";
+
+        public override void Run(Window window)
+        {
+            Background bg1 = new Background(window)
+            {
+                Color = Color.Orange
+            };
+
+            Background bg2 = new Background(window)
+            {
+                File = "/home/owner/apps_rw/ElmSharpTest/res/picture.png",
+                BackgroundOption = BackgroundOptions.Center,
+                BackgroundColor = Color.Gray
+            };
+
+            bg2.SetFileLoadSize(50, 50);
+
+            Show(bg1, 0, 0, 100, 100);
+            Show(bg2, 0, 100, 700, 700);
+        }
+
+        void Show(Background bg, int x, int y, int w, int h)
+        {
+            bg.Show();
+            bg.Move(x, y);
+            bg.Resize(w, h);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/BackgroundTest2.cs b/test/ElmSharp.Test/TC/BackgroundTest2.cs
new file mode 100644 (file)
index 0000000..09581bc
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class BackgroundTest2 : TestCaseBase
+    {
+        public override string TestName => "BackgroundTest2";
+        public override string TestDescription => "To test basic operation of Background";
+
+        public override void Run(Window window)
+        {
+            Background bg1 = new Background(window)
+            {
+                Color = Color.Orange
+            };
+
+            Background bg2 = new Background(window)
+            {
+                Color = new Color(60, 128, 255, 100)
+            };
+            Show(bg1, 0, 0, 500, 500);
+            Show(bg2, 100, 100, 500, 500);
+
+            Console.WriteLine("bg1.Color : {0}", bg1.Color.ToString());
+            Console.WriteLine("bg2.Color : {0}", bg2.Color.ToString());
+        }
+
+        void Show(Background bg, int x, int y, int w, int h)
+        {
+            bg.Move(x, y);
+            bg.Resize(w, h);
+            bg.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/BackgroundTest3.cs b/test/ElmSharp.Test/TC/BackgroundTest3.cs
new file mode 100644 (file)
index 0000000..788aa3b
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class BackgroundTest3 : TestCaseBase
+    {
+        public override string TestName => "BackgroundTest3";
+        public override string TestDescription => "To test basic operation of Background";
+
+        public override void Run(Window window)
+        {
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+            Background bg = new Background(window)
+            {
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            bg.Show();
+            box.PackEnd(bg);
+            Slider red = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Red",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider green = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Green",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider blue = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Blue",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider alpha = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Alpha",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            red.Show();
+            green.Show();
+            blue.Show();
+            alpha.Show();
+            box.PackEnd(red);
+            box.PackEnd(green);
+            box.PackEnd(blue);
+            box.PackEnd(alpha);
+            red.Value = 255;
+            green.Value = 255;
+            blue.Value = 255;
+            alpha.Value = 255;
+
+            bg.Color = new Color(255, 255, 255, 255);
+
+            EventHandler handler = (s, e) =>
+            {
+                bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value);
+            };
+
+            red.ValueChanged += handler;
+            green.ValueChanged += handler;
+            blue.ValueChanged += handler;
+            alpha.ValueChanged += handler;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/BoxLayoutTest1.cs b/test/ElmSharp.Test/TC/BoxLayoutTest1.cs
new file mode 100644 (file)
index 0000000..ebe68b4
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+
+namespace ElmSharp.Test
+{
+    public class BoxLayoutTest1 : TestCaseBase
+    {
+        public override string TestName => "BoxLayoutTest1";
+        public override string TestDescription => "Box Layout callback test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            navi.Push(CreatePage(window), "0 Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Box box = new Box(parent);
+            box.Show();
+
+            Label label = new Label(parent)
+            {
+                Text = string.Format("{0} Page", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button push = new Button(parent)
+            {
+                Text = "Push",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button pop = new Button(parent)
+            {
+                Text = "pop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            push.Resize(500, 100);
+            pop.Resize(500, 100);
+            label.Resize(500, 100);
+            box.SetLayoutCallback(() =>
+            {
+                Console.WriteLine("Layout callback with : {0}", box.Geometry);
+                var rect = box.Geometry;
+                label.Move(rect.X, rect.Y);
+                push.Move(rect.X, rect.Y + 100);
+                pop.Move(rect.X, rect.Y + 200);
+            });
+
+            box.PackEnd(label);
+            box.PackEnd(push);
+            box.PackEnd(pop);
+            return box;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/BoxTest1.cs b/test/ElmSharp.Test/TC/BoxTest1.cs
new file mode 100644 (file)
index 0000000..e927724
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class BoxTest1 : TestCaseBase
+    {
+        public override string TestName => "BoxTest1";
+        public override string TestDescription => "To test basic operation of Box";
+
+        Box box;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            box = new Box(window);
+            box.BackgroundColor = Color.Orange;
+            conformant.SetContent(box);
+            box.Show();
+
+            Button button1 = new Button(window) {
+                Text = "Button 1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Button button2 = new Button(window) {
+                Text = "Button 2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = new Color(50,100,200,75)
+            };
+            Button button3 = new Button(window) {
+                Text = "Button 3",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = Color.Olive
+            };
+
+            box.PackEnd(button1);
+            box.PackEnd(button2);
+            box.PackEnd(button3);
+
+            button1.Show();
+            button2.Show();
+            button3.Show();
+
+            button1.Clicked += Button1_Clicked;
+            button2.Clicked += Button1_Clicked;
+            button3.Clicked += Button1_Clicked;
+        }
+
+        private void Button1_Clicked(object sender, EventArgs e)
+        {
+            Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Box's BG Color : {2}", ((Button)sender).Text, ((Button)sender).BackgroundColor, box.BackgroundColor);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ButtonTest1.cs b/test/ElmSharp.Test/TC/ButtonTest1.cs
new file mode 100644 (file)
index 0000000..ab39a61
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class ButtonTest1 : TestCaseBase
+    {
+        public override string TestName => "ButtonTest1";
+        public override string TestDescription => "To test basic operation of Button";
+
+        void SetButtonEventHandler(Button button)
+        {
+            button.Clicked += (s, e) =>
+            {
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.BackgroundColor);
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName);
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower());
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", ""));
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg");
+            };
+
+            button.Pressed += (s, e) =>
+            {
+                Console.WriteLine("{0} Pressed!", button.Text);
+            };
+
+            button.Released += (s, e) =>
+            {
+                Console.WriteLine("{0} Released!", button.Text);
+            };
+
+            button.Repeated += (s, e) =>
+            {
+                Console.WriteLine("{0} Repeated!", button.Text);
+            };
+
+            button.Show();
+        }
+
+        public override void Run(Window window)
+        {
+            Button button1 = new Button(window) {
+                Text = "Button 1",
+            };
+            button1.SetPartColor("bg", Color.Red);
+            SetButtonEventHandler(button1);
+            button1.Resize(500, 100);
+            button1.Move(0, 0);
+
+            Button button2 = new Button(window) {
+                Text = "Button 2",
+                BackgroundColor = Color.Red,
+            };
+            SetButtonEventHandler(button2);
+            button2.Resize(500, 100);
+            button2.Move(0, 200);
+
+            Button button3 = new Button(window) {
+                Text = "Button 3",
+                BackgroundColor = new Color(125,200,255, 150)
+            };
+            SetButtonEventHandler(button3);
+            button3.Resize(500, 100);
+            button3.Move(0, 400);
+
+            Button button4 = new Button(window) {
+                Text = "Button 4",
+                BackgroundColor = new Color(125, 200, 255, 10)
+            };
+            SetButtonEventHandler(button4);
+            button4.Resize(500, 100);
+            button4.Move(0, 600);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/CalendarTest1.cs b/test/ElmSharp.Test/TC/CalendarTest1.cs
new file mode 100644 (file)
index 0000000..291d5f5
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class CalendarTest1 : TestCaseBase
+    {
+        public override string TestName => "CalendarTest1";
+        public override string TestDescription => "To test basic operation of Calendar";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Calendar calendar = new Calendar(window)
+            {
+                FirstDayOfWeek = DayOfWeek.Monday,
+                WeekDayNames = new List<string>() { "S", "M", "T", "W", "T", "F", "S" },
+                MinimumYear = DateTime.MinValue.Year,
+                MaximumYear = DateTime.MaxValue.Year
+            };
+
+            IList<CalendarMark> marks = new List<CalendarMark>();
+
+            var mark = calendar.AddMark("holiday", DateTime.Today, CalendarMarkRepeatType.Unique);
+            marks.Add(mark);
+
+            Label label1 = new Label(window)
+            {
+                Text = string.Format("WeekDayLabel.Count={0}", calendar.WeekDayNames.Count),
+                Color = Color.Black,
+            };
+
+            Label label2 = new Label(window)
+            {
+                Text = string.Format("WeekDayLabel.FirstDayOfWeek={0}", calendar.FirstDayOfWeek),
+                Color = Color.Black,
+            };
+
+            Label label3 = new Label(window)
+            {
+                Text = string.Format("WeekDayLabel.SelectedDate={0}", calendar.SelectedDate),
+                Color = Color.Black,
+            };
+
+            var selectMode = new Label(window)
+            {
+                Text = string.Format("SelectMode = {0}", calendar.SelectMode),
+                Color = Color.Black,
+            };
+
+            var addMark = new Button(window)
+            {
+                Text = "Add Mark"
+            };
+
+            var i = 1;
+
+            addMark.Clicked += (s, e) =>
+            {
+                var newMark = calendar.AddMark("holiday", DateTime.Today.AddDays(i), CalendarMarkRepeatType.Unique);
+
+                Console.WriteLine("Call Add Mark : " + DateTime.Today.AddDays(i));
+                marks.Add(newMark);
+                calendar.DrawMarks();
+                i++;
+            };
+
+            var delMark = new Button(window)
+            {
+                Text = "Delete Mark"
+            };
+
+            delMark.Clicked += (s, e) =>
+            {
+                if (marks.Count > 0)
+                {
+                    calendar.DeleteMark(marks[0]);
+                    marks.Remove(marks[0]);
+                    calendar.DrawMarks();
+                }
+            };
+
+            var changeMode = new Button(window)
+            {
+                Text = "Change Select Mode"
+            };
+
+            changeMode.Clicked += (s, e) =>
+            {
+                if (calendar.SelectMode == CalendarSelectMode.Always || calendar.SelectMode == CalendarSelectMode.Default)
+                {
+                    calendar.SelectMode = CalendarSelectMode.None;
+                }
+                else if (calendar.SelectMode == CalendarSelectMode.None)
+                {
+                    calendar.SelectMode = CalendarSelectMode.OnDemand;
+                }
+                else
+                {
+                    calendar.SelectMode = CalendarSelectMode.Always;
+                }
+                selectMode.Text = string.Format("SelectMode = {0}", calendar.SelectMode);
+            };
+
+            calendar.DateChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                label1.Text = string.Format("Old.Day={0}, Month={1}, Year={2}", e.OldDate.Day, e.OldDate.Month, e.OldDate.Year);
+                label2.Text = string.Format("New.Day={0}, Month={1}, Year={2}", e.NewDate.Day, e.NewDate.Month, e.NewDate.Year);
+                label3.Text = string.Format("SelectedDate={0}", calendar.SelectedDate);
+            };
+
+            calendar.DisplayedMonthChanged += (object sender, DisplayedMonthChangedEventArgs e) =>
+            {
+                label3.Text = string.Format("Old Month={0}, New Month={1}", e.OldMonth, e.NewMonth);
+            };
+
+            var label4 = new Label(window)
+            {
+                Text = string.Format("Selectable={0}", calendar.Selectable),
+                Color = Color.Black,
+            };
+
+            var changeSelectable = new Button(window)
+            {
+                Text = "Change Selectable"
+            };
+
+            calendar.Selectable = CalendarSelectable.Month;
+
+            changeSelectable.Clicked += (s, e) =>
+            {
+                if (calendar.Selectable == CalendarSelectable.None)
+                {
+                    calendar.Selectable = CalendarSelectable.Year;
+                }
+                else if (calendar.Selectable == CalendarSelectable.Year)
+                {
+                    calendar.Selectable = CalendarSelectable.Month;
+                }
+                else if (calendar.Selectable == CalendarSelectable.Month)
+                {
+                    calendar.Selectable = CalendarSelectable.Day;
+                }
+                else
+                {
+                    calendar.Selectable = CalendarSelectable.None;
+                }
+                label4.Text = string.Format("Selectable={0}", calendar.Selectable);
+            };
+
+            var setTime = new Button(window)
+            {
+                Text = "Set 2015,1,1",
+            };
+
+            setTime.Clicked += (s, e) =>
+            {
+                calendar.SelectedDate = new DateTime(2015, 1, 1);
+            };
+
+            calendar.Resize(600, 600);
+            calendar.Move(0, 150);
+            calendar.Show();
+
+            label1.Resize(600, 30);
+            label1.Move(0, 0);
+            label1.Show();
+
+            label2.Resize(600, 30);
+            label2.Move(0, 30);
+            label2.Show();
+
+            label3.Resize(600, 30);
+            label3.Move(0, 60);
+            label3.Show();
+
+            selectMode.Resize(600, 30);
+            selectMode.Move(0, 90);
+            selectMode.Show();
+
+            addMark.Resize(600, 100);
+            addMark.Move(0, 750);
+            addMark.Show();
+
+            delMark.Resize(600, 100);
+            delMark.Move(0, 850);
+            delMark.Show();
+
+            changeMode.Resize(600, 100);
+            changeMode.Move(0, 950);
+            changeMode.Show();
+
+            label4.Resize(600, 30);
+            label4.Move(0, 1050);
+            label4.Show();
+
+            changeSelectable.Resize(600, 100);
+            changeSelectable.Move(0, 1080);
+            changeSelectable.Show();
+
+            setTime.Resize(600, 100);
+            setTime.Move(0, 1180);
+            setTime.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/CheckTest1.cs b/test/ElmSharp.Test/TC/CheckTest1.cs
new file mode 100644 (file)
index 0000000..e11c835
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class CheckTest1 : TestCaseBase
+    {
+        public override string TestName => "CheckTest1";
+        public override string TestDescription => "To test basic operation of Check";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Check check = new Check(window)
+            {
+                Text = "This is Check",
+                Style = "default",
+            };
+
+            Label label1 = new Label(window) {
+                Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style),
+            };
+
+            Label label2 = new Label(window);
+
+            Label label3 = new Label(window);
+
+            check.StateChanged += (object sender, CheckStateChangedEventArgs e) =>
+            {
+                check.Style = check.Style == "default" ? "on&off": "default";
+                label1.Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style);
+                label2.Text = string.Format("OldState={0}", e.OldState);
+                label3.Text = string.Format("NewState={0}", e.NewState);
+            };
+
+            check.Resize(600, 100);
+            check.Move(0, 300);
+            check.Show();
+
+            label1.Resize(600, 100);
+            label1.Move(0, 0);
+            label1.Show();
+
+            label2.Resize(600, 100);
+            label2.Move(0, 100);
+            label2.Show();
+
+            label3.Resize(600, 100);
+            label3.Move(0, 200);
+            label3.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/ClipperTest1.cs b/test/ElmSharp.Test/TC/ClipperTest1.cs
new file mode 100644 (file)
index 0000000..d222bbc
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ClipperTest1 : TestCaseBase
+    {
+        public override string TestName => "ClipperTest1";
+        public override string TestDescription => "ClipperTest1 test";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.None,
+            };
+            scroller.Show();
+            Box container = new Box(window);
+            scroller.SetContent(container);
+
+            var rect1 = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Color = Color.Blue,
+                MinimumHeight = 500
+            };
+            rect1.Show();
+
+            var clipper = new Rectangle(window);
+            clipper.Color = new ElmSharp.Color(200, 200, 200, 200);
+            clipper.Geometry = rect1.Geometry;
+            rect1.Moved += (s, e) =>
+            {
+                clipper.Geometry = ((Rectangle)s).Geometry;
+            };
+            rect1.SetClip(clipper);
+            clipper.Show();
+            container.PackEnd(rect1);
+
+            Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon };
+            for (int i = 0; i < 6; i++)
+            {
+                var rect = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    WeightX = 1,
+                    Color = colors[i],
+                    MinimumHeight = 500
+                };
+                rect.Show();
+                container.PackEnd(rect);
+            }
+
+            navi.Push(scroller, "Scroll Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ColorSelectorTest1.cs b/test/ElmSharp.Test/TC/ColorSelectorTest1.cs
new file mode 100644 (file)
index 0000000..1938d60
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class ColorSelectorTest1 : TestCaseBase
+    {
+        public override string TestName => "ColorSelectorTest1";
+        public override string TestDescription => "To test basic operation of ColorSelector";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            ColorSelector cs = new ColorSelector(window);
+
+            Label label1 = new Label(window) {
+                Text = string.Format("Selected Color={0}", cs.SelectedColor),
+            };
+
+            Label label2 = new Label(window);
+
+            Label label3 = new Label(window);
+
+            cs.ColorChanged += (object sender, ColorChangedEventArgs e) =>
+            {
+                label1.Text = string.Format("Selected Color={0}", cs.SelectedColor);
+                label2.Text = string.Format("Old Color={0}", e.OldColor);
+                label3.Text = string.Format("New Color={0}", e.NewColor);
+            };
+
+            cs.Resize(600, 600);
+            cs.Move(0, 300);
+            cs.Show();
+
+            label1.Resize(600, 100);
+            label1.Move(0, 0);
+            label1.Show();
+
+            label2.Resize(600, 100);
+            label2.Move(0, 100);
+            label2.Show();
+
+            label3.Resize(600, 100);
+            label3.Move(0, 200);
+            label3.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/ContextPopupTest1.cs b/test/ElmSharp.Test/TC/ContextPopupTest1.cs
new file mode 100644 (file)
index 0000000..22ef5ca
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ContextPopupTest1 : TestCaseBase
+    {
+        public override string TestName => "ContextPopupTest1";
+        public override string TestDescription => "To test basic operation of ContextPopup";
+        private int _count = 0;
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            ContextPopup ctxPopup = new ContextPopup(bg)
+            {
+                IsHorizontal = false,
+                AutoHide = false,
+            };
+
+            for (int i = 0; i < 5; i++)
+            {
+                ctxPopup.Append(string.Format("{0} item", _count++));
+            }
+
+            ctxPopup.Dismissed += (e, o) => {
+                Console.WriteLine("Dismissed");
+            };
+            ctxPopup.Show();
+
+            bool ctxPopupVisible = true;
+            string dismissCaption = "Dismiss ContextPopup!";
+            string showCaption = "Show ContextPopup!";
+
+            Button button = new Button(window) {
+                Text = dismissCaption
+            };
+            button.Clicked += (E, o) =>
+            {
+                if(ctxPopupVisible)
+                {
+                    ctxPopup.Dismiss();
+                }
+                else
+                {
+                    ctxPopup.Show();
+                }
+                ctxPopupVisible = !ctxPopupVisible;
+                button.Text = ctxPopupVisible?dismissCaption:showCaption;
+            };
+            button.Move(200, 100);
+            button.Resize(500, 100);
+            button.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs b/test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs
new file mode 100644 (file)
index 0000000..2cd239e
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class DateTimeSelectorTest1 : TestCaseBase
+    {
+        public override string TestName => "DateTimeSelectorTest1";
+        public override string TestDescription => "To test basic operation of DateTimeSelector";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.Gray;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            DateTimeSelector dateTime = new DateTimeSelector(window)
+            {
+                MinimumDateTime = new DateTime(2015,1,1),
+                MaximumDateTime = DateTime.Now,
+                DateTime = DateTime.Now
+            };
+
+            Label label1 = new Label(window);
+
+            Label label2 = new Label(window);
+
+            Label label3 = new Label(window) {
+                Text = string.Format("Current DateTime={0}", dateTime.DateTime),
+            };
+
+            dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                label1.Text = string.Format("Old DateTime={0}", e.OldDate);
+                label2.Text = string.Format("New DateTime={0}", e.NewDate);
+                label3.Text = string.Format("Current DateTime={0}", dateTime.DateTime);
+            };
+
+            dateTime.Resize(720, 600);
+            dateTime.Move(0, 300);
+            dateTime.Show();
+
+            label1.Resize(600, 100);
+            label1.Move(0, 0);
+            label1.Show();
+
+            label2.Resize(600, 100);
+            label2.Move(0, 100);
+            label2.Show();
+
+            label3.Resize(600, 100);
+            label3.Move(0, 200);
+            label3.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs b/test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs
new file mode 100644 (file)
index 0000000..bbe8c75
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class DateTimeSelectorTest2 : TestCaseBase
+    {
+        public override string TestName => "DateTimeSelectorTest2";
+        public override string TestDescription => "To test basic operation of DateTimeSelector";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.Gray;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            DateTimeSelector dateTime = new DateTimeSelector(window)
+            {
+                DateTime = DateTime.Today,
+                Style = "time_layout",
+                Format = "%d/%b/%Y %I:%M %p"
+            };
+
+            Label label1 = new Label(window);
+
+            Label label2 = new Label(window);
+
+            Label label3 = new Label(window) {
+                Text = string.Format("Current DateTime={0}", dateTime.DateTime),
+            };
+
+            dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                label1.Text = string.Format("Old DateTime={0}", e.OldDate);
+                label2.Text = string.Format("New DateTime={0}", e.NewDate);
+                label3.Text = string.Format("Current DateTime={0}", dateTime.DateTime);
+            };
+
+            dateTime.Resize(720, 600);
+            dateTime.Move(0, 300);
+            dateTime.Show();
+
+            label1.Resize(600, 100);
+            label1.Move(0, 0);
+            label1.Show();
+
+            label2.Resize(600, 100);
+            label2.Move(0, 100);
+            label2.Show();
+
+            label3.Resize(600, 100);
+            label3.Move(0, 200);
+            label3.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/EcoreTimerTest1.cs b/test/ElmSharp.Test/TC/EcoreTimerTest1.cs
new file mode 100644 (file)
index 0000000..325f6a4
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test
+{
+    class EcoreTimerTest1 : TestCaseBase
+    {
+        public override string TestName => "EcoreTimerTest1";
+        public override string TestDescription => "To timer operation of EcoreMainLoop";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+
+            int number = 0;
+            bool bReturn = true;
+            Label label1 = new Label(window);
+            label1.Move(150, 150);
+            label1.Resize(300, 100);
+
+            Button btnTimerSwitch = new Button(window);
+            btnTimerSwitch.Text = "Timer : On";
+            btnTimerSwitch.Move(0, 300);
+            btnTimerSwitch.Resize(300, 100);
+
+            Func<bool> handler = () =>
+            {
+                label1.Text = (++number).ToString();
+                label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000 font_size=64 align=left valign=bottom wrap=word'";
+                return bReturn;
+            };
+            IntPtr prevId = EcoreMainloop.AddTimer(1.0, handler);
+            btnTimerSwitch.Clicked += (s, e) =>
+             {
+                 if(bReturn)
+                 {
+                     bReturn = false;
+                     btnTimerSwitch.Text = "Timer : Off";
+                 }
+                 else
+                 {
+                     bReturn = true;
+                     btnTimerSwitch.Text = "Timer : On";
+                     EcoreMainloop.RemoveTimer(prevId);
+                     prevId = EcoreMainloop.AddTimer(1.0, handler);
+                 }
+             };
+
+            window.BackButtonPressed += (s, e) =>
+            {
+                EcoreMainloop.RemoveTimer(prevId);
+            };
+
+            label1.Show();
+            btnTimerSwitch.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/EntryTest1.cs b/test/ElmSharp.Test/TC/EntryTest1.cs
new file mode 100644 (file)
index 0000000..2dc8437
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class EntryTest1 : TestCaseBase
+    {
+        public override string TestName => "EntryTest1";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Entry entry1 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+            };
+            entry1.SetPartText("guide", "<span color=#999999>Single Line</span>");
+
+            Entry entry2 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsPassword = true
+            };
+            entry2.SetPartText("guide", "<span color=#999999>Password</span>");
+
+            Entry entry3 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Scrollable = true,
+            };
+            entry3.SetPartText("guide", "<span color=#808080FF font_size=28 align=left valign=top wrap=mixed>Enter a System.Double</span>");
+            //entry3.Geometry = new Rect(0, 163, 720, 37);
+            entry3.Show();
+
+            var capital1 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Auto Capital : Word",
+                AutoCapital = AutoCapital.Word
+            };
+
+            var capital2 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Auto Capital : Sentence",
+                AutoCapital = AutoCapital.Sentence
+            };
+
+            var capital3 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Auto Capital : All",
+                AutoCapital = AutoCapital.All
+            };
+
+            var getText = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "get cursor content test",
+            };
+
+            var label = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+            };
+
+            getText.CursorChanged += (s, e) =>
+            {
+                label.Text = getText.GetCursorContent();
+            };
+
+            //var autoSave = new Entry(window)
+            //{
+            //    AlignmentX = -1,
+            //    AlignmentY = 0,
+            //    WeightX = 1,
+            //    WeightY = 1,
+            //    Text = "Auto Save",
+            //    IsAutoSave = true
+            //};
+
+            var btn = new Button(window)
+            {
+            };
+
+            box.PackEnd(entry1);
+            box.PackEnd(entry2);
+            box.PackEnd(entry3);
+            box.PackEnd(capital1);
+            box.PackEnd(capital2);
+            box.PackEnd(capital3);
+            box.PackEnd(getText);
+            box.PackEnd(label);
+
+            entry1.Show();
+            entry2.Show();
+            entry3.Show();
+            capital1.Show();
+            capital2.Show();
+            capital3.Show();
+            getText.Show();
+            label.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/EntryTest2.cs b/test/ElmSharp.Test/TC/EntryTest2.cs
new file mode 100644 (file)
index 0000000..06c9f7c
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class EntryTest2 : TestCaseBase
+    {
+        public override string TestName => "EntryTest2";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window) {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Yellow
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Check check = new Check(window) {
+                AlignmentX = -1,
+                AlignmentY = 0.9,
+                WeightX = 1,
+                WeightY = 0.1,
+                Text = "Select All",
+            };
+            check.Show();
+
+            Entry entry = new Entry(window) {
+                AlignmentX = -1,
+                AlignmentY = 0.1,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Text = "Hello, Tizen !!!"
+            };
+            entry.Show();
+
+            check.StateChanged += (object sender, CheckStateChangedEventArgs e) =>
+            {
+                if (e.NewState == true)
+                {
+                    entry.SelectAll();
+                }
+                else
+                {
+                    entry.SelectNone();
+                }
+            };
+
+            box.PackEnd(check);
+            box.PackEnd(entry);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/EntryTest3.cs b/test/ElmSharp.Test/TC/EntryTest3.cs
new file mode 100644 (file)
index 0000000..755f887
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class EntryTest3 : TestCaseBase
+    {
+        public override string TestName => "EntryTest3";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Yellow
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Entry entry = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Text = "Hello, Tizen"
+            };
+
+            var btn = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Set Filter"
+            };
+            btn.Show();
+
+            //var filter = new Entry.TextFilter(SetFilter);
+            btn.Clicked += (s, e) =>
+            {
+                entry.AppendMarkUpFilter(SetFilter);
+            };
+
+            var btn1 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Remove Filter"
+            };
+            btn1.Show();
+            btn1.Clicked += (s, e) =>
+            {
+                entry.RemoveMarkUpFilter(SetFilter);
+            };
+
+            //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter));
+
+            entry.Show();
+            box.PackEnd(entry);
+            box.PackEnd(btn);
+            box.PackEnd(btn1);
+        }
+
+        public string SetFilter(Entry entry, string text)
+        {
+            if (text.Equals("a") || text.Equals("b") || text.Equals("c") || text.Equals("d"))
+                return text;
+            else
+                return "Tizen";
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/EvasMapTest1.cs b/test/ElmSharp.Test/TC/EvasMapTest1.cs
new file mode 100644 (file)
index 0000000..498dd16
--- /dev/null
@@ -0,0 +1,113 @@
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class EvasMapTest1 : TestCaseBase
+    {
+        public override string TestName => "EvasMapTest1";
+        public override string TestDescription => "Test EvasMap on different levels of hierarchy";
+
+        public override void Run(Window window)
+        {
+            var box = new Box(window)
+            {
+                IsHorizontal = false,
+            };
+            box.SetAlignment(-1.0, -1.0);
+            box.SetWeight(1.0, 1.0);
+            box.Show();
+
+            var text = new Label(box)
+            {
+                Text = "<span color=#ffffff font_size=30>Target</span>",
+                AlignmentX = -1.0,
+                AlignmentY = -1.0,
+                WeightX = 1.0,
+                WeightY = 1.0,
+            };
+            text.Show();
+
+            var textBox = new Box(box)
+            {
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+                WeightY = 0.7,
+            };
+            textBox.PackEnd(text);
+            textBox.Show();
+
+            double angle = 0.0;
+
+            var reset = new Button(box)
+            {
+                Text = "Reset",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+                WeightY = 0.1,
+            };
+            reset.Show();
+
+            double zx = 1.0;
+            double zy = 1.0;
+            reset.Clicked += (object sender, EventArgs e) =>
+            {
+                text.IsMapEnabled = false;
+                angle = 0.0;
+                zx = 1.0;
+                zy = 1.0;
+            };
+
+            var zoom = new Button(box)
+            {
+                Text = "Zoom Target",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+                WeightY = 0.1,
+            };
+            zoom.Show();
+
+            zoom.Clicked += (object sender, EventArgs e) =>
+            {
+                zx += 0.1;
+                zy += 0.1;
+                var map = new EvasMap(4);
+                var g = text.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                map.Zoom(zx, zy, g.X, g.Y);
+                text.EvasMap = map;
+                text.IsMapEnabled = true;
+            };
+
+            var rotate = new Button(box)
+            {
+                Text = "Rotate Target",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+                WeightY = 0.1,
+            };
+            rotate.Show();
+
+            rotate.Clicked += (object sender, EventArgs e) =>
+            {
+                angle += 5.0;
+                var map = new EvasMap(4);
+                var g = text.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                map.Zoom(zx, zy, g.X, g.Y);
+                text.EvasMap = map;
+                text.IsMapEnabled = true;
+            };
+
+            box.PackEnd(textBox);
+            box.PackEnd(reset);
+            box.PackEnd(zoom);
+            box.PackEnd(rotate);
+
+            box.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            box.Move(0, 0);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/EvasMapTest2.cs b/test/ElmSharp.Test/TC/EvasMapTest2.cs
new file mode 100644 (file)
index 0000000..17d411e
--- /dev/null
@@ -0,0 +1,131 @@
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class EvasMapTest2 : TestCaseBase
+    {
+        public override string TestName => "EvasMapTest2";
+        public override string TestDescription => "Test EvasMap on different levels of hierarchy";
+
+        public override void Run(Window window)
+        {
+            var box = new Box(window)
+            {
+                IsHorizontal = false,
+            };
+            box.SetAlignment(-1.0, -1.0);  // fill
+            box.SetWeight(1.0, 1.0);  // expand
+            box.Show();
+
+            var group = new Box(box)
+            {
+                IsHorizontal = true,
+                BackgroundColor = Color.White,
+            };
+            group.Show();
+
+            var x = new Label(group)
+            {
+                Text = "X",
+            };
+            x.Show();
+
+            var y = new Label(group)
+            {
+                Text = "Y",
+            };
+            y.Show();
+
+            var z = new Label(group)
+            {
+                Text = "Z",
+            };
+            z.Show();
+            group.PackEnd(x);
+            group.PackEnd(y);
+            group.PackEnd(z);
+
+            var top = new Rectangle(box)
+            {
+                Color = Color.Red,
+            };
+            top.SetAlignment(-1.0, -1.0);  // fill
+            top.SetWeight(1.0, 1.0);  // expand
+            top.Show();
+
+            var bottom = new Rectangle(box)
+            {
+                Color = Color.Green,
+            };
+            bottom.SetAlignment(-1.0, -1.0);  // fill
+            bottom.SetWeight(1.0, 1.0);  // expand
+            bottom.Show();
+
+            double angle = 0.0;
+
+            var reset = new Button(box)
+            {
+                Text = "Reset",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+            };
+            reset.Show();
+
+            reset.Clicked += (object sender, EventArgs e) =>
+            {
+                group.IsMapEnabled = false;
+                x.IsMapEnabled = false;
+                angle = 0.0;
+            };
+
+            var zoom = new Button(box)
+            {
+                Text = "Zoom group",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+            };
+            zoom.Show();
+
+            zoom.Clicked += (object sender, EventArgs e) =>
+            {
+                var map = new EvasMap(4);
+                var g = group.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Zoom(3.0, 3.0, g.X + g.Width / 2, g.Y + g.Height / 2);
+                group.EvasMap = map;
+                group.IsMapEnabled = true;
+            };
+
+            var rotate = new Button(box)
+            {
+                Text = "Rotate X",
+                AlignmentX = -1.0,
+                WeightX = 1.0,
+            };
+            rotate.Show();
+
+            rotate.Clicked += (object sender, EventArgs e) =>
+            {
+                angle += 5.0;
+
+                var map = new EvasMap(4);
+                var g = x.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                x.EvasMap = map;
+                x.IsMapEnabled = true;
+            };
+
+            box.PackEnd(top);
+            box.PackEnd(group);
+            box.PackEnd(bottom);
+            box.PackEnd(reset);
+            box.PackEnd(zoom);
+            box.PackEnd(rotate);
+
+            box.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            box.Move(0, 0);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/FlipSelectorTest.cs b/test/ElmSharp.Test/TC/FlipSelectorTest.cs
new file mode 100644 (file)
index 0000000..0c2a85d
--- /dev/null
@@ -0,0 +1,113 @@
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class FlipSelectorTest : TestCaseBase
+    {
+        public override string TestName => "FlipSelectorTest";
+        public override string TestDescription => "To test FlipSelector";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+
+            FlipSelector flip = new FlipSelector(window)
+            {
+                Interval = 1.0,
+            };
+
+            flip.Append("two");
+            flip.Prepend("one");
+
+            flip.Show();
+            box.PackEnd(flip);
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(box);
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            prev.Clicked += (s, e) => { flip.Prev(); };
+            prev.Show();
+
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            next.Clicked += (s, e) => { flip.Next(); };
+            next.Show();
+
+            Button prepend = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "prepend"
+            };
+            prepend.Clicked += (s, e) => {
+
+                var random = new Random();
+                int value = random.Next(99);
+                flip.Prepend(value.ToString());
+            };
+            prepend.Show();
+
+            Button append = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "append"
+            };
+            append.Clicked += (s, e) => {
+
+                var random = new Random();
+                int value = random.Next(99);
+                flip.Append(value.ToString());
+            };
+            append.Show();
+
+            Button remove = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "remove"
+            };
+            remove.Clicked += (s, e) => { flip.Remove(flip.SelectedItem); };
+            remove.Show();
+
+            outterBox.PackEnd(box);
+            outterBox.PackEnd(prev);
+            outterBox.PackEnd(next);
+            outterBox.PackEnd(append);
+            outterBox.PackEnd(prepend);
+            outterBox.PackEnd(remove);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/FloatingButtonTest.cs b/test/ElmSharp.Test/TC/FloatingButtonTest.cs
new file mode 100644 (file)
index 0000000..61c0a62
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class FloatingButtonTest : TestCaseBase
+    {
+        public override string TestName => "FloatingButtonTest";
+        public override string TestDescription => "To test FloatingButton";
+
+        Button _RedButton = null;
+        Button _GreenButton = null;
+
+        public Button CreateButton(Window window, string text)
+        {
+            return new Button(window)
+            {
+                Text = text,
+                AlignmentY = -1,
+                AlignmentX = -1,
+            };
+        }
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            FloatingButton floatingButton = new FloatingButton(window)
+            {
+                Mode = FloatingButtonMode.All,
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            floatingButton.Show();
+            floatingButton.Resize(700, 700);
+            floatingButton.Move(0, 400);
+
+            Box backGround = new Box(window)
+            {
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            backGround.Show();
+
+            Button button1 = CreateButton(window, "Mode change to LeftRightOnly");
+            button1.Clicked += (s, e) => {
+                if (floatingButton.Mode == FloatingButtonMode.All)
+                {
+                    floatingButton.Mode = FloatingButtonMode.LeftRightOnly;
+                    button1.Text = "Mode change to All";
+                }
+                else
+                {
+                    floatingButton.Mode = FloatingButtonMode.All;
+                    button1.Text = "Mode change to LeftRightOnly";
+                }
+            };
+            button1.Show();
+
+            Button button2 = CreateButton(window, "MovementBlock Set");
+            button2.Clicked += (s, e) => {
+                floatingButton.MovementBlock = !floatingButton.MovementBlock;
+                if (floatingButton.MovementBlock) button2.Text = "MovementBlock Unset";
+                else button2.Text = "MovementBlock Set";
+            };
+            button2.Show();
+
+            Button button3 = CreateButton(window, "RedButton Set");
+            button3.Clicked += (s, e) => {
+                if (_RedButton == null)
+                {
+                    _RedButton = CreateButton(window, "RedButton");
+                    _RedButton.BackgroundColor = Color.Red;
+                    floatingButton.SetPartContent("button1", _RedButton, true);
+                    button3.Text = "RedButton Unset";
+                }
+                else
+                {
+                    _RedButton.Unrealize();
+                    _RedButton = null;
+                    floatingButton.SetPartContent("button1", _RedButton, true);
+                    button3.Text = "RedButton Set";
+                }
+            };
+            button3.Show();
+
+            Button button4 = CreateButton(window, "GreenButton Set");
+            button4.Clicked += (s, e) => {
+                if (_GreenButton == null)
+                {
+                    _GreenButton = CreateButton(window, "GreenButton");
+                    _GreenButton.BackgroundColor = Color.Green;
+                    floatingButton.SetPartContent("button2", _GreenButton, true);
+                    button4.Text = "GreenButton Unset";
+                }
+                else
+                {
+                    _GreenButton.Unrealize();
+                    _GreenButton = null;
+                    floatingButton.SetPartContent("button2", _GreenButton, true);
+                    button4.Text = "GreenButton Unset";
+                }
+            };
+            button4.Show();
+
+            box.PackEnd(backGround);
+            box.PackEnd(button1);
+            box.PackEnd(button2);
+            box.PackEnd(button3);
+            box.PackEnd(button4);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs b/test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs
new file mode 100644 (file)
index 0000000..c0aa049
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class FocusAutoScrollModeTest : TestCaseBase
+    {
+        public override string TestName => "FocusAutoScrollModeTest";
+        public override string TestDescription => "To test basic operation of Elementary.FocusAutoScrollMode";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenGrid grid = new GenGrid(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ItemAlignmentX = -1,
+                ItemAlignmentY = -1,
+                ItemWidth = window.ScreenSize.Width / 3,
+                ItemHeight = window.ScreenSize.Width / 3,
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    if (part == "elm.swallow.icon")
+                    {
+                        var colorbox = new Rectangle(window)
+                        {
+                            Color = item
+                        };
+                        return colorbox;
+                    }
+                    return null;
+                }
+
+            };
+
+            GenGridItem firstitem = null;
+            GenGridItem lastitem = null;
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                var item = grid.Append(defaultClass, color);
+                if (i == 0)
+                    firstitem = item;
+                if (i == 101)
+                    lastitem = item;
+            }
+            grid.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            box.PackEnd(grid);
+
+            Button show = new Button(window)
+            {
+                Text = "Show",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button none = new Button(window)
+            {
+                Text = "None",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button bringIn = new Button(window)
+            {
+                Text = "BringIn",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            show.Clicked += (s, e) =>
+            {
+                Elementary.FocusAutoScrollMode = FocusAutoScrollMode.Show;
+                Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode);
+            };
+            none.Clicked += (s, e) =>
+            {
+                Elementary.FocusAutoScrollMode = FocusAutoScrollMode.None;
+                Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode);
+            };
+            bringIn.Clicked += (s, e) =>
+            {
+                Elementary.FocusAutoScrollMode = FocusAutoScrollMode.BringIn;
+                Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode);
+            };
+
+            show.Show();
+            none.Show();
+            bringIn.Show();
+
+            box.PackEnd(show);
+            box.PackEnd(none);
+            box.PackEnd(bringIn);
+
+            grid.ItemActivated += Grid_ItemActivated;
+            grid.ItemSelected += Grid_ItemSelected;
+            grid.ItemUnselected += Grid_ItemUnselected;
+            grid.ItemRealized += Grid_ItemRealized;
+            grid.ItemUnrealized += Grid_ItemUnrealized;
+            grid.ItemPressed += Grid_ItemPressed;
+            grid.ItemReleased += Grid_ItemReleased;
+            grid.ItemLongPressed += Grid_ItemLongPressed;
+            grid.ItemDoubleClicked += Grid_ItemDoubleClicked;
+        }
+
+        private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemReleased(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemRealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemSelected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemActivated(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/FocusTest1.cs b/test/ElmSharp.Test/TC/FocusTest1.cs
new file mode 100644 (file)
index 0000000..033280b
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test
+{
+    public class FocusTest1 : TestCaseBase
+    {
+        public override string TestName => "FocusTest1";
+        public override string TestDescription => "To test basic operation of Focus";
+
+        Button currentButton;
+        Label lbInfo;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Box buttonBox1 = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox1.Show();
+
+            Box buttonBox2 = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox2.Show();
+
+            Box buttonBox3 = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox3.Show();
+
+            Button leftButton = new Button(window)
+            {
+                Text = "Left",
+                BackgroundColor = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            leftButton.Show();
+
+            Button rightButton = new Button(window)
+            {
+                Text = "Right",
+                BackgroundColor = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            rightButton.Show();
+
+            Button upButton = new Button(window)
+            {
+                Text = "Up",
+                BackgroundColor = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            upButton.Show();
+
+            Button downButton = new Button(window)
+            {
+                Text = "Down",
+                BackgroundColor = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            downButton.Show();
+
+            leftButton.Focused += Button_Focused;
+            leftButton.Unfocused += Button_Unfocused;
+            rightButton.Focused += Button_Focused;
+            rightButton.Unfocused += Button_Unfocused;
+            upButton.Focused += Button_Focused;
+            upButton.Unfocused += Button_Unfocused;
+            downButton.Focused += Button_Focused;
+            downButton.Unfocused += Button_Unfocused;
+
+            leftButton.AllowFocus(false);
+            rightButton.AllowFocus(false);
+            upButton.AllowFocus(false);
+            downButton.AllowFocus(false);
+
+            buttonBox1.PackEnd(leftButton);
+            buttonBox1.PackEnd(rightButton);
+            buttonBox1.PackEnd(upButton);
+            buttonBox1.PackEnd(downButton);
+
+            Button buttonA = new Button(window)
+            {
+                Text = "A",
+                AlignmentX = 0.5,
+                WeightX = 1,
+                WeightY = 1
+            };
+            buttonA.Show();
+
+            Button buttonB = new Button(window)
+            {
+                Text = "B",
+                AlignmentX = 0.5,
+                WeightX = 1,
+                WeightY = 1
+            };
+            buttonB.Show();
+
+            buttonBox2.PackEnd(buttonA);
+            buttonBox2.PackEnd(buttonB);
+
+            buttonA.Focused += Button_Focused;
+            buttonA.Unfocused += Button_Unfocused;
+            buttonB.Focused += Button_Focused;
+            buttonB.Unfocused += Button_Unfocused;
+
+            Button itemButton1 = new Button(window)
+            {
+                Text = "No.1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            itemButton1.Show();
+
+            Button itemButton2 = new Button(window)
+            {
+                Text = "No.2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            itemButton2.Show();
+
+            Button itemButton3 = new Button(window)
+            {
+                Text = "No.3",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            itemButton3.Show();
+
+            Button itemButton4 = new Button(window) {
+                Text = "No.4",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            itemButton4.Show();
+
+            itemButton1.Focused += Button_Focused;
+            itemButton1.Unfocused += Button_Unfocused;
+            itemButton2.Focused += Button_Focused;
+            itemButton2.Unfocused += Button_Unfocused;
+            itemButton3.Focused += Button_Focused;
+            itemButton3.Unfocused += Button_Unfocused;
+            itemButton4.Focused += Button_Focused;
+            itemButton4.Unfocused += Button_Unfocused;
+
+            itemButton1.SetNextFocusObject(itemButton4, FocusDirection.Left);
+            itemButton2.SetNextFocusObject(itemButton1, FocusDirection.Left);
+            itemButton3.SetNextFocusObject(itemButton2, FocusDirection.Left);
+            itemButton4.SetNextFocusObject(itemButton3, FocusDirection.Left);
+            itemButton1.SetNextFocusObject(itemButton2, FocusDirection.Right);
+            itemButton2.SetNextFocusObject(itemButton3, FocusDirection.Right);
+            itemButton3.SetNextFocusObject(itemButton4, FocusDirection.Right);
+            itemButton4.SetNextFocusObject(itemButton1, FocusDirection.Right);
+            itemButton1.SetNextFocusObject(buttonA, FocusDirection.Up);
+            itemButton2.SetNextFocusObject(buttonA, FocusDirection.Up);
+            itemButton3.SetNextFocusObject(buttonA, FocusDirection.Up);
+            itemButton4.SetNextFocusObject(buttonA, FocusDirection.Up);
+
+            buttonA.SetNextFocusObject(buttonB, FocusDirection.Left);
+            buttonB.SetNextFocusObject(buttonA, FocusDirection.Left);
+            buttonA.SetNextFocusObject(buttonB, FocusDirection.Right);
+            buttonB.SetNextFocusObject(buttonA, FocusDirection.Right);
+            buttonA.SetNextFocusObject(itemButton1, FocusDirection.Down);
+            buttonB.SetNextFocusObject(itemButton1, FocusDirection.Down);
+
+            buttonBox3.PackEnd(itemButton1);
+            buttonBox3.PackEnd(itemButton2);
+            buttonBox3.PackEnd(itemButton3);
+            buttonBox3.PackEnd(itemButton4);
+
+            leftButton.Clicked += (s, e) =>
+            {
+                if (currentButton != null)
+                {
+                    currentButton.FocusNext(FocusDirection.Left);
+                }
+            };
+            rightButton.Clicked += (s, e) =>
+            {
+                if (currentButton != null)
+                {
+                    currentButton.FocusNext(FocusDirection.Right);
+                }
+            };
+            upButton.Clicked += (s, e) =>
+            {
+                if (currentButton != null)
+                {
+                    currentButton.FocusNext(FocusDirection.Up);
+                }
+            };
+            downButton.Clicked += (s, e) =>
+            {
+                if (currentButton != null)
+                {
+                    currentButton.FocusNext(FocusDirection.Down);
+                }
+            };
+
+            lbInfo = new Label(window) {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+
+            box.PackEnd(lbInfo);
+            box.PackEnd(buttonBox1);
+            box.PackEnd(buttonBox2);
+            box.PackEnd(buttonBox3);
+        }
+
+        void Button_Focused(object sender, EventArgs e)
+        {
+            var btn = sender as Button;
+            if (btn!=null)
+            {
+                btn.BackgroundColor = Color.Red;
+                currentButton = btn;
+                lbInfo.Text = "Focused Button : " + btn.Text;
+            }
+        }
+
+        void Button_Unfocused(object sender, EventArgs e)
+        {
+            var btn = sender as Button;
+            if (btn != null)
+            {
+                btn.BackgroundColor = Color.Default;
+                currentButton = btn;
+                lbInfo.Text = "";
+            }
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenGridTest1.cs b/test/ElmSharp.Test/TC/GenGridTest1.cs
new file mode 100644 (file)
index 0000000..da4752e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class GenGridTest1 : TestCaseBase
+    {
+        public override string TestName => "GenGridTest1";
+        public override string TestDescription => "To test basic operation of GenGrid";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenGrid grid = new GenGrid(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ItemAlignmentX = -1,
+                ItemAlignmentY = -1,
+                ItemWidth = window.ScreenSize.Width / 3,
+                ItemHeight = window.ScreenSize.Width / 3,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    Console.WriteLine("{0} part create requested", part);
+                    if (part == "elm.swallow.icon")
+                    {
+                        var colorbox = new Rectangle(window)
+                        {
+                            Color = item
+                        };
+                        return colorbox;
+                    }
+                    return null;
+                }
+            };
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                var griditem = grid.Append(defaultClass, color);
+                griditem.SetTooltipText("AAAAAA");
+                //griditem.TooltipStyle = "transparent";
+
+                griditem.TooltipContentDelegate = () => { return new Button(window); };
+
+            }
+
+            grid.Show();
+            conformant.SetContent(grid);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/GenGridTest2.cs b/test/ElmSharp.Test/TC/GenGridTest2.cs
new file mode 100644 (file)
index 0000000..c8de4b1
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class GenGridTest2 : TestCaseBase
+    {
+        public override string TestName => "GenGridTest2";
+        public override string TestDescription => "To test basic operation of GenGrid";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenGrid grid = new GenGrid(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ItemAlignmentX = -1,
+                ItemAlignmentY = -1,
+                ItemWidth = window.ScreenSize.Width / 3,
+                ItemHeight = window.ScreenSize.Width / 3,
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    if (part == "elm.swallow.icon")
+                    {
+                        var colorbox = new Rectangle(window)
+                        {
+                            Color = item
+                        };
+                        return colorbox;
+                    }
+                    return null;
+                }
+
+            };
+
+            GenGridItem firstitem = null;
+            GenGridItem lastitem = null;
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                var item = grid.Append(defaultClass, color);
+                if (i == 0)
+                    firstitem = item;
+                if (i == 101)
+                    lastitem = item;
+            }
+            grid.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            box.PackEnd(grid);
+
+            Button first = new Button(window)
+            {
+                Text = "First",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button last = new Button(window)
+            {
+                Text = "Last",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            first.Clicked += (s, e) =>
+            {
+                grid.ScrollTo(firstitem, ScrollToPosition.In, true);
+            };
+            last.Clicked += (s, e) =>
+            {
+                grid.ScrollTo(lastitem, ScrollToPosition.In, true);
+            };
+            first.Show();
+            last.Show();
+
+            box.PackEnd(first);
+            box.PackEnd(last);
+            grid.ItemActivated += Grid_ItemActivated;
+            grid.ItemSelected += Grid_ItemSelected;
+            grid.ItemUnselected += Grid_ItemUnselected;
+            grid.ItemRealized += Grid_ItemRealized;
+            grid.ItemUnrealized += Grid_ItemUnrealized;
+            grid.ItemPressed += Grid_ItemPressed;
+            grid.ItemReleased += Grid_ItemReleased;
+            grid.ItemLongPressed += Grid_ItemLongPressed;
+            grid.ItemDoubleClicked += Grid_ItemDoubleClicked;
+        }
+
+        private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemReleased(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemRealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemSelected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B);
+        }
+
+        private void Grid_ItemActivated(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Console.WriteLine("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest1.cs b/test/ElmSharp.Test/TC/GenListTest1.cs
new file mode 100644 (file)
index 0000000..86a2c87
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class GenListTest1 : TestCaseBase
+    {
+        public override string TestName => "GenListTest1";
+        public override string TestDescription => "To test basic operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            conformant.SetContent(list);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest10.cs b/test/ElmSharp.Test/TC/GenListTest10.cs
new file mode 100644 (file)
index 0000000..ba47741
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class GenListTest10 : TestCaseBase
+    {
+        public override string TestName => "GenListTest10";
+        public override string TestDescription => "To test InsertBefore operation of GenList with full style";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        Text = obj.ToString(),
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    return btn;
+                }
+            };
+
+            GenItemClass headerClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        Text = obj.ToString(),
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    btn.Show();
+
+                    var label = new Label(window)
+                    {
+                        Text = "GenItem with full style"
+                    };
+                    label.Show();
+
+                    Box hBox = new Box(window)
+                    {
+                        AlignmentX = -1,
+                        AlignmentY = -1,
+                        WeightX = 1,
+                        WeightY = 1,
+                    };
+                    hBox.Show();
+                    hBox.PackEnd(btn);
+                    hBox.PackEnd(label);
+                    return hBox;
+                }
+
+            };
+
+            List<GenListItem> itemList = new List<GenListItem>();
+            GenListItem firstItem = null;
+
+            for (int i = 0; i < 5; i++)
+            {
+                GenListItem now = list.Append(defaultClass, string.Format("{0} Item", i));
+                itemList.Add(now);
+
+                if (firstItem == null)
+                {
+                    firstItem = now;
+                }
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            box.PackEnd(list);
+
+            Button first = new Button(window)
+            {
+                Text = "First",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button last = new Button(window)
+            {
+                Text = "last",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            first.Clicked += (s, e) =>
+            {
+                firstItem = list.InsertBefore(headerClass, "Header", firstItem);
+            };
+            last.Clicked += (s, e) =>
+            {
+                list.Append(headerClass, "Footer");
+            };
+
+            first.Show();
+            last.Show();
+            box.PackEnd(first);
+            box.PackEnd(last);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest2.cs b/test/ElmSharp.Test/TC/GenListTest2.cs
new file mode 100644 (file)
index 0000000..a22311a
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class GenListTest2 : TestCaseBase
+    {
+        public override string TestName => "GenListTest2";
+        public override string TestDescription => "To test ScrollTo operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] items = new GenListItem[100];
+            int i = 0;
+            for (i = 0; i < 100; i++)
+            {
+                items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+
+            GenListItem scroll = items[0];
+
+            box.PackEnd(list);
+            Button first = new Button(window)
+            {
+                Text = "First",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button last = new Button(window)
+            {
+                Text = "last",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button Add = new Button(window)
+            {
+                Text = "Add",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Add.Clicked += (s, e) =>
+            {
+                scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll);
+                list.ScrollTo(scroll, ScrollToPosition.In, false);
+            };
+            first.Clicked += (s, e) =>
+            {
+                list.ScrollTo(scroll, ScrollToPosition.In, true);
+            };
+            last.Clicked += (s, e) =>
+            {
+                list.ScrollTo(items[99], ScrollToPosition.In, true);
+            };
+            first.Show();
+            last.Show();
+            Add.Show();
+            box.PackEnd(first);
+            box.PackEnd(last);
+            box.PackEnd(Add);
+
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest3.cs b/test/ElmSharp.Test/TC/GenListTest3.cs
new file mode 100644 (file)
index 0000000..f26e92d
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class GenListTest3 : TestCaseBase
+    {
+        public override string TestName => "GenListTest3";
+        public override string TestDescription => "To test group operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass groupClass = new GenItemClass("group_index")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] groups = new GenListItem[10];
+
+            for (int i = 0; i< 10; i++)
+            {
+                groups[i] = list.Append(groupClass, string.Format("{0}", i) , GenListItemType.Group);
+            }
+            
+            
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} - {1}", (string)obj, part);
+                    return null;
+                }
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window) {
+                        Text = "Button in List",
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    return btn;
+                }
+            };
+
+            for (int j = 0; j < 10; j++)
+            {
+                for (int i = 0; i < 20; i++)
+                {
+                    list.Append( j == 0 ? fullyCustomizeClass : defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+                }
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            conformant.SetContent(list);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest4.cs b/test/ElmSharp.Test/TC/GenListTest4.cs
new file mode 100644 (file)
index 0000000..53bea96
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class GenListTest4 : TestCaseBase
+    {
+        public override string TestName => "GenListTest4";
+        public override string TestDescription => "To test Append/Prepend/InsertBefore operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] items = new GenListItem[100];
+            for (int i = 0; i < 100; i++)
+            {
+                if (i < 30)
+                {
+                    items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+                }
+                else if (i < 60)
+                {
+                    items[i] = list.Prepend(defaultClass, string.Format("{0} Item", i));
+                }else
+                {
+                    items[i] = list.InsertBefore(defaultClass, string.Format("{0} Item", i), items[50]);
+                }
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            conformant.SetContent(list);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest5.cs b/test/ElmSharp.Test/TC/GenListTest5.cs
new file mode 100644 (file)
index 0000000..b684048
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class GenListTest5 : TestCaseBase
+    {
+        public override string TestName => "GenListTest5";
+        public override string TestDescription => "To test event operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemUnselected += List_ItemUnselected;
+            list.ItemPressed += List_ItemPressed;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemReleased += List_ItemReleased;
+            list.ItemUnrealized += List_ItemUnrealized;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+            conformant.SetContent(list);
+        }
+
+        private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data));
+        }
+
+        private void List_ItemLongPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemReleased(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was released", (string)(e.Item.Data));
+        }
+
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data));
+        }
+
+        private void List_ItemPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnselected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data));
+        }
+
+        private void List_ItemActivated(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data));
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest6.cs b/test/ElmSharp.Test/TC/GenListTest6.cs
new file mode 100644 (file)
index 0000000..9a1739c
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class GenListTest6 : TestCaseBase
+    {
+        public override string TestName => "GenListTest6";
+        public override string TestDescription => "To test deletion of GenListItem";
+        GenListItem selected = null;
+
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                },
+                DeleteHandler = new GenItemClass.DeleteDelegate((obj) =>
+                {
+                    Console.WriteLine("DeleteHandler was called with... {0}", (string)obj);
+                }),
+            };
+            GenListItem[] items = new GenListItem[100];
+            for (int i = 0; i < 100; i++)
+            {
+                items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemUnselected += List_ItemUnselected;
+            list.ItemPressed += List_ItemPressed;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemReleased += List_ItemReleased;
+            list.ItemUnrealized += List_ItemUnrealized;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+            box.PackEnd(list);
+            Button first = new Button(window)
+            {
+                Text = "Delete",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            first.Clicked += (s, e) =>
+            {
+                selected?.Delete();
+            };
+            first.Show();
+            box.PackEnd(first);
+
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            selected = e.Item;
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+        private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data));
+        }
+
+        private void List_ItemLongPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("!!!! Item was Unrealized!!!");
+            Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemReleased(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was released", (string)(e.Item.Data));
+        }
+
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data));
+        }
+
+        private void List_ItemPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnselected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data));
+        }
+
+        private void List_ItemActivated(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest7.cs b/test/ElmSharp.Test/TC/GenListTest7.cs
new file mode 100644 (file)
index 0000000..114b6e1
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class GenListTest7 : TestCaseBase
+    {
+        public override string TestName => "GenListTest7";
+        public override string TestDescription => "To test basic operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button button = new Button(window)
+            {
+                Text = "Remove",
+                AlignmentX = -1,
+                AlignmentY = -1,
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            GenListItem[] itemArr = new GenListItem[9];
+            for (int i = 0; i < 9; i++)
+            {
+                itemArr[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+
+            int idx = 0;
+            button.Clicked += (s, e) =>
+            {
+                if (idx < 9) {
+                    Console.WriteLine("GenListItem deleted");
+                    itemArr[idx++].Delete();
+                }
+            };
+            button.Show();
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemUnrealized += List_ItemUnrealized;
+
+            box.PackEnd(list);
+            box.PackEnd(button);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was realized", (string)(e.Item.Data));
+        }
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unrealized", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest8.cs b/test/ElmSharp.Test/TC/GenListTest8.cs
new file mode 100644 (file)
index 0000000..6316235
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class GenListTest8 : TestCaseBase
+    {
+
+        Dictionary<EvasObject, Button> _cacheMap = new Dictionary<EvasObject, Button>();
+        public override string TestName => "GenListTest8";
+        public override string TestDescription => "To test group operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            bg.Show();
+            bg.Lower();
+
+            window.AddResizeObject(bg);
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Check check = new Check(window);
+            check.Show();
+            check.IsChecked = true;
+            check.Text = "Reuse?";
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        AlignmentX = -1,
+                        WeightX = 1,
+                        Text = (string)obj
+                    };
+                    return btn;
+                },
+                ReusableContentHandler = (object data, string part, EvasObject old) =>
+                {
+                    Console.WriteLine("{0} part reuse requested", part);
+                    if (!check.IsChecked)
+                    {
+                        return null;
+                    }
+                    var btn = old as Button;
+                    btn.Text = (string)data;
+                    return old;
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(fullyCustomizeClass, string.Format("{0} Item", i), GenListItemType.Normal);
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            box.Show();
+            box.PackEnd(check);
+            box.PackEnd(list);
+            conformant.SetContent(box);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GenListTest9.cs b/test/ElmSharp.Test/TC/GenListTest9.cs
new file mode 100644 (file)
index 0000000..39a0325
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class GenListTest9 : TestCaseBase
+    {
+
+        public class ItemContext
+        {
+            public object Data;
+            public GenListItem Item;
+            public EvasObject Realized;
+        }
+
+        Dictionary<EvasObject, Button> _cacheMap = new Dictionary<EvasObject, Button>();
+
+        Dictionary<ItemObject, EvasObject> _realizedMap = new Dictionary<ItemObject, EvasObject>();
+        public override string TestName => "GenListTest9";
+        public override string TestDescription => "To test FieldUpdate operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            bg.Show();
+            bg.Lower();
+
+            window.AddResizeObject(bg);
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        AlignmentX = -1,
+                        WeightX = 1,
+                        Text = (string)(obj as ItemContext).Data
+                    };
+                    btn.MinimumHeight = 100;
+                    (obj as ItemContext).Realized = btn;
+                    (obj as ItemContext).Item?.UpdateField("elm.swallow.content", GenListItemFieldType.None);
+                    return btn;
+                },
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                var context = new ItemContext();
+                context.Data = string.Format("{0} Item", i);
+                context.Item = list.Append(fullyCustomizeClass, context, GenListItemType.Normal);
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            box.Show();
+            box.PackEnd(list);
+            conformant.SetContent(box);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            var itemContext = e.Item.Data as ItemContext;
+            Console.WriteLine("{0} Item was selected", (string)(itemContext.Data));
+            itemContext.Realized.MinimumHeight += 20;
+            e.Item.UpdateField("elm.swallow.content", GenListItemFieldType.None);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/GestureLayerTest1.cs b/test/ElmSharp.Test/TC/GestureLayerTest1.cs
new file mode 100644 (file)
index 0000000..b59cbcc
--- /dev/null
@@ -0,0 +1,86 @@
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class GestureLayerTest1 : TestCaseBase
+    {
+        public override string TestName => "GestureLayerTest1";
+        public override string TestDescription => "Demonstrate GestureLayer features: Tap, DoubleTap, Rotate, Zoom detection.";
+
+        private GestureLayer _glayer;
+        private Label _log;
+        private List<string> _logEntries;
+        private Background _background;
+        private Rectangle _box1;
+
+        public override void Run(Window window)
+        {
+            _background = new Background(window);
+            var windowSize = window.ScreenSize;
+            _background.Color = Color.White;
+            _background.Resize(windowSize.Width, windowSize.Height);
+            _background.Show();
+
+            _box1 = new Rectangle(window)
+                {
+                    Color = Color.Yellow
+                };
+            _box1.Resize(400, 600);
+            _box1.Move(160, 160);
+            _box1.Show();
+
+            _log = new Label(window);
+            _log.Resize(700, 1280 - 780);
+            _log.Move(10, 770);
+            _log.Show();
+            _logEntries = new List<string>();
+            Log("Double tap to register additional gestures. Tripple tap to unregister them.");
+
+            _glayer = new GestureLayer(_box1);
+            _glayer.Attach(_box1);
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => {
+                Log("Tap {0},{1}", info.X, info.Y);
+            });
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.DoubleTap, GestureLayer.GestureState.End, (info) => {
+                Log("DoubleTap {0},{1} {2}", info.X, info.Y, info.FingersCount);
+                _glayer.SetLineCallback(GestureLayer.GestureState.End, (line) => {
+                    Log("Line {0},{1}-{2},{3}, M:{4},{5}", line.X1, line.Y1, line.X2, line.Y2, line.HorizontalMomentum, line.VerticalMomentum);
+                });
+                _glayer.SetFlickCallback(GestureLayer.GestureState.End, (flick) => {
+                    Log("Flick {0},{1}-{2},{3}, M:{4},{5}", flick.X1, flick.Y1, flick.X2, flick.Y2, flick.HorizontalMomentum, flick.VerticalMomentum);
+                });
+                _glayer.RotateStep = 3;
+                _glayer.SetRotateCallback(GestureLayer.GestureState.Move, (rotate) => {
+                    Log("Rotation {0},{1} a:{2:F3} ba:{3:F3}", rotate.X, rotate.Y, rotate.Angle, rotate.BaseAngle);
+                });
+                _glayer.SetZoomCallback(GestureLayer.GestureState.End, (zoom) => {
+                    Log("Zoom {0},{1} r:{2} z:{3:F3}", zoom.X, zoom.Y, zoom.Radius, zoom.Zoom);
+                });
+                Log("Line, Flick, Rotate, and Zoom callbacks enabled.");
+            });
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.TripleTap, GestureLayer.GestureState.End, (info) => {
+                Log("TrippleTap {0},{1} {2}", info.X, info.Y, info.FingersCount);
+                _glayer.SetLineCallback(GestureLayer.GestureState.End, null);
+                _glayer.SetFlickCallback(GestureLayer.GestureState.End, null);
+                _glayer.SetRotateCallback(GestureLayer.GestureState.Move, null);
+                _glayer.SetZoomCallback(GestureLayer.GestureState.End, null);
+                Log("Cleared Line, Flick, Rotate, and Zoom callbacks.");
+            });
+            // Momentum is not used, it seems that it conflicts with Rotate and Zoom
+        }
+
+        private void Log(string format, params object[] args)
+        {
+            var entry = string.Format(format, args);
+            if (_logEntries.Count > 15)
+                _logEntries.RemoveRange(0, _logEntries.Count - 15);
+            _logEntries.Add(entry);
+            _log.Text = string.Join("<br>", _logEntries);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/HoverselTest1.cs b/test/ElmSharp.Test/TC/HoverselTest1.cs
new file mode 100644 (file)
index 0000000..122d98b
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class HoverselTest1 : TestCaseBase
+    {
+        public override string TestName => "HoverselTest1";
+        public override string TestDescription => "To test basic operation of Hoversel";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Hoversel hoversel = new Hoversel(window)
+            {
+                IsHorizontal = false,
+                HoverParent = window,
+                Text = "Hoversel"
+            };
+            hoversel.ItemSelected += (s, e) =>
+            {
+                Console.WriteLine("ItemSelected : " + e.Item.Label);
+            };
+            hoversel.Dismissed += (s, e) =>
+            {
+                Console.WriteLine("Hoversel is dismissed");
+            };
+            hoversel.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Hoversel is Clicked");
+            };
+            hoversel.Expanded += (s, e) =>
+            {
+                Console.WriteLine("Hoversel is Expanded");
+            };
+
+            HoverselItem item1 = hoversel.AddItem("item1");
+            HoverselItem item2 = hoversel.AddItem("item2");
+            HoverselItem item3 = hoversel.AddItem("item3");
+
+            EventHandler handler = (s, e) =>
+            {
+                var item = s as HoverselItem;
+                Console.WriteLine($"{item?.Label} is selected");
+            };
+            item1.ItemSelected += handler;
+            item2.ItemSelected += handler;
+            item3.ItemSelected += handler;
+
+            hoversel.Resize(200, 100);
+            hoversel.Move(100, 100);
+            hoversel.Show();
+
+            Button beginButton = new Button(window)
+            {
+                Text = "Begin"
+            };
+            beginButton.Clicked += (s, e) =>
+            {
+                hoversel.HoverBegin();
+            };
+            beginButton.Resize(200, 100);
+            beginButton.Move(100, 500);
+            beginButton.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/IconTest1.cs b/test/ElmSharp.Test/TC/IconTest1.cs
new file mode 100644 (file)
index 0000000..137bc00
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class IconTest1 : TestCaseBase
+    {
+        public override string TestName => "IconTest1";
+        public override string TestDescription => "To test basic operation of Icon";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window);
+            scroller.Show();
+            conformant.SetContent(scroller);
+            Box box = new Box(window);
+            box.Show();
+            scroller.SetContent(box);
+
+            List<string> iconList = new List<string>{ "home", "close", "apps", "arrow_up", "arrow_down", "arrow_left", "arrow_right", "chat", "clock", "delete", "edit", "refresh", "folder", "file",
+                "menu/home", "menu/close", "menu/apps", "menu/arrow_up", "menu/arrow_down", "menu/arrow_left", "menu/arrow_right", "menu/chat", "menu/clock", "menu/delete", "menu/edit", "menu/refresh", "menu/folder",
+                "menu/file", "media_player/forward", "media_player/info", "media_player/next", "media_player/pause", "media_player/play", "media_player/prev", "media_player/rewind", "media_player/stop"};
+
+            foreach (var iconName in iconList)
+            {
+                Label label = new Label(window)
+                {
+                    Text = iconName,
+                };
+                Icon icon = new Icon(window)
+                {
+                    IconLookupOrder = IconLookupOrder.ThemeFirst,
+                    StandardIconName = iconName,
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    MinimumHeight = 100,
+                    MinimumWidth = 100,
+                };
+                icon.Show();
+                label.Show();
+                box.PackEnd(icon);
+                box.PackEnd(label);
+            }
+
+            
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ImageTest1.cs b/test/ElmSharp.Test/TC/ImageTest1.cs
new file mode 100644 (file)
index 0000000..0a6793d
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class ImageTest1 : TestCaseBase
+    {
+        public override string TestName => "ImageTest1";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Box buttonBox1 = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox1.Show();
+
+            Box buttonBox2 = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox2.Show();
+
+            Button btnFile1 = new Button(window)
+            {
+                Text = "File1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile1.Show();
+
+            Button btnFile2 = new Button(window)
+            {
+                Text = "File2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile2.Show();
+
+            Button btnUri1 = new Button(window)
+            {
+                Text = "Uri",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnUri1.Show();
+
+            Button btnStream1 = new Button(window)
+            {
+                Text = "Strm",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnStream1.Show();
+
+            buttonBox1.PackEnd(btnFile1);
+            buttonBox1.PackEnd(btnFile2);
+            buttonBox1.PackEnd(btnUri1);
+            buttonBox1.PackEnd(btnStream1);
+
+
+            Button btnFileAsync1 = new Button(window)
+            {
+                Text = "FileA1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFileAsync1.Show();
+
+            Button btnFileAsync2 = new Button(window)
+            {
+                Text = "FileA2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFileAsync2.Show();
+
+            Button btnUriAsync1 = new Button(window)
+            {
+                Text = "UriA",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnUriAsync1.Show();
+
+            Button btnStreamAsync1 = new Button(window)
+            {
+                Text = "StrmA",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnStreamAsync1.Show();
+
+            buttonBox2.PackEnd(btnFileAsync1);
+            buttonBox2.PackEnd(btnFileAsync2);
+            buttonBox2.PackEnd(btnUriAsync1);
+            buttonBox2.PackEnd(btnStreamAsync1);
+
+
+            lbInfo = new Label(window)
+            {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+
+            image = new Image(window)
+            {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btnFile1.Clicked += (s, e) => LoadFile("TED/large/a.jpg");
+            btnFile2.Clicked += (s, e) => LoadFile("TED/large/b.jpg");
+            btnUri1.Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btnStream1.Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open));
+
+            btnFileAsync1.Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg");
+            btnFileAsync2.Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg");
+            btnUriAsync1.Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btnStreamAsync1.Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open));
+            box.PackEnd(buttonBox1);
+            box.PackEnd(buttonBox2);
+            box.PackEnd(lbInfo);
+            box.PackEnd(image);
+        }
+
+        void LoadFile(string file)
+        {
+            bool ret = image.Load(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadUri(string uri)
+        {
+            bool ret = image.Load(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadStream(Stream stream)
+        {
+            bool ret = image.Load(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadFileAsync(string file)
+        {
+            var ret = await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadUriAsync(string uri)
+        {
+            var ret = await image.LoadAsync(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadStreamAsync(Stream stream)
+        {
+            var ret = await image.LoadAsync(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void UpdateLabelText(Label lable, string text)
+        {
+            lable.Text = "<span color=#ffffff font_size=20>" + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ImageTest2.cs b/test/ElmSharp.Test/TC/ImageTest2.cs
new file mode 100644 (file)
index 0000000..b82f357
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test
+{
+    public class ImageTest2 : TestCaseBase
+    {
+        public override string TestName => "ImageTest2";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Box buttonBox1 = new Box(window) {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox1.Show();
+
+            Button btnFile1 = new Button(window) {
+                Text = "Blue",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile1.Show();
+
+            Button btnFile2 = new Button(window) {
+                Text = "Default",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile2.Show();
+
+            Button btnFile3 = new Button(window) {
+                Text = "Aspect",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile3.Show();
+
+            Button btnFile4 = new Button(window) {
+                Text = "Rotate",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile4.Show();
+
+            buttonBox1.PackEnd(btnFile1);
+            buttonBox1.PackEnd(btnFile2);
+            buttonBox1.PackEnd(btnFile3);
+            buttonBox1.PackEnd(btnFile4);
+
+            lbInfo = new Label(window) {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+
+            image = new Image(window) {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btnFile1.Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btnFile2.Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btnFile3.Clicked += (s, e) => { image.IsFixedAspect = image.IsFixedAspect == true ? false : true; };
+            btnFile4.Clicked += (s, e) => { image.Orientation = image.Orientation == ImageOrientation.None ? ImageOrientation.Rotate270 : ImageOrientation.None; };
+
+            box.PackEnd(buttonBox1);
+            box.PackEnd(lbInfo);
+            box.PackEnd(image);
+        }
+
+        void UpdateLabelText(string text)
+        {
+            lbInfo.Text = "<span color=#ffffff font_size=20> BackgroundColor => " + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ImageTest3.cs b/test/ElmSharp.Test/TC/ImageTest3.cs
new file mode 100644 (file)
index 0000000..db3617b
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test
+{
+    public class ImageTest3 : TestCaseBase
+    {
+        public override string TestName => "ImageTest3";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Box buttonBox1 = new Box(window) {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox1.Show();
+
+            Box buttonBox2 = new Box(window) {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox2.Show();
+
+            Button btnFile1 = new Button(window) {
+                Text = "Blue (BG)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile1.Show();
+
+            Button btnFile2 = new Button(window) {
+                Text = "Default (BG)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile2.Show();
+
+            Button btnFile3 = new Button(window) {
+                Text = "Blue (FG)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile3.Show();
+
+            Button btnFile4 = new Button(window) {
+                Text = "Default (FG)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile4.Show();
+
+            buttonBox1.PackEnd(btnFile1);
+            buttonBox1.PackEnd(btnFile2);
+            buttonBox2.PackEnd(btnFile3);
+            buttonBox2.PackEnd(btnFile4);
+
+            lbInfo = new Label(window) {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+
+            image = new Image(window) {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "btn_delete.png"));
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btnFile1.Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btnFile2.Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btnFile3.Clicked += (s, e) => { image.Color = Color.Blue; UpdateLabelText(image.Color.ToString(), false); };
+            btnFile4.Clicked += (s, e) => { image.Color = Color.Default; UpdateLabelText(image.Color.ToString(), false); };
+
+            box.PackEnd(buttonBox1);
+            box.PackEnd(buttonBox2);
+            box.PackEnd(lbInfo);
+            box.PackEnd(image);
+        }
+
+        void UpdateLabelText(string text, bool isBackground = true)
+        {
+            if(isBackground)
+                lbInfo.Text = "<span color=#ffffff font_size=20> Background Color => " + text + "</span>";
+            else
+                lbInfo.Text = "<span color=#ffffff font_size=20> Foreground Color => " + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ImageTest4.cs b/test/ElmSharp.Test/TC/ImageTest4.cs
new file mode 100644 (file)
index 0000000..6c54c35
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Diagnostics;
+using System.IO;
+
+namespace ElmSharp.Test
+{
+    public class ImageTest4 : TestCaseBase
+    {
+        public override string TestName => "ImageTest4";
+        public override string TestDescription => "To test border operation of Image";
+
+        Image image, image2;
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Button btnBorder = new Button(window)
+            {
+                Text = "Border Set : off",
+            };
+            btnBorder.Move(10, 10);
+            btnBorder.Resize(300, 100);
+            btnBorder.Show();
+
+            Button btnBorderCenterFillMode = new Button(window)
+            {
+                Text = "BoderCenterFillMode",
+            };
+            btnBorderCenterFillMode.Move(310, 10);
+            btnBorderCenterFillMode.Resize(300, 100);
+            btnBorderCenterFillMode.Show();
+
+            image2 = new Image(window);
+            image2.Load(Path.Combine(TestRunner.ResourceDir, "TED/large/a.jpg"));
+            image2.MinimumWidth = 300; 
+            image2.MinimumHeight = 300;
+            image2.Move(50, 500);
+            image2.Resize(600, 500);
+            image2.Show();
+
+            image = new Image(window);
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.MinimumWidth = image.ObjectSize.Width;
+            image.MinimumHeight = image.ObjectSize.Height;
+            image.Move(100, 600);
+            image.Resize(image.ObjectSize.Width, image.ObjectSize.Height);
+            image.Show();
+
+
+            btnBorder.Clicked += (s, e) =>
+            {
+                int nX = image.ObjectSize.Width / 6;
+                int nY = image.ObjectSize.Height / 6;
+                image.SetBorder(nX, nX, nY, nY);
+                btnBorder.Text = "Border Set : on";
+            };
+
+            btnBorderCenterFillMode.Clicked += (s, e) =>
+            {
+                image.BorderCenterFillMode = ((ImageBorderFillMode)Enum.ToObject(typeof(ImageBorderFillMode), ((int)image.BorderCenterFillMode + 1) % Enum.GetValues(typeof(ImageBorderFillMode)).Length));
+                btnBorderCenterFillMode.Text = image.BorderCenterFillMode.ToString();
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/IndexTest1.cs b/test/ElmSharp.Test/TC/IndexTest1.cs
new file mode 100644 (file)
index 0000000..767b7b0
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    class IndexTest1 : TestCaseBase
+    {
+        Dictionary<IndexItem, GenListItem> _indexTable = new Dictionary<IndexItem, GenListItem>();
+        public override string TestName => "IndexTest1";
+        public override string TestDescription => "To test group operation of Index";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            list.Show();
+            Index index = new Index(window)
+            {
+                IsHorizontal = false,
+                AlignmentY = -1,
+                WeightY = 1,
+                MinimumWidth = 100,
+                AutoHide = false,
+                Style = "fastscroll"
+            };
+            index.Show();
+
+            GenItemClass groupClass = new GenItemClass("group_index")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] groups = new GenListItem[10];
+
+            for (int i = 0; i < 10; i++)
+            {
+                groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group);
+                var indexitem = index.Append(string.Format("{0}", i));
+                indexitem.Selected += (s, e) =>
+                {
+                    Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text);
+                    list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true);
+                };
+                _indexTable[indexitem] = groups[i];
+            }
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            for (int j = 0; j < 10; j++)
+            {
+                for (int i = 0; i < 20; i++)
+                {
+                    list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+                }
+            }
+
+            list.ItemSelected += List_ItemSelected;
+            index.Update(0);
+            box.PackEnd(list);
+            box.PackEnd(index);
+            box.SetLayoutCallback(() =>
+            {
+                list.Geometry = box.Geometry;
+                index.Geometry = box.Geometry;
+            });
+            conformant.SetContent(box);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/IndexTest2.cs b/test/ElmSharp.Test/TC/IndexTest2.cs
new file mode 100644 (file)
index 0000000..9f9efc8
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class IndexTest2 : TestCaseBase
+    {
+        Dictionary<IndexItem, int> _indexTable = new Dictionary<IndexItem, int>();
+
+        public override string TestName => "IndexTest2";
+        public override string TestDescription => "To test basic operation of Index";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            Index index = new Index(window)
+            {
+                IsHorizontal = true,
+                Style = "pagecontrol",
+                AlignmentX = -1,
+                WeightX = 1,
+                MinimumHeight = 200,
+            };
+            index.Show();
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+                var item = index.Append(string.Format("{0}", i));
+                item.Selected += (s, e) =>
+                {
+                    scroller.ScrollTo(_indexTable[(IndexItem)s], 0, true);
+                };
+                _indexTable[item] = i;
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1 : 0, scroller.VerticalPageIndex, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+            };
+            prev.Show();
+            next.Show();
+            outterBox.PackEnd(prev);
+            outterBox.PackEnd(next);
+            outterBox.PackEnd(index);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/KeyEventTest1.cs b/test/ElmSharp.Test/TC/KeyEventTest1.cs
new file mode 100644 (file)
index 0000000..0f6efd7
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class KeyEventTest1 : TestCaseBase
+    {
+        public override string TestName => "KeyEventTest1";
+        public override string TestDescription => "To test basic operation of KeyEvent";
+
+        Box box;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            box = new Box(window);
+            box.BackgroundColor = Color.Orange;
+            conformant.SetContent(box);
+            box.Show();
+
+            Button button1 = new Button(window) {
+                Text = "Button 1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Button button2 = new Button(window) {
+                Text = "Button 2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = new Color(50,100,200,75)
+            };
+
+            Box innerBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            innerBox.Show();
+            Button button3 = new Button(window)
+            {
+                Text = "Button 3",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = new Color(50, 100, 200, 75)
+            };
+
+            box.PackEnd(button1);
+            box.PackEnd(button2);
+            box.PackEnd(innerBox);
+            innerBox.PackEnd(button3);
+
+
+            button1.Show();
+            button2.Show();
+            button3.Show();
+
+            box.KeyDown += (s, e) =>
+            {
+                System.Console.WriteLine("Key down {0} on box has onHold {1}", e.KeyName, e.Flags);
+            };
+            button1.KeyDown += (s, e) =>
+            {
+                System.Console.WriteLine("Key down {0} on button1 has onHold {1}", e.KeyName, e.Flags);
+                e.Flags = EvasEventFlag.OnHold;
+            };
+            button2.KeyDown += (s, e) =>
+            {
+                System.Console.WriteLine("Key down {0} on button2 has onHold {1}", e.KeyName, e.Flags);
+            };
+            button3.KeyDown += (s, e) =>
+            {
+                System.Console.WriteLine("Key down {0} on button3 has onHold {1}", e.KeyName, e.Flags);
+            };
+            innerBox.KeyDown += (s, e) =>
+            {
+                System.Console.WriteLine("Key down {0} on innerbox has onHold {1}", e.KeyName, e.Flags);
+                e.Flags = EvasEventFlag.OnHold;
+            };
+
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest1.cs b/test/ElmSharp.Test/TC/LabelTest1.cs
new file mode 100644 (file)
index 0000000..d09b8ff
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class LabelTest1 : TestCaseBase
+    {
+        public override string TestName => "LabelTest1";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window);
+            label1.Color = Color.Black;
+            label1.Text = "Label Test!!!";
+
+            label1.Show();
+            label1.Resize(200, 30);
+            label1.Move(0, 0);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest2.cs b/test/ElmSharp.Test/TC/LabelTest2.cs
new file mode 100644 (file)
index 0000000..25a2b56
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class LabelTest2 : TestCaseBase
+    {
+        public override string TestName => "LabelTest2";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window);
+            label1.Text = "[default valign=top] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'";
+            label1.Resize(650, 0);
+            var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label1.Show();
+            label1.Resize(size.Width, size.Height);
+            label1.Move(0, 0);
+
+            Label label2 = new Label(window);
+            label2.Move(0, size.Height + 10);
+            label2.Text = "[default valign=middle] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'";
+            label2.Resize(650, 0);
+            size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label2.Show();
+            label2.Resize(size.Width, size.Height);
+
+            Label label3 = new Label(window);
+            label3.Move(0, label2.Geometry.Y + size.Height + 10);
+            label3.Text = "[default valign=bottom] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'";
+            label3.Resize(650, 0);
+            size = label3.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label3.Show();
+            label3.Resize(size.Width, size.Height);
+
+            Label label4 = new Label(window);
+            label4.Move(0, label3.Geometry.Y + size.Height + 10);
+            label4.Text = "<span color=#000000>[No TextStyle]</span>" +
+                "<span color=#000000 valign=bottom>[bottom gyp]</span>, " +
+                "<span color=#000000 valign=top>[top gyp]</span>, " +
+                "<span color=#000000 valign=middle>[middle gyp]</span>";
+            label4.Resize(650, 0);
+            size = label4.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label4.Show();
+            label4.Resize(size.Width, size.Height);
+
+            Label label5 = new Label(window);
+            label5.Move(0, label4.Geometry.Y + size.Height + 10);
+            label5.Text = "<span valign=top color=#000000 font_size=50>[top gyp]</span>";
+            label5.Resize(650, 0);
+            size = label5.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label5.Show();
+            label5.Resize(size.Width, size.Height);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest3.cs b/test/ElmSharp.Test/TC/LabelTest3.cs
new file mode 100644 (file)
index 0000000..eaf5aeb
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class LabelTest3 : TestCaseBase
+    {
+        public override string TestName => "LabelTest3";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window);
+            scroller.Show();
+            conformant.SetContent(scroller);
+            Box box = new Box(window);
+            box.SetLayoutCallback(() => { });
+            box.Show();
+            scroller.SetContent(box);
+
+            Size size;
+
+            Label label1 = new Label(window);
+            box.PackEnd(label1);
+            Label label2 = new Label(window);
+            box.PackEnd(label2);
+
+
+            label1.Text = "Jo Ann Buckner";
+            label1.TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'";
+            label1.Show();
+            label1.Resize(100000, 0);
+            size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label1.Geometry = new Rect(55, 213, size.Width, size.Height);
+
+            label2.Text = "Customer Success Engineer";
+            label2.TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'";
+            label2.Show();
+
+            label2.Resize(100000, 0);
+            size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label2.Geometry = new Rect(55, 300, size.Width, size.Height);
+
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest4.cs b/test/ElmSharp.Test/TC/LabelTest4.cs
new file mode 100644 (file)
index 0000000..c7dab02
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class LabelTest4 : TestCaseBase
+    {
+        public override string TestName => "LabelTest4";
+        public override string TestDescription => "To test slide Animation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window)
+            {
+                Style = "slide_long",
+                SlideDuration = 3,
+                SlideMode = LabelSlideMode.Always,
+                Color = Color.Black,
+                Text = "Lab test12345678"
+            };
+
+            label1.Show();
+            label1.Resize(200, 30);
+            label1.Move(0, 0);
+            label1.PlaySlide();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest5.cs b/test/ElmSharp.Test/TC/LabelTest5.cs
new file mode 100644 (file)
index 0000000..46294e4
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class LabelTest5 : TestCaseBase
+    {
+        public override string TestName => "LabelTest5";
+        public override string TestDescription => "To test Slide Animation Speed of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            conformant.SetContent(box);
+            box.Show();
+
+            Label label1 = new Label(window)
+            {
+                Text = "Test Slide Animaiton",
+                Color = Color.Black,
+                Style = "slide_long",
+                SlideSpeed = 100,
+                SlideMode = LabelSlideMode.Always,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            label1.Show();
+            label1.PlaySlide();
+
+            Button btnCurrentSpeed = new Button(window)
+            {
+                Text = "Current Speed : 100",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            Button btnSpeedUp = new Button(window)
+            {
+                Text = "Speed + 10",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            btnSpeedUp.Clicked += (s, e) =>
+            {
+                label1.SlideSpeed += 10;
+                btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed);
+                label1.PlaySlide();
+            };
+            Button btnSpeedDown = new Button(window)
+            {
+                Text = "Speed - 10",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            btnSpeedDown.Clicked += (s, e) =>
+            {
+                label1.SlideSpeed -= 10;
+                btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed);
+                label1.PlaySlide();
+            };
+
+            box.PackEnd(label1);
+            box.PackEnd(btnCurrentSpeed);
+            box.PackEnd(btnSpeedUp);
+            box.PackEnd(btnSpeedDown);
+            btnCurrentSpeed.Show();
+            btnSpeedUp.Show();
+            btnSpeedDown.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelTest6.cs b/test/ElmSharp.Test/TC/LabelTest6.cs
new file mode 100644 (file)
index 0000000..31a2c10
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    public class LabelTest6 : TestCaseBase
+    {
+        public override string TestName => "LabelTest6";
+        public override string TestDescription => "To test Horizontal align of Label";
+
+        int count = 0;
+        public override void Run(Window window)
+        {
+
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Show();
+            conformant.SetContent(box);
+
+            box.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+
+            var label = new Label(window);
+            var label2 = new Label(window);
+            var button = new Button(window);
+
+            box.SetLayoutCallback(() =>
+            {
+                label.Geometry = new Rect(10, box.Geometry.Y, box.Geometry.Width - 20, 100);
+                label2.Geometry = new Rect(10, label.Geometry.Y + 120, box.Geometry.Width - 20, 100);
+                button.Geometry = new Rect(0, box.Geometry.Y + 300, box.Geometry.Width, 200);
+            });
+
+
+            label.BackgroundColor = Color.Aqua;
+            label.LineWrapType = WrapType.Word;
+            label.IsEllipsis = false;
+            label.TextStyle = "DEFAULT = 'align=left'";
+
+            label2.BackgroundColor = Color.Aqua;
+            label2.LineWrapType = WrapType.None;
+            label2.IsEllipsis = false;
+            label2.TextStyle = "DEFAULT = 'align=left'";
+
+            label.Show();
+            label2.Show();
+            box.PackEnd(label);
+            box.PackEnd(label2);
+
+            
+            button.SetAlignment(-1, -1);
+            button.SetWeight(1, 1);
+            button.Text = "Append";
+            button.Show();
+            box.PackEnd(button);
+
+
+            button.Clicked += (s, e) =>
+            {
+                string alpahbat = "ABCDEFGHIJKLMOPQRSTUVWXYZ";
+                label.Text += alpahbat[count % alpahbat.Length];
+                label.Text += alpahbat[count % alpahbat.Length];
+                label2.Text += alpahbat[count % alpahbat.Length];
+                label2.Text += alpahbat[count % alpahbat.Length];
+                count++;
+            };
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/LabelValignTest1.cs b/test/ElmSharp.Test/TC/LabelValignTest1.cs
new file mode 100644 (file)
index 0000000..5d72b73
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class LabelValignTest1 : TestCaseBase
+    {
+        public override string TestName => "LabelValignTest1";
+        public override string TestDescription => "To test Vertical align of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            Box labelBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                MinimumHeight = 400,
+                BackgroundColor = Color.Blue,
+            };
+            labelBox.Show();
+
+
+
+            Label label1 = new Label(window)
+            {
+                Text = "Align Test",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            label1.TextStyle = "DEFAULT = 'color=#000000FF font_size=100 align=center wrap=word'";
+            label1.Show();
+            labelBox.PackEnd(label1);
+
+            Button top = new Button(window)
+            {
+                Text = "Top",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            Button middle = new Button(window)
+            {
+                Text = "Middle",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            Button bottom = new Button(window)
+            {
+                Text = "bottom",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            top.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 0);
+            };
+
+            middle.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 0.5);
+            };
+
+            bottom.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 1.0);
+            };
+
+            top.Show();
+            labelBox.Show();
+            middle.Show();
+            bottom.Show();
+            box.PackEnd(labelBox);
+            box.PackEnd(top);
+            box.PackEnd(middle);
+            box.PackEnd(bottom);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ListTest1.cs b/test/ElmSharp.Test/TC/ListTest1.cs
new file mode 100644 (file)
index 0000000..b81e285
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ListTest1 : TestCaseBase
+    {
+        public override string TestName => "ListTest1";
+        public override string TestDescription => "To test basic operation of List";
+        private int _count = 0;
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            List list = new List(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            for (int i = 0; i < 5; i++)
+            {
+                list.Append(string.Format("{0} item", _count++));
+            }
+
+            list.ItemSelected += List_Selected;
+            list.ItemUnselected += List_Unselected;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.RenderPost += List_RenderPost;
+            list.Update();
+            list.Show();
+
+            box.PackEnd(list);
+            Button append = new Button(window)
+            {
+                Text = "Append",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button prepend = new Button(window)
+            {
+                Text = "Prepend",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            append.Clicked += (s, e) =>
+            {
+                list.Append(string.Format("{0} item", _count++));
+                list.Update();
+            };
+            prepend.Clicked += (s, e) =>
+            {
+                list.Prepend(string.Format("{0} item", _count++));
+                list.Update();
+            };
+            append.Show();
+            prepend.Show();
+            box.PackEnd(append);
+            box.PackEnd(prepend);
+        }
+
+        int count = 0;
+        private void List_RenderPost(object sender, EventArgs e)
+        {
+            Console.WriteLine("{0} List_RenderPost", count++);
+        }
+
+        private void List_ItemLongPressed(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was long pressed", e.Item.Text);
+        }
+
+        private void List_ItemDoubleClicked(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was Double clicked", e.Item.Text);
+        }
+
+        private void List_ItemActivated(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was Activated", e.Item.Text);
+        }
+
+        private void List_Unselected(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was unselected", e.Item.Text);
+        }
+
+        private void List_Selected(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was selected", e.Item.Text);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs b/test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs
new file mode 100644 (file)
index 0000000..2ed7932
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class MultiButtonEntryTest1 : TestCaseBase
+    {
+        public override string TestName => "MultiButtonEntryTest1";
+        public override string TestDescription => "To test basic operation of MultiButtonEntry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            MultiButtonEntry mbe = new MultiButtonEntry(window)
+            {
+                IsEditable = true,
+                IsExpanded = true,
+                Text = "To: "
+            };
+
+            var test = mbe.Append("test");
+            mbe.Prepend("prepend");
+            mbe.Append("append");
+            mbe.InsertBefore(test, "insertBefore");
+            mbe.InsertAfter(test, "insertAfter");
+
+            mbe.ItemSelected += (s, e) =>
+            {
+                Console.WriteLine("item selected: " + e.Item.Label);
+                if (e.Item.Next != null)
+                    Console.WriteLine("next item: " + e.Item.Next);
+                if (e.Item.Prev != null)
+                    Console.WriteLine("previous item: " + e.Item.Prev);
+            };
+
+            mbe.ItemClicked += (s, e) =>
+            {
+                Console.WriteLine("item clicked: " + e.Item.Label);
+            };
+
+            mbe.ItemLongPressed += (s, e) =>
+            {
+                Console.WriteLine("item longpressed: " + e.Item.Label);
+            };
+
+            mbe.ItemAdded += (s, e) =>
+            {
+                Console.WriteLine("item added: " + e.Item.Label);
+            };
+
+            mbe.ItemDeleted += (s, e) =>
+            {
+                Console.WriteLine("item deleted: " + e.Item.Label);
+            };
+
+            mbe.AppendFilter((label) =>
+            {
+                if (label.Contains("a"))
+                {
+                    Console.WriteLine("appended filter : Item has 'a', It won't be added until 'a' is removed.");
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            });
+
+            mbe.PrependFilter((label) =>
+            {
+                if (label.Contains("p"))
+                {
+                    Console.WriteLine("prepended filter : Item has 'p', It won't be added until 'p' is removed.");
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            });
+
+            Label label1 = new Label(window)
+            {
+                Text = "MultiButtonEntry Test",
+                Color = Color.Blue
+            };
+
+            label1.Resize(600, 100);
+            label1.Move(50, 50);
+            label1.Show();
+
+            mbe.Resize(600, 600);
+            mbe.Move(0, 100);
+            mbe.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs b/test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs
new file mode 100644 (file)
index 0000000..8639099
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class MultiButtonEntryTest2 : TestCaseBase
+    {
+        public override string TestName => "MultiButtonEntryTest2";
+        public override string TestDescription => "To test basic operation of MultiButtonEntry";
+
+        bool _setCallback = false;
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            MultiButtonEntry mbe = new MultiButtonEntry(window)
+            {
+                IsEditable = true,
+                IsExpanded = true,
+                Text = "To: "
+            };
+
+            mbe.Append("Append1");
+            mbe.Append("Append2");
+            mbe.Append("Append3");
+            mbe.Append("Append4");
+            mbe.Append("Append5");
+            mbe.Append("Append6");
+            mbe.Append("Append7");
+            mbe.Append("Append8");
+            mbe.Append("Append9");
+            mbe.Append("Append10");
+            mbe.Append("Append11");
+            mbe.Append("Append12");
+
+            Label label1 = new Label(window)
+            {
+                Text = "MultiButtonEntry Test",
+                Color = Color.Blue
+            };
+
+            var expandButton = new Button(window)
+            {
+                Text = "IsExpanded",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            var formatButton = new Button(window)
+            {
+                Text = "format",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            expandButton.Clicked += (sender, e) =>
+            {
+                mbe.IsExpanded = !mbe.IsExpanded;
+            };
+
+            formatButton.Clicked += (sender, e) =>
+            {
+                if (_setCallback)
+                {
+                    mbe.SetFormatCallback(null);
+                    _setCallback = false;
+                }
+                else
+                {
+                    mbe.SetFormatCallback((count) => { return "(" + count + ")"; });
+                    _setCallback = true;
+                }
+            };
+
+            label1.Resize(600, 100);
+            label1.Move(50, 50);
+            label1.Show();
+
+            mbe.Resize(600, 600);
+            mbe.Move(0, 100);
+            mbe.Show();
+
+            expandButton.Resize(200, 100);
+            expandButton.Move(50, 700);
+            expandButton.Show();
+
+            formatButton.Resize(200, 100);
+            formatButton.Move(300, 700);
+            formatButton.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/NaviframeTest1.cs b/test/ElmSharp.Test/TC/NaviframeTest1.cs
new file mode 100644 (file)
index 0000000..64118bc
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class NaviframeTest1 : TestCaseBase
+    {
+        public override string TestName => "NaviframeTest1";
+        public override string TestDescription => "Naviframe test";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("naviframe was popped : " + e.Content.GetType());
+            };
+
+            Rectangle rect1 = new Rectangle(window)
+            {
+                Color = Color.Red,
+                Geometry = new Rect(0, 0, 200, 200)
+            };
+
+            navi.Push(rect1, "First Page");
+
+            Rectangle rect2 = new Rectangle(window)
+            {
+                Color = Color.Blue,
+                Geometry = new Rect(0, 0, 200, 200)
+            };
+
+            navi.Push(rect2, "Second Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/NaviframeTest2.cs b/test/ElmSharp.Test/TC/NaviframeTest2.cs
new file mode 100644 (file)
index 0000000..064640b
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+
+namespace ElmSharp.Test
+{
+    public class NaviframeTest2 : TestCaseBase
+    {
+        public override string TestName => "NaviframeTest2";
+        public override string TestDescription => "Naviframe test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            navi.Push(CreatePage(window), "0 Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Box box = new Box(parent);
+            box.Show();
+
+            Label label = new Label(parent) {
+                Text = string.Format("{0} Page", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button push = new Button(parent) {
+                Text = "Push",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button pop = new Button(parent) {
+                Text = "pop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button insertBeforeTop = new Button(parent) {
+                Text = "insertBeforeTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button insertAfterTop = new Button(parent) {
+                Text = "insertAfterTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button removeTop = new Button(parent)
+            {
+                Text = "removeTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button barChange = new Button(parent)
+            {
+                Text = "TitleBarColor Change",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button barColorDefault = new Button(parent)
+            {
+                Text = "TitleBarColor - Default",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+            insertBeforeTop.Show();
+            insertAfterTop.Show();
+            removeTop.Show();
+            barChange.Show();
+            barColorDefault.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            insertBeforeTop.Clicked += (s, e) =>
+            {
+                _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+
+            insertAfterTop.Clicked += (s, e) =>
+            {
+                _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+            removeTop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer);
+                item.Delete();
+                Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer);
+            };
+
+            Random rand = new Random(DateTime.Now.Millisecond);
+            barChange.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next()));
+                }
+            };
+
+            barColorDefault.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default;
+                }
+            };
+
+            box.PackEnd(label);
+            box.PackEnd(push);
+            box.PackEnd(pop);
+            box.PackEnd(insertBeforeTop);
+            box.PackEnd(insertAfterTop);
+            box.PackEnd(removeTop);
+            box.PackEnd(barChange);
+            box.PackEnd(barColorDefault);
+
+            return box;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/NaviframeTest3.cs b/test/ElmSharp.Test/TC/NaviframeTest3.cs
new file mode 100644 (file)
index 0000000..6c35376
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+
+namespace ElmSharp.Test
+{
+    public class NaviframeTest3 : TestCaseBase
+    {
+        public override string TestName => "NaviframeTest3";
+        public override string TestDescription => "Naviframe test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            NaviItem item = navi.Push(CreatePage(window), "0 Page");
+            item.SetPartContent("title_left_btn", new Button(window) { Text = "LEFT" , Style = "naviframe/title_left"} );
+            item.SetPartContent("title_right_btn", new Button(window) { Text = "RIGHT", Style = "naviframe/title_right" });
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Box box = new Box(parent);
+            box.Show();
+
+            Label label = new Label(parent) {
+                Text = string.Format("{0} Page", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button push = new Button(parent) {
+                Text = "Push",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button pop = new Button(parent) {
+                Text = "pop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button insertBeforeTop = new Button(parent) {
+                Text = "insertBeforeTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button insertAfterTop = new Button(parent) {
+                Text = "insertAfterTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button removeTop = new Button(parent)
+            {
+                Text = "removeTop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button barChange = new Button(parent)
+            {
+                Text = "TitleBarColor Change",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            Button barColorDefault = new Button(parent)
+            {
+                Text = "TitleBarColor - Default",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+            insertBeforeTop.Show();
+            insertAfterTop.Show();
+            removeTop.Show();
+            barChange.Show();
+            barColorDefault.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            insertBeforeTop.Clicked += (s, e) =>
+            {
+                _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+
+            insertAfterTop.Clicked += (s, e) =>
+            {
+                _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+            removeTop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer);
+                item.Delete();
+                Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer);
+            };
+
+            Random rand = new Random(DateTime.Now.Millisecond);
+            barChange.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next()));
+                }
+            };
+
+            barColorDefault.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default;
+                }
+            };
+
+            box.PackEnd(label);
+            box.PackEnd(push);
+            box.PackEnd(pop);
+            box.PackEnd(insertBeforeTop);
+            box.PackEnd(insertAfterTop);
+            box.PackEnd(removeTop);
+            box.PackEnd(barChange);
+            box.PackEnd(barColorDefault);
+
+            return box;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/PanelTest1.cs b/test/ElmSharp.Test/TC/PanelTest1.cs
new file mode 100644 (file)
index 0000000..d88fcd9
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class PanelTest1 : TestCaseBase
+    {
+        public override string TestName => "PanelTest1";
+        public override string TestDescription => "To test basic operation of Panel";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Label label = new Label(window)
+            {
+                Text = "<span color=#ffffff font_size=50>Panel as NonScrollable</span>",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            label.Show();
+            box.PackEnd(label);
+
+            Panel panel = new Panel(window)
+            {
+                Direction = PanelDirection.Left,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            panel.SetScrollable(false);
+
+            Rectangle redbox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+            };
+            redbox.Show();
+            panel.SetContent(redbox);
+            panel.Show();
+            panel.IsOpen = true;
+            box.PackEnd(panel);
+
+            Button button1 = new Button(window)
+            {
+                Text = "Toggle open",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            Button button2 = new Button(window)
+            {
+                Text = "Toggle direction",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            box.PackEnd(button1);
+            box.PackEnd(button2);
+            button1.Show();
+            button2.Show();
+
+            button1.Clicked += (s, e) =>
+            {
+                panel.Toggle();
+            };
+            button2.Clicked += (s, e) =>
+            {
+                panel.Direction = (PanelDirection)((int)(panel.Direction+1) % 4);
+            };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
+        }
+        
+    }
+}
diff --git a/test/ElmSharp.Test/TC/PanelTest2.cs b/test/ElmSharp.Test/TC/PanelTest2.cs
new file mode 100644 (file)
index 0000000..2cb047b
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class PanelTest2 : TestCaseBase
+    {
+        public override string TestName => "PanelTest2";
+        public override string TestDescription => "To test basic operation of Panel";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Label label = new Label(window)
+            {
+                Text = "<span color=#ffffff font_size=50>Panel as Scrollable</span>",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            label.Show();
+            box.PackEnd(label);
+
+            Panel panel = new Panel(window)
+            {
+                Direction = PanelDirection.Left,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            panel.SetScrollable(true);
+            panel.SetScrollableArea(1.0);
+
+            Rectangle redbox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+            };
+            redbox.Show();
+            panel.SetContent(redbox);
+            panel.Show();
+            panel.IsOpen = true;
+            box.PackEnd(panel);
+
+            Button button1 = new Button(window)
+            {
+                Text = "Toggle open",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            Button button2 = new Button(window)
+            {
+                Text = "Toggle direction",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            box.PackEnd(button1);
+            box.PackEnd(button2);
+            button1.Show();
+            button2.Show();
+
+            button1.Clicked += (s, e) =>
+            {
+                panel.Toggle();
+            };
+            button2.Clicked += (s, e) =>
+            {
+                panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4);
+            };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/PanesTest1.cs b/test/ElmSharp.Test/TC/PanesTest1.cs
new file mode 100644 (file)
index 0000000..146169e
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class PanesTest1 : TestCaseBase
+    {
+        public override string TestName => "PanesTest1";
+        public override string TestDescription => "To test basic operation of Panes";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Rectangle redBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+            };
+            redBox.Show();
+            Rectangle blueBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Blue,
+            };
+            Rectangle greenBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Green,
+            };
+            Panes subPanes = new Panes(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Proportion = 0.3,
+                IsHorizontal = false
+            };
+            subPanes.Show();
+            subPanes.SetPartContent("left", blueBox);
+            subPanes.SetPartContent("right", greenBox);
+            Panes panes = new Panes(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Proportion = 0.1,
+                IsFixed = true,
+                IsHorizontal = true,
+            };
+            panes.SetPartContent("left", redBox);
+            panes.SetPartContent("right", subPanes);
+            panes.Show();
+            box.PackEnd(panes);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/PerformanceTest.cs b/test/ElmSharp.Test/TC/PerformanceTest.cs
new file mode 100644 (file)
index 0000000..b5bb77e
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class PerformanceTest : TestCaseBase
+    {
+        public override string TestName => "PerformanceTest";
+        public override string TestDescription => "To test Performance of GenList";
+
+        const int TestItemMax = 2000;
+        const double TimeSet = 5.0;
+
+        string[] arrLabel = {
+            "Time Warner Cable(Cable)",
+            "ComCast (Cable)",
+            "Dish (Satellite)",
+            "DirecTV (Satellite)",
+            "Tata Sky (Satellite)",
+            "Nextra Cable(Cable)",
+            "DD Plus (Cable)",
+            "Tikona Cable(Cable)",
+            "True Provider (Cable)",
+            "Vodafone (Satellite)",
+            "Sample Text"
+        };
+
+        GenList list;
+        Box box;
+        Box box2;
+        GenListItem ItemTarget = null;
+        double _enteringSpeed = 0;
+        int _frameCount = 0;
+        int _ecoreCount = 0;
+        double _frameSet = 0;
+        IntPtr _anim = IntPtr.Zero;
+        double FrameFPS = 0;
+        double AnimatorFPS = 0;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+
+            box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+
+            box2 = new Box(box);
+            //elm_box_padding_set(box2, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10)); ºÎºÐ ºüÁü.
+            box2.Show();
+            box.PackEnd(box2);
+
+            list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Style = "solid/default"
+            };
+            box.PackEnd(list);
+            navi.Push(box, "Performance");
+
+            InitializeListItem();
+
+            list.Changed += List_Changed;
+            list.ScrollAnimationStarted += List_ScrollAnimationStarted;
+            list.ScrollAnimationStopped += List_ScrollAnimationStopped;
+            list.Show();
+
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        private void InitializeListItem()
+        {
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return (string)obj;
+                }
+            };
+
+            for (int i = 0; i < TestItemMax; ++i)
+            {
+                if (i == 999)
+                    ItemTarget = list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray()));
+                else
+                    list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray()));
+            }
+        }
+
+        private void List_ScrollAnimationStopped(object sender, EventArgs e)
+        {
+            list.RenderPost -= List_RenderPostFrame;
+            list.ScrollAnimationStarted -= List_ScrollAnimationStarted;
+            list.ScrollAnimationStopped -= List_ScrollAnimationStopped;
+
+            EcoreAnimator.RemoveAnimator(_anim);
+            Elementary.BringInScrollFriction = _frameSet;
+
+            FrameFPS = _frameCount / TimeSet;
+            AnimatorFPS = _ecoreCount / TimeSet;
+
+            Button btn1 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            btn1.Text = string.Format("Entering Speed : {0:f1} msec", _enteringSpeed);
+            btn1.Show();
+            box2.PackEnd(btn1);
+            Button btn2 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            btn2.Text = string.Format("Animator FPS : {0:f1} fps", AnimatorFPS);
+            btn2.Show();
+            box2.PackEnd(btn2);
+            Button btn3 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            btn3.Text = string.Format("Evas FPS : {0:f1} fps", FrameFPS);
+            btn3.Show();
+            box2.PackEnd(btn3);
+            box2.SetAlignment(-1, -1);
+            box2.SetWeight(1, 0.07);
+        }
+
+        private void List_RenderPost(object sender, EventArgs e)
+        {
+            list.RenderPost -= List_RenderPost;
+            _enteringSpeed = (EcoreAnimator.GetCurrentTime() - _enteringSpeed) * 1000;
+
+            _frameSet = Elementary.BringInScrollFriction;
+            Elementary.BringInScrollFriction = TimeSet;
+            list.ScrollTo(ItemTarget, ScrollToPosition.In, true);
+        }
+
+        private void List_ScrollAnimationStarted(object sender, EventArgs e)
+        {
+            _ecoreCount = 0;
+            _anim = EcoreAnimator.AddAnimator(OnEcoreCheck);
+            list.RenderPost += List_RenderPostFrame;
+        }
+
+        private bool OnEcoreCheck()
+        {
+            _ecoreCount++;
+            return true;
+        }
+
+        private void List_RenderPostFrame(object sender, EventArgs e)
+        {
+            _frameCount++;
+        }
+
+        private void List_Changed(object sender, EventArgs e)
+        {
+            _enteringSpeed = EcoreAnimator.GetCurrentTime();
+            list.Changed -= List_Changed;
+            list.RenderPost += List_RenderPost;
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/PolygonTest1.cs b/test/ElmSharp.Test/TC/PolygonTest1.cs
new file mode 100644 (file)
index 0000000..66223f0
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class PolygonTest1 : TestCaseBase
+    {
+        public override string TestName => "PolygonTest1";
+        public override string TestDescription => "To test basic operation of Polygon";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Polygon triangle1 = new Polygon(window);
+            triangle1.Color = Color.Blue;
+            triangle1.AddPoint(100, 100);
+            triangle1.AddPoint(100, 500);
+            triangle1.AddPoint(500, 500);
+            triangle1.Show();
+
+            Polygon triange2 = new Polygon(window);
+            triange2.AddPoint(300, 300);
+            triange2.AddPoint(new Point{X=600, Y=300});
+            triange2.AddPoint(new Point{X=600, Y=600});
+            triange2.Color = Color.Green;
+            triange2.Show();
+
+            Polygon hexagon = new Polygon(window);
+            hexagon.Color = Color.Pink;
+            hexagon.AddPoint(0, 0);
+            hexagon.AddPoint(700, 0);
+            hexagon.ClearPoints();
+            for (double a=0; a < 2 * Math.PI; a += Math.PI / 3)
+            {
+                hexagon.AddPoint(
+                    300 + (int)(120 * Math.Sin(a)),
+                    580 + (int)(120 * Math.Cos(a))
+                );
+            }
+            hexagon.Show();
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/PopupTest1.cs b/test/ElmSharp.Test/TC/PopupTest1.cs
new file mode 100644 (file)
index 0000000..90eda9c
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class PopupTest1 : TestCaseBase
+    {
+        public override string TestName => "PopupTest1";
+        public override string TestDescription => "To test basic operation of Popup";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Show();
+            Button btn = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Open"
+            };
+            btn.Show();
+            
+            Popup popup = new Popup(window)
+            {
+                Orientation = PopupOrientation.Bottom,
+                Timeout = 5,
+            };
+
+            popup.Dismissed += (s, e) =>
+            {
+                Console.WriteLine("Popup dismissed");
+            };
+
+            popup.ShowAnimationFinished += (s, e) =>
+            {
+                Console.WriteLine("Popup show animation finished");
+            };
+
+            popup.OutsideClicked += (s, e) =>
+            {
+                Console.WriteLine("Popup outside clicked");
+            };
+
+            popup.TimedOut += (s, e) =>
+            {
+                Console.WriteLine("Popup time out");
+            };
+
+            popup.Append("Label1");
+            popup.Append("Label2");
+            popup.Append("Label3");
+
+            popup.BackButtonPressed += (s, e) =>
+            {
+                Console.WriteLine("!!! BackButtonPressed Event on Popup!!");
+                popup.Hide();
+            };
+
+            btn.Clicked += (s, e) =>
+            {
+                popup.Show();
+            };
+
+            Button close = new Button(popup)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Close"
+            };
+            popup.SetPartContent("button1", close);
+
+            close.Clicked += (s, e) =>
+            {
+                popup.Hide();
+            };
+
+            box.PackEnd(btn);
+            conformant.SetContent(box);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ProgressBarTest1.cs b/test/ElmSharp.Test/TC/ProgressBarTest1.cs
new file mode 100644 (file)
index 0000000..04a04cf
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class ProgressBarTest1 : TestCaseBase
+    {
+        public override string TestName => "ProgressBarTest1";
+        public override string TestDescription => "To test basic operation of ProgressBar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window);
+            conformant.SetContent(table);
+            table.Show();
+
+            ProgressBar pb1 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                UnitFormat = "%.0f %%",
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Label lb2 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt1 = new Button(window)
+            {
+                Text = "Increase Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt2 = new Button(window)
+            {
+                Text = "Decrease Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt3 = new Button(window)
+            {
+                Text = "Increase PartValue",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt4 = new Button(window)
+            {
+                Text = "Decrease PartValue",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            string part = "elm.cur.progressbar";
+            double unit = 0.1;
+            double max = 1.0;
+            double min = 0;
+
+            pb1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", pb1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+                lb2.Text = string.Format("PartValue Changed: {0}", pb1.GetPartValue(part));
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            bt1.Clicked += (s, e) =>
+            {
+                var val = pb1.Value + unit;
+                if (val <= max)
+                    pb1.Value = val;
+            };
+
+            bt2.Clicked += (s, e) =>
+            {
+                var val = pb1.Value - unit;
+                if (val >= min)
+                {
+                    pb1.Value = val;
+                }
+            };
+
+            bt3.Clicked += (s, e) =>
+            {
+                var val = pb1.GetPartValue(part) + unit;
+                if (val <= max)
+                    pb1.SetPartValue(part, val);
+            };
+
+            bt4.Clicked += (s, e) =>
+            {
+                var val = pb1.GetPartValue(part) - unit;
+                if (val >= min)
+                {
+                    pb1.SetPartValue(part, val);
+                }
+            };
+
+            table.Pack(pb1, 1, 1, 2, 1);
+            table.Pack(lb1, 1, 2, 2, 1);
+            table.Pack(lb2, 1, 3, 2, 1);
+            table.Pack(bt1, 1, 4, 1, 1);
+            table.Pack(bt2, 1, 5, 1, 1);
+            table.Pack(bt3, 1, 6, 1, 1);
+            table.Pack(bt4, 1, 7, 1, 1);
+
+            pb1.Show();
+            lb1.Show();
+            lb2.Show();
+            bt1.Show();
+            bt2.Show();
+            bt3.Show();
+            bt4.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/ProgressBarTest2.cs b/test/ElmSharp.Test/TC/ProgressBarTest2.cs
new file mode 100644 (file)
index 0000000..d85847e
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class ProgressBarTest2 : TestCaseBase
+    {
+        public override string TestName => "ProgressBarTest2";
+        public override string TestDescription => "To test basic operation of ProgressBar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box table = new Box(window)
+            {
+                BackgroundColor = Color.White,
+            };
+            conformant.SetContent(table);
+            table.Show();
+
+            ProgressBar pb1 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                Style = "process_medium",
+                Value = 0.1,
+                AlignmentX = 0,
+                AlignmentY = 0,
+                WeightX = 0,
+                WeightY = 1
+            };
+            pb1.PlayPulse();
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+
+            Button bt1 = new Button(window)
+            {
+                Text = "Increase Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            bt1.Clicked += (s, e) =>
+            {
+                Random rand = new Random(DateTime.UtcNow.Millisecond);
+                pb1.Color = new Color(rand.Next(255), rand.Next(255), rand.Next(255));
+                lb1.Text = pb1.Color.ToString();
+            };
+
+            Button bt2 = new Button(window)
+            {
+                Text = "zoom",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            bt2.Clicked += (s, e) =>
+            {
+                var map = new EvasMap(4);
+                var g = pb1.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Zoom(2, 2, g.X, g.Y);
+                pb1.EvasMap = map;
+                pb1.IsMapEnabled = true;
+            };
+
+            table.PackEnd(pb1);
+            table.PackEnd(lb1);
+            table.PackEnd(bt1);
+            table.PackEnd(bt2);
+
+            pb1.Show();
+            lb1.Show();
+            bt1.Show();
+            bt2.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/RadioTest1.cs b/test/ElmSharp.Test/TC/RadioTest1.cs
new file mode 100644 (file)
index 0000000..0462e7a
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class RadioTest1 : TestCaseBase
+    {
+        public override string TestName => "RadioTest1";
+        public override string TestDescription => "To test basic operation of Radio";
+
+        Label _lb1;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Radio rd1 = new Radio(window)
+            {
+                StateValue = 1,
+                Text = "<span color=#ffffff>Value #1</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Radio rd2 = new Radio(window)
+            {
+                StateValue = 2,
+                Text = "<span color=#ffffff>Value #2</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Radio rd3 = new Radio(window)
+            {
+                StateValue = 3,
+                Text = "<span color=#ffffff>Value #3</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            rd2.SetGroup(rd1);
+            rd3.SetGroup(rd2);
+
+            rd1.ValueChanged += OnRadioValueChanged;
+            rd2.ValueChanged += OnRadioValueChanged;
+            rd3.ValueChanged += OnRadioValueChanged;
+
+            _lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            box.PackEnd(_lb1);
+            box.PackEnd(rd1);
+            box.PackEnd(rd2);
+            box.PackEnd(rd3);
+
+            _lb1.Show();
+            rd1.Show();
+            rd2.Show();
+            rd3.Show();
+        }
+
+        void OnRadioValueChanged(object sender, EventArgs e)
+        {
+            _lb1.Text = string.Format("Value Changed: {0}", ((Radio)sender).GroupValue);
+            _lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/RectangleTest1.cs b/test/ElmSharp.Test/TC/RectangleTest1.cs
new file mode 100644 (file)
index 0000000..23e58f5
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class RectangleTest1 : TestCaseBase
+    {
+        public override string TestName => "RectangleTest1";
+        public override string TestDescription => "Add one Red Rectangle and one Orange Rectangle";
+
+        public override void Run(Window window)
+        {
+            Rectangle box1 = new Rectangle(window)
+            {
+                Color = Color.Red
+            };
+            box1.Show();
+            box1.Resize(100, 100);
+            box1.Move(0, 0);
+            Rectangle box2 = new Rectangle(window)
+            {
+                Color = Color.Orange
+            };
+            box2.Show();
+            box2.Resize(100, 100);
+            box2.Move(100, 100);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ScreenInformationTest.cs b/test/ElmSharp.Test/TC/ScreenInformationTest.cs
new file mode 100644 (file)
index 0000000..5150454
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp.Test
+{
+    public class ScreenInformationTest : TestCaseBase
+    {
+        public override string TestName => "ScreenInformationTest";
+        public override string TestDescription => "To get screen information";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Show();
+            conformant.SetContent(box);
+            Label label = new Label(window);
+            label.SetAlignment(-1, 0);
+            label.SetWeight(1, 0);
+            label.Text = string.Format("<span color=#FFFFFF , font_size=50>ScreenSize : {0}x{1}", window.ScreenSize.Width, window.ScreenSize.Height);
+            label.Show();
+            box.PackEnd(label);
+            Label label2 = new Label(window);
+            label2.SetAlignment(-1, 0);
+            label2.SetWeight(1, 0);
+            label2.Text = string.Format("<span color=#FFFFFF , font_size=50>ScreenDPI : xdpi : {0} ydpi : {1}", window.ScreenDpi.X, window.ScreenDpi.Y);
+            label2.Show();
+            box.PackEnd(label2);
+        }        
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ScrollerTest1.cs b/test/ElmSharp.Test/TC/ScrollerTest1.cs
new file mode 100644 (file)
index 0000000..2bfdbba
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ScrollerTest1 : TestCaseBase
+    {
+        public override string TestName => "ScrollerTest1";
+        public override string TestDescription => "To test basic operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.None,
+            };
+            scroller.Show();
+            conformant.SetContent(scroller);
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumHeight = 400,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+            }
+            scroller.Scrolled += Scroller_Scrolled;
+        }
+
+        private void Scroller_Scrolled(object sender, EventArgs e)
+        {
+            Console.WriteLine("Scrolled : {0}x{1}", ((Scroller)sender).CurrentRegion.X, ((Scroller)sender).CurrentRegion.Y);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ScrollerTest2.cs b/test/ElmSharp.Test/TC/ScrollerTest2.cs
new file mode 100644 (file)
index 0000000..f246a66
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ScrollerTest2 : TestCaseBase
+    {
+        public override string TestName => "ScrollerTest2";
+        public override string TestDescription => "To test basic operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+            };
+            prev.Show();
+            next.Show();
+            outterBox.PackEnd(prev);
+            outterBox.PackEnd(next);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ScrollerTest3.cs b/test/ElmSharp.Test/TC/ScrollerTest3.cs
new file mode 100755 (executable)
index 0000000..90d7015
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class ScrollerTest3 : TestCaseBase
+    {
+        public override string TestName => "ScrollerTest3";
+        public override string TestDescription => "To test ScrollTo operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            for (int i = 0; i < 30; i++)
+            {
+                Label addlabel = new Label(window)
+                {
+                    Text = i + " Label Test",
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                };
+                addlabel.Show();
+                box.PackEnd(addlabel);
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                Rect region = new Rect(0, 0, scroller.Geometry.Width, scroller.Geometry.Width);
+                Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width);
+                scroller.ScrollTo(region, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                Rect region = new Rect(0, scroller.Geometry.Height, scroller.Geometry.Width, scroller.Geometry.Height);
+                Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width);
+                scroller.ScrollTo(region, true);
+            };
+            prev.Show();
+            next.Show();
+            outterBox.PackEnd(prev);
+            outterBox.PackEnd(next);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/SliderTest1.cs b/test/ElmSharp.Test/TC/SliderTest1.cs
new file mode 100644 (file)
index 0000000..0d0f53a
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class SliderTest1 : TestCaseBase
+    {
+        public override string TestName => "SliderTest1";
+        public override string TestDescription => "To test basic operation of Slider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window);
+            conformant.SetContent(table);
+            table.Show();
+
+            Slider sld1 = new Slider(window)
+            {
+                Text = "Slider Test",
+                IndicatorFormat = "%1.2f meters",
+                Minimum = 0.0,
+                Maximum = 100.0,
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1,
+                IsIndicatorFocusable = true
+            };
+
+            Button btn = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Set IsIndicatorFocusable"
+            };
+            btn.Clicked += (s, e) =>
+            {
+                if (sld1.IsIndicatorFocusable)
+                {
+                    sld1.IsIndicatorFocusable = false;
+                }
+                else
+                {
+                    sld1.IsIndicatorFocusable = true;
+                }
+            };
+
+            Button btn2 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Set IndicatorVisibleMode"
+            };
+            btn2.Clicked += (s, e) =>
+            {
+                if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always;
+                    btn2.Text = "Always";
+                }
+                else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus;
+                    btn2.Text = "OnFocus";
+                }
+                else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None;
+                    btn2.Text = "None";
+                }
+                else
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default;
+                    btn2.Text = "Default";
+                }
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            table.Pack(sld1, 1, 1, 2, 1);
+            table.Pack(btn, 1, 2, 2, 1);
+            table.Pack(btn2, 1, 3, 2, 1);
+            table.Pack(lb1, 1, 4, 2, 1);
+
+            sld1.Show();
+            btn.Show();
+            lb1.Show();
+            btn2.Show();
+
+            sld1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", sld1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/SliderTest2.cs b/test/ElmSharp.Test/TC/SliderTest2.cs
new file mode 100644 (file)
index 0000000..b17ca38
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class SliderTest2 : TestCaseBase
+    {
+        public override string TestName => "SliderTest2";
+        public override string TestDescription => "To test basic operation of Slider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window);
+            conformant.SetContent(table);
+            table.Show();
+
+            Slider sld = new Slider(window)
+            {
+                Text = "Slider Test",
+                IndicatorFormat = "%1.2f meters",
+                Minimum = 0.0,
+                Maximum = 100.0,
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1,
+                IsIndicatorFocusable = true
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()),
+            };
+            lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+            Label lb2 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()),
+            };
+            lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+            Button btn1 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Change IndicatorVisibleMode"
+            };
+            btn1.Clicked += (s, e) =>
+            {
+                sld.IndicatorVisibleMode = (SliderIndicatorVisibleMode)(((int)sld.IndicatorVisibleMode + 1) % 4);
+                lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            Button btn2 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Change IsIndicatorVisible"
+            };
+            btn2.Clicked += (s, e) =>
+            {
+                sld.IsIndicatorVisible = !sld.IsIndicatorVisible;
+                lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            table.Pack(sld, 1, 1, 2, 1);
+            table.Pack(lb1, 1, 2, 2, 1);
+            table.Pack(lb2, 1, 3, 2, 1);
+            table.Pack(btn1, 1, 4, 2, 1);
+            table.Pack(btn2, 1, 5, 2, 1);
+
+            sld.Show();
+            lb1.Show();
+            lb2.Show();
+            btn1.Show();
+            btn2.Show();
+
+            sld.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+                lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/SpinnerTest1.cs b/test/ElmSharp.Test/TC/SpinnerTest1.cs
new file mode 100644 (file)
index 0000000..419bfff
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test
+{
+    class SpinnerTest1 : TestCaseBase
+    {
+        public override string TestName => "SpinnerTest1";
+        public override string TestDescription => "To test basic operation of Spinner";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window);
+            conformant.SetContent(table);
+            table.Show();
+
+            Spinner spn1 = new Spinner(window)
+            {
+                Text = "Slider Test",
+                LabelFormat = "%1.2f Value",
+                Minimum = 1,
+                Maximum = 12,
+                Value = 1.5,
+                Step = 0.5,
+                Interval = 0.5,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1
+            };
+            spn1.AddSpecialValue(5, "Five !!!!");
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            table.Pack(spn1, 1, 1, 2, 1);
+            table.Pack(lb1, 1, 2, 2, 1);
+
+            spn1.Show();
+            lb1.Show();
+
+            spn1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", spn1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/TableTest1.cs b/test/ElmSharp.Test/TC/TableTest1.cs
new file mode 100644 (file)
index 0000000..24ca0d6
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public class TableTest1 : TestCaseBase
+    {
+        public override string TestName => "TableTest1";
+        public override string TestDescription => "To test basic operation of Table";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window) {
+                PaddingX = 10,
+                PaddingY = 10
+            };
+           // table.BackgroundColor = Color.Orange;
+            conformant.SetContent(table);
+            table.Show();
+
+            Button button1 = new Button(window) {
+                Text = "Button (set Color.Oranage)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            button1.Clicked += (e,o) =>
+            {
+                table.BackgroundColor = Color.Orange;
+                Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+            };
+
+            Button button2 = new Button(window) {
+                Text = "Button 2 (set Color.Defalut)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = new Color(50, 100, 200, 75)
+            };
+            button2.Clicked += (e, o) =>
+            {
+                table.BackgroundColor = Color.Default;
+                Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+            };
+
+            table.Pack(button1,0,0,3,3);
+            table.Pack(button2,3,1,1,1);
+
+            button1.Show();
+            button2.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ToolbarTest1.cs b/test/ElmSharp.Test/TC/ToolbarTest1.cs
new file mode 100644 (file)
index 0000000..5849dfc
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class ToolbarTest1 : TestCaseBase
+    {
+        Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>();
+        Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>();
+        int currentItemIndex = 0;
+        public override string TestName => "ToolbarTest1";
+        public override string TestDescription => "To test basic operation of Toolbar";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+
+            Toolbar toolbar = new Toolbar(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                ShrinkMode = ToolbarShrinkMode.Scroll
+            };
+
+            toolbar.Show();
+            outterBox.PackEnd(toolbar);
+
+
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 5; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                box.PackEnd(colorBox);
+                ToolbarItem item = toolbar.Append(string.Format("{0} Item", i), "home");
+                _itemTable[item] = i;
+                _reverseItemTable[i] = item;
+                item.Selected += (s, e) =>
+                {
+                    scroller.ScrollTo(_itemTable[(ToolbarItem)s], 0, true);
+                };
+            }
+            scroller.Scrolled += (s, e) =>
+            {
+                if (scroller.HorizontalPageIndex != currentItemIndex)
+                {
+                    currentItemIndex = scroller.HorizontalPageIndex;
+                    _reverseItemTable[currentItemIndex].IsSelected = true;
+                }
+            };
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ToolbarTest2.cs b/test/ElmSharp.Test/TC/ToolbarTest2.cs
new file mode 100644 (file)
index 0000000..07780fb
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class ToolbarTest2 : TestCaseBase
+    {
+        Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>();
+        Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>();
+        public override string TestName => "ToolbarTest2";
+        public override string TestDescription => "To test basic operation of Toolbar";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outerBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+                BackgroundColor = Color.Aqua,
+            };
+            outerBox.Show();
+
+            Toolbar toolbar = new Toolbar(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            toolbar.Show();
+            outerBox.PackEnd(toolbar);
+
+            List<ToolbarItem> items = new List<ToolbarItem>();
+            items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home"));
+
+            Button bt = new Button(window)
+            {
+                Text = "Add ToolbarItem",
+                MinimumWidth = 400
+            };
+            bt.Clicked += (s, e) =>
+            {
+                items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home"));
+            };
+
+            Button removebt = new Button(window)
+            {
+                Text = "Remove first ToolbarItem",
+                MinimumWidth = 400
+            };
+            removebt.Clicked += (s, e) =>
+            {
+                foreach (var cur in items)
+                {
+                    items.Remove(cur);
+                    cur.Delete();
+                    return;
+                }
+            };
+
+            bt.Show();
+            removebt.Show();
+            outerBox.PackEnd(bt);
+            outerBox.PackEnd(removebt);
+            conformant.SetContent(outerBox);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ToolbarTest3.cs b/test/ElmSharp.Test/TC/ToolbarTest3.cs
new file mode 100644 (file)
index 0000000..5568088
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class ToolbarTest3 : TestCaseBase
+    {
+        Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>();
+        Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>();
+        public override string TestName => "ToolbarTest3";
+        public override string TestDescription => "To test basic operation of Toolbar for changing bg color";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+                BackgroundColor = Color.Aqua,
+            };
+            outterBox.Show();
+
+            Toolbar toolbar = new Toolbar(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            var rnd = new Random();
+            toolbar.BackgroundColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
+            toolbar.Show();
+            outterBox.PackEnd(toolbar);
+
+            toolbar.Selected += (s, e) =>
+            {
+                e.Item.DeletePartColor("bg");
+            };
+
+            Label lb = new Label(window)
+            {
+                Text = "Please, click an item for delete part color",
+            };
+            lb.Show();
+            outterBox.PackEnd(lb);
+
+            for (int i = 0; i < 5; i++)
+            {
+                ToolbarItem item = toolbar.Append(string.Format("{0} home", i), "home");
+                Color bgColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
+                item.SetPartColor("bg", bgColor);
+
+                item.Clicked += (s, e) =>
+                {
+                    lb.Text = (s as ToolbarItem).Text+" clicked";
+                };
+            }
+
+
+            conformant.SetContent(outterBox);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/ToolbarTest4.cs b/test/ElmSharp.Test/TC/ToolbarTest4.cs
new file mode 100644 (file)
index 0000000..268aadf
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+    public class ToolbarTest4 : TestCaseBase
+    {
+        public override string TestName => "ToolbarTest4";
+        public override string TestDescription => "To test basic operation of Toolbar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+                BackgroundColor = Color.Aqua,
+            };
+            outterBox.Show();
+
+            Toolbar toolbar = new Toolbar(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                ShrinkMode = ToolbarShrinkMode.Scroll,
+                IconLookupOrder = ToolbarIconLookupOrder.ThemeFreedesktop,
+            };
+            toolbar.Show();
+            outterBox.PackEnd(toolbar);
+
+            toolbar.Append("FirstItem", "home");
+            toolbar.Append("LastItem", "home");
+            ToolbarItem result = toolbar.InsertAfter(toolbar.FirstItem, "Result", "");
+
+            Button bt1 = new Button(window)
+            {
+                Text = "Change IconSize",
+                MinimumWidth = 400
+            };
+            bt1.Clicked += (s, e) =>
+            {
+                if (toolbar.IconSize < 50)
+                    toolbar.IconSize = 100;
+                else
+                    toolbar.IconSize = 32;
+                result.Text = string.Format("IconSize{0}", toolbar.IconSize.ToString());
+            };
+            bt1.Show();
+            outterBox.PackEnd(bt1);
+
+            Button bt2 = new Button(window)
+            {
+                Text = "Find FirstItem",
+                MinimumWidth = 400
+            };
+            bt2.Clicked += (s, e) =>
+            {
+                ToolbarItem item1 = toolbar.FirstItem;
+                ToolbarItem item2 = toolbar.FindItemByLabel("FirstItem");
+                if (item1 == null || item2 == null || item1 != item2)
+                    result.Text = "FAIL";
+                else
+                    result.Text = "PASS";
+            };
+            bt2.Show();
+            outterBox.PackEnd(bt2);
+
+            Button bt3 = new Button(window)
+            {
+                Text = "Find LastItem",
+                MinimumWidth = 400
+            };
+            bt3.Clicked += (s, e) =>
+            {
+                ToolbarItem item1 = toolbar.LastItem;
+                ToolbarItem item2 = toolbar.FindItemByLabel("LastItem");
+                if (item1 == null || item2 == null || item1 != item2)
+                    result.Text = "FAIL";
+                else
+                    result.Text = "PASS";
+            };
+            bt3.Show();
+            outterBox.PackEnd(bt3);
+
+            Button bt4 = new Button(window)
+            {
+                Text = "Get ItemsCount",
+                MinimumWidth = 400
+            };
+            bt4.Clicked += (s, e) =>
+            {
+                result.Text = toolbar.ItemsCount.ToString();
+            };
+            bt4.Show();
+            outterBox.PackEnd(bt4);
+
+            Button bt5 = new Button(window)
+            {
+                Text = "Change IconLookupOrder",
+                MinimumWidth = 400
+            };
+            bt5.Clicked += (s, e) =>
+            {
+                toolbar.IconLookupOrder = (ToolbarIconLookupOrder)(((int)toolbar.IconLookupOrder + 1) % 4);
+                result.Text = toolbar.IconLookupOrder.ToString();
+            };
+            bt5.Show();
+            outterBox.PackEnd(bt5);
+
+            conformant.SetContent(outterBox);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/TooltipTest1.cs b/test/ElmSharp.Test/TC/TooltipTest1.cs
new file mode 100755 (executable)
index 0000000..8c26364
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class TooltipTest1 : TestCaseBase
+    {
+        public override string TestName => "TooltipTest1";
+        public override string TestDescription => "To test basic operation of Tooltip";
+
+        void SetButtonEventHandler(Button button)
+        {
+            button.Clicked += (s, e) =>
+            {
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.BackgroundColor);
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName);
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower());
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", ""));
+                Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg");
+
+                Console.WriteLine("Tooltip's Orientation {0}", button.TooltipOrientation);
+                Console.WriteLine("Tooltip's Window mode {0}", button.TooltipWindowMode);
+                Console.WriteLine("Tooltip's Style {0}", button.TooltipStyle);
+            };
+
+            button.Pressed += (s, e) =>
+            {
+                Console.WriteLine("{0} Pressed!", button.Text);
+            };
+
+            button.Released += (s, e) =>
+            {
+                Console.WriteLine("{0} Released!", button.Text);
+            };
+
+            button.Repeated += (s, e) =>
+            {
+                Console.WriteLine("{0} Repeated!", button.Text);
+            };
+
+            button.Show();
+        }
+
+        public override void Run(Window window)
+        {
+            Button button1 = new Button(window) {
+                Text = "Basic operation of Tooltip",
+            };
+            button1.SetPartColor("bg", Color.Red);
+            button1.Resize(600, 100);
+            button1.Move(0, 0);
+            button1.SetTooltipText("Tooltip Tes1");
+            SetButtonEventHandler(button1);
+
+            Button button2 = new Button(window) {
+                Text = "Orientation of Tooltip",
+                BackgroundColor = Color.Pink,
+            };
+            button2.Resize(600, 100);
+            button2.Move(0, 200);
+            button2.SetTooltipText("Tooltip Test2");
+            button2.TooltipOrientation = TooltipOrientation.Bottom;
+            button2.Text = button2.TooltipOrientation.ToString();
+            SetButtonEventHandler(button2);
+
+            Button button3 = new Button(window) {
+                Text = "Style of Tooltip",
+                BackgroundColor = Color.Purple
+            };
+            button3.SetTooltipText("Tooltip Test3");
+            button3.TooltipStyle = "transparent";
+            button3.Text = button3.TooltipStyle;
+            button3.Resize(600, 100);
+            button3.Move(0, 400);
+            SetButtonEventHandler(button3);
+
+            Button button4 = new Button(window) {
+                Text = "Window mode of Tooltip",
+                BackgroundColor = Color.Green
+            };
+            button4.SetTooltipText("Tooltip Test4");
+            button4.TooltipWindowMode = true;
+            button4.Text = button4.TooltipWindowMode.ToString();
+            button4.Resize(600, 100);
+            button4.Move(0, 600);
+            SetButtonEventHandler(button4);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/TransitTest.cs b/test/ElmSharp.Test/TC/TransitTest.cs
new file mode 100644 (file)
index 0000000..6bab1e2
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    class TransitTest : TestCaseBase
+    {
+        public override string TestName => "TransitTest";
+        public override string TestDescription => "To test basic operation of Transit";
+
+        Transit CreateTransit()
+        {
+            Transit transit = new Transit();
+            transit.Deleted += (s, e) => { Console.WriteLine("Transit Deleted"); };
+            transit.Repeat = 1;
+            transit.AutoReverse = true;
+            transit.Duration = 1;
+            return transit;
+        }
+
+        public override void Run(Window window)
+        {
+            Button button1 = new Button(window) {
+                Text = "Effect",
+            };
+            button1.Move(0, 0);
+            button1.Resize(270, 200);
+            button1.Show();
+
+            Button button2 = new Button(window)
+            {
+                Text = "Chain Effect",
+            };
+            button2.Move(270, 200);
+            button2.Resize(270, 200);
+            button2.Show();
+
+            Point begin = new Point();
+            begin.X = begin.Y = 0;
+            Point end = new Point();
+            end.X = end.Y = 200;
+            TranslationEffect translation = new TranslationEffect(begin, end);
+            translation.EffectEnded += (s, e) => { Console.WriteLine("Translation Effect Ended"); };
+
+            RotationEffect rotation = new RotationEffect(0, 180);
+            rotation.EffectEnded += (s, e) => { Console.WriteLine("Rotation Effect Ended"); };
+
+            button1.Clicked += (s, e) => {
+                Transit transit1 = CreateTransit();
+                transit1.Objects.Add(button1);
+                transit1.Objects.Add(button2);
+                transit1.AddEffect(translation);
+                transit1.AddEffect(rotation);
+                transit1.Go();
+            };
+
+            button2.Clicked += (s, e) => {
+                Transit transit1 = CreateTransit();
+                transit1.Objects.Add(button1);
+                transit1.AddEffect(translation);
+                transit1.AddEffect(rotation);
+
+                Transit transit2 = CreateTransit();
+                transit2.Objects.Add(button2);
+                transit2.AddEffect(translation);
+                transit2.AddEffect(rotation);
+
+                transit1.Chains.Add(transit2);
+                transit1.Go();
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs
new file mode 100644 (file)
index 0000000..0903c6e
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class BackgroundColorTest : WearableTestCase
+    {
+        public override string TestName => "BackgroundColorTest1";
+        public override string TestDescription => "To test basic operation of Widget's background Color";
+
+        Color[] _colors = new Color[] {
+            Color.Red,
+            new Color(125,200,255, 150),
+            new Color(125, 200, 255, 10),
+            Color.Default
+        };
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Button colorButton = new Button(window);
+            colorButton.Geometry = square;
+            Log.Debug(colorButton.Geometry.ToString());
+            colorButton.Text = colorButton.BackgroundColor.ToString();
+            colorButton.Show();
+
+            int colorIndex = 0;
+            colorButton.Clicked += (s, e) =>
+            {
+                colorButton.BackgroundColor = _colors[colorIndex++];
+                colorButton.Text = colorButton.BackgroundColor.ToString();
+                if (colorIndex == _colors.Length) colorIndex = 0;
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs
new file mode 100644 (file)
index 0000000..7f25d34
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class BackgroundTest1 : WearableTestCase
+
+    {
+        public override string TestName => "BackgroundTest1";
+        public override string TestDescription => "To test basic operation of Background";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Background bg1 = new Background(window)
+            {
+                Color = Color.Orange,
+                Geometry = new Rect(square.X, square.Y, square.Width / 2, square.Height / 2)
+            };
+
+            Background bg2 = new Background(window)
+            {
+                Color = new Color(60, 128, 255, 100),
+                Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width / 2, square.Height / 2)
+            };
+
+            Background bg3 = new Background(window)
+            {
+                File = "/home/owner/apps_rw/ElmSharpTest/res/picture.png",
+                BackgroundOption = BackgroundOptions.Center,
+                BackgroundColor = Color.Gray,
+                Geometry = new Rect(square.X + square.Width/2, square.Y, square.Width / 2, square.Height)
+            };
+
+            bg3.SetFileLoadSize(square.Width/2, square.Height);
+
+            bg1.Show();
+            bg2.Show();
+            bg3.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs
new file mode 100644 (file)
index 0000000..5520cad
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class BackgroundTest2 : WearableTestCase
+    {
+        public override string TestName => "BackgroundTest2";
+        public override string TestDescription => "To test basic operation of Background";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Box box = new Box(window)
+            {
+                Geometry = square
+            };
+            box.Show();
+            Background bg = new Background(window)
+            {
+                AlignmentY = -1,
+                AlignmentX = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            bg.Show();
+            box.PackEnd(bg);
+            Slider red = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Red",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider green = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Green",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider blue = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Blue",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            Slider alpha = new Slider(window)
+            {
+                Minimum = 0,
+                Maximum = 255,
+                Text = "Alpha",
+                AlignmentX = -1,
+                WeightX = 1
+            };
+            red.Show();
+            green.Show();
+            blue.Show();
+            alpha.Show();
+            box.PackEnd(red);
+            box.PackEnd(green);
+            box.PackEnd(blue);
+            box.PackEnd(alpha);
+            red.Value = 255;
+            green.Value = 255;
+            blue.Value = 255;
+            alpha.Value = 255;
+
+            bg.Color = new Color(255, 255, 255, 255);
+
+            EventHandler handler = (s, e) =>
+            {
+                bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value);
+            };
+
+            red.ValueChanged += handler;
+            green.ValueChanged += handler;
+            blue.ValueChanged += handler;
+            alpha.ValueChanged += handler;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs b/test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs
new file mode 100644 (file)
index 0000000..8fbab67
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    // under construct
+    class BoxLayoutTest1 : WearableTestCase
+    {
+        public override string TestName => "BoxLayoutTest1";
+        public override string TestDescription => "Box Layout callback test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+        Rect _square;
+
+        public override void Run(Window window)
+        {
+            _square = window.GetInnerSquare();
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            navi.Push(CreatePage(window));
+            navi.Show();
+            //navi.Geometry = _square;
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Box box = new Box(parent);
+            box.Show();
+            box.BackgroundColor = Color.Gray;
+
+            Label label = new Label(parent)
+            {
+                Text = string.Format("{0} Page", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button push = new Button(parent)
+            {
+                Text = "Push",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button pop = new Button(parent)
+            {
+                Text = "pop",
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            push.Resize(_square.Width, _square.Height / 6);
+            pop.Resize(_square.Width, _square.Height / 6);
+            label.Resize(_square.Width, _square.Height / 6);
+            box.SetLayoutCallback(() =>
+            {
+                Console.WriteLine("Layout callback with : {0}", _square);
+                var rect = box.Geometry;
+                label.Move(_square.X, rect.Y);
+                push.Move(_square.X, rect.Y + _square.Height / 6 + 5);
+                pop.Move(_square.X, rect.Y + _square.Height / 3 + 10);
+            });
+
+            box.PackEnd(label);
+            box.PackEnd(push);
+            box.PackEnd(pop);
+            return box;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs b/test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs
new file mode 100644 (file)
index 0000000..d1addb8
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class ButtonTest1 : WearableTestCase
+    {
+        public override string TestName => "ButtonTest1";
+        public override string TestDescription => "To test basic operation of Button";
+
+        void SetButtonEventHandler(Button button)
+        {
+            button.Clicked += (s, e) =>
+            {
+                Log.Debug($"{button.Text} Clicked! : {button.BackgroundColor}");
+                Log.Debug($"{button.Text} Clicked! : {button.ClassName}");
+                Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower()}");
+                Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower().Replace("elm_", "")}");
+                Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg"}");
+            };
+
+            button.Pressed += (s, e) =>
+            {
+                Log.Debug("{button.Text} Pressed!");
+            };
+
+            button.Released += (s, e) =>
+            {
+                Log.Debug("{button.Text} Released!");
+            };
+
+            button.Repeated += (s, e) =>
+            {
+                Log.Debug("{button.Text} Repeated!");
+            };
+
+            button.Show();
+        }
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+            Log.Debug(square.ToString());
+
+            Button button1 = new Button(window)
+            {
+                Text = "Button 1",
+            };
+            button1.SetPartColor("bg", Color.Red);
+            SetButtonEventHandler(button1);
+            button1.Resize(square.Width, square.Height/4);
+            button1.Move(square.X, square.Y);
+
+            Button button2 = new Button(window)
+            {
+                Text = "Button 2",
+                BackgroundColor = Color.Red,
+            };
+            SetButtonEventHandler(button2);
+            button2.Resize(square.Width, square.Height / 4);
+            button2.Move(square.X, square.Y + square.Height / 4);
+
+            Button button3 = new Button(window)
+            {
+                Text = "Button 3",
+                BackgroundColor = new Color(125, 200, 255, 150)
+            };
+            SetButtonEventHandler(button3);
+            button3.Resize(square.Width, square.Height / 4);
+            button3.Move(square.X, square.Y + square.Height / 2);
+
+            Button button4 = new Button(window)
+            {
+                Text = "Button 4",
+                BackgroundColor = new Color(125, 200, 255, 10)
+            };
+            SetButtonEventHandler(button4);
+            button4.Resize(square.Width, square.Height / 4);
+            button4.Move(square.X, square.Y + square.Height * 3 / 4);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs b/test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs
new file mode 100644 (file)
index 0000000..11c68bc
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class ButtonTest2 : WearableTestCase
+    {
+        public override string TestName => "ButtonTest2";
+        public override string TestDescription => "To Test Wearable Circular Buttons";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.Black;
+            bg.Show();
+
+            Button btn_bottom = new Button(window)
+            {
+                Style = "bottom",
+                Text = "Down",
+                Geometry = new Rect((window.ScreenSize.Width - 360) / 2, (window.ScreenSize.Height - 100), 360, 100)
+            };
+            btn_bottom.Show();
+
+            Button btn_left = new Button(window)
+            {
+                Style = "popup/circle/left",
+                Text = "Left",
+                Geometry = new Rect(0, 0, 64, 360)
+            };
+            btn_left.Show();
+
+            Button btn_right = new Button(window)
+            {
+                Style = "popup/circle/right",
+                Text = "Right",
+                Geometry = new Rect(window.ScreenSize.Width - 64, 0, 64, 360)
+            };
+            btn_right.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/CheckTest1.cs b/test/ElmSharp.Test/TC/Wearable/CheckTest1.cs
new file mode 100644 (file)
index 0000000..3dce199
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class CheckTest1 : WearableTestCase
+    {
+        public override string TestName => "CheckTest1";
+        public override string TestDescription => "To test basic operation of Check";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Background bg = new Background(window);
+            bg.Color = Color.Black;
+            bg.Geometry = square;
+            bg.Show();
+
+            Check check = new Check(window)
+            {
+                Text = "This is Check",
+                Style = "default"
+            };
+
+            Check onoff = new Check(window)
+            {
+                Text = "On or Off",
+                Style = "on&off"
+            };
+
+            Label label1 = new Label(window);
+            Label label2 = new Label(window);
+            Label label3 = new Label(window);
+            Label label4 = new Label(window);
+
+            EventHandler<CheckStateChangedEventArgs> update = (s, e) =>
+            {
+                Check c = s as Check;
+                label1.Text = string.Format("IsChecked ={0}", c.IsChecked);
+                label2.Text = string.Format("Style={0}", c.Style);
+                if (e != null)
+                {
+                    label3.Text = string.Format("OldState={0}", e.OldState);
+                    label4.Text = string.Format("NewState={0}", e.NewState);
+                }
+            };
+
+            check.StateChanged += (s, e) => update(s, e);
+
+            onoff.StateChanged += (s, e) => update(s, e);
+
+            Rect pieces = square;
+            pieces.Height /= 5;
+
+            label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height);
+            label1.Show();
+
+            label2.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height);
+            label2.Show();
+
+            label3.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 2, pieces.Width, pieces.Height);
+            label3.Show();
+
+            label4.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 3, pieces.Width, pieces.Height);
+            label4.Show();
+
+            check.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 4, pieces.Width/2, pieces.Height);
+            check.Show();
+
+            onoff.Geometry = new Rect(pieces.X + pieces.Width/2, pieces.Y + pieces.Height * 4, pieces.Width / 2, pieces.Height);
+            onoff.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/CircleTool.cs b/test/ElmSharp.Test/TC/Wearable/CircleTool.cs
new file mode 100644 (file)
index 0000000..11e371f
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    public static class CircleTool
+    {
+        static Rect _inSquare;
+        public static Rect GetInnerSquare(this Window window)
+        {
+            Size screenSize = window.ScreenSize;
+            int min = Math.Min(screenSize.Height, screenSize.Width);
+            int width = (int)(min * Math.Cos(Math.PI / 4));
+            int x = screenSize.Width / 2 - width / 2;
+            int y = screenSize.Height / 2 - width / 2;
+
+            return _inSquare == default(Rect) ? (_inSquare = new Rect(x, y, width, width)) : _inSquare;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs b/test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs
new file mode 100644 (file)
index 0000000..5a44d79
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class ClipperTest1 : WearableTestCase
+    {
+        public override string TestName => "ClipperTest1";
+        public override string TestDescription => "ClipperTest1 test";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.None,
+            };
+            scroller.Show();
+            Box container = new Box(window);
+            scroller.SetContent(container);
+
+            var rect1 = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Color = Color.Blue,
+                MinimumHeight = square.Height / 3
+            };
+            rect1.Show();
+
+            var clipper = new Rectangle(window);
+            clipper.Color = new Color(200, 200, 200, 200);
+            clipper.Geometry = rect1.Geometry;
+            rect1.Moved += (s, e) =>
+            {
+                clipper.Geometry = ((Rectangle)s).Geometry;
+            };
+            rect1.SetClip(clipper);
+            clipper.Show();
+            container.PackEnd(rect1);
+
+            Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon };
+            for (int i = 0; i < 6; i++)
+            {
+                var rect = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    WeightX = 1,
+                    Color = colors[i],
+                    MinimumHeight = square.Height / 3
+                };
+                rect.Show();
+                container.PackEnd(rect);
+            }
+
+            navi.Push(scroller, "Scroll Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs b/test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs
new file mode 100644 (file)
index 0000000..5badc7c
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class ContextPopupTest1 : WearableTestCase
+    {
+        public override string TestName => "ContextPopupTest1";
+        public override string TestDescription => "To test basic operation of ContextPopup";
+        private int _count = 0;
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Background bg = new Background(window);
+            bg.Color = Color.Olive;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            ContextPopup ctxPopup = new ContextPopup(bg)
+            {
+                IsHorizontal = false,
+                AutoHide = false,
+            };
+
+            for (int i = 0; i < 5; i++)
+            {
+                ctxPopup.Append(string.Format("{0} item", _count++));
+            }
+
+            ctxPopup.Dismissed += (e, o) => {
+                Console.WriteLine("Dismissed");
+            };
+            ctxPopup.Geometry = new Rect(square.X, square.Y, square.Width / 4, square.Height);
+            ctxPopup.Show();
+
+            bool ctxPopupVisible = true;
+            string dismissCaption = "Dismiss ContextPopup!";
+            string showCaption = "Show ContextPopup!";
+
+            Button button = new Button(window)
+            {
+                Text = dismissCaption
+            };
+            button.Clicked += (E, o) =>
+            {
+                if (ctxPopupVisible)
+                {
+                    ctxPopup.Dismiss();
+                }
+                else
+                {
+                    ctxPopup.Show();
+                }
+                ctxPopupVisible = !ctxPopupVisible;
+                button.Text = ctxPopupVisible ? dismissCaption : showCaption;
+            };
+
+            button.Geometry = new Rect(square.X + square.Width/2, square.Y, square.Width / 2, square.Height);
+            button.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs b/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs
new file mode 100644 (file)
index 0000000..60cc932
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class DateTimeSelectorTest1 : WearableTestCase
+    {
+        public override string TestName => "DateTimeSelectorTest1";
+        public override string TestDescription => "To test basic operation of DateTimeSelector";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Background bg = new Background(window);
+            bg.Color = Color.Black;
+            bg.Show();
+            conformant.SetContent(bg);
+
+            DateTimeSelector dateTime = new DateTimeSelector(window)
+            {
+                MinimumDateTime = new DateTime(2015, 1, 1),
+                MaximumDateTime = DateTime.Now,
+                DateTime = DateTime.Now
+            };
+
+            dateTime.Geometry = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height);
+            dateTime.Show();
+
+            dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug($"Old DateTime={e.OldDate}");
+                Log.Debug($"New DateTime={e.NewDate}");
+                Log.Debug($"Current DateTime={dateTime.DateTime}");
+            };
+
+            Button btn_left = new Button(window)
+            {
+                Style = "popup/circle/left",
+                Text = "Left",
+                Geometry = new Rect(0, 0, 64, 360)
+            };
+            btn_left.Show();
+
+            Button btn_right = new Button(window)
+            {
+                Style = "popup/circle/right",
+                Text = "Right",
+                Geometry = new Rect(window.ScreenSize.Width - 64, 0, 64, 360)
+            };
+            btn_right.Show();
+
+            btn_left.Clicked += (s, e) =>
+            {
+                dateTime.DateTime -= new TimeSpan(1, 0, 0, 0, 0);
+            };
+
+            btn_right.Clicked += (s, e) =>
+            {
+                dateTime.DateTime += new TimeSpan(1, 0, 0, 0, 0);
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs b/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs
new file mode 100644 (file)
index 0000000..9b3ca95
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Test.Wearable
+{
+    class DateTimeSelectorTest2 : WearableTestCase
+    {
+        public override string TestName => "DateTimeSelectorTest2";
+        public override string TestDescription => "To test basic operation of DateTimeSelector";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Background bg = new Background(window);
+            bg.Color = Color.Black;
+            bg.Show();
+            conformant.SetContent(bg);
+
+            DateTimeSelector dateTime = new DateTimeSelector(window)
+            {
+                DateTime = DateTime.Today,
+                Style = "time_layout",
+                Format = "%I:%M %p"
+            };
+
+            dateTime.Geometry = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height);
+            dateTime.Show();
+
+            dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug($"Old DateTime={e.OldDate}");
+                Log.Debug($"New DateTime={e.NewDate}");
+                Log.Debug($"Current DateTime={dateTime.DateTime}");
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs b/test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs
new file mode 100644 (file)
index 0000000..03118db
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EcoreTimerTest1 : WearableTestCase
+    {
+        public override string TestName => "EcoreTimerTest1";
+        public override string TestDescription => "To timer operation of EcoreMainLoop";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Gray
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+
+            int number = 0;
+            bool bReturn = true;
+            Label label1 = new Label(window);
+            label1.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2);
+
+            Button btnTimerSwitch = new Button(window);
+            btnTimerSwitch.Text = "Timer : On";
+            btnTimerSwitch.Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 2);
+
+            Func<bool> handler = () =>
+            {
+                label1.Text = (++number).ToString();
+                label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000 font_size=64 align=left valign=bottom wrap=word'";
+                return bReturn;
+            };
+            IntPtr prevId = EcoreMainloop.AddTimer(1.0, handler);
+            btnTimerSwitch.Clicked += (s, e) =>
+            {
+                if (bReturn)
+                {
+                    bReturn = false;
+                    btnTimerSwitch.Text = "Timer : Off";
+                }
+                else
+                {
+                    bReturn = true;
+                    btnTimerSwitch.Text = "Timer : On";
+                    EcoreMainloop.RemoveTimer(prevId);
+                    prevId = EcoreMainloop.AddTimer(1.0, handler);
+                }
+            };
+
+            window.BackButtonPressed += (s, e) =>
+            {
+                EcoreMainloop.RemoveTimer(prevId);
+            };
+
+            label1.Show();
+            btnTimerSwitch.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest1.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest1.cs
new file mode 100644 (file)
index 0000000..c2342c3
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EntryTest1 : WearableTestCase
+    {
+        public override string TestName => "EntryTest1";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Black
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            //conformant.SetContent(box);
+            box.Show();
+            box.Geometry = square;
+
+            Entry entry1 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+            };
+            entry1.SetPartText("guide", "<span color=#999999>Single Line</span>");
+
+            Entry entry2 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsPassword = true
+            };
+            entry2.SetPartText("guide", "<span color=#999999>Password</span>");
+
+            Entry entry3 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Scrollable = true,
+            };
+            entry3.SetPartText("guide", "<span color=#808080FF font_size=28 align=left valign=top wrap=mixed>Enter a System.Double</span>");
+            entry3.Show();
+
+            box.PackEnd(entry1);
+            box.PackEnd(entry2);
+            box.PackEnd(entry3);
+
+            entry1.Show();
+            entry2.Show();
+            entry3.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest2.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest2.cs
new file mode 100644 (file)
index 0000000..9e990b4
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EntryTest2 : WearableTestCase
+    {
+        public override string TestName => "EntryTest2";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Black
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Geometry = window.GetInnerSquare();
+            box.Show();
+
+            var capital1 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = " Word",
+                AutoCapital = AutoCapital.Word
+            };
+
+            var capital2 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Sentence",
+                AutoCapital = AutoCapital.Sentence
+            };
+
+            var capital3 = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "All",
+                AutoCapital = AutoCapital.All
+            };
+
+            var getText = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "get cursor content test",
+            };
+
+            var label = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+            };
+
+            getText.CursorChanged += (s, e) =>
+            {
+                label.Text = getText.GetCursorContent();
+            };
+
+            box.PackEnd(capital1);
+            box.PackEnd(capital2);
+            box.PackEnd(capital3);
+            box.PackEnd(getText);
+            box.PackEnd(label);
+
+            capital1.Show();
+            capital2.Show();
+            capital3.Show();
+            getText.Show();
+            label.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest3.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest3.cs
new file mode 100644 (file)
index 0000000..431585e
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EntryTest3 : WearableTestCase
+    {
+        public override string TestName => "EntryTest3";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window) {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Black
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Geometry = window.GetInnerSquare();
+            box.Show();
+
+            Check check = new Check(window) {
+                AlignmentX = -1,
+                AlignmentY = 0.9,
+                WeightX = 1,
+                WeightY = 0.1,
+                Text = "Select All",
+            };
+            check.Show();
+
+            Entry entry = new Entry(window) {
+                AlignmentX = -1,
+                AlignmentY = 0.1,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Text = "Hello, Tizen !!!"
+            };
+            entry.Show();
+
+            check.StateChanged += (object sender, CheckStateChangedEventArgs e) =>
+            {
+                if (e.NewState == true)
+                {
+                    entry.SelectAll();
+                }
+                else
+                {
+                    entry.SelectNone();
+                }
+            };
+
+            box.PackEnd(check);
+            box.PackEnd(entry);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest4.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest4.cs
new file mode 100644 (file)
index 0000000..850c76b
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EntryTest4 : WearableTestCase
+    {
+        public override string TestName => "EntryTest4";
+        public override string TestDescription => "To test basic operation of Entry";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Black
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Geometry = window.GetInnerSquare();
+            box.Show();
+
+            Entry entry = new Entry(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                IsSingleLine = true,
+                Text = "Hello, Tizen"
+            };
+
+            var btn = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Set Filter"
+            };
+            btn.Show();
+
+            //var filter = new Entry.TextFilter(SetFilter);
+            btn.Clicked += (s, e) =>
+            {
+                entry.AppendMarkUpFilter(SetFilter);
+            };
+
+            var btn1 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Remove Filter"
+            };
+            btn1.Show();
+            btn1.Clicked += (s, e) =>
+            {
+                entry.RemoveMarkUpFilter(SetFilter);
+            };
+
+            //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter));
+
+            entry.Show();
+            box.PackEnd(entry);
+            box.PackEnd(btn);
+            box.PackEnd(btn1);
+        }
+
+        public string SetFilter(Entry entry, string text)
+        {
+            if (text.Equals("a") || text.Equals("b") || text.Equals("c") || text.Equals("d"))
+                return text;
+            else
+                return "Tizen";
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs b/test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs
new file mode 100644 (file)
index 0000000..dac3457
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EvasMapTest1 : WearableTestCase
+    {
+        public override string TestName => "EvasMapTest1";
+        public override string TestDescription => "Test EvasMap on different levels of hierarchy";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            var box = new Box(window)
+            {
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2),
+                BackgroundColor = Color.Gray
+            };
+            box.Show();
+
+            var text = new Label(box)
+            {
+                Text = "<span color=#ffffff font_size=30>Target</span>",
+                AlignmentX = -1.0,
+                AlignmentY = -1.0,
+                WeightX = 1.0,
+                WeightY = 1.0,
+            };
+            text.Show();
+
+            box.PackEnd(text);
+
+            double angle = 0.0;
+
+            var reset = new Button(box)
+            {
+                Text = "Reset",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 6)
+            };
+            reset.Show();
+
+            double zx = 1.0;
+            double zy = 1.0;
+            reset.Clicked += (object sender, EventArgs e) =>
+            {
+                text.IsMapEnabled = false;
+                angle = 0.0;
+                zx = 1.0;
+                zy = 1.0;
+            };
+
+            var zoom = new Button(box)
+            {
+                Text = "Zoom Target",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height / 6, square.Width, square.Height / 6)
+            };
+            zoom.Show();
+
+            zoom.Clicked += (object sender, EventArgs e) =>
+            {
+                zx += 0.1;
+                zy += 0.1;
+                var map = new EvasMap(4);
+                var g = text.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                map.Zoom(zx, zy, g.X, g.Y);
+                text.EvasMap = map;
+                text.IsMapEnabled = true;
+            };
+
+            var rotate = new Button(box)
+            {
+                Text = "Rotate Target",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height * 2 / 6, square.Width, square.Height / 6)
+            };
+            rotate.Show();
+
+            rotate.Clicked += (object sender, EventArgs e) =>
+            {
+                angle += 5.0;
+                var map = new EvasMap(4);
+                var g = text.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                map.Zoom(zx, zy, g.X, g.Y);
+                text.EvasMap = map;
+                text.IsMapEnabled = true;
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs b/test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs
new file mode 100644 (file)
index 0000000..d662f0e
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class EvasMapTest2 : WearableTestCase
+    {
+        public override string TestName => "EvasMapTest2";
+        public override string TestDescription => "Test EvasMap on different levels of hierarchy";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+            var box = new Box(window)
+            {
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2),
+                BackgroundColor = Color.Gray
+            };
+            box.Show();
+
+            var group = new Box(box)
+            {
+                IsHorizontal = true,
+                BackgroundColor = Color.White,
+            };
+            group.Show();
+
+            var x = new Label(group)
+            {
+                Text = "X",
+            };
+            x.Show();
+
+            var y = new Label(group)
+            {
+                Text = "Y",
+            };
+            y.Show();
+
+            var z = new Label(group)
+            {
+                Text = "Z",
+            };
+            z.Show();
+            group.PackEnd(x);
+            group.PackEnd(y);
+            group.PackEnd(z);
+
+            var top = new Rectangle(box)
+            {
+                Color = Color.Red,
+            };
+            top.SetAlignment(-1.0, -1.0);  // fill
+            top.SetWeight(1.0, 1.0);  // expand
+            top.Show();
+
+            var bottom = new Rectangle(box)
+            {
+                Color = Color.Green,
+            };
+            bottom.SetAlignment(-1.0, -1.0);  // fill
+            bottom.SetWeight(1.0, 1.0);  // expand
+            bottom.Show();
+
+            double angle = 0.0;
+
+            var reset = new Button(box)
+            {
+                Text = "Reset",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 6)
+            };
+            reset.Show();
+
+            reset.Clicked += (object sender, EventArgs e) =>
+            {
+                group.IsMapEnabled = false;
+                x.IsMapEnabled = false;
+                angle = 0.0;
+            };
+
+            var zoom = new Button(box)
+            {
+                Text = "Zoom group",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height / 6, square.Width, square.Height / 6)
+            };
+            zoom.Show();
+
+            zoom.Clicked += (object sender, EventArgs e) =>
+            {
+                var map = new EvasMap(4);
+                var g = group.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Zoom(3.0, 3.0, g.X + g.Width / 2, g.Y + g.Height / 2);
+                group.EvasMap = map;
+                group.IsMapEnabled = true;
+            };
+
+            var rotate = new Button(box)
+            {
+                Text = "Rotate X",
+                Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height * 2 / 6, square.Width, square.Height / 6)
+            };
+            rotate.Show();
+
+            rotate.Clicked += (object sender, EventArgs e) =>
+            {
+                angle += 5.0;
+
+                var map = new EvasMap(4);
+                var g = x.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+                x.EvasMap = map;
+                x.IsMapEnabled = true;
+            };
+
+            box.PackEnd(top);
+            box.PackEnd(group);
+            box.PackEnd(bottom);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/FocusTest1.cs b/test/ElmSharp.Test/TC/Wearable/FocusTest1.cs
new file mode 100644 (file)
index 0000000..8db7411
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class FocusTest1 : WearableTestCase
+    {
+        public override string TestName => "FocusTest1";
+        public override string TestDescription => "To test basic operation of Focus";
+
+        string[] btn_names = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i" };
+        string previous;
+
+        Button current;
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            Button[] btns = new Button[9];
+
+            Size btnSize = new Size(square.Width / 3 - 2, square.Height / 4 - 2);
+            for (int i=0; i<3; i++)
+            {
+                for (int j=0; j<3; j++)
+                {
+                    btns[i*3+j] = new Button(window) { Text = btn_names[i * 3 + j] };
+                    int x = i * btnSize.Width + i * 2;
+                    int y = j * btnSize.Height + j*2;
+                    btns[i*3+j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height);
+
+                    btns[i * 3 + j].Focused += Button_Focused;
+                    btns[i * 3 + j].Unfocused += Button_Unfocused;
+                    btns[i * 3 + j].Show();
+                }
+            }
+
+            for (int i = 0; i < 3; i++)
+            {
+                for (int j=0; j<3; j++)
+                {
+                    if (j > 0)
+                    {
+                        btns[i * 3 + j].SetNextFocusObject(btns[i * 3 + (j - 1)], FocusDirection.Up);
+                    }
+                    if (i > 0)
+                    {
+                        btns[i * 3 + j].SetNextFocusObject(btns[(i - 1) * 3 + j], FocusDirection.Left);
+                    }
+                    if (j < 2)
+                    {
+                        btns[i * 3 + j].SetNextFocusObject(btns[i * 3 + (j + 1)], FocusDirection.Down);
+                    }
+                    if (i < 2)
+                    {
+                        btns[i * 3 + j].SetNextFocusObject(btns[(i + 1) * 3 + j], FocusDirection.Right);
+                    }
+                }
+            }
+
+            Size arrowSize = new Size(square.Width / 4, square.Height / 4);
+
+            Button left= new Button(window) { Text = "&lt;", Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) };
+            Button right = new Button(window) { Text = ">", Geometry = new Rect(square.X + arrowSize.Width, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) };
+            Button up = new Button(window) { Text = "^", Geometry = new Rect(square.X + arrowSize.Width*2, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) };
+            Button down = new Button(window) { Text = "v", Geometry = new Rect(square.X + arrowSize.Width*3, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) };
+
+            current = btns[0];
+            previous = current.Text;
+
+            current.Text = "X";
+
+            left.Clicked += (s, e) => current.FocusNext(FocusDirection.Left);
+            right.Clicked += (s, e) => current.FocusNext(FocusDirection.Right);
+            up.Clicked += (s, e) => current.FocusNext(FocusDirection.Up);
+            down.Clicked += (s, e) => current.FocusNext(FocusDirection.Down);
+
+            left.AllowFocus(false);
+            right.AllowFocus(false);
+            up.AllowFocus(false);
+            down.AllowFocus(false);
+
+            left.Show();
+            right.Show();
+            up.Show();
+            down.Show();
+        }
+
+        void Button_Focused(object sender, EventArgs e)
+        {
+            var btn = sender as Button;
+            if (btn != null)
+            {
+                btn.BackgroundColor = Color.Red;
+                current = btn;
+                previous = btn.Text;
+                btn.Text = "X";
+            }
+        }
+
+        void Button_Unfocused(object sender, EventArgs e)
+        {
+            var btn = sender as Button;
+            if (btn != null)
+            {
+                btn.BackgroundColor = Color.Default;
+                current = btn;
+                btn.Text = previous;
+                previous = "";
+            }
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs b/test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs
new file mode 100644 (file)
index 0000000..b59b85d
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class GenGridTest1 : WearableTestCase
+    {
+        public override string TestName => "GenGridTest1";
+        public override string TestDescription => "To test basic operation of GenGrid";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenGrid grid = new GenGrid(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ItemAlignmentX = -1,
+                ItemAlignmentY = -1,
+                ItemWidth = window.ScreenSize.Width / 3,
+                ItemHeight = window.ScreenSize.Width / 3,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    Console.WriteLine("{0} part create requested", part);
+                    if (part == "elm.swallow.icon")
+                    {
+                        var colorbox = new Rectangle(window)
+                        {
+                            Color = item
+                        };
+                        return colorbox;
+                    }
+                    return null;
+                }
+            };
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                var griditem = grid.Append(defaultClass, color);
+                griditem.SetTooltipText("AAAAAA");
+                //griditem.TooltipStyle = "transparent";
+
+                griditem.TooltipContentDelegate = () => { return new Button(window); };
+
+            }
+
+            grid.Show();
+            grid.Geometry = window.GetInnerSquare();
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs b/test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs
new file mode 100644 (file)
index 0000000..3d5b5ce
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class GenGridTest2 : WearableTestCase
+    {
+        public override string TestName => "GenGridTest2";
+        public override string TestDescription => "To test basic operation of GenGrid";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenGrid grid = new GenGrid(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ItemAlignmentX = -1,
+                ItemAlignmentY = -1,
+                ItemWidth = window.ScreenSize.Width / 3,
+                ItemHeight = window.ScreenSize.Width / 3,
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Color item = (Color)obj;
+                    if (part == "elm.swallow.icon")
+                    {
+                        var colorbox = new Rectangle(window)
+                        {
+                            Color = item
+                        };
+                        return colorbox;
+                    }
+                    return null;
+                }
+
+            };
+
+            GenGridItem firstitem = null;
+            GenGridItem lastitem = null;
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                var item = grid.Append(defaultClass, color);
+                if (i == 0)
+                    firstitem = item;
+                if (i == 101)
+                    lastitem = item;
+            }
+            grid.Show();
+            var square = window.GetInnerSquare();
+            grid.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3/ 4);
+
+            Button first = new Button(window)
+            {
+                Text = "First",
+                BackgroundColor = Color.Red
+            };
+            Button last = new Button(window)
+            {
+                Text = "Last",
+                BackgroundColor = Color.Blue
+            };
+            first.Clicked += (s, e) =>
+            {
+                grid.ScrollTo(firstitem, ScrollToPosition.In, true);
+                Log.Debug(first.Text);
+            };
+            last.Clicked += (s, e) =>
+            {
+                grid.ScrollTo(lastitem, ScrollToPosition.In, true);
+                Log.Debug(last.Text);
+            };
+            first.Show();
+            last.Show();
+
+            first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height);
+            last.Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height);
+
+            grid.ItemActivated += Grid_ItemActivated;
+            grid.ItemSelected += Grid_ItemSelected;
+            grid.ItemUnselected += Grid_ItemUnselected;
+            grid.ItemRealized += Grid_ItemRealized;
+            grid.ItemUnrealized += Grid_ItemUnrealized;
+            grid.ItemPressed += Grid_ItemPressed;
+            grid.ItemReleased += Grid_ItemReleased;
+            grid.ItemLongPressed += Grid_ItemLongPressed;
+            grid.ItemDoubleClicked += Grid_ItemDoubleClicked;
+        }
+
+        private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemReleased(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemPressed(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemRealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemSelected(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B));
+        }
+
+        private void Grid_ItemActivated(object sender, GenGridItemEventArgs e)
+        {
+            Color color = (Color)e.Item.Data;
+            Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest1.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest1.cs
new file mode 100644 (file)
index 0000000..260fcd4
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest1 : WearableTestCase
+    {
+        public override string TestName => "GenListTest1";
+        public override string TestDescription => "To test basic operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            list.Geometry = window.GetInnerSquare();
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest10.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest10.cs
new file mode 100644 (file)
index 0000000..12f3c3f
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest10 : WearableTestCase
+    {
+        public override string TestName => "GenListTest10";
+        public override string TestDescription => "To test InsertBefore operation of GenList with full style";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        Text = obj.ToString(),
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    return btn;
+                }
+            };
+
+            GenItemClass headerClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        Text = obj.ToString(),
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    btn.Show();
+
+                    var label = new Label(window)
+                    {
+                        Text = "GenItem with full style"
+                    };
+                    label.Show();
+
+                    Box hBox = new Box(window)
+                    {
+                        AlignmentX = -1,
+                        AlignmentY = -1,
+                        WeightX = 1,
+                        WeightY = 1,
+                    };
+                    hBox.Show();
+                    hBox.PackEnd(btn);
+                    hBox.PackEnd(label);
+                    return hBox;
+                }
+
+            };
+
+            List<GenListItem> itemList = new List<GenListItem>();
+            GenListItem firstItem = null;
+
+            for (int i = 0; i < 5; i++)
+            {
+                GenListItem now = list.Append(defaultClass, string.Format("{0} Item", i));
+                itemList.Add(now);
+
+                if (firstItem == null)
+                {
+                    firstItem = now;
+                }
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+
+            Button first = new Button(window)
+            {
+                Text = "First",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button last = new Button(window)
+            {
+                Text = "last",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+
+            first.Clicked += (s, e) =>
+            {
+                firstItem = list.InsertBefore(headerClass, "Header", firstItem);
+            };
+            last.Clicked += (s, e) =>
+            {
+                list.Append(headerClass, "Footer");
+            };
+
+            first.Show();
+            last.Show();
+
+            var square = window.GetInnerSquare();
+            list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4);
+            first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height / 4);
+            last.Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height / 4);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest2.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest2.cs
new file mode 100644 (file)
index 0000000..9ed9229
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest2 : WearableTestCase
+    {
+        public override string TestName => "GenListTest2";
+        public override string TestDescription => "To test ScrollTo operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] items = new GenListItem[100];
+            int i = 0;
+            for (i = 0; i < 100; i++)
+            {
+                items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+
+            GenListItem scroll = items[0];
+
+            Button first = new Button(window)
+            {
+                Text = "F",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button last = new Button(window)
+            {
+                Text = "L",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button add = new Button(window)
+            {
+                Text = "A",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            add.Clicked += (s, e) =>
+            {
+                scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll);
+                list.ScrollTo(scroll, ScrollToPosition.In, false);
+            };
+            first.Clicked += (s, e) =>
+            {
+                list.ScrollTo(scroll, ScrollToPosition.In, true);
+            };
+            last.Clicked += (s, e) =>
+            {
+                list.ScrollTo(items[99], ScrollToPosition.In, true);
+            };
+            first.Show();
+            last.Show();
+            add.Show();
+
+            var square = window.GetInnerSquare();
+
+            list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4);
+            first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4);
+            last.Geometry = new Rect(square.X + square.Width / 3, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4);
+            add.Geometry = new Rect(square.X + square.Width * 2 / 3, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest3.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest3.cs
new file mode 100644 (file)
index 0000000..debec3d
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest3 : WearableTestCase
+    {
+        public override string TestName => "GenListTest3";
+        public override string TestDescription => "To test group operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass groupClass = new GenItemClass("group_index")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] groups = new GenListItem[10];
+
+            for (int i = 0; i < 10; i++)
+            {
+                groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group);
+            }
+
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                },
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} - {1}", (string)obj, part);
+                    return null;
+                }
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Console.WriteLine("{0} part create requested", part);
+                    var btn = new Button(window)
+                    {
+                        Text = "Button in List",
+                        AlignmentX = -1,
+                        WeightX = 1,
+                    };
+                    return btn;
+                }
+            };
+
+            for (int j = 0; j < 10; j++)
+            {
+                for (int i = 0; i < 20; i++)
+                {
+                    list.Append(j == 0 ? fullyCustomizeClass : defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+                }
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            list.Geometry = window.GetInnerSquare();
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest4.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest4.cs
new file mode 100644 (file)
index 0000000..dea63a4
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest4 : WearableTestCase
+    {
+        public override string TestName => "GenListTest4";
+        public override string TestDescription => "To test Append/Prepend/InsertBefore operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] items = new GenListItem[100];
+            for (int i = 0; i < 100; i++)
+            {
+                if (i < 30)
+                {
+                    items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+                }
+                else if (i < 60)
+                {
+                    items[i] = list.Prepend(defaultClass, string.Format("{0} Item", i));
+                }
+                else
+                {
+                    items[i] = list.InsertBefore(defaultClass, string.Format("{0} Item", i), items[50]);
+                }
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            conformant.SetContent(list);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest5.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest5.cs
new file mode 100644 (file)
index 0000000..91bddba
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class GenListTest5 : WearableTestCase
+    {
+        public override string TestName => "GenListTest5";
+        public override string TestDescription => "To test event operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected; ;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemUnselected += List_ItemUnselected;
+            list.ItemPressed += List_ItemPressed;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemReleased += List_ItemReleased;
+            list.ItemUnrealized += List_ItemUnrealized;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+
+            list.Geometry = window.GetInnerSquare();
+        }
+
+        private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was double clicked", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemLongPressed(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was Long pressed", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was unrealzed", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemReleased(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was released", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was Realized", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemPressed(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was Pressed", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemUnselected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was unselected", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemActivated(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was Activated", (string)(e.Item.Data)));
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was selected", (string)(e.Item.Data)));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest6.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest6.cs
new file mode 100644 (file)
index 0000000..d68bea7
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest6 : WearableTestCase
+    {
+        public override string TestName => "GenListTest6";
+        public override string TestDescription => "To test deletion of GenListItem";
+        GenListItem selected = null;
+
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                },
+                DeleteHandler = new GenItemClass.DeleteDelegate((obj) =>
+                {
+                    Log.Debug($"DeleteHandler was called with... {(string)obj}");
+                }),
+            };
+            GenListItem[] items = new GenListItem[100];
+            for (int i = 0; i < 100; i++)
+            {
+                items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemUnselected += List_ItemUnselected;
+            list.ItemPressed += List_ItemPressed;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemReleased += List_ItemReleased;
+            list.ItemUnrealized += List_ItemUnrealized;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+
+            var square = window.GetInnerSquare();
+
+            list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4);
+
+            Button first = new Button(window)
+            {
+                Text = "Delete",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            first.Clicked += (s, e) =>
+            {
+                selected?.Delete();
+            };
+            first.Show();
+            first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width, square.Height / 4);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            selected = e.Item;
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+        private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data));
+        }
+
+        private void List_ItemLongPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("!!!! Item was Unrealized!!!");
+            Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemReleased(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was released", (string)(e.Item.Data));
+        }
+
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data));
+        }
+
+        private void List_ItemPressed(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data));
+        }
+
+        private void List_ItemUnselected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data));
+        }
+
+        private void List_ItemActivated(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest7.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest7.cs
new file mode 100644 (file)
index 0000000..e0be283
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest7 : WearableTestCase
+    {
+        public override string TestName => "GenListTest7";
+        public override string TestDescription => "To test basic operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button button = new Button(window)
+            {
+                Text = "Remove",
+                AlignmentX = -1,
+                AlignmentY = -1,
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] itemArr = new GenListItem[9];
+            for (int i = 0; i < 9; i++)
+            {
+                itemArr[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+
+            int idx = 0;
+            button.Clicked += (s, e) =>
+            {
+                if (idx < 9)
+                {
+                    Console.WriteLine("GenListItem deleted");
+                    itemArr[idx++].Delete();
+                }
+            };
+            button.Show();
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+            list.ItemRealized += List_ItemRealized;
+            list.ItemUnrealized += List_ItemUnrealized;
+
+            var square = window.GetInnerSquare();
+            list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4);
+            button.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width, square.Height / 4);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+        private void List_ItemRealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was realized", (string)(e.Item.Data));
+        }
+        private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was unrealized", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest8.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest8.cs
new file mode 100644 (file)
index 0000000..3fe5575
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest8 : WearableTestCase
+    {
+
+        Dictionary<EvasObject, Button> _cacheMap = new Dictionary<EvasObject, Button>();
+        public override string TestName => "GenListTest8";
+        public override string TestDescription => "To test group operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                Color = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            bg.Show();
+            bg.Lower();
+
+            window.AddResizeObject(bg);
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Check check = new Check(window);
+            check.Show();
+            check.IsChecked = true;
+            check.Text = "Reuse?";
+
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Log.Debug(string.Format("{0} part create requested", part));
+                    var btn = new Button(window)
+                    {
+                        AlignmentX = -1,
+                        WeightX = 1,
+                        Text = (string)obj
+                    };
+                    return btn;
+                },
+                ReusableContentHandler = (object data, string part, EvasObject old) =>
+                {
+                    Log.Debug(string.Format("{0} part reuse requested", part));
+                    if (!check.IsChecked)
+                    {
+                        return null;
+                    }
+                    var btn = old as Button;
+                    btn.Text = (string)data;
+                    return old;
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(fullyCustomizeClass, string.Format("{0} Item", i), GenListItemType.Normal);
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+
+            var square = window.GetInnerSquare();
+
+            check.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 4);
+            list.Geometry = new Rect(square.X, square.Y + square.Height / 4, square.Width, square.Height * 3 / 4);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(string.Format("{0} Item was selected", (string)(e.Item.Data)));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest9.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest9.cs
new file mode 100644 (file)
index 0000000..7a038a2
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GenListTest9 : WearableTestCase
+    {
+
+        public class ItemContext
+        {
+            public object Data;
+            public GenListItem Item;
+            public EvasObject Realized;
+        }
+
+        Dictionary<EvasObject, Button> _cacheMap = new Dictionary<EvasObject, Button>();
+
+        Dictionary<ItemObject, EvasObject> _realizedMap = new Dictionary<ItemObject, EvasObject>();
+        public override string TestName => "GenListTest9";
+        public override string TestDescription => "To test FieldUpdate operation of GenList";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                Color = Color.Gray,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            bg.Show();
+            bg.Lower();
+
+            window.AddResizeObject(bg);
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass fullyCustomizeClass = new GenItemClass("full")
+            {
+                GetContentHandler = (obj, part) =>
+                {
+                    Log.Debug(string.Format("{0} part create requested", part));
+                    var btn = new Button(window)
+                    {
+                        AlignmentX = -1,
+                        WeightX = 1,
+                        Text = (string)(obj as ItemContext).Data
+                    };
+                    btn.MinimumHeight = 100;
+                    (obj as ItemContext).Realized = btn;
+                    (obj as ItemContext).Item?.UpdateField("elm.swallow.content", GenListItemFieldType.None);
+                    return btn;
+                },
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                var context = new ItemContext();
+                context.Data = string.Format("{0} Item", i);
+                context.Item = list.Append(fullyCustomizeClass, context, GenListItemType.Normal);
+            }
+
+            list.Show();
+            list.ItemSelected += List_ItemSelected;
+
+            list.Geometry = window.GetInnerSquare();
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            var itemContext = e.Item.Data as ItemContext;
+            Log.Debug(string.Format("{0} Item was selected", (string)(itemContext.Data)));
+            itemContext.Realized.MinimumHeight += 20;
+            e.Item.UpdateField("elm.swallow.content", GenListItemFieldType.None);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs b/test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs
new file mode 100644 (file)
index 0000000..0a02dbe
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class GestureLayerTest1 : WearableTestCase
+    {
+        public override string TestName => "GestureLayerTest1";
+        public override string TestDescription => "Demonstrate GestureLayer features: Tap, DoubleTap, Rotate, Zoom detection.";
+
+        private GestureLayer _glayer;
+        private Background _background;
+        private Rectangle _box1;
+
+        public override void Run(Window window)
+        {
+            _background = new Background(window);
+            var windowSize = window.ScreenSize;
+            _background.Color = Color.White;
+            _background.Resize(windowSize.Width, windowSize.Height);
+            _background.Show();
+
+            _box1 = new Rectangle(window)
+            {
+                Color = Color.Yellow
+            };
+            _box1.Geometry = window.GetInnerSquare();
+            _box1.Show();
+
+            Msg("Double tap to register additional gestures. Tripple tap to unregister them.");
+
+            _glayer = new GestureLayer(_box1);
+            _glayer.Attach(_box1);
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => {
+                Msg("Tap {0},{1}", info.X, info.Y);
+            });
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.DoubleTap, GestureLayer.GestureState.End, (info) => {
+                Msg("DoubleTap {0},{1} {2}", info.X, info.Y, info.FingersCount);
+                _glayer.SetLineCallback(GestureLayer.GestureState.End, (line) => {
+                    Msg("Line {0},{1}-{2},{3}, M:{4},{5}", line.X1, line.Y1, line.X2, line.Y2, line.HorizontalMomentum, line.VerticalMomentum);
+                });
+                _glayer.SetFlickCallback(GestureLayer.GestureState.End, (flick) => {
+                    Msg("Flick {0},{1}-{2},{3}, M:{4},{5}", flick.X1, flick.Y1, flick.X2, flick.Y2, flick.HorizontalMomentum, flick.VerticalMomentum);
+                });
+                _glayer.RotateStep = 3;
+                _glayer.SetRotateCallback(GestureLayer.GestureState.Move, (rotate) => {
+                    Msg("Rotation {0},{1} a:{2:F3} ba:{3:F3}", rotate.X, rotate.Y, rotate.Angle, rotate.BaseAngle);
+                });
+                _glayer.SetZoomCallback(GestureLayer.GestureState.End, (zoom) => {
+                    Msg("Zoom {0},{1} r:{2} z:{3:F3}", zoom.X, zoom.Y, zoom.Radius, zoom.Zoom);
+                });
+                Msg("Line, Flick, Rotate, and Zoom callbacks enabled.");
+            });
+
+            _glayer.SetTapCallback(GestureLayer.GestureType.TripleTap, GestureLayer.GestureState.End, (info) => {
+                Msg("TrippleTap {0},{1} {2}", info.X, info.Y, info.FingersCount);
+                _glayer.SetLineCallback(GestureLayer.GestureState.End, null);
+                _glayer.SetFlickCallback(GestureLayer.GestureState.End, null);
+                _glayer.SetRotateCallback(GestureLayer.GestureState.Move, null);
+                _glayer.SetZoomCallback(GestureLayer.GestureState.End, null);
+                Msg("Cleared Line, Flick, Rotate, and Zoom callbacks.");
+            });
+            // Momentum is not used, it seems that it conflicts with Rotate and Zoom
+        }
+
+        private void Msg(string format, params object[] args)
+        {
+            var entry = string.Format(format, args);
+            Log.Debug(entry);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/IconTest1.cs b/test/ElmSharp.Test/TC/Wearable/IconTest1.cs
new file mode 100644 (file)
index 0000000..215a07f
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class IconTest1 : WearableTestCase
+    {
+        public override string TestName => "IconTest1";
+        public override string TestDescription => "To test basic operation of Icon";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Gray
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window);
+            scroller.Show();
+            scroller.Geometry = window.GetInnerSquare();
+            Box box = new Box(window);
+            box.Show();
+            scroller.SetContent(box);
+
+            List<string> iconList = new List<string>{ "home", "close", "apps", "arrow_up", "arrow_down", "arrow_left", "arrow_right", "chat", "clock", "delete", "edit", "refresh", "folder", "file",
+                "menu/home", "menu/close", "menu/apps", "menu/arrow_up", "menu/arrow_down", "menu/arrow_left", "menu/arrow_right", "menu/chat", "menu/clock", "menu/delete", "menu/edit", "menu/refresh", "menu/folder",
+                "menu/file", "media_player/forward", "media_player/info", "media_player/next", "media_player/pause", "media_player/play", "media_player/prev", "media_player/rewind", "media_player/stop"};
+
+            foreach (var iconName in iconList)
+            {
+                Label label = new Label(window)
+                {
+                    Text = iconName,
+                };
+                Icon icon = new Icon(window)
+                {
+                    IconLookupOrder = IconLookupOrder.ThemeFirst,
+                    StandardIconName = iconName,
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    MinimumHeight = 100,
+                    MinimumWidth = 100,
+                };
+                icon.Show();
+                label.Show();
+                box.PackEnd(icon);
+                box.PackEnd(label);
+            }
+
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest1.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest1.cs
new file mode 100755 (executable)
index 0000000..b7c7c5a
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ImageTest1 : WearableTestCase
+    {
+        public override string TestName => "ImageTest1";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+        string[] btn_names = new string[] {"File1", "File2", "Uri", "Strm", "FileA1", "FileA2", "UriA", "StrmA"};
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Button[] btns = new Button[8];
+            Size btnSize = new Size(square.Width / 4 - 2, square.Height / 5 - 1);
+            for (int i = 0; i < 2; i++)
+            {
+                for (int j = 0; j < 4; j++)
+                {
+                    btns[i * 4 + j] = new Button(window)
+                    {
+                        Text = "<span color=#ffffff font_size=12>" + btn_names[i * 4 + j] + "</span>",
+                    };
+                    int x = j * btnSize.Width + j *2;
+                    int y = i * btnSize.Height + i;
+                    btns[i * 4 + j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height);
+                    btns[i * 4 + j].Show();
+                }
+            }
+
+            lbInfo = new Label(window)
+            {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+            lbInfo.Geometry = new Rect(square.X,  square.Y + square.Height, square.Width, 15);
+
+            image = new Image(window)
+            {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.Geometry = new Rect(square.X, square.Y + btnSize.Height * 2 + 2 , square.Width, btnSize.Height * 3);
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btns[0].Clicked += (s, e) => LoadFile("TED/large/a.jpg");
+            btns[1].Clicked += (s, e) => LoadFile("TED/large/b.jpg");
+            btns[2].Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btns[3].Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open));
+
+            btns[4].Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg");
+            btns[5].Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg");
+            btns[6].Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btns[7].Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open));
+        }
+
+        void LoadFile(string file)
+        {
+            bool ret = image.Load(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadUri(string uri)
+        {
+            bool ret = image.Load(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadStream(Stream stream)
+        {
+            bool ret = image.Load(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadFileAsync(string file)
+        {
+            var ret = await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadUriAsync(string uri)
+        {
+            var ret = await image.LoadAsync(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadStreamAsync(Stream stream)
+        {
+            var ret = await image.LoadAsync(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void UpdateLabelText(Label lable, string text)
+        {
+            lable.Text = "<span color=#ffffff font_size=12>" + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest2.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest2.cs
new file mode 100755 (executable)
index 0000000..4842c01
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ImageTest2 : WearableTestCase
+    {
+        public override string TestName => "ImageTest2";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+
+        string[] btn_names = new string[] { "Blue", "Default", "Aspect", "Rotate" };
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Button[] btns = new Button[4];
+            Size btnSize = new Size(square.Width / 4 - 2, square.Height / 4);
+            for (int i = 0; i < 4; i++)
+            {
+                btns[i] = new Button(window)
+                {
+                    Text = "<span color=#ffffff font_size=12>" + btn_names[i] + "</span>",
+                };
+                int x = i * btnSize.Width + i * 2;
+                btns[i].Geometry = new Rect(square.X + x, square.Y, btnSize.Width, btnSize.Height);
+                btns[i].Show();
+            }
+
+            lbInfo = new Label(window) {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+            lbInfo.Geometry = new Rect(square.X, square.Y + square.Height, square.Width, 15);
+
+            image = new Image(window) {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.Geometry = new Rect(square.X, square.Y + btnSize.Height, square.Width, btnSize.Height * 3);
+
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btns[0].Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btns[1].Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btns[2].Clicked += (s, e) => { image.IsFixedAspect = image.IsFixedAspect == true ? false : true; };
+            btns[3].Clicked += (s, e) => { image.Orientation = image.Orientation == ImageOrientation.None ? ImageOrientation.Rotate270 : ImageOrientation.None; };
+        }
+
+        void UpdateLabelText(string text)
+        {
+            lbInfo.Text = "<span color=#ffffff font_size=12> BackgroundColor => " + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest3.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest3.cs
new file mode 100755 (executable)
index 0000000..fa96a6e
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ImageTest3 : WearableTestCase
+    {
+        public override string TestName => "ImageTest3";
+        public override string TestDescription => "To test basic operation of Image";
+
+        Image image;
+        Label lbInfo;
+
+        string[] btn_names = new string[] { "Blue(BG)", "Default(BG)", "Blue(FG)", "Default(FG)" };
+
+        public override void Run(Window window)
+        {
+
+            Rect square = window.GetInnerSquare();
+
+            Button[] btns = new Button[4];
+            Size btnSize = new Size(square.Width / 2 , square.Height / 5);
+            for (int i = 0; i < 2; i++)
+            {
+                for (int j = 0; j < 2; j++)
+                {
+                    btns[i * 2 + j] = new Button(window)
+                    {
+                        Text = "<span color=#ffffff font_size=15>" + btn_names[i * 2 + j] + "</span>",
+
+                    };
+                    int x = j * btnSize.Width + j * 2;
+                    int y = i * btnSize.Height + i;
+                    btns[i * 2 + j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height);
+                    btns[i * 2 + j].Show();
+                }
+            }
+
+            lbInfo = new Label(window) {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+            lbInfo.Geometry = new Rect(square.X, square.Y + square.Height, square.Width, 15);
+
+            image = new Image(window) {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            image.Show();
+            image.Load(Path.Combine(TestRunner.ResourceDir, "btn_delete.png"));
+            image.Geometry = new Rect(square.X, square.Y + btnSize.Height * 2 + 2, square.Width, btnSize.Height * 3 );
+
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btns[0].Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btns[1].Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); };
+            btns[2].Clicked += (s, e) => { image.Color = Color.Blue; UpdateLabelText(image.Color.ToString(), false); };
+            btns[3].Clicked += (s, e) => { image.Color = Color.Default; UpdateLabelText(image.Color.ToString(), false); };
+
+        }
+
+        void UpdateLabelText(string text, bool isBackground = true)
+        {
+            if(isBackground)
+                lbInfo.Text = "<span color=#ffffff font_size=15> Background Color => " + text + "</span>";
+            else
+                lbInfo.Text = "<span color=#ffffff font_size=15> Foreground Color => " + text + "</span>";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest4.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest4.cs
new file mode 100755 (executable)
index 0000000..f44a391
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ImageTest4 : WearableTestCase
+    {
+        public override string TestName => "ImageTest4";
+        public override string TestDescription => "To test border operation of Image";
+
+        Image image;
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+            Log.Debug(square.ToString());
+
+            Button btnBorder = new Button(window)
+            {
+                Text = "Set : off",
+            };
+            btnBorder.Resize(square.Width / 2, square.Height / 4);
+            btnBorder.Move(square.X, square.Y);
+            btnBorder.Show();
+
+            Button btnBorderCenterFillMode = new Button(window)
+            {
+                Text = "FillMode",
+            };
+            btnBorderCenterFillMode.Resize(square.Width / 2, square.Height / 4);
+            btnBorderCenterFillMode.Move(square.X + square.Width / 2 , square.Y);
+            btnBorderCenterFillMode.Show();
+
+            image = new Image(window);
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.MinimumWidth = square.Width;
+            image.MinimumHeight = square.Height * 3 / 4;
+            image.Move(square.X, square.Y + square.Height / 4);
+            image.Resize(square.Width, square.Height * 3 / 4);
+            image.Show();
+
+
+            btnBorder.Clicked += (s, e) =>
+            {
+                int nX = square.Width / 6;
+                int nY = square.Height / 8;
+                Log.Debug("image.Width" + image.ObjectSize.Width.ToString());
+                Log.Debug("image.Height" + image.ObjectSize.Height.ToString());
+                Log.Debug("nX :" + nX + ", nY :" + nY);
+                image.SetBorder(nX, nX, nY, nY);
+                btnBorder.Text = "Border Set : on";
+            };
+
+            btnBorderCenterFillMode.Clicked += (s, e) =>
+            {
+                image.BorderCenterFillMode = ((ImageBorderFillMode)Enum.ToObject(typeof(ImageBorderFillMode), ((int)image.BorderCenterFillMode + 1) % Enum.GetValues(typeof(ImageBorderFillMode)).Length));
+                btnBorderCenterFillMode.Text = image.BorderCenterFillMode.ToString();
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/IndexTest1.cs b/test/ElmSharp.Test/TC/Wearable/IndexTest1.cs
new file mode 100755 (executable)
index 0000000..4199fcc
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    class IndexTest1 : WearableTestCase
+    {
+        Dictionary<IndexItem, GenListItem> _indexTable = new Dictionary<IndexItem, GenListItem>();
+        public override string TestName => "IndexTest1";
+        public override string TestDescription => "To test group operation of Index";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            GenList list = new GenList(window)
+            {
+                Homogeneous = false,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            list.Show();
+            Index index = new Index(window)
+            {
+                IsHorizontal = false,
+                AlignmentY = -1,
+                WeightY = 1,
+                MinimumWidth = 100,
+                AutoHide = false,
+                Style = "fastscroll"
+            };
+            index.Show();
+
+            GenItemClass groupClass = new GenItemClass("group_index")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            GenListItem[] groups = new GenListItem[10];
+
+            for (int i = 0; i < 10; i++)
+            {
+                groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group);
+                var indexitem = index.Append(string.Format("{0}", i));
+                indexitem.Selected += (s, e) =>
+                {
+                    Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text);
+                    list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true);
+                };
+                _indexTable[indexitem] = groups[i];
+            }
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}", (string)obj, part);
+                }
+            };
+
+            for (int j = 0; j < 10; j++)
+            {
+                for (int i = 0; i < 20; i++)
+                {
+                    list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+                }
+            }
+
+            list.ItemSelected += List_ItemSelected;
+            index.Update(0);
+            box.PackEnd(list);
+            box.PackEnd(index);
+            box.SetLayoutCallback(() =>
+            {
+                list.Geometry = box.Geometry;
+                index.Geometry = box.Geometry;
+            });
+            conformant.SetContent(box);
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/IndexTest2.cs b/test/ElmSharp.Test/TC/Wearable/IndexTest2.cs
new file mode 100755 (executable)
index 0000000..e6fcbb2
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class IndexTest2 : WearableTestCase
+    {
+        Dictionary<IndexItem, int> _indexTable = new Dictionary<IndexItem, int>();
+
+        public override string TestName => "IndexTest2";
+        public override string TestDescription => "To test basic operation of Index";
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            Index index = new Index(window)
+            {
+                IsHorizontal = true,
+                Style = "pagecontrol",
+                AlignmentX = -1,
+                WeightX = 1,
+                MinimumHeight = 100,
+            };
+            index.Show();
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+                var item = index.Append(string.Format("{0}", i));
+                item.Selected += (s, e) =>
+                {
+                    scroller.ScrollTo(_indexTable[(IndexItem)s], 0, true);
+                };
+                _indexTable[item] = i;
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1 : 0, scroller.VerticalPageIndex, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+            };
+            prev.Show();
+            next.Show();
+            buttonBox.PackEnd(prev);
+            buttonBox.PackEnd(next);
+            outterBox.PackEnd(buttonBox);
+            outterBox.PackEnd(index);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Log.Debug("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Log.Debug("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest1.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest1.cs
new file mode 100644 (file)
index 0000000..808e52f
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    class LabelTest1 : WearableTestCase
+    {
+        public override string TestName => "LabelTest1";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window);
+            label1.Color = Color.Black;
+            label1.Text = "Label Test!!!";
+
+            label1.Show();
+            int width = 200;
+            int height = 30;
+            label1.Resize(width, height);
+            label1.Move(window.ScreenSize.Width/2 - width/2, window.ScreenSize.Height/2 - height/2);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest2.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest2.cs
new file mode 100644 (file)
index 0000000..7f707a5
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    class LabelTest2 : WearableTestCase
+    {
+        public override string TestName => "LabelTest2";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window);
+            label1.Text = "[default valign=top] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'";
+            label1.Resize(650, 0);
+            var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label1.Show();
+            label1.Resize(size.Width, size.Height);
+            label1.Move(0, 0);
+
+            Label label2 = new Label(window);
+            label2.Move(0, size.Height + 10);
+            label2.Text = "[default valign=middle] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'";
+            label2.Resize(650, 0);
+            size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label2.Show();
+            label2.Resize(size.Width, size.Height);
+
+            Label label3 = new Label(window);
+            label3.Move(0, label2.Geometry.Y + size.Height + 10);
+            label3.Text = "[default valign=bottom] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
+            label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'";
+            label3.Resize(650, 0);
+            size = label3.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label3.Show();
+            label3.Resize(size.Width, size.Height);
+
+            Label label4 = new Label(window);
+            label4.Move(0, label3.Geometry.Y + size.Height + 10);
+            label4.Text = "<span color=#000000>[No TextStyle]</span>" +
+                "<span color=#000000 valign=bottom>[bottom gyp]</span>, " +
+                "<span color=#000000 valign=top>[top gyp]</span>, " +
+                "<span color=#000000 valign=middle>[middle gyp]</span>";
+            label4.Resize(650, 0);
+            size = label4.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label4.Show();
+            label4.Resize(size.Width, size.Height);
+
+            Label label5 = new Label(window);
+            label5.Move(0, label4.Geometry.Y + size.Height + 10);
+            label5.Text = "<span valign=top color=#000000 font_size=50>[top gyp]</span>";
+            label5.Resize(650, 0);
+            size = label5.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label5.Show();
+            label5.Resize(size.Width, size.Height);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest3.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest3.cs
new file mode 100644 (file)
index 0000000..666b996
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    public class LabelTest3 : WearableTestCase
+    {
+        public override string TestName => "LabelTest3";
+        public override string TestDescription => "To test basic operation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Show();
+            window.AddResizeObject(bg);
+
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window);
+            scroller.Show();
+            conformant.SetContent(scroller);
+            Box box = new Box(window);
+            box.SetLayoutCallback(() => { });
+            box.Show();
+            scroller.SetContent(box);
+
+            Size size;
+
+            Label label1 = new Label(window);
+            box.PackEnd(label1);
+            Label label2 = new Label(window);
+            box.PackEnd(label2);
+
+
+            label1.Text = "Jo Ann Buckner";
+            label1.TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'";
+            label1.Show();
+            label1.Resize(100000, 0);
+            size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label1.Geometry = new Rect(55, 213, size.Width, size.Height);
+
+            label2.Text = "Customer Success Engineer";
+            label2.TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'";
+            label2.Show();
+
+            label2.Resize(100000, 0);
+            size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
+            label2.Geometry = new Rect(55, 300, size.Width, size.Height);
+
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest4.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest4.cs
new file mode 100644 (file)
index 0000000..503b981
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    public class LabelTest4 : WearableTestCase
+    {
+        public override string TestName => "LabelTest4";
+        public override string TestDescription => "To test slide Animation of Label";
+
+        public override void Run(Window window)
+        {
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Label label1 = new Label(window)
+            {
+                Style = "slide_long",
+                SlideDuration = 3,
+                SlideMode = LabelSlideMode.Always,
+                Color = Color.Black,
+                Text = "Lab test12345678"
+            };
+
+            label1.Show();
+            int width = 200;
+            int height = 30;
+            label1.Resize(width, height);
+            label1.Move(window.ScreenSize.Width/2 - width/2, window.ScreenSize.Height/2 - height/2);
+            label1.PlaySlide();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest5.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest5.cs
new file mode 100644 (file)
index 0000000..432a5ff
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    public class LabelTest5 : WearableTestCase
+    {
+        public override string TestName => "LabelTest5";
+        public override string TestDescription => "To test Slide Animation Speed of Label";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Geometry = square;
+            bg.Show();
+
+            Rect pieces = square;
+            pieces.Height /= 4;
+
+            Label label1 = new Label(window)
+            {
+                Text = "Test Slide Animaiton",
+                Color = Color.Black,
+                Style = "slide_long",
+                SlideSpeed = 100,
+                SlideMode = LabelSlideMode.Always,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button btnCurrentSpeed = new Button(window)
+            {
+                Text = "Current Speed : 100",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            Button btnSpeedUp = new Button(window)
+            {
+                Text = "Speed + 10",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            btnSpeedUp.Clicked += (s, e) =>
+            {
+                label1.SlideSpeed += 10;
+                btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed);
+                label1.PlaySlide();
+            };
+            Button btnSpeedDown = new Button(window)
+            {
+                Text = "Speed - 10",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            btnSpeedDown.Clicked += (s, e) =>
+            {
+                label1.SlideSpeed -= 10;
+                btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed);
+                label1.PlaySlide();
+            };
+
+            label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height);
+            label1.Show();
+            label1.PlaySlide();
+
+            btnCurrentSpeed.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height);
+            btnCurrentSpeed.Show();
+
+            btnSpeedUp.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*2, pieces.Width, pieces.Height);
+            btnSpeedUp.Show();
+
+            btnSpeedDown.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*3, pieces.Width, pieces.Height);
+            btnSpeedDown.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs b/test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs
new file mode 100644 (file)
index 0000000..622d4c3
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    public class LabelValignTest1 : WearableTestCase
+    {
+        public override string TestName => "LabelValignTest1";
+        public override string TestDescription => "To test Vertical align of Label";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Background bg = new Background(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.White
+            };
+            bg.Geometry = square;
+            bg.Show();
+
+            Rect pieces = square;
+            pieces.Height /= 4;
+
+            Label label1 = new Label(window)
+            {
+                Text = "Align Test",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            label1.TextStyle = "DEFAULT = 'color=#000000FF font_size=30 align=center wrap=word'";
+            label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height);
+            label1.Show();
+
+            Button top = new Button(window)
+            {
+                Text = "Top",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            Button middle = new Button(window)
+            {
+                Text = "Middle",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+            Button bottom = new Button(window)
+            {
+                Text = "bottom",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+            };
+
+            top.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 0);
+            };
+
+            middle.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 0.5);
+            };
+
+            bottom.Clicked += (s, e) =>
+            {
+                label1.SetVerticalTextAlignment("elm.text", 1.0);
+            };
+
+            top.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height);
+            top.Show();
+
+            middle.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*2, pieces.Width, pieces.Height);
+            middle.Show();
+
+            bottom.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*3, pieces.Width, pieces.Height);
+            bottom.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ListTest1.cs b/test/ElmSharp.Test/TC/Wearable/ListTest1.cs
new file mode 100755 (executable)
index 0000000..fbcc536
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ListTest1 : WearableTestCase
+    {
+        public override string TestName => "ListTest1";
+        public override string TestDescription => "To test basic operation of List";
+        private int _count = 0;
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            List list = new List(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            _count = 0;
+
+            for (int i = 0; i < 5; i++)
+            {
+                list.Append(string.Format("{0} item", _count++));
+            }
+
+            list.ItemSelected += List_Selected;
+            list.ItemUnselected += List_Unselected;
+            list.ItemActivated += List_ItemActivated;
+            list.ItemDoubleClicked += List_ItemDoubleClicked;
+            list.ItemLongPressed += List_ItemLongPressed;
+            list.RenderPost += List_RenderPost;
+            list.Update();
+            list.Show();
+
+            box.PackEnd(list);
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button append = new Button(window)
+            {
+                Text = "Append",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            Button prepend = new Button(window)
+            {
+                Text = "Prepend",
+                AlignmentX = -1,
+                WeightX = 1,
+            };
+            append.Clicked += (s, e) =>
+            {
+                list.Append(string.Format("{0} item", _count++));
+                list.Update();
+            };
+            prepend.Clicked += (s, e) =>
+            {
+                list.Prepend(string.Format("{0} item", _count++));
+                list.Update();
+            };
+            append.Show();
+            prepend.Show();
+            buttonBox.PackEnd(append);
+            buttonBox.PackEnd(prepend);
+            box.PackEnd(buttonBox);
+        }
+
+        int count = 0;
+        private void List_RenderPost(object sender, EventArgs e)
+        {
+            Console.WriteLine("{0} List_RenderPost", count++);
+        }
+
+        private void List_ItemLongPressed(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was long pressed", e.Item.Text);
+        }
+
+        private void List_ItemDoubleClicked(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was Double clicked", e.Item.Text);
+        }
+
+        private void List_ItemActivated(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was Activated", e.Item.Text);
+        }
+
+        private void List_Unselected(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was unselected", e.Item.Text);
+        }
+
+        private void List_Selected(object sender, ListItemEventArgs e)
+        {
+            Console.WriteLine("{0} item was selected", e.Item.Text);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs
new file mode 100644 (file)
index 0000000..c11196c
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class NaviframeTest1 : WearableTestCase
+    {
+        public override string TestName => "NaviframeTest1";
+        public override string TestDescription => "Naviframe test";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true,
+                Geometry = square
+            };
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("naviframe was popped : " + e.Content.GetType());
+            };
+
+            Rectangle rect1 = new Rectangle(window)
+            {
+                Color = Color.Red,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height)
+            };
+
+            navi.Push(rect1, "First Page");
+
+            Rectangle rect2 = new Rectangle(window)
+            {
+                Color = Color.Blue,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height)
+            };
+
+            navi.Push(rect2, "Second Page");
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs
new file mode 100644 (file)
index 0000000..f4a7625
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class NaviframeTest2 : WearableTestCase
+    {
+        public override string TestName => "NaviframeTest2";
+        public override string TestDescription => "Naviframe test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+        Rect square;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            square = window.GetInnerSquare();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            navi.Push(CreatePage(window), "0 Page");
+
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Table table = new Table(parent);
+            table.Geometry = square;
+            table.Show();
+
+            Label label = new Label(parent) {
+                Text = string.Format("<span color=#000000 font_size=15>{0} Page</span>", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height/9)
+            };
+
+            Button push = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>Push</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X, square.Y + square.Height/9, square.Width/2, square.Height/9)
+            };
+
+            Button pop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>pop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X + square.Width/2, square.Y + square.Height/9, square.Width/2, square.Height/9)
+            };
+
+            Button insertBeforeTop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>insertBeforeTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X, square.Y + square.Height / 9*2, square.Width / 2, square.Height / 9)
+            };
+
+            Button insertAfterTop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>insertAfterTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height / 9*2, square.Width / 2, square.Height / 9)
+            };
+
+            Button removeTop = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>removeTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X, square.Y + square.Height / 9 * 3, square.Width, square.Height / 9)
+            };
+
+            Button barChange = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>TitleBarColor Change</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X, square.Y + square.Height / 9 * 4, square.Width / 2, square.Height / 9)
+            };
+
+            Button barColorDefault = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>TitleBarColor - Default</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+                Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height / 9 * 4, square.Width / 2, square.Height / 9)
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+            insertBeforeTop.Show();
+            insertAfterTop.Show();
+            removeTop.Show();
+            barChange.Show();
+            barColorDefault.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            insertBeforeTop.Clicked += (s, e) =>
+            {
+                _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+
+            insertAfterTop.Clicked += (s, e) =>
+            {
+                _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+            removeTop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer);
+                item.Delete();
+                Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer);
+            };
+
+            Random rand = new Random(DateTime.Now.Millisecond);
+            barChange.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next()));
+                }
+            };
+
+            barColorDefault.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default;
+                }
+            };
+
+            table.Pack(label, 0,0,1,1);
+            table.Pack(push,  0,1,1,1);
+            table.Pack(pop,   1,1,1,1);
+            table.Pack(insertBeforeTop, 0, 2, 1, 1);
+            table.Pack(insertAfterTop,  1, 2, 1, 1);
+            table.Pack(removeTop, 0, 3, 1, 1);
+            table.Pack(barChange, 0, 4, 1, 1);
+            table.Pack(barColorDefault, 1, 4, 1, 1);
+
+            return table;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs
new file mode 100644 (file)
index 0000000..0ba309f
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Linq;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class NaviframeTest3 : WearableTestCase
+    {
+        public override string TestName => "NaviframeTest3";
+        public override string TestDescription => "Naviframe test";
+
+        Naviframe _navi;
+        int _sequence = 0;
+        Rect square;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            square = window.GetInnerSquare();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true
+            };
+            _navi = navi;
+
+            navi.Popped += (s, e) =>
+            {
+                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
+            };
+
+            NaviItem item = navi.Push(CreatePage(window), "0 Page");
+            item.SetPartContent("title_left_btn", new Button(window) { Text = "LEFT" , Style = "naviframe/title_left"} );
+            item.SetPartContent("title_right_btn", new Button(window) { Text = "RIGHT", Style = "naviframe/title_right" });
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        EvasObject CreatePage(Window parent)
+        {
+            Table table = new Table(parent);
+            table.Geometry = square;
+            table.Show();
+
+            Label label = new Label(parent) {
+                Text = string.Format("<span color=#000000 font_size=15>{0} Page</span>", _sequence++),
+                WeightX = 1,
+                AlignmentX = -1,
+            };
+            Button push = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>Push</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+            Button pop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>pop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+            Button insertBeforeTop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>insertBeforeTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+            Button insertAfterTop = new Button(parent) {
+                Text = "<span color=#000000 font_size=15>insertAfterTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+
+            Button removeTop = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>removeTop</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+
+            Button barChange = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>TitleBarColor Change</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+
+            Button barColorDefault = new Button(parent)
+            {
+                Text = "<span color=#000000 font_size=15>TitleBarColor - Default</span>",
+                WeightX = 1,
+                AlignmentX = -1,
+                BackgroundColor = Color.Black,
+            };
+
+            label.Show();
+            push.Show();
+            pop.Show();
+            insertBeforeTop.Show();
+            insertAfterTop.Show();
+            removeTop.Show();
+            barChange.Show();
+            barColorDefault.Show();
+
+            push.Clicked += (s, e) =>
+            {
+                _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1));
+            };
+
+            pop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer);
+                _navi.Pop();
+                Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer);
+            };
+
+            insertBeforeTop.Clicked += (s, e) =>
+            {
+                _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+
+            insertAfterTop.Clicked += (s, e) =>
+            {
+                _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1));
+            };
+            removeTop.Clicked += (s, e) =>
+            {
+                var item = _navi.NavigationStack.LastOrDefault();
+                int nativePointer = (int)(IntPtr)(item.Content);
+                Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer);
+                item.Delete();
+                Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer);
+            };
+
+            Random rand = new Random(DateTime.Now.Millisecond);
+            barChange.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next()));
+                }
+            };
+
+            barColorDefault.Clicked += (s, e) =>
+            {
+                int currentIndex = _navi.NavigationStack.Count - 1;
+                if (currentIndex >= 0)
+                {
+                    _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default;
+                }
+            };
+
+            table.Pack(label, 0, 0, 1, 1);
+            table.Pack(push, 0, 1, 1, 1);
+            table.Pack(pop, 1, 1, 1, 1);
+            table.Pack(insertBeforeTop, 0, 2, 1, 1);
+            table.Pack(insertAfterTop, 1, 2, 1, 1);
+            table.Pack(removeTop, 0, 3, 1, 1);
+            table.Pack(barChange, 0, 4, 1, 1);
+            table.Pack(barColorDefault, 1, 4, 1, 1);
+
+            return table;
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/PanelTest1.cs b/test/ElmSharp.Test/TC/Wearable/PanelTest1.cs
new file mode 100644 (file)
index 0000000..5e5fac6
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using ElmSharp.Test.Wearable;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class PanelTest1 : WearableTestCase
+    {
+        public override string TestName => "PanelTest1";
+        public override string TestDescription => "To test basic operation of Panel";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            Label label = new Label(window) {
+                Text = "<span color=#ffffff font_size=26>Panel as NonScrollable</span>",
+                AlignmentX = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height/6)
+            };
+            label.Show();
+
+            Panel panel = new Panel(window) {
+                Direction = PanelDirection.Left,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y+ square.Height/6, square.Width, square.Height/5*2)
+            };
+            panel.SetScrollable(false);
+
+            Rectangle redbox = new Rectangle(window) {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+                Geometry = new Rect(square.X, square.Y + square.Height/6, square.Width/2, square.Height/5*2)
+            };
+            redbox.Show();
+            panel.SetContent(redbox);
+            panel.Show();
+            panel.IsOpen = true;
+
+            Button button1 = new Button(window) {
+                Text = "Toggle open",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height/6 + square.Height/5*2+5, square.Width, square.Height/5)
+            };
+            Button button2 = new Button(window) {
+                Text = "Toggle direction",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height/6 + square.Height/5*3+5, square.Width, square.Height/5)
+            };
+            button1.Show();
+            button2.Show();
+
+            button1.Clicked += (s, e) =>
+            {
+                panel.Toggle();
+            };
+            button2.Clicked += (s, e) =>
+            {
+                panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4);
+            };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/PanelTest2.cs b/test/ElmSharp.Test/TC/Wearable/PanelTest2.cs
new file mode 100644 (file)
index 0000000..2198ffe
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class PanelTest2 : WearableTestCase
+    {
+        public override string TestName => "PanelTest2";
+        public override string TestDescription => "To test basic operation of Panel";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+
+            Label label = new Label(window)
+            {
+                Text = "<span color=#ffffff font_size=26>Panel as Scrollable</span>",
+                AlignmentX = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 6)
+            };
+            label.Show();
+
+            Panel panel = new Panel(window)
+            {
+                Direction = PanelDirection.Left,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height / 6, square.Width, square.Height / 5 * 2)
+            };
+            panel.SetScrollable(true);
+            panel.SetScrollableArea(1.0);
+
+            Rectangle redbox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+                Geometry = new Rect(square.X, square.Y + square.Height / 6, square.Width / 2, square.Height / 5 * 2)
+            };
+            redbox.Show();
+            panel.SetContent(redbox);
+            panel.Show();
+            panel.IsOpen = true;
+
+            Button button1 = new Button(window)
+            {
+                Text = "Toggle open",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height / 6 + square.Height / 5 * 2 + 5, square.Width, square.Height / 5)
+            };
+            Button button2 = new Button(window)
+            {
+                Text = "Toggle direction",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height / 6 + square.Height / 5 * 3 + 5, square.Width, square.Height / 5)
+            };
+            button1.Show();
+            button2.Show();
+
+            button1.Clicked += (s, e) =>
+            {
+                panel.Toggle();
+            };
+            button2.Clicked += (s, e) =>
+            {
+                panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4);
+            };
+            panel.Toggled += (s, e) =>
+            {
+                Console.WriteLine("Panel Toggled!");
+            };
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/PanesTest1.cs b/test/ElmSharp.Test/TC/Wearable/PanesTest1.cs
new file mode 100644 (file)
index 0000000..1e4463b
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class PanesTest1 : WearableTestCase
+    {
+        public override string TestName => "PanesTest1";
+        public override string TestDescription => "To test basic operation of Panes";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Rectangle redBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Red,
+            };
+            redBox.Show();
+            Rectangle blueBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Blue,
+            };
+            Rectangle greenBox = new Rectangle(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Color = Color.Green,
+            };
+            Panes subPanes = new Panes(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Proportion = 0.3,
+                IsHorizontal = false
+            };
+            subPanes.Show();
+            subPanes.SetPartContent("left", blueBox);
+            subPanes.SetPartContent("right", greenBox);
+            Panes panes = new Panes(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Proportion = 0.1,
+                IsFixed = true,
+                IsHorizontal = true,
+            };
+            panes.SetPartContent("left", redBox);
+            panes.SetPartContent("right", subPanes);
+            panes.Show();
+            box.PackEnd(panes);
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs b/test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs
new file mode 100644 (file)
index 0000000..3347aa9
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class PerformanceTest : WearableTestCase
+    {
+        public override string TestName => "PerformanceTest";
+        public override string TestDescription => "To test Performance of GenList";
+
+        const int TestItemMax = 2000;
+        const double TimeSet = 5.0;
+
+        string[] arrLabel = {
+            "Time Warner Cable(Cable)",
+            "ComCast (Cable)",
+            "Dish (Satellite)",
+            "DirecTV (Satellite)",
+            "Tata Sky (Satellite)",
+            "Nextra Cable(Cable)",
+            "DD Plus (Cable)",
+            "Tikona Cable(Cable)",
+            "True Provider (Cable)",
+            "Vodafone (Satellite)",
+            "Sample Text"
+        };
+
+        GenList list;
+        Box box;
+        Box box2;
+        GenListItem ItemTarget = null;
+        double _enteringSpeed = 0;
+        int _frameCount = 0;
+        int _ecoreCount = 0;
+        double _frameSet = 0;
+        IntPtr _anim = IntPtr.Zero;
+        double FrameFPS = 0;
+        double AnimatorFPS = 0;
+        Rect square;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            square = window.GetInnerSquare();
+
+            Naviframe navi = new Naviframe(window)
+            {
+                PreserveContentOnPop = true,
+                DefaultBackButtonEnabled = true,
+                Geometry = square
+            };
+
+            box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height)
+            };
+            box.Show();
+
+            box2 = new Box(box);
+            box2.Geometry = new Rect(square.X, square.Y + square.Height/6, square.Width, square.Height/2);
+            box2.Show();
+            box.PackEnd(box2);
+
+            list = new GenList(window)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Style = "solid/default"
+            };
+            box.PackEnd(list);
+            navi.Push(box, "Performance");
+
+            InitializeListItem();
+
+            list.Changed += List_Changed;
+            list.ScrollAnimationStarted += List_ScrollAnimationStarted;
+            list.ScrollAnimationStopped += List_ScrollAnimationStopped;
+            list.Show();
+
+            navi.Show();
+            conformant.SetContent(navi);
+        }
+
+        private void InitializeListItem()
+        {
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return (string)obj;
+                }
+            };
+
+            for (int i = 0; i < TestItemMax; ++i)
+            {
+                if (i == 999)
+                    ItemTarget = list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray()));
+                else
+                    list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray()));
+            }
+        }
+
+        private void List_ScrollAnimationStopped(object sender, EventArgs e)
+        {
+            list.RenderPost -= List_RenderPostFrame;
+            list.ScrollAnimationStarted -= List_ScrollAnimationStarted;
+            list.ScrollAnimationStopped -= List_ScrollAnimationStopped;
+
+            EcoreAnimator.RemoveAnimator(_anim);
+            Elementary.BringInScrollFriction = _frameSet;
+
+            FrameFPS = _frameCount / TimeSet;
+            AnimatorFPS = _ecoreCount / TimeSet;
+
+            Button btn1 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 3)
+            };
+            btn1.Text = string.Format("Entering Speed : {0:f1} msec", _enteringSpeed);
+            btn1.Show();
+
+            Button btn2 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y+ square.Height / 3, square.Width, square.Height / 3)
+            };
+            btn2.Text = string.Format("Animator FPS : {0:f1} fps", AnimatorFPS);
+            btn2.Show();
+
+            Button btn3 = new Button(box2)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Geometry = new Rect(square.X, square.Y + square.Height / 3*2, square.Width, square.Height / 3)
+            };
+            btn3.Text = string.Format("Evas FPS : {0:f1} fps", FrameFPS);
+            btn3.Show();
+        }
+
+        private void List_RenderPost(object sender, EventArgs e)
+        {
+            list.RenderPost -= List_RenderPost;
+            _enteringSpeed = (EcoreAnimator.GetCurrentTime() - _enteringSpeed) * 1000;
+
+            _frameSet = Elementary.BringInScrollFriction;
+            Elementary.BringInScrollFriction = TimeSet;
+            list.ScrollTo(ItemTarget, ScrollToPosition.In, true);
+        }
+
+        private void List_ScrollAnimationStarted(object sender, EventArgs e)
+        {
+            _ecoreCount = 0;
+            _anim = EcoreAnimator.AddAnimator(OnEcoreCheck);
+            list.RenderPost += List_RenderPostFrame;
+        }
+
+        private bool OnEcoreCheck()
+        {
+            _ecoreCount++;
+            return true;
+        }
+
+        private void List_RenderPostFrame(object sender, EventArgs e)
+        {
+            _frameCount++;
+        }
+
+        private void List_Changed(object sender, EventArgs e)
+        {
+            _enteringSpeed = EcoreAnimator.GetCurrentTime();
+            list.Changed -= List_Changed;
+            list.RenderPost += List_RenderPost;
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs b/test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs
new file mode 100644 (file)
index 0000000..7f6a4e0
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class PolygonTest1 : WearableTestCase
+    {
+        public override string TestName => "PolygonTest1";
+        public override string TestDescription => "To test basic operation of Polygon";
+
+        public override void Run(Window window)
+        {
+            var square = window.GetInnerSquare();
+            Background bg = new Background(window);
+            bg.Color = Color.White;
+            bg.Move(0, 0);
+            bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            bg.Show();
+
+            Polygon triangle1 = new Polygon(window);
+            triangle1.Color = Color.Blue;
+            triangle1.AddPoint(square.X, square.Y + square.Height/6);
+            triangle1.AddPoint(square.X, square.Y + square.Height/3);
+            triangle1.AddPoint(square.X + square.Width/2, square.Y + square.Height/5);
+            triangle1.Show();
+
+            Polygon triange2 = new Polygon(window);
+            triange2.AddPoint(square.X + square.Width/2, square.Y + square.Height/5);
+            triange2.AddPoint(new Point{X= square.X + square.Width, Y= square.Y + square.Height/5 });
+            triange2.AddPoint(new Point{X= square.X + square.Width, Y= square.Y + square.Height/3 });
+            triange2.Color = Color.Green;
+            triange2.Show();
+
+            Polygon hexagon = new Polygon(window);
+            hexagon.Color = Color.Pink;
+            hexagon.AddPoint(square.X, square.Y);
+            hexagon.AddPoint(square.X + square.Width, square.Y);
+            hexagon.ClearPoints();
+            for (double a=0; a < 2 * Math.PI; a += Math.PI / 3)
+            {
+                hexagon.AddPoint(
+                    square.X + square.Width/2 + (int)(120 * Math.Sin(a)),
+                    square.Y + square.Height/2+square.Height/6 + (int)(120 * Math.Cos(a))
+                );
+            }
+            hexagon.Show();
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/PopupTest1.cs b/test/ElmSharp.Test/TC/Wearable/PopupTest1.cs
new file mode 100644 (file)
index 0000000..75080ea
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class PopupTest1 : WearableTestCase
+    {
+        public override string TestName => "PopupTest1";
+        public override string TestDescription => "To test basic operation of Popup";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Show();
+            Button btn = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Open"
+            };
+            btn.Show();
+
+            Popup popup = new Popup(window)
+            {
+                Orientation = PopupOrientation.Bottom,
+                Timeout = 5,
+            };
+
+            popup.Dismissed += (s, e) =>
+            {
+                Console.WriteLine("Popup dismissed");
+            };
+
+            popup.ShowAnimationFinished += (s, e) =>
+            {
+                Console.WriteLine("Popup show animation finished");
+            };
+
+            popup.OutsideClicked += (s, e) =>
+            {
+                Console.WriteLine("Popup outside clicked");
+            };
+
+            popup.TimedOut += (s, e) =>
+            {
+                Console.WriteLine("Popup time out");
+            };
+
+            popup.Append("Label1");
+            popup.Append("Label2");
+            popup.Append("Label3");
+
+            popup.BackButtonPressed += (s, e) =>
+            {
+                Console.WriteLine("!!! BackButtonPressed Event on Popup!!");
+                popup.Hide();
+            };
+
+            btn.Clicked += (s, e) =>
+            {
+                popup.Show();
+            };
+
+            Button close = new Button(popup)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Close"
+            };
+            popup.SetPartContent("button1", close);
+
+            close.Clicked += (s, e) =>
+            {
+                popup.Hide();
+            };
+
+            box.PackEnd(btn);
+            conformant.SetContent(box);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs b/test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs
new file mode 100755 (executable)
index 0000000..1a4184e
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp.Test.Wearable
+{
+    class ProgressBarTest1 : WearableTestCase
+    {
+        public override string TestName => "ProgressBarTest1";
+        public override string TestDescription => "To test basic operation of ProgressBar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window);
+            conformant.SetContent(table);
+            table.Show();
+
+            ProgressBar pb1 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                UnitFormat = "%.0f %%",
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Label lb2 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt1 = new Button(window)
+            {
+                Text = "Increase Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt2 = new Button(window)
+            {
+                Text = "Decrease Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt3 = new Button(window)
+            {
+                Text = "Increase PartValue",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Button bt4 = new Button(window)
+            {
+                Text = "Decrease PartValue",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            string part = "elm.cur.progressbar";
+            double unit = 0.1;
+            double max = 1.0;
+            double min = 0;
+
+            pb1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", pb1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+                lb2.Text = string.Format("PartValue Changed: {0}", pb1.GetPartValue(part));
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            bt1.Clicked += (s, e) =>
+            {
+                var val = pb1.Value + unit;
+                if (val <= max)
+                    pb1.Value = val;
+            };
+
+            bt2.Clicked += (s, e) =>
+            {
+                var val = pb1.Value - unit;
+                if (val >= min)
+                {
+                    pb1.Value = val;
+                }
+            };
+
+            bt3.Clicked += (s, e) =>
+            {
+                var val = pb1.GetPartValue(part) + unit;
+                if (val <= max)
+                    pb1.SetPartValue(part, val);
+            };
+
+            bt4.Clicked += (s, e) =>
+            {
+                var val = pb1.GetPartValue(part) - unit;
+                if (val >= min)
+                {
+                    pb1.SetPartValue(part, val);
+                }
+            };
+
+            table.Pack(bt1, 1, 1, 1, 1);
+            table.Pack(bt2, 2, 1, 1, 1);
+            table.Pack(pb1, 1, 2, 2, 1);
+            table.Pack(lb1, 1, 3, 2, 1);
+            table.Pack(lb2, 1, 4, 2, 1);
+            table.Pack(bt3, 1, 5, 1, 1);
+            table.Pack(bt4, 2, 5, 1, 1);
+
+            pb1.Show();
+            lb1.Show();
+            lb2.Show();
+            bt1.Show();
+            bt2.Show();
+            bt3.Show();
+            bt4.Show();
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs b/test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs
new file mode 100755 (executable)
index 0000000..c91cb09
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    class ProgressBarTest2 : WearableTestCase
+    {
+        public override string TestName => "ProgressBarTest2";
+        public override string TestDescription => "To test basic operation of ProgressBar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.None,
+            };
+            scroller.Show();
+            conformant.SetContent(scroller);
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            ProgressBar pb1 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                Style = "process",
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            pb1.PlayPulse();
+            pb1.Show();
+
+            ProgressBar pb2 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                Style = "process/small",
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            pb2.PlayPulse();
+            pb2.Show();
+
+            box.PackEnd(pb1);
+            box.PackEnd(pb2);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/RadioTest1.cs b/test/ElmSharp.Test/TC/Wearable/RadioTest1.cs
new file mode 100755 (executable)
index 0000000..abdec2b
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test.Wearable
+{
+    class RadioTest1 : WearableTestCase
+    {
+        public override string TestName => "RadioTest1";
+        public override string TestDescription => "To test basic operation of Radio";
+
+        Label _lb1;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Radio rd1 = new Radio(window)
+            {
+                StateValue = 1,
+                Text = "<span color=#ffffff>Value #1</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Radio rd2 = new Radio(window)
+            {
+                StateValue = 2,
+                Text = "<span color=#ffffff>Value #2</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            Radio rd3 = new Radio(window)
+            {
+                StateValue = 3,
+                Text = "<span color=#ffffff>Value #3</span>",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+            rd2.SetGroup(rd1);
+            rd3.SetGroup(rd2);
+
+            rd1.ValueChanged += OnRadioValueChanged;
+            rd2.ValueChanged += OnRadioValueChanged;
+            rd3.ValueChanged += OnRadioValueChanged;
+
+            _lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            box.PackEnd(_lb1);
+            box.PackEnd(rd1);
+            box.PackEnd(rd2);
+            box.PackEnd(rd3);
+
+            _lb1.Show();
+            rd1.Show();
+            rd2.Show();
+            rd3.Show();
+        }
+
+        void OnRadioValueChanged(object sender, EventArgs e)
+        {
+            _lb1.Text = string.Format("Value Changed: {0}", ((Radio)sender).GroupValue);
+            _lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs b/test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs
new file mode 100755 (executable)
index 0000000..a0696a5
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class RectangleTest1 : WearableTestCase
+    {
+        public override string TestName => "RectangleTest1";
+        public override string TestDescription => "Add one Red Rectangle and one Orange Rectangle";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+            Rectangle box1 = new Rectangle(window)
+            {
+                Color = Color.Red
+            };
+            box1.Show();
+            box1.Resize(square.Width / 2, square.Height / 2);
+            box1.Move(square.X, square.Y);
+            Rectangle box2 = new Rectangle(window)
+            {
+                Color = Color.Orange
+            };
+            box2.Show();
+            box2.Resize(square.Width / 2, square.Height / 2);
+            box2.Move(square.X + square.Width / 2, square.Y + square.Height / 2);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs b/test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs
new file mode 100755 (executable)
index 0000000..92ac97c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ScreenInformationTest : WearableTestCase
+    {
+        public override string TestName => "ScreenInformationTest";
+        public override string TestDescription => "To get screen information";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            box.Show();
+            conformant.SetContent(box);
+            Label label = new Label(window);
+            label.SetAlignment(-1, 0);
+            label.SetWeight(1, 0);
+            label.Text = string.Format("<span color=#FFFFFF , font_size=30>ScreenSize : {0}x{1}", window.ScreenSize.Width, window.ScreenSize.Height);
+            label.Show();
+            box.PackEnd(label);
+            Label label2 = new Label(window);
+            label2.SetAlignment(-1, 0);
+            label2.SetWeight(1, 0);
+            label2.Text = string.Format("<span color=#FFFFFF , font_size=30>ScreenDPI : xdpi : {0} ydpi : {1}", window.ScreenDpi.X, window.ScreenDpi.Y);
+            label2.Show();
+            box.PackEnd(label2);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs
new file mode 100755 (executable)
index 0000000..5d364ff
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ScrollerTest1 : WearableTestCase
+    {
+        public override string TestName => "ScrollerTest1";
+        public override string TestDescription => "To test basic operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.None,
+            };
+            scroller.Show();
+            conformant.SetContent(scroller);
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumHeight = 400,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+            }
+            scroller.Scrolled += Scroller_Scrolled;
+        }
+
+        private void Scroller_Scrolled(object sender, EventArgs e)
+        {
+            Console.WriteLine("Scrolled : {0}x{1}", ((Scroller)sender).CurrentRegion.X, ((Scroller)sender).CurrentRegion.Y);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs
new file mode 100755 (executable)
index 0000000..adf2b72
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ScrollerTest2 : WearableTestCase
+    {
+        public override string TestName => "ScrollerTest2";
+        public override string TestDescription => "To test basic operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 102; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+                box.PackEnd(colorBox);
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+            };
+            prev.Show();
+            next.Show();
+            buttonBox.PackEnd(prev);
+            buttonBox.PackEnd(next);
+            outterBox.PackEnd(buttonBox);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs
new file mode 100755 (executable)
index 0000000..5b403dd
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class ScrollerTest3 : WearableTestCase
+    {
+        public override string TestName => "ScrollerTest3";
+        public override string TestDescription => "To test ScrollTo operation of Scroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box outterBox = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            outterBox.Show();
+            Scroller scroller = new Scroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                ScrollBlock = ScrollBlock.Vertical,
+                HorizontalPageScrollLimit = 1,
+            };
+            scroller.SetPageSize(1.0, 1.0);
+            scroller.Show();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            scroller.SetContent(box);
+
+            for (int i = 0; i < 30; i++)
+            {
+                Label addlabel = new Label(window)
+                {
+                    Text = i + " Label Test",
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                };
+                addlabel.Show();
+                box.PackEnd(addlabel);
+            }
+
+            conformant.SetContent(outterBox);
+            outterBox.PackEnd(scroller);
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button prev = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "Prev"
+            };
+            Button next = new Button(window)
+            {
+                AlignmentX = -1,
+                WeightX = 1,
+                Text = "next"
+            };
+            prev.Clicked += (s, e) =>
+            {
+                Rect region = new Rect(0, 0, scroller.Geometry.Width, scroller.Geometry.Width);
+                Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width);
+                scroller.ScrollTo(region, true);
+            };
+            next.Clicked += (s, e) =>
+            {
+                Rect region = new Rect(0, scroller.Geometry.Height, scroller.Geometry.Width, scroller.Geometry.Height);
+                Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width);
+                scroller.ScrollTo(region, true);
+            };
+            prev.Show();
+            next.Show();
+            buttonBox.PackEnd(prev);
+            buttonBox.PackEnd(next);
+            outterBox.PackEnd(buttonBox);
+
+            scroller.DragStart += Scroller_DragStart;
+            scroller.DragStop += Scroller_DragStop;
+        }
+
+        private void Scroller_DragStop(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag stop");
+        }
+
+        private void Scroller_DragStart(object sender, EventArgs e)
+        {
+            Console.WriteLine("Drag start");
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/SliderTest1.cs b/test/ElmSharp.Test/TC/Wearable/SliderTest1.cs
new file mode 100755 (executable)
index 0000000..40342b1
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+namespace ElmSharp.Test.Wearable
+{
+    class SliderTest1 : WearableTestCase
+    {
+        public override string TestName => "SliderTest1";
+        public override string TestDescription => "To test basic operation of Slider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            Slider sld1 = new Slider(window)
+            {
+                Text = "Slider Test",
+                IndicatorFormat = "%1.2f meters",
+                Minimum = 0.0,
+                Maximum = 100.0,
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1,
+                IsIndicatorFocusable = true
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            Label lb2 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString()),
+            };
+
+            Label lb3 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString()),
+            };
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button btn = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "IsIndicatorFocusable"
+            };
+            btn.Clicked += (s, e) =>
+            {
+                if (sld1.IsIndicatorFocusable)
+                {
+                    sld1.IsIndicatorFocusable = false;
+                }
+                else
+                {
+                    sld1.IsIndicatorFocusable = true;
+                }
+                lb2.Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString());
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            Button btn2 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "IndicatorVisibleMode"
+            };
+            btn2.Clicked += (s, e) =>
+            {
+                if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always;
+                }
+                else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus;
+                }
+                else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus)
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None;
+                }
+                else
+                {
+                    sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default;
+                }
+
+                lb3.Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString());
+                lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            sld1.Show();
+            lb1.Show();
+            lb2.Show();
+            lb3.Show();
+            btn.Show();
+            btn2.Show();
+
+            buttonBox.PackEnd(btn);
+            buttonBox.PackEnd(btn2);
+
+            box.PackEnd(lb1);
+            box.PackEnd(lb2);
+            box.PackEnd(lb3);
+            box.PackEnd(sld1);
+            box.PackEnd(buttonBox);
+
+            lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+            sld1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", sld1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/SliderTest2.cs b/test/ElmSharp.Test/TC/Wearable/SliderTest2.cs
new file mode 100755 (executable)
index 0000000..fa9aca7
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+namespace ElmSharp.Test.Wearable
+{
+    class SliderTest2 : WearableTestCase
+    {
+        public override string TestName => "SliderTest2";
+        public override string TestDescription => "To test basic operation of Slider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = false,
+            };
+            box.Show();
+            conformant.SetContent(box);
+
+            Slider sld = new Slider(window)
+            {
+                Text = "Slider Test",
+                IndicatorFormat = "%1.2f meters",
+                Minimum = 0.0,
+                Maximum = 100.0,
+                Value = 0.1,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1,
+                IsIndicatorFocusable = true
+            };
+
+            Label Emptylb = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text="  "
+            };
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()),
+            };
+            lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+            Label lb2 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()),
+            };
+            lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+            Box buttonBox = new Box(window)
+            {
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox.Show();
+
+            Button btn1 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "IndicatorVisibleMode"
+            };
+            btn1.Clicked += (s, e) =>
+            {
+                sld.IndicatorVisibleMode = (SliderIndicatorVisibleMode)(((int)sld.IndicatorVisibleMode + 1) % 4);
+                lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            Button btn2 = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "IsIndicatorVisible"
+            };
+            btn2.Clicked += (s, e) =>
+            {
+                sld.IsIndicatorVisible = !sld.IsIndicatorVisible;
+                lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+
+            sld.Show();
+            Emptylb.Show();
+            lb1.Show();
+            lb2.Show();
+            btn1.Show();
+            btn2.Show();
+
+            buttonBox.PackEnd(btn1);
+            buttonBox.PackEnd(btn2);
+
+            box.PackEnd(Emptylb);
+            box.PackEnd(lb1);
+            box.PackEnd(lb2);
+            box.PackEnd(sld);
+            box.PackEnd(buttonBox);
+
+            sld.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+
+                lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
+                lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs b/test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs
new file mode 100755 (executable)
index 0000000..d2cf348
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    class SpinnerTest1 : WearableTestCase
+    {
+        public override string TestName => "SpinnerTest1";
+        public override string TestDescription => "To test basic operation of Spinner";
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+
+            Spinner spn1 = new Spinner(window)
+            {
+                Text = "Slider Test",
+                LabelFormat = "%1.2f Value",
+                Minimum = 1,
+                Maximum = 12,
+                Value = 1.5,
+                Step = 0.5,
+                Interval = 0.5,
+                AlignmentX = -1,
+                AlignmentY = 0.5,
+                WeightX = 1,
+                WeightY = 1
+            };
+            spn1.AddSpecialValue(5, "Five !!!!");
+
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            spn1.Geometry = new Rect(square.X, square.Y, square.Width , square.Height / 4);
+            spn1.Show();
+
+            lb1.Geometry = new Rect(square.X, square.Y + square.Width * 2 / 4 , square.Width, square.Height / 4);
+            lb1.Show();
+
+            spn1.ValueChanged += (s, e) =>
+            {
+                lb1.Text = string.Format("Value Changed: {0}", spn1.Value);
+                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/TableTest1.cs b/test/ElmSharp.Test/TC/Wearable/TableTest1.cs
new file mode 100644 (file)
index 0000000..ce31133
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    public class TableTest1 : WearableTestCase
+    {
+        public override string TestName => "TableTest1";
+        public override string TestDescription => "To test basic operation of Table";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Table table = new Table(window) {
+                PaddingX = 10,
+                PaddingY = 10
+            };
+           // table.BackgroundColor = Color.Orange;
+            conformant.SetContent(table);
+            table.Show();
+
+            Button button1 = new Button(window) {
+                Text = "Button (set Color.Oranage)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            button1.Clicked += (e,o) =>
+            {
+                table.BackgroundColor = Color.Orange;
+                Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+            };
+
+            Button button2 = new Button(window) {
+                Text = "Button 2 (set Color.Defalut)",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                BackgroundColor = new Color(50, 100, 200, 75)
+            };
+            button2.Clicked += (e, o) =>
+            {
+                table.BackgroundColor = Color.Default;
+                Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+            };
+
+            table.Pack(button1,0,0,3,3);
+            table.Pack(button2,3,1,1,1);
+
+            button1.Show();
+            button2.Show();
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/TC/Wearable/TransitTest.cs b/test/ElmSharp.Test/TC/Wearable/TransitTest.cs
new file mode 100755 (executable)
index 0000000..36d41f3
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test.Wearable
+{
+    class TransitTest : WearableTestCase
+    {
+        public override string TestName => "TransitTest";
+        public override string TestDescription => "To test basic operation of Transit";
+
+        Transit CreateTransit()
+        {
+            Transit transit = new Transit();
+            transit.Deleted += (s, e) => { Console.WriteLine("Transit Deleted"); };
+            transit.Repeat = 1;
+            transit.AutoReverse = true;
+            transit.Duration = 1;
+            return transit;
+        }
+
+        public override void Run(Window window)
+        {
+            Rect square = window.GetInnerSquare();
+            Button button1 = new Button(window) {
+                Text = "Effect",
+            };
+            button1.Move(square.X, square.Y);
+            button1.Resize(square.Width / 2, square.Height / 2);
+            button1.Show();
+
+            Button button2 = new Button(window)
+            {
+                Text = "Chain Effect",
+            };
+            button2.Move(square.X + square.Width / 2, square.Y + square.Height / 2);
+            button2.Resize(square.Width / 2, square.Height / 2);
+            button2.Show();
+
+            Point begin = new Point();
+            begin.X = begin.Y = 0;
+            Point end = new Point();
+            end.X = end.Y = square.Height / 2;
+            TranslationEffect translation = new TranslationEffect(begin, end);
+            translation.EffectEnded += (s, e) => { Console.WriteLine("Translation Effect Ended"); };
+
+            RotationEffect rotation = new RotationEffect(0, 180);
+            rotation.EffectEnded += (s, e) => { Console.WriteLine("Rotation Effect Ended"); };
+
+            button1.Clicked += (s, e) => {
+                Transit transit1 = CreateTransit();
+                transit1.Objects.Add(button1);
+                transit1.Objects.Add(button2);
+                transit1.AddEffect(translation);
+                transit1.AddEffect(rotation);
+                transit1.Go();
+            };
+
+            button2.Clicked += (s, e) => {
+                Transit transit1 = CreateTransit();
+                transit1.Objects.Add(button1);
+                transit1.AddEffect(translation);
+                transit1.AddEffect(rotation);
+
+                Transit transit2 = CreateTransit();
+                transit2.Objects.Add(button2);
+                transit2.AddEffect(translation);
+                transit2.AddEffect(rotation);
+
+                transit1.Chains.Add(transit2);
+                transit1.Go();
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs b/test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs
new file mode 100755 (executable)
index 0000000..2307fb5
--- /dev/null
@@ -0,0 +1,97 @@
+using Tizen.Applications;
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test.Wearable
+{
+    class WindowInternalTest : WearableTestCase
+    {
+        public override string TestName => "WindowInternalTest";
+        public override string TestDescription => "Window Test";
+
+        public override void Run(Window window)
+        {
+            var firstWindow = (Application.Current as TestRunner)?._firstPageWindow;
+            firstWindow.Hide();
+            firstWindow.Unrealize();
+
+            Rect square = window.GetInnerSquare();
+
+            Button button1 = new Button(window) {
+                Text = "Iconified",
+            };
+            button1.Resize(square.Width, square.Height / 3);
+            button1.Move(square.X, square.Y);
+            button1.Show();
+
+            button1.Clicked += (e, o) =>
+            {
+                window.Iconified = true;
+            };
+
+            Button button2 = new Button(window)
+            {
+                Text = "WinKeyGrab",
+            };
+            button2.Resize(square.Width, square.Height / 3);
+            button2.Move( square.X, square.Y + square.Height / 3);
+            button2.Show();
+
+            button2.Clicked += (e, o) =>
+            {
+                Log.Debug("@@KeyGrab");
+                window.KeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, true);
+                window.WinKeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, KeyGrabMode.Exclusive);
+            };
+
+            Button button3 = new Button(window)
+            {
+                Text = "WinUnKeyGrab",
+            };
+            button3.Resize(square.Width, square.Height / 3);
+            button3.Move(square.X, square.Y + square.Height * 2 / 3);
+            button3.Show();
+
+            button3.Clicked += (e, o) =>
+            {
+                Log.Debug("@@UnKeyGrab");
+                window.WinKeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+                window.KeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+
+            };
+            window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true);
+            EventHandler<EvasKeyEventArgs> handler = (s, e) =>
+            {
+                Log.Debug("@@KeyDown start" + e.KeyName);
+
+                if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
+                {
+                    Application.Current.Exit();
+                }
+                if (e.KeyName == EvasKeyEventArgs.PlatformHomeButtonName)
+                {
+                    Log.Debug("@@KeyDown OK : " + window.Iconified);
+                    window.Iconified = !window.Iconified;
+                }
+            };
+
+            window.KeyUp += handler;
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TC/WindowInternalTest.cs b/test/ElmSharp.Test/TC/WindowInternalTest.cs
new file mode 100644 (file)
index 0000000..c238b74
--- /dev/null
@@ -0,0 +1,97 @@
+using Tizen.Applications;
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Diagnostics;
+
+namespace ElmSharp.Test
+{
+    class WindowInternalTest : TestCaseBase
+    {
+        public override string TestName => "WindowInternalTest";
+        public override string TestDescription => "Window Test";
+
+        public override void Run(Window window)
+        {
+            var firstWindow = (Application.Current as TestRunner)?._firstPageWindow;
+            firstWindow.Hide();
+            firstWindow.Unrealize();
+
+            Button button1 = new Button(window) {
+                Text = "Iconified",
+            };
+            button1.Resize(window.ScreenSize.Width, 100);
+            button1.Move(0, 0);
+            button1.Show();
+
+            button1.Clicked += (e, o) =>
+            {
+                window.Iconified = true;
+            };
+
+            Button button2 = new Button(window)
+            {
+                Text = "WinKeyGrab",
+            };
+            button2.Resize(window.ScreenSize.Width, 100);
+            button2.Move(0, 100);
+            button2.Show();
+
+            button2.Clicked += (e, o) =>
+            {
+                Debug.WriteLine("@@KeyGrab");
+                window.KeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, true);
+                window.WinKeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, KeyGrabMode.Exclusive);
+            };
+
+            Button button3 = new Button(window)
+            {
+                Text = "WinUnKeyGrab",
+            };
+            button3.Resize(window.ScreenSize.Width, 100);
+            button3.Move(0, 200);
+            button3.Show();
+
+            button3.Clicked += (e, o) =>
+            {
+                Debug.WriteLine("@@UnKeyGrab");
+                window.WinKeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+                window.KeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+
+            };
+            window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true);
+            EventHandler<EvasKeyEventArgs> handler = (s, e) =>
+            {
+                Debug.WriteLine("@@KeyDown start" + e.KeyName);
+
+                if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
+                {
+                    Application.Current.Exit();
+                }
+                if (e.KeyName == EvasKeyEventArgs.PlatformHomeButtonName)
+                {
+                    Debug.WriteLine("@@KeyDown OK : " + window.Iconified);
+                    window.Iconified = !window.Iconified;
+                }
+            };
+
+            window.KeyUp += handler;
+        }
+
+    }
+}
diff --git a/test/ElmSharp.Test/TestCaseBase.cs b/test/ElmSharp.Test/TestCaseBase.cs
new file mode 100644 (file)
index 0000000..04987dc
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+
+namespace ElmSharp.Test
+{
+    [Flags]
+    public enum TargetProfile
+    {
+        Mobile = 1,
+        Tv = 2,
+        Wearable = 4
+    }
+    public abstract class TestCaseBase
+    {
+        public abstract string TestName { get; }
+        public abstract string TestDescription { get; }
+        public virtual TargetProfile TargetProfile => TargetProfile.Mobile | TargetProfile.Tv;
+        public abstract void Run(Window window);
+    }
+
+    public abstract class WearableTestCase : TestCaseBase
+    {
+        public override TargetProfile TargetProfile => TargetProfile.Wearable;
+    }
+}
diff --git a/test/ElmSharp.Test/TestRunner.cs b/test/ElmSharp.Test/TestRunner.cs
new file mode 100644 (file)
index 0000000..315cb0b
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+
+using Tizen.Applications;
+
+namespace ElmSharp.Test
+{
+    public class TestRunner : CoreUIApplication
+    {
+        internal Window _firstPageWindow;
+        private static bool s_terminated;
+
+        public static string ResourceDir { get; private set; }
+
+        public string Profile { get; set; }
+
+        public TestRunner()
+        {
+            s_terminated = false;
+        }
+
+        protected override void OnCreate()
+        {
+            ResourceDir = DirectoryInfo.Resource;
+
+            var testCases = GetTestCases();
+            CreateFirstPage(testCases);
+            base.OnCreate();
+        }
+
+        protected override void OnTerminate()
+        {
+            s_terminated = true;
+            base.OnTerminate();
+        }
+
+        public void RunStandalone(string[] args)
+        {
+            ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res");
+
+            EcoreSynchronizationContext.Initialize();
+
+            var testCases = GetTestCases();
+            TestCaseBase theTest = null;
+
+            if (args.Count() > 0)
+            {
+                theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault();
+            }
+
+            if (theTest != null)
+            {
+                StartTC(theTest);
+                EcoreMainloop.Begin();
+            }
+            else
+            {
+                CreateFirstPage(testCases);
+                EcoreMainloop.Begin();
+            }
+
+            Elementary.Shutdown();
+        }
+
+        private IEnumerable<TestCaseBase> GetTestCases()
+        {
+            Assembly asm = typeof(TestRunner).GetTypeInfo().Assembly;
+            Type testCaseType = typeof(TestCaseBase);
+
+            var tests = from test in asm.GetTypes()
+                        where testCaseType.IsAssignableFrom(test) && !test.GetTypeInfo().IsInterface && !test.GetTypeInfo().IsAbstract
+                        select Activator.CreateInstance(test) as TestCaseBase;
+
+            return from test in tests
+                   orderby test.TestName
+                   select test;
+        }
+
+        internal static void UIExit()
+        {
+            EcoreMainloop.Quit();
+        }
+
+        private Window CreateWindow(bool isSecond = false)
+        {
+            Window window = new Window("ElmSharp UI Tests")
+            {
+                AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
+            };
+            window.Show();
+            if (isSecond)
+            {
+                window.BackButtonPressed += (s, e) =>
+                {
+                    window.Hide();
+                    window.Unrealize();
+                    GC.Collect();
+                    GC.WaitForPendingFinalizers();
+                };
+            }
+            else
+            {
+                window.BackButtonPressed += (s, e) =>
+                {
+                    UIExit();
+                };
+            }
+            return window;
+        }
+
+        private void CreateFirstPage(IEnumerable<TestCaseBase> testCases)
+        {
+            _firstPageWindow = CreateWindow();
+            Console.WriteLine("Screen DPI : {0}", _firstPageWindow.ScreenDpi.X);
+            Conformant conformant = new Conformant(_firstPageWindow);
+            conformant.Show();
+            Box box = new Box(_firstPageWindow)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            var bg = new Background(_firstPageWindow);
+            bg.Color = Color.White;
+            bg.SetContent(box);
+            conformant.SetContent(bg);
+
+            GenList list = new GenList(_firstPageWindow)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (data, part) =>
+                {
+                    TestCaseBase tc = data as TestCaseBase;
+                    return tc == null ? "" : tc.TestName;
+                }
+            };
+
+            foreach (var tc in testCases.Where<TestCaseBase>((tc) => tc.TargetProfile.HasFlag(GetTargetProfile())))
+            {
+                list.Append(defaultClass, tc);
+            }
+
+            if (Profile == "wearable")
+            {
+                list.Prepend(defaultClass, null);
+                list.Append(defaultClass, null);
+            }
+
+            list.ItemSelected += (s, e) =>
+            {
+                TestCaseBase tc = e.Item.Data as TestCaseBase;
+                StartTCFromList(tc);
+            };
+            list.Show();
+
+            box.PackEnd(list);
+        }
+
+        private void StartTC(TestCaseBase tc)
+        {
+            Window window = CreateWindow();
+            tc.Run(window);
+        }
+
+        private void StartTCFromList(TestCaseBase tc)
+        {
+            Window window = CreateWindow(true);
+            tc.Run(window);
+        }
+
+        private TargetProfile GetTargetProfile()
+        {
+            switch (Profile)
+            {
+                case "wearable" :
+                    return TargetProfile.Wearable;
+                case "mobile" :
+                    return TargetProfile.Mobile;
+                case "tv":
+                    return TargetProfile.Tv;
+            }
+            return TargetProfile.Mobile;
+        }
+
+        static void Main(string[] args)
+        {
+            Elementary.Initialize();
+            Elementary.ThemeOverlay();
+
+            var profile = Elementary.GetProfile();
+            Console.WriteLine("ELM_PROFILE : {0}", profile);
+            Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale());
+
+            TestRunner testRunner = new TestRunner();
+            testRunner.Profile = profile;
+            testRunner.Run(args);
+
+            // if running with appfw is failed, below line will be executed.
+            if (!s_terminated)
+            {
+                testRunner.RunStandalone(args);
+            }
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/res/TED/app_icn_ted.png b/test/ElmSharp.Test/res/TED/app_icn_ted.png
new file mode 100755 (executable)
index 0000000..ab726c8
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/app_icn_ted.png differ
diff --git a/test/ElmSharp.Test/res/TED/large/a.jpg b/test/ElmSharp.Test/res/TED/large/a.jpg
new file mode 100755 (executable)
index 0000000..ff18439
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/a.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/b.jpg b/test/ElmSharp.Test/res/TED/large/b.jpg
new file mode 100755 (executable)
index 0000000..e34e60b
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/b.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/c.jpg b/test/ElmSharp.Test/res/TED/large/c.jpg
new file mode 100755 (executable)
index 0000000..ae2a56c
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/c.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/d.jpg b/test/ElmSharp.Test/res/TED/large/d.jpg
new file mode 100755 (executable)
index 0000000..bb7d72a
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/d.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/e.jpg b/test/ElmSharp.Test/res/TED/large/e.jpg
new file mode 100755 (executable)
index 0000000..d35a60d
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/e.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/f.jpg b/test/ElmSharp.Test/res/TED/large/f.jpg
new file mode 100755 (executable)
index 0000000..238d722
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/f.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/g.jpg b/test/ElmSharp.Test/res/TED/large/g.jpg
new file mode 100755 (executable)
index 0000000..873c9f3
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/g.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/a.jpg b/test/ElmSharp.Test/res/TED/thumbnail/a.jpg
new file mode 100755 (executable)
index 0000000..4d16594
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/a.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/b.jpg b/test/ElmSharp.Test/res/TED/thumbnail/b.jpg
new file mode 100755 (executable)
index 0000000..f3dc3dd
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/b.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/c.jpg b/test/ElmSharp.Test/res/TED/thumbnail/c.jpg
new file mode 100755 (executable)
index 0000000..a0a4c1a
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/c.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/d.jpg b/test/ElmSharp.Test/res/TED/thumbnail/d.jpg
new file mode 100755 (executable)
index 0000000..4dfda7c
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/d.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/e.jpg b/test/ElmSharp.Test/res/TED/thumbnail/e.jpg
new file mode 100755 (executable)
index 0000000..0d4ded3
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/e.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/f.jpg b/test/ElmSharp.Test/res/TED/thumbnail/f.jpg
new file mode 100755 (executable)
index 0000000..a3fc744
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/f.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/g.jpg b/test/ElmSharp.Test/res/TED/thumbnail/g.jpg
new file mode 100755 (executable)
index 0000000..33c46c1
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/g.jpg differ
diff --git a/test/ElmSharp.Test/res/btn_delete.png b/test/ElmSharp.Test/res/btn_delete.png
new file mode 100644 (file)
index 0000000..7bafac6
Binary files /dev/null and b/test/ElmSharp.Test/res/btn_delete.png differ
diff --git a/test/ElmSharp.Test/res/picture.png b/test/ElmSharp.Test/res/picture.png
new file mode 100644 (file)
index 0000000..7522362
Binary files /dev/null and b/test/ElmSharp.Test/res/picture.png differ
diff --git a/test/ElmSharp.Test/shared/res/ElmSharp.Test.png b/test/ElmSharp.Test/shared/res/ElmSharp.Test.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/test/ElmSharp.Test/shared/res/ElmSharp.Test.png differ
diff --git a/test/ElmSharp.Test/test.sh b/test/ElmSharp.Test/test.sh
new file mode 100755 (executable)
index 0000000..aa3cbc7
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+TARGET_USER=owner
+TARGET_DIR=/home/$TARGET_USER/elmsharp_test
+TARGET_RES_DIR=$TARGET_DIR/res
+
+TO_COPY_FILES="bin/Debug"
+
+exit_on_error() {
+  if [ $1 -ne "0" ]
+  then
+    exit $1
+  fi
+}
+
+sdb_cmd() {
+  sdb shell su -l $TARGET_USER -c "$1"
+}
+
+usage() {
+  echo "Usage: $0 [options] [testcase]"
+  echo "    Options:"
+  echo "        -h, --help         Show this usages message"
+  echo "        -i, --install      Install test cases to target device"
+  echo "        -r, --install-res  Install resource files for test cases to target device"
+  echo "        -m, --use-mono     Execute test case by using mono instead of corerun"
+}
+
+install() {
+  echo "install"
+  sdb root on
+  sdb_cmd "rm -fr $TARGET_DIR"
+  sdb_cmd "mkdir -p $TARGET_DIR"
+  sdb push $TO_COPY_FILES/Tizen*.dll $TARGET_DIR
+  sdb push $TO_COPY_FILES/ElmSharp*.dll $TARGET_DIR
+  sdb push $TO_COPY_FILES/ElmSharp*.exe $TARGET_DIR
+  exit_on_error $?
+}
+
+install_res() {
+  sdb root on
+  sdb_cmd "rm -fr $TARGET_RES_DIR"
+  sdb_cmd "mkdir -p $TARGET_RES_DIR"
+  sdb push $TO_COPY_FILES/res $TARGET_RES_DIR
+  exit_on_error $?
+}
+
+run() {
+  sdb root on
+  sdb_cmd "/usr/share/tizen.net/corerun $TARGET_DIR/ElmSharp.Test.exe $1"
+  exit_on_error $?
+}
+
+run_mono() {
+  sdb root on
+  sdb_cmd "MONO_TRACE_LISTENER=Console.Error mono $TARGET_DIR/ElmSharp.Test.exe $1"
+  exit_on_error $?
+}
+
+OPTS=`getopt -o hirm --long help,install,install-res,use-mono -n 'test' -- "$@"`
+if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi
+eval set -- "$OPTS"
+
+FLAG_HELP=false
+FLAG_INSTALL=false
+FLAG_INSTALL_RES=false
+FLAG_USE_MONO=false
+
+while true; do
+  case "$1" in
+    -h|--help) FLAG_HELP=true; shift ;;
+    -i|--install) FLAG_INSTALL=true; shift ;;
+    -r|--install-res) FLAG_INSTALL_RES=true; shift ;;
+    -m|--use-mono) FLAG_USE_MONO=true; shift ;;
+    --) shift; break ;;
+    *) break ;;
+  esac
+done
+
+if $FLAG_HELP; then usage; exit 1; fi
+
+if $FLAG_INSTALL; then install; fi
+if $FLAG_INSTALL_RES; then install_res; fi
+if $FLAG_USE_MONO; then run_mono $@; else run $@; fi
diff --git a/test/ElmSharp.Test/tizen-manifest.xml b/test/ElmSharp.Test/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..5067a8f
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="ElmSharpTest" version="1.0.0">
+       <profile name="common" />
+       <ui-application appid="org.tizen.ElmSharp.Test"
+                                       exec="ElmSharp.Test.exe"
+                                       type="dotnet"
+                                       multiple="false"
+                                       taskmanage="true"
+                                       launch_mode="single">
+       <icon>ElmSharp.Test.png</icon>
+       <label>ElmSharp.Test</label>
+       </ui-application>
+</manifest>
diff --git a/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj b/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj
new file mode 100644 (file)
index 0000000..419f133
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ProjectGuid>{C6E111B7-21E2-4CD6-93BF-2CD5ED255749}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ElmSharp.Wearable.Test</RootNamespace>
+    <AssemblyName>ElmSharp.Wearable.Test</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701;1702</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TC\CircleDateTimeSelectorTest1.cs" />
+    <Compile Include="TC\CircleDateTimeSelectorTest2.cs" />
+    <Compile Include="TC\CircleDateTimeSelectorTest3.cs" />
+    <Compile Include="TC\CircleDateTimeSelectorTest4.cs" />
+    <Compile Include="TC\CircleGenListTest1.cs" />
+    <Compile Include="TC\CircleGenListTest2.cs" />
+    <Compile Include="TC\CircleGenListTest3.cs" />
+    <Compile Include="TC\CircleGenListTest4.cs" />
+    <Compile Include="TC\CircleScrollerTest1.cs" />
+    <Compile Include="TC\CircleScrollerTest2.cs" />
+    <Compile Include="TC\CircleScrollerTest3.cs" />
+    <Compile Include="TC\CircleScrollerTest4.cs" />
+    <Compile Include="TC\CircleSliderTest1.cs" />
+    <Compile Include="TC\CircleSliderTest2.cs" />
+    <Compile Include="TC\CircleProgressBarTest1.cs" />
+    <Compile Include="TC\CircleProgressBarTest2.cs" />
+    <Compile Include="TC\CircleProgressBarTest3.cs" />
+    <Compile Include="TC\CircleProgressBarTest4.cs" />
+    <Compile Include="TC\CircleSpinnerTest1.cs" />
+    <Compile Include="TC\CircleSpinnerTest2.cs" />
+    <Compile Include="TC\Log.cs" />
+    <Compile Include="TC\MoreOptionTest.cs" />
+    <Compile Include="TC\RotarySelectorTest.cs" />
+    <Compile Include="TestCaseBase.cs" />
+    <Compile Include="TestRunner.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ElmSharp.Wearable.Test.project.json" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="res\icons\bg_black.png" />
+    <Content Include="res\icons\bg_red.png" />
+    <Content Include="res\icons\bg_white.png" />
+    <Content Include="res\icons\icon_aquamarine_260_me.png" />
+    <Content Include="res\icons\icon_auamarine_260_me.png" />
+    <Content Include="res\icons\icon_azure_215_me.png" />
+    <Content Include="res\icons\icon_beige_330_me.png" />
+    <Content Include="res\icons\icon_blue_45_me.png" />
+    <Content Include="res\icons\icon_brown_90_me.png" />
+    <Content Include="res\icons\icon_cyan_230_me.png" />
+    <Content Include="res\icons\icon_firebrick_95_me.png" />
+    <Content Include="res\icons\icon_gold_75_me.png" />
+    <Content Include="res\icons\icon_green_60_me.png" />
+    <Content Include="res\icons\icon_honeydew_285_me.png" />
+    <Content Include="res\icons\icon_ivory_315_me.png" />
+    <Content Include="res\icons\icon_khaki_360_me.png" />
+    <Content Include="res\icons\icon_lime_300_me.png" />
+    <Content Include="res\icons\icon_maroon_120_me.png" />
+    <Content Include="res\icons\icon_me.png" />
+    <Content Include="res\icons\icon_orchid_160_me.png" />
+    <Content Include="res\icons\icon_pink_145_me.png" />
+    <Content Include="res\icons\icon_purple_200_me.png" />
+    <Content Include="res\icons\icon_red_30_me.png" />
+    <Content Include="res\icons\icon_snow_75_me.png" />
+    <Content Include="res\icons\icon_snow_80_me.png" />
+    <Content Include="res\icons\icon_teal_245_me.png" />
+    <Content Include="res\icons\icon_violet_180_me.png" />
+    <Content Include="res\icons\icon_yellow_345_me.png" />
+    <Content Include="res\icons\pressed.png" />
+    <Content Include="res\icons\round_bg_green.png" />
+    <Content Include="res\icons\round_bg_white.png" />
+    <Content Include="res\icons\round_bg_yellow.png" />
+    <Content Include="res\icons\round_content_black.png" />
+    <Content Include="res\icons\round_content_blue.png" />
+    <Content Include="res\icons\round_content_red.png" />
+    <Content Include="shared\res\ElmSharp.Test.png" />
+    <Content Include="tizen-manifest.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\ElmSharp.Wearable\ElmSharp.Wearable.csproj">
+      <Project>{9a1c45ac-93e3-4b09-b896-769df60cf1b2}</Project>
+      <Name>ElmSharp.Wearable</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ElmSharp\ElmSharp.csproj">
+      <Project>{d00c29dd-4b2e-41c0-a323-bad1a74c69bf}</Project>
+      <Name>ElmSharp</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+    -->
+    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+       to prevent it from outputting a warning (MSB3644).
+    -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
+        <ProjectCommonFlavorCfg />
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.project.json b/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.project.json
new file mode 100644 (file)
index 0000000..4bd5e6c
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "dependencies": {
+    "Microsoft.NETCore.App": "1.0.0",
+    "Tizen.Applications.Common": "1.5.8",
+    "Tizen.Applications.UI": "1.5.8"
+  },
+  "frameworks": {
+    "netcoreapp1.0": {}
+  },
+  "runtimes": {
+    "win": {}
+  }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/Properties/AssemblyInfo.cs b/test/ElmSharp.Wearable.Test/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..c419e2d
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ElmSharp.Wearable.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("ElmSharp.Wearable.Test")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2e1a161a-baa9-40ef-a8b4-082ce7c813b8")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs
new file mode 100644 (file)
index 0000000..4318a75
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleDateTimeSelectorTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleDateTimeSelectorTest1";
+        public override string TestDescription => "To display a date time selector with circle UI";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+
+            layout.SetTheme("layout", "circle", "datetime");
+
+            conformant.SetContent(layout);
+
+            DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+            {
+                MinimumDateTime = new DateTime(2015, 1, 1),
+                MaximumDateTime = DateTime.Now,
+                DateTime = DateTime.Now
+            };
+
+            layout.SetContent(datetime);
+
+            Button btn = new Button(layout)
+            {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+
+            layout.SetPartText("elm.text", "Set date");
+
+            datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
+                Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString());
+                Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString());
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs
new file mode 100644 (file)
index 0000000..6e3bdf0
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleDateTimeSelectorTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleDateTimeSelectorTest2";
+        public override string TestDescription => "To display a date time selector with circle UI";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+
+            layout.SetTheme("layout", "circle", "datetime");
+
+            conformant.SetContent(layout);
+
+            DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+            {
+                DateTime = DateTime.Now,
+                Style = "timepicker/circle"
+            };
+
+            layout.SetContent(datetime);
+
+            Button btn = new Button(layout)
+            {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+
+            layout.SetPartText("elm.text", "Set time");
+
+            datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
+                Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString());
+                Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString());
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs
new file mode 100644 (file)
index 0000000..8ac1907
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleDateTimeSelectorTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleDateTimeSelectorTest3";
+        public override string TestDescription => "To display a date time selector with circle UI";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+
+            layout.SetTheme("layout", "circle", "datetime");
+
+            conformant.SetContent(layout);
+
+            DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+            {
+                DateTime = DateTime.Now,
+                Style = "timepicker/circle",
+                Disabled = true
+            };
+
+            layout.SetContent(datetime);
+
+            Button btn = new Button(layout)
+            {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+
+            layout.SetPartText("elm.text", "Set time");
+
+            datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
+                Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString());
+                Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString());
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs
new file mode 100644 (file)
index 0000000..3a93ab5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleDateTimeSelectorTest4 : TestCaseBase
+    {
+        public override string TestName => "CircleDateTimeSelectorTest4";
+        public override string TestDescription => "To display a date time selector with circle UI";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+
+            layout.SetTheme("layout", "circle", "datetime");
+
+            conformant.SetContent(layout);
+
+            DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+            {
+                DateTime = DateTime.Now,
+                Style = "timepicker/circle",
+                MarkerLineWidth = 40,
+                MarkerColor = Color.Pink,
+                MarkerRadius = 100,
+            };
+
+            layout.SetContent(datetime);
+
+            Button btn = new Button(layout)
+            {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+
+            layout.SetPartText("elm.text", "Set time");
+
+            datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+            {
+                Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
+                Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString());
+                Log.Debug(TestName,"Current DateTime={0}", datetime.DateTime.ToString());
+            };
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs
new file mode 100644 (file)
index 0000000..03de32b
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleGenListTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleGenListTest1";
+        public override string TestDescription => "To display a genlist applied a circle UI on a conformant";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            var list = new CircleGenList(conformant)
+            {
+                Homogeneous = true,
+                VerticalScrollBarColor = Color.Red,
+                VerticalScrollBackgroundColor = Color.Pink,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Visible,
+            };
+
+            conformant.SetContent(list);
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.ItemSelected += List_ItemSelected; ;
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs
new file mode 100644 (file)
index 0000000..ff1e9fd
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleGenListTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleGenListTest2";
+        public override string TestDescription => "To display a genlist applied a circle UI on a layout";
+
+        public override void Run(Window window)
+        {
+            var layout = new Layout(window);
+            layout.Show();
+
+            layout.Move(0, 0);
+            layout.Resize(360, 360);
+
+            var list = new CircleGenList(layout)
+            {
+                Homogeneous = true,
+                VerticalScrollBackgroundRadius = 165,
+                VerticalScrollBarRadius = 165,
+                VerticalScrollBackgroundLineWidth = 30,
+                VerticalScrollBarLineWidth = 30,
+            };
+            list.Show();
+
+            list.Move(0, 0);
+            list.Resize(360, 360);
+            list.Lower();
+
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.ItemSelected += List_ItemSelected; ;
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs
new file mode 100644 (file)
index 0000000..6dc5f53
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleGenListTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleGenListTest3";
+        public override string TestDescription => "To display a genlist applied a circle UI on a naviframe";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            var naviframe = new Naviframe(conformant);
+
+            conformant.SetContent(naviframe);
+
+            var list = new CircleGenList(naviframe)
+            {
+                Homogeneous = true,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
+                Disabled = true,
+            };
+
+            var item = naviframe.Push(list);
+            item.Style = "empty";
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.ItemSelected += List_ItemSelected; ;
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs
new file mode 100644 (file)
index 0000000..d5190ab
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleGenListTest4 : TestCaseBase
+    {
+        public override string TestName => "CircleGenListTest4";
+        public override string TestDescription => "To display a genlist applied a circle UI on an window";
+
+        public override void Run(Window window)
+        {
+            var list = new CircleGenList(window)
+            {
+                Homogeneous = true,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+            };
+            list.Show();
+
+            list.Move(0, 0);
+            list.Resize(360, 360);
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (obj, part) =>
+                {
+                    return string.Format("{0} - {1}",(string)obj, part);
+                }
+            };
+
+            for (int i = 0; i < 100; i++)
+            {
+                list.Append(defaultClass, string.Format("{0} Item", i));
+            }
+            list.ItemSelected += List_ItemSelected; ;
+        }
+
+        private void List_ItemSelected(object sender, GenListItemEventArgs e)
+        {
+            Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data));
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs
new file mode 100644 (file)
index 0000000..a0bc3cb
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleProgressBarTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleProgressBarTest1";
+        public override string TestDescription => "To test basic operation of CircleProgressBar";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleProgressBar run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            CircleProgressBar pb1 = new CircleProgressBar(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+
+                // default
+                Value = 20,
+                Maximum = 100,
+                Minimum = 0,
+                BarRadius = 80,
+                BarLineWidth = 6,
+
+                // background
+                BackgroundRadius = 80,
+                BackgroundLineWidth = 6,
+            };
+            pb1.Show();
+            conformant.SetContent(pb1);
+            Label lb1 = new Label(window)
+            {
+                Text = string.Format("{0} %", pb1.Value),
+            };
+
+            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb1.Move(170, window.ScreenSize.Height / 2 - 20);
+            lb1.Show();
+
+            EcoreMainloop.AddTimer(0.05, () =>
+            {
+                pb1.Value += 1;
+                lb1.Text = string.Format("{0} %", pb1.Value);
+
+                return true;
+            });
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs
new file mode 100644 (file)
index 0000000..d41034d
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleProgressBarTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleProgressBarTest2";
+        public override string TestDescription => "To test property related with background of CircleProgressBar";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleProgressBar run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            CircleProgressBar pb1 = new CircleProgressBar(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+
+                // bar
+                Value = 20,
+                Maximum = 100,
+                Minimum = 0,
+                BarRadius = 100,
+                BarLineWidth = 10,
+                BarColor = Color.Green,
+
+                // Test purpose :  to test property related with background
+
+                // background
+                BackgroundRadius = 110,
+                BackgroundLineWidth = 10,
+                BackgroundColor = Color.Aqua
+            };
+            pb1.Show();
+            conformant.SetContent(pb1);
+            Label lb1 = new Label(window)
+            {
+                Text = string.Format("S {0} %", pb1.Value),
+            };
+
+            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb1.Move(160, window.ScreenSize.Height / 2 - 20);
+            lb1.Show();
+
+            EcoreMainloop.AddTimer(0.05, () =>
+            {
+                pb1.Value += 1;
+                lb1.Text = string.Format("S {0} %", pb1.Value);
+
+                return true;
+            });
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs
new file mode 100644 (file)
index 0000000..66a2ba6
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleProgressBarTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleProgressBarTest3";
+        public override string TestDescription => "To test property related with angle of CircleProgressBar";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleProgressBar run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            CircleProgressBar pb1 = new CircleProgressBar(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+
+                // Test purpose :  to test property related with angle
+
+                // bar
+                Maximum = 100,
+                BarRadius = 100,
+                BarLineWidth = 20,
+                BarColor = Color.Green,
+                BarAngleOffset = 90,
+                BarAngle = 90,
+                BarAngleMaximum = 180,
+
+                // background
+                BackgroundRadius = 100,
+                BackgroundLineWidth = 20,
+                BackgroundColor = Color.Aqua,
+                BackgroundAngleOffset = 90,
+                BackgroundAngle = 180,
+            };
+            pb1.Show();
+            conformant.SetContent(pb1);
+            Label lb1 = new Label(window)
+            {
+                Text = string.Format("V {0} %", pb1.Value),
+            };
+
+            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
+            lb1.Show();
+
+            Label lb2 = new Label(window)
+            {
+                Text = string.Format("A {0} ", pb1.BarAngle),
+            };
+
+            lb2.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb2.Move(160, window.ScreenSize.Height / 2);
+            lb2.Show();
+
+            EcoreMainloop.AddTimer(0.5, () =>
+            {
+                pb1.Value += 1;
+
+                lb1.Text = string.Format("V {0} %", pb1.Value);
+                lb2.Text = string.Format("A {0} ", pb1.BarAngle);
+
+                return true;
+            });
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs
new file mode 100644 (file)
index 0000000..9ff9d48
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleProgressBarTest4 : TestCaseBase
+    {
+        public override string TestName => "CircleProgressBarTest4";
+        public override string TestDescription => "To test Disabled property of CircleProgressBar";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleProgressBar run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            CircleProgressBar pb1 = new CircleProgressBar(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+
+                // bar
+                Value = 0,
+                Maximum = 100,
+                Minimum = 0,
+                BarRadius = 100,
+                BarLineWidth = 15,
+                BarColor = Color.Green,
+
+                // background
+                BackgroundRadius = 100,
+                BackgroundLineWidth = 15,
+                BackgroundColor = Color.Aqua,
+            };
+            pb1.Show();
+            conformant.SetContent(pb1);
+            Label lb1 = new Label(window)
+            {
+                Text = string.Format("S {0} %", pb1.Value),
+            };
+
+            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
+            lb1.Show();
+
+            EcoreMainloop.AddTimer(0.05, () =>
+            {
+                if (pb1.Value == pb1.Maximum/2)
+                {
+                    // Test purpose : set disable
+                    pb1.Disabled = true;
+                }
+
+                if (pb1.Value == pb1.Maximum)
+                {
+                    EcoreMainloop.RemoveTimer(pb1);
+                }
+
+                pb1.Value += 1;
+                lb1.Text = string.Format("S {0} %", pb1.Value);
+
+                return true;
+            });
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs
new file mode 100644 (file)
index 0000000..21d7a33
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleScrollerTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleScrollerTest1";
+        public override string TestDescription => "To test basic operation of CircleScroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            CircleScroller circleScroller = new CircleScroller(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+            };
+            circleScroller.Show();
+            conformant.SetContent(circleScroller);
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            box.Show();
+            circleScroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumHeight = window.ScreenSize.Height,
+                };
+                colorBox.Show();
+                box.PackEnd(colorBox);
+            }
+            circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Circle Scrolled Scrolled");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs
new file mode 100644 (file)
index 0000000..b968e53
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleScrollerTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleScrollerTest2";
+        public override string TestDescription => "To test basic operation of CircleScroller";
+
+        public override void Run(Window window)
+        {
+            Layout layout = new Layout(window);
+            layout.Show();
+            layout.Move(0, 0);
+            layout.Resize(360, 360);
+
+            CircleScroller circleScroller = new CircleScroller(layout)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
+            };
+            circleScroller.Show();
+            circleScroller.Move(0, 0);
+            circleScroller.Resize(360, 360);
+            circleScroller.Lower();
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            circleScroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                box.PackEnd(colorBox);
+            }
+            circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs
new file mode 100644 (file)
index 0000000..412e1e0
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleScrollerTest3 : TestCaseBase
+    {
+        public override string TestName => "CircleScrollerTest3";
+        public override string TestDescription => "To test basic operation of CircleScroller";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Naviframe naviframe = new Naviframe(conformant);
+
+            CircleScroller circleScroller = new CircleScroller(naviframe)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
+                HorizontalScrollBarColor = new Color(255, 0, 0, 50),
+                HorizontalScrollBackgroundColor = Color.Orange,
+                HorizontalScrollBarLineWidth = 15,
+                HorizontalScrollBackgroundLineWidth = 15,
+            };
+            circleScroller.Show();
+            naviframe.Push(circleScroller);
+            naviframe.Show();
+            conformant.SetContent(naviframe);
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                IsHorizontal = true,
+            };
+            box.Show();
+            circleScroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumWidth = window.ScreenSize.Width,
+                };
+                colorBox.Show();
+                box.PackEnd(colorBox);
+            }
+            circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs
new file mode 100644 (file)
index 0000000..13a3db8
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleScrollerTest4 : TestCaseBase
+    {
+        public override string TestName => "CircleScrollerTest4";
+        public override string TestDescription => "To test basic operation of CircleScroller";
+
+        public override void Run(Window window)
+        {
+
+            CircleScroller circleScroller = new CircleScroller(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                VerticalScrollBarColor = Color.Yellow,
+                VerticalScrollBackgroundColor = Color.Red,
+                VerticalScrollBarRadius = 170,
+                VerticalScrollBackgroundRadius = 170,
+            };
+            circleScroller.Show();
+            circleScroller.Move(0, 0);
+            circleScroller.Resize(360, 360);
+
+            Box box = new Box(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            circleScroller.SetContent(box);
+
+            var rnd = new Random();
+            for (int i = 0; i < 10; i++)
+            {
+                int r = rnd.Next(255);
+                int g = rnd.Next(255);
+                int b = rnd.Next(255);
+                Color color = Color.FromRgb(r, g, b);
+                Rectangle colorBox = new Rectangle(window)
+                {
+                    AlignmentX = -1,
+                    AlignmentY = -1,
+                    WeightX = 1,
+                    WeightY = 1,
+                    Color = color,
+                    MinimumHeight = window.ScreenSize.Height,
+                };
+                colorBox.Show();
+                box.PackEnd(colorBox);
+            }
+            circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs
new file mode 100644 (file)
index 0000000..91a4cc2
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleSliderTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleSliderTest1";
+        public override string TestDescription => "To test basic operation of CircleSlider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+
+            CircleSlider circleSlider = new CircleSlider(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Minimum = 0,
+                Maximum = 100,
+                Value = 25,
+                Step = 5,
+            };
+            circleSlider.Show();
+            conformant.SetContent(circleSlider);
+
+            Label label1 = new Label(window)
+            {
+                Text = string.Format("{0}", circleSlider.Value),
+                Color = Color.White,
+            };
+
+            label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            label1.Move(170, window.ScreenSize.Height / 2 - 20);
+            label1.Show();
+
+            circleSlider.Changed += (s, e) =>
+            {
+                label1.Text = string.Format("{0}", circleSlider.Value);
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs
new file mode 100644 (file)
index 0000000..9f0c262
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    public class CircleSliderTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleSliderTest2";
+        public override string TestDescription => "To test basic operation of CircleSlider";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+
+            CircleSlider circleSlider = new CircleSlider(conformant)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Minimum = 0,
+                Maximum = 15,
+                BarColor = Color.Purple,
+                BackgroundColor = Color.Red,
+                BarRadius = 160,
+                BackgroundRadius = 160,
+                BarLineWidth = 15,
+                BackgroundLineWidth = 15,
+                BackgroundAngleOffset = 90,
+                BackgroundAngle = 270,
+                BarAngleOffset = 90.0,
+                BarAngleMinimum = 0.0,
+                BarAngleMaximum = 270.0,
+                Value = 3,
+                Step = 0.5,
+            };
+            circleSlider.Show();
+            conformant.SetContent(circleSlider);
+            Label label1 = new Label(window)
+            {
+                Text = string.Format("{0:F1}", circleSlider.Value),
+                Color = Color.White,
+            };
+
+            label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            label1.Move(170, window.ScreenSize.Height / 2 - 30);
+            label1.Show();
+
+            Label label2 = new Label(window)
+            {
+                Text = string.Format("min:{0},max{1}", circleSlider.Minimum, circleSlider.Maximum),
+                Color = Color.White,
+            };
+
+            label2.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+            label2.Move(110, window.ScreenSize.Height / 2 + 10);
+            label2.Show();
+
+            Log.Debug(TestName, "CircleSliderTest2 step:" + circleSlider.Step);
+
+            circleSlider.Changed += (s, e) =>
+            {
+                label1.Text = string.Format("{0:F1}", circleSlider.Value);
+            };
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs
new file mode 100644 (file)
index 0000000..d67564e
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleSpinnerTest1 : TestCaseBase
+    {
+        public override string TestName => "CircleSpinnerTest1";
+        public override string TestDescription => "To test basic operation of Circle Spinner";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleSpinnerTest run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+            layout.SetTheme("layout", "circle", "spinner");
+            conformant.SetContent(layout);
+
+            CircleSpinner spn1 = new CircleSpinner(conformant)
+            {
+                Text = "Spinner Test",
+                LabelFormat = "%d Value",
+                Style = "circle",
+                AngleRatio = 3.0,
+                Minimum = 0,
+                Maximum = 360,
+                Value = 0,
+                Step = 10,
+                Interval = 0.5,
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            spn1.AddSpecialValue(50, "50 match !!!!");
+            layout.SetContent(spn1);
+
+            Button btn = new Button(layout) {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            btn.Clicked += (s, e) =>
+            {
+                spn1.Disabled = true;
+                spn1.Text = "100 match";
+                spn1.Value = 0;
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+            layout.SetPartText("elm.text", "Set value");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs
new file mode 100644 (file)
index 0000000..59adefd
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class CircleSpinnerTest2 : TestCaseBase
+    {
+        public override string TestName => "CircleSpinnerTest2";
+        public override string TestDescription => "To test basic operation of Circle Spinner";
+
+        public override void Run(Window window)
+        {
+            Log.Debug(TestName, "CircleSpinnerTest run");
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+
+            Layout layout = new Layout(window);
+            layout.SetTheme("layout", "circle", "spinner");
+            conformant.SetContent(layout);
+
+            CircleSpinner spn1 = new CircleSpinner(conformant)
+            {
+                Text = "Slider Test",
+                LabelFormat = "%d Value",
+                Style = "circle",
+                AngleRatio = 3.0,
+                Minimum = 0,
+                Maximum = 360,
+                Value = 0,
+                Step = 10,
+                Interval = 0.5,
+                AlignmentX = -1,
+                AlignmentY = 1,
+                WeightX = 1,
+                WeightY = 1,
+                // change marker
+                MarkerLineWidth = 40,
+                MarkerColor = Color.Pink,
+                MarkerRadius = 100,
+            };
+            spn1.AddSpecialValue(50, "50 match !!!!");
+            layout.SetContent(spn1);
+
+            Button btn = new Button(layout) {
+                Text = "OK",
+                Style = "bottom",
+            };
+
+            layout.SetPartContent("elm.swallow.btn", btn);
+            layout.SetPartText("elm.text", "Set value");
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/Log.cs b/test/ElmSharp.Wearable.Test/TC/Log.cs
new file mode 100644 (file)
index 0000000..37313aa
--- /dev/null
@@ -0,0 +1,60 @@
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace ElmSharp.Test
+{
+    internal static class Log
+    {
+        const string Library = "libdlog.so.0";
+        const string TAG = "ElmSharp.Test";
+
+        public static void Debug(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        public static void Info(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        public static void Error(string message,
+                [CallerFilePath] string file = "",
+                [CallerMemberName] string func = "",
+                [CallerLineNumber] int line = 0)
+        {
+            Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+        }
+
+        internal enum LogPriority
+        {
+            DLOG_UNKNOWN = 0,
+            DLOG_DEFAULT,
+            DLOG_VERBOSE,
+            DLOG_DEBUG,
+            DLOG_INFO,
+            DLOG_WARN,
+            DLOG_ERROR,
+            DLOG_FATAL,
+            DLOG_SILENT,
+            DLOG_PRIO_MAX,
+        }
+
+        private static void Print(LogPriority priority, string tag, string message, string file, string func, int line)
+        {
+            FileInfo finfo = new FileInfo(file);
+            Print(priority, tag, "%s: %s(%d) > %s", finfo.Name, func, line, message);
+        }
+
+        [DllImportAttribute(Library, EntryPoint = "dlog_print")]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs b/test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs
new file mode 100644 (file)
index 0000000..4c0e2b8
--- /dev/null
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class MoreOptionTest : TestCaseBase
+    {
+        public override string TestName => "MoreOptionTest";
+
+        public override string TestDescription => "Wearable More Option Widget Test";
+
+        class ColorMoreOptionItem : MoreOptionItem
+        {
+            public Color Color;
+            public ColorMoreOptionItem(Window window, string iconName, Color color)
+            {
+                MainText = (iconName.First().ToString().ToUpper() + iconName.Substring(1)).Replace('_', ' ');
+                SubText = color.ToString();
+                Icon = new Image(window);
+                Icon.Show();
+                Icon.Load(Path.Combine(TestRunner.ResourceDir, "icons", iconName+".png"));
+                Color = color;
+            }
+        }
+
+        static Color Deep(Color color)
+        {
+            return new Color(color.R / 2, color.G / 2, color.B / 2);
+        }
+
+        public override void Run(Window window)
+        {
+            Conformant conf = new Conformant(window);
+            conf.Show();
+
+            MoreOption option = new MoreOption(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+                Direction = MoreOptionDirection.Right
+            };
+            option.Show();
+            //option.Move(window.ScreenSize.Width/2, window.ScreenSize.Height/2);
+            conf.SetContent(option);
+
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_aquamarine_260_me", Color.FromHex("#800000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_auamarine_260_me", Color.FromHex("#800012")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_azure_215_me", Color.FromHex("#800034")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_beige_330_me", Color.FromHex("#800056")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_blue_45_me", Color.FromHex("#800067")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_brown_90_me", Color.FromHex("#800087")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_cyan_230_me", Color.FromHex("#800023")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_firebrick_95_me", Color.FromHex("#804300")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_gold_75_me", Color.FromHex("#854000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_green_60_me", Color.FromHex("#800340")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_honeydew_285_me", Color.FromHex("#823000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_ivory_315_me", Color.FromHex("#806700")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_khaki_360_me", Color.FromHex("#80ab00")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_lime_300_me", Color.FromHex("#800c30")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_maroon_120_me", Color.FromHex("#8fd000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_me", Color.FromHex("#800000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_orchid_160_me", Color.FromHex("#8d3000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_pink_145_me", Color.FromHex("#8002d0")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_purple_200_me", Color.FromHex("#8ff000")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_red_30_me", Color.FromHex("#800fa0")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_snow_75_me", Color.FromHex("#80f200")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_snow_80_me", Color.FromHex("#80d200")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_teal_245_me", Color.FromHex("#80f300")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_violet_180_me", Color.FromHex("#80fb00")));
+            option.Items.Add(new ColorMoreOptionItem(window, "icon_yellow_345_me", Color.FromHex("#800b30")));
+
+            option.Opened += (s, e) => Log.Debug(TestName, "Opened!");
+            option.Closed += (s, e) => Log.Debug(TestName, "Closed!");
+            option.Selected += (s, e) => Log.Debug(TestName, "Selected! : " + e?.Item?.MainText);
+            option.Clicked += (s, e) => Log.Debug(TestName, "Clicked! : " + e?.Item?.MainText);
+
+            option.Opened += (s, e) => option.BackgroundColor = Color.Aqua;
+            option.Closed += (s, e) => option.BackgroundColor = Color.Black;
+
+            option.Selected += (s, e) => option.BackgroundColor = (e?.Item as ColorMoreOptionItem).Color;
+            option.Clicked += (s, e) => option.BackgroundColor = Deep((e?.Item as ColorMoreOptionItem).Color);
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs b/test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs
new file mode 100644 (file)
index 0000000..549c580
--- /dev/null
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Linq;
+using System.IO;
+
+using ElmSharp.Wearable;
+
+namespace ElmSharp.Test.TC
+{
+    class RotarySelectorTest : TestCaseBase
+    {
+        public override string TestName => "RotarySelectorTest";
+
+        public override string TestDescription => "Rotary Selector Widget Test";
+
+        Window _window;
+
+        class MyRotarySelectorItem : RotarySelectorItem
+        {
+            public Color Color { get; set; }
+            public string Message { get; set; }
+        }
+
+        MyRotarySelectorItem NewItem(string iconName, Color color)
+        {
+            Image img = new Image(_window);
+            img.Load(Path.Combine(TestRunner.ResourceDir, "icons", iconName + ".png"));
+
+            string title = (iconName.First().ToString().ToUpper() + iconName.Substring(1)).Replace('_', ' ');
+
+            return new MyRotarySelectorItem
+            {
+                Color = color,
+                Message = title,
+                MainText = title,
+                SubText = color.ToString(),
+                NormalIconImage = img,
+
+                //PressedIconColor = Color.Green,
+                //IconColor = Color.Red,
+
+                //BackgroundImage = img,
+                //BackgroundColor = Color.Blue,
+                //PressedBackgroundColor = Color.Red
+
+            };
+        }
+
+        public override void Run(Window window)
+        {
+            this._window = window;
+            Conformant conf = new Conformant(window);
+            conf.Show();
+
+            RotarySelector selector = new RotarySelector(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            selector.Show();
+
+            selector.Items.Add(NewItem("icon_aquamarine_260_me", Color.FromHex("#800000")));
+            selector.Items.Add(NewItem("icon_auamarine_260_me", Color.FromHex("#800012")));
+            selector.Items.Add(NewItem("icon_azure_215_me", Color.FromHex("#800034")));
+            selector.Items.Add(NewItem("icon_beige_330_me", Color.FromHex("#800056")));
+            selector.Items.Add(NewItem("icon_blue_45_me", Color.FromHex("#800067")));
+            selector.Items.Add(NewItem("icon_brown_90_me", Color.FromHex("#800087")));
+            selector.Items.Add(NewItem("icon_cyan_230_me", Color.FromHex("#800023")));
+            selector.Items.Add(NewItem("icon_firebrick_95_me", Color.FromHex("#804300")));
+            selector.Items.Add(NewItem("icon_gold_75_me", Color.FromHex("#854000")));
+            selector.Items.Add(NewItem("icon_green_60_me", Color.FromHex("#800340")));
+            selector.Items.Add(NewItem("icon_honeydew_285_me", Color.FromHex("#823000")));
+            selector.Items.Add(NewItem("icon_ivory_315_me", Color.FromHex("#806700")));
+            selector.Items.Add(NewItem("icon_khaki_360_me", Color.FromHex("#80ab00")));
+            selector.Items.Add(NewItem("icon_lime_300_me", Color.FromHex("#800c30")));
+            selector.Items.Add(NewItem("icon_maroon_120_me", Color.FromHex("#8fd000")));
+            selector.Items.Add(NewItem("icon_me", Color.FromHex("#800000")));
+            selector.Items.Add(NewItem("icon_orchid_160_me", Color.FromHex("#8d3000")));
+            selector.Items.Add(NewItem("icon_pink_145_me", Color.FromHex("#8002d0")));
+            selector.Items.Add(NewItem("icon_purple_200_me", Color.FromHex("#8ff000")));
+            selector.Items.Add(NewItem("icon_red_30_me", Color.FromHex("#800fa0")));
+            selector.Items.Add(NewItem("icon_snow_75_me", Color.FromHex("#80f200")));
+            selector.Items.Add(NewItem("icon_snow_80_me", Color.FromHex("#80d200")));
+            selector.Items.Add(NewItem("icon_teal_245_me", Color.FromHex("#80f300")));
+            selector.Items.Add(NewItem("icon_violet_180_me", Color.FromHex("#80fb00")));
+            selector.Items.Add(NewItem("icon_yellow_345_me", Color.FromHex("#800b30")));
+            //selector.BackgroundImage = new Image(window);
+            //selector.BackgroundImage.Load(Path.Combine(TestRunner.ResourceDir, "icons", "round_bg_green.png"));
+            //selector.BackgroundColor = Color.Pink;
+            //selector.PressedBackgroundColor = Color.Gray;
+            conf.SetContent(selector);
+
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TestCaseBase.cs b/test/ElmSharp.Wearable.Test/TestCaseBase.cs
new file mode 100644 (file)
index 0000000..5803eaa
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+    public abstract class TestCaseBase
+    {
+        public abstract string TestName { get; }
+        public abstract string TestDescription { get; }
+        public abstract void Run(Window window);
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/TestRunner.cs b/test/ElmSharp.Wearable.Test/TestRunner.cs
new file mode 100644 (file)
index 0000000..927f2b6
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+
+using Tizen.Applications;
+
+namespace ElmSharp.Test
+{
+    public class TestRunner : CoreUIApplication
+    {
+        internal Window _firstPageWindow;
+        private static bool s_terminated;
+
+        public static string ResourceDir { get; private set; }
+
+        public TestRunner()
+        {
+            s_terminated = false;
+        }
+
+        protected override void OnCreate()
+        {
+            ResourceDir = DirectoryInfo.Resource;
+
+            var testCases = GetTestCases();
+            CreateFirstPage(testCases);
+            base.OnCreate();
+        }
+
+        protected override void OnTerminate()
+        {
+            s_terminated = true;
+            base.OnTerminate();
+        }
+
+        public void RunStandalone(string[] args)
+        {
+            ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res");
+
+            EcoreSynchronizationContext.Initialize();
+
+            var testCases = GetTestCases();
+            TestCaseBase theTest = null;
+
+            if (args.Count() > 0)
+            {
+                theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault();
+            }
+
+            if (theTest != null)
+            {
+                StartTC(theTest);
+                EcoreMainloop.Begin();
+            }
+            else
+            {
+                CreateFirstPage(testCases);
+                EcoreMainloop.Begin();
+            }
+
+            Elementary.Shutdown();
+        }
+
+        private IEnumerable<TestCaseBase> GetTestCases()
+        {
+            Assembly asm = typeof(TestRunner).GetTypeInfo().Assembly;
+            Type testCaseType = typeof(TestCaseBase);
+
+            var tests = from test in asm.GetTypes()
+                        where testCaseType.IsAssignableFrom(test) && !test.GetTypeInfo().IsInterface && !test.GetTypeInfo().IsAbstract
+                        select Activator.CreateInstance(test) as TestCaseBase;
+
+            return from test in tests
+                   orderby test.TestName
+                   select test;
+        }
+
+        internal static void UIExit()
+        {
+            EcoreMainloop.Quit();
+        }
+
+        private Window CreateWindow(bool isSecond = false)
+        {
+            Window window = new Window("ElmSharp UI Tests")
+            {
+                AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
+            };
+            window.Show();
+            if (isSecond)
+            {
+                window.BackButtonPressed += (s, e) =>
+                {
+                    window.Hide();
+                    window.Unrealize();
+                    GC.Collect();
+                    GC.WaitForPendingFinalizers();
+                };
+            }
+            else
+            {
+                window.BackButtonPressed += (s, e) =>
+                {
+                    UIExit();
+                };
+            }
+            return window;
+        }
+
+        private void CreateFirstPage(IEnumerable<TestCaseBase> testCases)
+        {
+            _firstPageWindow = CreateWindow();
+            Console.WriteLine("Screen DPI : {0}", _firstPageWindow.ScreenDpi.X);
+            Conformant conformant = new Conformant(_firstPageWindow);
+            conformant.Show();
+            Box box = new Box(_firstPageWindow)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+            box.Show();
+            var bg = new Background(_firstPageWindow);
+            bg.Color = Color.White;
+            bg.SetContent(box);
+            conformant.SetContent(bg);
+
+            GenList list = new GenList(_firstPageWindow)
+            {
+                Homogeneous = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            GenItemClass defaultClass = new GenItemClass("default")
+            {
+                GetTextHandler = (data, part) =>
+                {
+                    return string.Format("{0}",(string)data);
+                }
+            };
+
+            list.Append(defaultClass, "");
+            foreach (var tc in testCases)
+            {
+                list.Append(defaultClass, tc.TestName);
+            }
+            list.Append(defaultClass, "");
+
+            list.ItemSelected += (s, e) =>
+            {
+                foreach (var tc in testCases)
+                {
+                    if (tc.TestName == (string)(e.Item.Data))
+                    {
+                        StartTCFromList(tc);
+                        break;
+                    }
+                }
+            };
+            list.Show();
+
+            box.PackEnd(list);
+        }
+
+        private void StartTC(TestCaseBase tc)
+        {
+            Window window = CreateWindow();
+            tc.Run(window);
+        }
+
+        private void StartTCFromList(TestCaseBase tc)
+        {
+            Window window = CreateWindow(true);
+            tc.Run(window);
+        }
+
+        static void Main(string[] args)
+        {
+            Elementary.Initialize();
+            Elementary.ThemeOverlay();
+
+            Console.WriteLine("ELM_PROFILE : {0}", Elementary.GetProfile());
+            Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale());
+
+            TestRunner testRunner = new TestRunner();
+            testRunner.Run(args);
+
+            // if running with appfw is failed, below line will be executed.
+            if (!s_terminated)
+            {
+                testRunner.RunStandalone(args);
+            }
+        }
+    }
+}
diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_black.png b/test/ElmSharp.Wearable.Test/res/icons/bg_black.png
new file mode 100644 (file)
index 0000000..08a258a
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/bg_black.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_red.png b/test/ElmSharp.Wearable.Test/res/icons/bg_red.png
new file mode 100644 (file)
index 0000000..b8ccbb5
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/bg_red.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_white.png b/test/ElmSharp.Wearable.Test/res/icons/bg_white.png
new file mode 100644 (file)
index 0000000..1041aa0
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/bg_white.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png
new file mode 100644 (file)
index 0000000..f6ea110
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png
new file mode 100644 (file)
index 0000000..d35eeca
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png
new file mode 100644 (file)
index 0000000..17e613c
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png
new file mode 100644 (file)
index 0000000..7bfac09
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png
new file mode 100644 (file)
index 0000000..7da3ffa
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png
new file mode 100644 (file)
index 0000000..4b176aa
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png
new file mode 100644 (file)
index 0000000..c846907
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png
new file mode 100644 (file)
index 0000000..faaeb6c
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png
new file mode 100644 (file)
index 0000000..b0a23b7
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png
new file mode 100644 (file)
index 0000000..617703f
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png
new file mode 100644 (file)
index 0000000..b25e59c
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png
new file mode 100644 (file)
index 0000000..1617f72
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png
new file mode 100644 (file)
index 0000000..89ee897
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png
new file mode 100644 (file)
index 0000000..685c002
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png
new file mode 100644 (file)
index 0000000..822d1ec
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_me.png
new file mode 100644 (file)
index 0000000..a0ec18c
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png
new file mode 100644 (file)
index 0000000..c063483
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png
new file mode 100644 (file)
index 0000000..d0934f0
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png
new file mode 100644 (file)
index 0000000..69468e2
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png
new file mode 100644 (file)
index 0000000..66bbd09
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png
new file mode 100644 (file)
index 0000000..e6d82d7
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png
new file mode 100644 (file)
index 0000000..b419131
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png
new file mode 100644 (file)
index 0000000..db1a10c
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png
new file mode 100644 (file)
index 0000000..df07406
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png
new file mode 100644 (file)
index 0000000..9af0e0f
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/make_icon.sh b/test/ElmSharp.Wearable.Test/res/icons/make_icon.sh
new file mode 100644 (file)
index 0000000..31f6fe8
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+OPTIND=1
+
+while getopts "h?c:r:" opt; do
+       case "$opt" in
+               h|\?)
+                       echo "$0 [-c color] [-r degree]"
+                       exit 0
+                       ;;
+               c) color=$OPTARG
+                       ;;
+               r) rotate=$OPTARG
+                       ;;
+       esac
+done
+
+shift $((OPTIND-1))
+filename=$1
+iconname=$2
+
+if [ -z $color ]; then
+       color="white"
+fi
+
+if [ -z $rotate ]; then
+       rotate=0
+fi
+
+if [ -z $toname ]; then
+       iconname="icon_${color}_${rotate}_$filename"
+fi
+
+convert $filename -resize 75x75 \
+       -stroke $color -fill none -draw "stroke-width 5 circle 37, 37, 60, 60" \
+       \( +clone -threshold -1 -negate -fill white -draw "ellipse 37, 37 36, 36 4, 176 ellipse 37, 37, 36, 36 184, 356" \) \
+       -distort SRT $rotate \
+       -alpha off -compose copy_opacity -composite $iconname
+
diff --git a/test/ElmSharp.Wearable.Test/res/icons/me.png b/test/ElmSharp.Wearable.Test/res/icons/me.png
new file mode 100644 (file)
index 0000000..1653fa6
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/me.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/me_circle.png b/test/ElmSharp.Wearable.Test/res/icons/me_circle.png
new file mode 100644 (file)
index 0000000..f52d56a
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/me_circle.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/me_small.png b/test/ElmSharp.Wearable.Test/res/icons/me_small.png
new file mode 100644 (file)
index 0000000..f024c79
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/me_small.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/pressed.png b/test/ElmSharp.Wearable.Test/res/icons/pressed.png
new file mode 100644 (file)
index 0000000..a0a9abb
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/pressed.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png
new file mode 100644 (file)
index 0000000..c13f8c1
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png
new file mode 100644 (file)
index 0000000..9499af8
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png
new file mode 100644 (file)
index 0000000..a2e1d91
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png
new file mode 100644 (file)
index 0000000..4034791
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png
new file mode 100644 (file)
index 0000000..f4e5be9
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png differ
diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png
new file mode 100644 (file)
index 0000000..1951a9d
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png differ
diff --git a/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png b/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png differ
diff --git a/test/ElmSharp.Wearable.Test/tizen-manifest.xml b/test/ElmSharp.Wearable.Test/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..623eb7c
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="ElmSharpTest.Wearable" version="1.0.0">
+       <profile name="wearable" />
+       <ui-application appid="org.tizen.ElmSharp.Wearable.Test"
+                                       exec="ElmSharp.Wearable.Test.exe"
+                                       type="dotnet"
+                                       multiple="false"
+                                       taskmanage="true"
+                                       launch_mode="single">
+       <icon>ElmSharp.Wearable.Test.png</icon>
+       <label>ElmSharp.Wearable.Test</label>
+       </ui-application>
+</manifest>