Init commit
authorJeesun Kim <iamjs.kim@samsung.com>
Fri, 7 Apr 2017 03:51:58 +0000 (12:51 +0900)
committerjeesun kim <iamjs.kim@samsung.com>
Wed, 12 Apr 2017 04:27:17 +0000 (21:27 -0700)
Change-Id: I84e5a29636cd9d7e745d0a56a4cdf6a994cc3bc2

30 files changed:
LICENSE [new file with mode: 0644]
packaging/csapi-calendar-service.manifest [new file with mode: 0644]
packaging/csapi-calendar-service.spec [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/Properties/AssemblyInfo.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.project.json [new file with mode: 0644]
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln [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/ReminderEventArgs.cs [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 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-calendar-service.manifest b/packaging/csapi-calendar-service.manifest
new file mode 100644 (file)
index 0000000..75b0fa5
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+    <request>
+        <domain name="_"/>
+    </request>
+</manifest>
diff --git a/packaging/csapi-calendar-service.spec b/packaging/csapi-calendar-service.spec
new file mode 100755 (executable)
index 0000000..9f184e6
--- /dev/null
@@ -0,0 +1,77 @@
+%{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
+%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
+
+%if 0%{?tizen_build_devel_mode}
+%define BUILDCONF Debug
+%else
+%define BUILDCONF Release
+%endif
+
+Name:       csapi-calendar-service
+Summary:    Tizen Calendar Service API for C#
+Version:    1.0.0
+Release:    1
+Group:      Development/Libraries
+License:    Apache-2.0
+URL:        https://www.tizen.org
+Source0:    %{name}-%{version}.tar.gz
+Source1:    %{name}.manifest
+
+AutoReqProv: no
+
+BuildRequires: mono-compiler
+BuildRequires: mono-devel
+
+BuildRequires: dotnet-build-tools
+
+# C# API Requires
+BuildRequires: csapi-tizen-nuget
+
+%description
+Tizen Calendar Service API for C#
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%define Assemblies Tizen.Pims.Calendar
+
+%build
+for ASM in %{Assemblies}; do
+# NuGet Restore
+find $ASM/*.project.json -exec nuget restore {} \;
+# Build
+find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
+# NuGet Pack
+nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
+done
+
+%install
+# Runtime Binary
+mkdir -p %{buildroot}%{dotnet_assembly_path}
+for ASM in %{Assemblies}; do
+%if 0%{?_with_corefx}
+  install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
+%else
+  install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
+%endif
+done
+
+# NuGet
+mkdir -p %{buildroot}/nuget
+install -p -m 644 *.nupkg %{buildroot}/nuget
+
+%files
+%manifest %{name}.manifest
+%license LICENSE
+%attr(644,root,root) %{dotnet_assembly_path}/*.dll
+
+%package nuget
+Summary:   NuGet package for %{name}
+Group:     Development/Libraries
+
+%description nuget
+NuGet package for %{name}
+
+%files nuget
+/nuget/*.nupkg
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..f8a1a40
--- /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 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);
+        }
+    }
+}
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..7513b22
--- /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..ff958ea
--- /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..93fc469
--- /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..ff86dd5
--- /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 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..0857a91
--- /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..cae2d17
--- /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/Properties/AssemblyInfo.cs b/src/Tizen.Pims.Calendar/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..b740a0a
--- /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("Tizen.Content")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Tizen.Content")]
+[assembly: AssemblyCopyright("Copyright \u00A9  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("61334a1f-008b-44b5-afcd-063a3e063d45")]
+
+// 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/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj
new file mode 100644 (file)
index 0000000..84f6106
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{98DD51D2-9332-47AA-B4EA-D1DB7E71C395}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Tizen.Pims.Calendar</RootNamespace>
+    <AssemblyName>Tizen.Pims.Calendar</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <DefaultLanguage>en-US</DefaultLanguage>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.3</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701</NoWarn>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </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>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="Tizen.Pims.Calendar.project.json" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Interop\Interop.Calendar.Vcalendar.cs" />
+    <Compile Include="Interop\Interop.Calendar.Reminder.cs" />
+    <Compile Include="Interop\Interop.Calendar.Record.cs" />
+    <Compile Include="Interop\Interop.Calendar.Query.cs" />
+    <Compile Include="Interop\Interop.Calendar.List.cs" />
+    <Compile Include="Interop\Interop.Calendar.Filter.cs" />
+    <Compile Include="Interop\Interop.Calendar.Database.cs" />
+    <Compile Include="Interop\Interop.Calendar.Service.cs" />
+    <Compile Include="Interop\Interop.Calendar.Libraries.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarDatabase.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarFilter.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarList.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarManager.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarRecord.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarReminder.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarTypes.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarVcalendar.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarViews.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarQuery.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarStructs.cs" />
+    <Compile Include="Tizen.Pims.Calendar\CalendarErrorFactory.cs" />
+    <Compile Include="Tizen.Pims.Calendar\ReminderEventArgs.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
+  </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>
+</Project>
\ No newline at end of file
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.project.json b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.project.json
new file mode 100644 (file)
index 0000000..0486945
--- /dev/null
@@ -0,0 +1,9 @@
+{
+  "dependencies": {
+    "NETStandard.Library": "1.6.0",
+    "Tizen": "1.0.1"
+  },
+  "frameworks": {
+    "netstandard1.3": {}
+  }
+}
\ No newline at end of file
diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln
new file mode 100644 (file)
index 0000000..702e5eb
--- /dev/null
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Pims.Calendar", "Tizen.Pims.Calendar.csproj", "{98DD51D2-9332-47AA-B4EA-D1DB7E71C395}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinApplication2.Tizen", "..\..\XamarinApplication2\XamarinApplication2\XamarinApplication2.Tizen\XamarinApplication2.Tizen.csproj", "{47A990B2-CC6D-48D3-8007-38308056E3E0}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {98DD51D2-9332-47AA-B4EA-D1DB7E71C395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {98DD51D2-9332-47AA-B4EA-D1DB7E71C395}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {98DD51D2-9332-47AA-B4EA-D1DB7E71C395}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {98DD51D2-9332-47AA-B4EA-D1DB7E71C395}.Release|Any CPU.Build.0 = Release|Any CPU
+               {47A990B2-CC6D-48D3-8007-38308056E3E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {47A990B2-CC6D-48D3-8007-38308056E3E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {47A990B2-CC6D-48D3-8007-38308056E3E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {47A990B2-CC6D-48D3-8007-38308056E3E0}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
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..1d2752f
--- /dev/null
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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 contact service.
+/// </remarks>
+
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// CalendarDatabase class is the interface class for managing the record from/to the database.
+    /// This class allows usre to access/create/update db operations for media content.
+    /// </summary>
+    public class CalendarDatabase
+    {
+        /// <summary>
+        /// </summary>
+        /// <param name="uri">The record uri</param>
+        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()
+        {
+
+        }
+
+        /// <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>
+        /// The calendar database version on the current connection.
+        /// </summary>
+        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 record id
+        /// </returns>
+        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>
+        /// CalendarRecord instance.
+        /// </returns>
+        public CalendarRecord Get(string viewUri, int recordId)
+        {
+            IntPtr handle;
+            int error = Interop.Calendar.Database.Get(viewUri, recordId, out handle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                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>
+        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>
+        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>
+        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>
+        /// CalendarList
+        /// </returns>
+        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>
+        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>
+        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>
+        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>
+        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>
+        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>
+        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>
+        /// CalendarList
+        /// </returns>
+        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
+        /// </returns>
+        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
+        /// </returns>
+        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>
+        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>
+        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);
+        }
+    }
+}
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..2f53036
--- /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 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 */
+        InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,   /**< Invalid parameter */
+        FileNoSpace = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice,     /** <FS Full*/
+        PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,   /**< Permission denied */
+        NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,           /**< Not supported */
+        NoData = Tizen.Internals.Errors.ErrorCode.NoData,                       /**< Requested data does not exist */
+        DBLocked = Globals.ErrorCalendar | 0x81,                                        /**< Database table locked or file locked */
+        ErrorDB = Globals.ErrorCalendar | 0x9F,                                         /**< Unknown DB error */
+        IPCNotAvailable = Globals.ErrorCalendar | 0xB1,                                 /**< IPC server is not available */
+        ErrorIPC = Globals.ErrorCalendar | 0xBF,                                        /**< Unknown IPC error */
+        ErrorSystem = Globals.ErrorCalendar | 0xEF,                                     /**< Internal system module error */
+        ErrorInternal = Globals.ErrorCalendar | 0xFF,                                   /**< Implementation Error Temporary Use */
+    };
+
+    internal static class Globals
+    {
+        internal const string LogTag = "Tizen.Pims.Calendar";
+        internal const int ErrorCalendar = -0x02010000;
+    }
+
+    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..516d366
--- /dev/null
@@ -0,0 +1,415 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarFilter:IDisposable
+    {
+        internal IntPtr _filterHandle;
+
+        /// <summary>
+        /// Creates a filter with 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>
+        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 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>
+        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 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>
+        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 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>
+        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 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>
+        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>
+        /// <param name=""></param>
+        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>
+        /// <param name=""></param>
+        public enum IntegerMatchType
+        {
+            /// <summary>
+            /// '='
+            /// </summary>
+            Equal,
+            /// <summary>
+            /// '>'
+            /// </summary>
+            GreaterThan,
+            /// <summary>
+            /// '>='
+            /// </summary>
+            GreaterThanOrEqual,
+            /// <summary>
+            /// <
+            /// </summary>
+            LessThan,
+            /// <summary>
+            /// <=
+            /// </summary>
+            LessThanOrEqual,
+            /// <summary>
+            /// <>, this flag can yield poor performance
+            /// </summary>
+            NotEqual,
+            /// <summary>
+            /// IS NULL
+            /// </summary>
+            None,
+        }
+
+        /// <summary>
+        /// Enumeration for a filter operator.
+        /// </summary>
+        /// <param name=""></param>
+        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;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds a condition for the 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 valu</param>
+        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 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 valu</param>
+        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 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 valu</param>
+        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 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 valu</param>
+        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 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 valu</param>
+        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>
+        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..91e6f33
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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 class CalendarList:IDisposable
+    {
+        internal int _count = -1;
+        internal IntPtr _listHandle;
+        internal CalendarList(IntPtr handle)
+        {
+            _listHandle = handle;
+        }
+
+        /// <summary>
+        /// Creates a calendar list.
+        /// </summary>
+        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);
+            }
+        }
+
+        ~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;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds a record to the calendar list.
+        /// </summary>
+        /// <param name="record">The record to be added</param>
+        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;
+        }
+
+        /// <summary>
+        /// Removes a record from the calendar list.
+        /// </summary>
+        /// <param name="record">The record to be removed</param>
+        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;
+        }
+
+        /// <summary>
+        /// Retrieves a record from the calendar list.
+        /// </summary>
+        /// <returns>
+        /// CalendarRecord
+        /// </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..f2cbdfb
--- /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;
+using static Interop.Calendar.Service;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarManager : IDisposable
+    {
+        private CalendarDatabase _db = null;
+
+        /// <summary>
+        /// Create a manager.
+        /// </summary>
+        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
+        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.Service.Disconnect();
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Disconnect Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                disposedValue = true;
+            }
+        }
+
+        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..ddd9c02
--- /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 static Interop.Calendar.Query;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarQuery : IDisposable
+    {
+        internal IntPtr _queryHandle;
+
+        /// <summary>
+        /// Creates a query.
+        /// </summary>
+        /// <param name="viewUri">The view URI of a query</param>
+        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;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+#endregion
+
+        /// <summary>
+        /// Adds property IDs for projection.
+        /// </summary>
+        /// <param name="propertyIdArray">The property ID array </param>
+        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>
+        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>
+        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>
+        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..7c4eec3
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarRecord : IDisposable
+    {
+        internal string _uri;
+        internal uint _id;
+        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);
+        }
+
+        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);
+        }
+
+        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);
+        }
+
+        /// <summary>
+        /// Creates a record.
+        /// </summary>
+        /// <param name="viewUri">The view URI</param>
+        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;
+        }
+
+        ~CalendarRecord()
+        {
+            Dispose(false);
+        }
+
+#region IDisposable Support
+        internal 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.Record.Destroy(_recordHandle, false);
+                if (CalendarError.None != (CalendarError)error)
+                {
+                    Log.Error(Globals.LogTag, "Destroy Failed with error " + error);
+                    throw CalendarErrorFactory.GetException(error);
+                }
+                _disposedValue = true;
+            }
+        }
+
+        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.TypeValue;
+            if ((int)CalendarTime.Type.Utc == time.type)
+            {
+                DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0);
+                time.utime = (value.DateTime.Ticks - epoch.Ticks) / 10000000;
+            }
+            else
+            {
+                time.year = value.DateTime.Year;
+                time.month = value.DateTime.Month;
+                time.mday = value.DateTime.Day;
+                time.hour = value.DateTime.Hour;
+                time.minute = value.DateTime.Minute;
+                time.second = value.DateTime.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);
+            }
+            return value;
+        }
+
+        /// <summary>
+        /// Makes a clone of a record.
+        /// </summary>
+        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 record which property id is matched.
+        /// </returns>
+        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 object to a record.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="value">value</param>
+        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>
+        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>
+        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>
+        /// Get a child record count.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// Count
+        /// </returns>
+        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>
+        /// Get a child record with index.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <param name="index">The child record index</param>
+        /// <returns>
+        /// CalendarRecord
+        /// </returns>
+        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>
+        /// Makes a clone of a given record's child record list.
+        /// </summary>
+        /// <param name="propertyId">The property ID</param>
+        /// <returns>
+        /// CalendarList
+        /// </returns>
+        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..3de7e19
--- /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 static Interop.Calendar.Reminder;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarReminder : IDisposable
+    {
+#region IDisposable Support
+        private bool disposedValue = false;
+
+        internal CalendarReminder()
+        {
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                disposedValue = true;
+            }
+        }
+
+        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..15c6544
--- /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 System.Runtime.InteropServices;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    public class CalendarTime : IDisposable
+    {
+        internal int _type;
+        internal DateTime _dateTime;
+
+        /// <summary>
+        /// Enumeration for the time type.
+        /// </summary>
+        public enum Type
+        {
+            /// <summary>
+            /// UTC time
+            /// </summary>
+            Utc,
+            /// <summary>
+            /// Local time
+            /// </summary>
+            Local
+        }
+
+        /// <summary>
+        /// Get time type.
+        /// </summary>
+        public int TypeValue
+        {
+            get
+            {
+                return _type;
+            }
+        }
+
+        /// <summary>
+        /// Get datatime.
+        /// </summary>
+        public DateTime DateTime
+        {
+            get
+            {
+                return _dateTime;
+            }
+        }
+
+        /// <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 % 10000000; /* delete millisecond */
+            _dateTime = 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>
+        public CalendarTime(int year, int month, int day, int hour, int minute, int second)
+        {
+            _type = (int)Type.Local;
+            _dateTime = new DateTime(year, month, day, hour, minute, second);
+        }
+
+        /// <summary>
+        /// Compare CalendarTime
+        /// </summary>
+        /// <param name="t1">The first CalendarTime to compare</param>
+        /// <param name="t1">The second CalendarTime to compare</param>
+        /// <returns>
+        /// A signed number indicating the relative values of t1 and t2.
+        /// </returns>
+        public static int Compare(CalendarTime t1, CalendarTime t2)
+        {
+            if (t1.TypeValue != t2.TypeValue)
+                return -1;
+
+            long ret = (t1.DateTime.Ticks / 10000000) - (t2.DateTime.Ticks / 10000000);
+            return (int)(0 == ret ? 0 : (ret / ret));
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name=""></param>
+        public void Dispose()
+        {
+
+        }
+    }
+}
+
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..11e41e3
--- /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 Range
+               {
+                       /// <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..9b40aeb
--- /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.Threading.Tasks;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+namespace Tizen.Pims.Calendar
+{
+    /// <summary>
+    /// </summary>
+    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>
+        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>
+        /// List of records
+        /// </returns>
+        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"></param>
+        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..cb10cd6
--- /dev/null
@@ -0,0 +1,1510 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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 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,
+
+            /// 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,
+        }
+
+        /// <summary>
+        /// </summary>
+        public class Book
+        {
+            internal 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</tr>
+            /// </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 @ref calendar_book_type_e)
+            /// </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 @ref calendar_book_mode_e)
+            /// </summary>
+            public const uint Mode        = (uint)PropertyIds.BookMode;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class Event
+        {
+            internal 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>
+            /// Refer to the @ref calendar_event_status_e
+            /// </summary>
+            public const uint EventStatus        = (uint)PropertyIds.EventEventStatus;
+            /// <summary>
+            /// Refer to the @ref calendar_event_priority_e
+            /// </summary>
+            public const uint Priority           = (uint)PropertyIds.EventPriority;
+            /// <summary>
+            /// The timezone_id of the event if it exists. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_timezone
+            /// </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>
+            /// Refer to the @ref calendar_event_busy_status_e
+            /// </summary>
+            public const uint BusyStatus         = (uint)PropertyIds.EventBusyStatus;
+            /// <summary>
+            /// Refer to the @ref calendar_sensitivity_e
+            /// </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>
+            /// Refer to the @ref calendar_meeting_status_e
+            /// </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 @ref calendar_recurrence_frequency_e
+            /// </summary>
+            public const uint Freq               = (uint)PropertyIds.EventFreq;
+            /// <summary>
+            /// Refer to the @ref calendar_range_type_e
+            /// </summary>
+            public const uint RangeType          = (uint)PropertyIds.EventRangeType;
+            /// <summary>
+            /// The end time of the event recurrence. If the range_type is @ref CALENDAR_RANGE_UNTIL
+            /// </summary>
+            public const uint Until              = (uint)PropertyIds.EventUntil;
+            /// <summary>
+            /// The count of the event recurrence. If the range_type is @ref CALENDAR_RANGE_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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated by commas
+            /// </summary>
+            public const uint Bysetpos           = (uint)PropertyIds.EventBysetpos;
+            /// <summary>
+            /// The start day of the week. Refer to the @ref calendar_days_of_week_e
+            /// </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. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_alarm
+            /// </summary>
+            public const uint Alarm              = (uint)PropertyIds.EventAlarm;
+            /// <summary>
+            /// The attendee list of the event. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_attendee
+            /// </summary>
+            public const uint Attendee           = (uint)PropertyIds.EventAttendee;
+            /// <summary>
+            /// Refer to the @ref calendar_system_type_e
+            /// </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. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_extended_property
+            /// </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>
+        /// </summary>
+        /// <param name=""></param>
+        public class Todo
+        {
+            internal 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>
+            /// Refer to the @ref calendar_todo_status_e
+            /// </summary>
+            public const uint TodoStatus        = (uint)PropertyIds.TodoStatus;
+            /// <summary>
+            /// Refer to the @ref calendar_todo_priority_e
+            /// </summary>
+            public const uint Priority          = (uint)PropertyIds.TodoPriority;
+            /// <summary>
+            /// Refer to the @ref calendar_sensitivity_e
+            /// </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 @ref calendar_recurrence_frequency_e
+            /// </summary>
+            public const uint Freq              = (uint)PropertyIds.TodoFreq;
+            /// <summary>
+            /// Refer to the @ref calendar_range_type_e
+            /// </summary>
+            public const uint RangeType         = (uint)PropertyIds.TodoRangeType;
+            /// <summary>
+            /// The end time of the todo recurrence. If the range_type is CALENDAR_RANGE_UNTI
+            /// </summary>
+            public const uint Until             = (uint)PropertyIds.TodoUntil;
+            /// <summary>
+            /// The count of the todo recurrence. If the range_type is CALENDAR_RANGE_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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated 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 seperated by commas
+            /// </summary>
+            public const uint Bysetpos          = (uint)PropertyIds.TodoBysetpos;
+            /// <summary>
+            /// The start day of the week. Refer to the @ref calendar_days_of_week_e
+            /// </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. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_alarm
+            /// </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. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_attendee
+            /// </summary>
+            public const uint Attendee          = (uint)PropertyIds.TodoAttendee;
+            /// <summary>
+            /// The extended property list of the todo. Refer to the @ref CAPI_SOCIAL_CALENDAR_SVC_VIEW_MODULE_calendar_extended_property
+            /// </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;
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name=""></param>
+        public class Timezone
+        {
+            internal 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;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class Attendee
+        {
+            internal 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 (one of CALENDAR_ATTENDEE_CUTYPE_INDIVIDUAL, CALENDAR_ATTENDEE_CUTYPE_GROUP, CALENDAR_ATTENDEE_CUTYPE_RESOURCE, CALENDAR_ATTENDEE_CUTYPE_ROOM, CALENDAR_ATTENDEE_CUTYPE_UNKNOWN) </tr>
+            /// </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 (one of CALENDAR_ATTENDEE_ROLE_REQ_PARTICIPANT, CALENDAR_ATTENDEE_ROLE_OPT_PARTICIPANT, CALENDAR_ATTENDEE_ROLE_NON_PARTICIPANT, CALENDAR_ATTENDEE_ROLE_CHAIR)
+            /// </summary>
+            public const uint Role         = (uint)PropertyIds.AttendeeRole;
+            /// <summary>
+            /// Attendee status (one of CALENDAR_ATTENDEE_STATUS_PENDING, CALENDAR_ATTENDEE_STATUS_ACCEPTED, CALENDAR_ATTENDEE_STATUS_DECLINED, CALENDAR_ATTENDEE_STATUS_TENTATIVE, CALENDAR_ATTENDEE_STATUS_DELEGATED, CALENDAR_ATTENDEE_STATUS_COMPLETED, CALENDAR_ATTENDEE_STATUS_IN_PROCESS)
+            /// </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;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class Alarm
+        {
+            internal 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 CALENDAR_ALARM_TIME_UNIT_MINUTE, CALENDAR_ALARM_TIME_UNIT_HOUR, CALENDAR_ALARM_TIME_UNIT_DAY, CALENDAR_ALARM_TIME_UNIT_WEEK.
+            /// </summary>
+            public const uint Tick        = (uint)PropertyIds.AlarmTick;
+            /// <summary>
+            /// Reminder tick time unit (one of CALENDAR_ALARM_NONE, CALENDAR_ALARM_TIME_UNIT_SPECIFIC, CALENDAR_ALARM_TIME_UNIT_MINUTE, CALENDAR_ALARM_TIME_UNIT_HOUR, CALENDAR_ALARM_TIME_UNIT_DAY, CALENDAR_ALARM_TIME_UNIT_WEEK)
+            /// </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 (one of CALENDAR_ALARM_ACTION_AUDIO, CALENDAR_ALARM_ACTION_DISPLAY, CALENDAR_ALARM_ACTION_EMAIL)
+            /// </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;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class InstanceUtimeBook
+        {
+            internal 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;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class InstanceLocaltimeBook
+        {
+            internal 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;
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name=""></param>
+        public class InstanceUtimeBookExtended
+        {
+            internal 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;
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name=""></param>
+        public class InstanceLocaltimeBookExtended
+        {
+            internal 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;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class UpdatedInfo
+        {
+            internal 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 (@ref calendar_record_modified_status_e)
+            /// </summary>
+            public const uint Type       = (uint)PropertyIds.UpdateInfoType;
+            /// <summary>
+            /// Version after change
+            /// </summary>
+            public const uint Version    = (uint)PropertyIds.UpdateInfoVersion;
+        }
+
+        /// <summary>
+        /// </summary>
+        public class Extended
+        {
+            internal 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 (@ref calendar_record_type_e)
+            /// </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/ReminderEventArgs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs
new file mode 100644 (file)
index 0000000..11bb9d4
--- /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 System.Collections.Generic;
+
+/// <summary>
+/// </summary>
+/// <remarks>
+/// </remarks>
+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 combined(Value string like id=value&time=value&tick=value&unit=value&type=value)
+        /// </summary>
+        public string Param
+        {
+            get;
+            internal set;
+        }
+    }
+}