[misc] Sync from master branch. 2.1b_release accepted/tizen_2.1/20130425.021649 submit/tizen_2.1/20130424.223122
authorTaeho Kang <taeho84.kang@samsung.com>
Mon, 22 Apr 2013 23:52:27 +0000 (08:52 +0900)
committerTaeho Kang <taeho84.kang@samsung.com>
Mon, 22 Apr 2013 23:52:27 +0000 (08:52 +0900)
25 files changed:
CMakeLists.txt
LICENSE.Flora
common/save-cancel.c
common/util-efl.c
include/appcontrol.h [new file with mode: 0755]
include/cld-utils.h
include/cld.h
include/save-cancel.h
libug-calendar-efl.xml
packaging/org.tizen.calendar.spec
src/list-base.c
src/list-delete.c
src/main.c
src/view-main-week.c
ug/detail/detail-ug.c
ug/edit/edit-alarm.c
ug/edit/edit-alarm.h
ug/edit/edit-repeat.c
ug/edit/edit-repeat.h
ug/edit/edit-ug.c
ug/list/ug-list.c
ug/list/ug.c
ug/list/ug.h
ug/settings/ug-settings.h
viewer/viewer.c

index 54c2d52..3150211 100755 (executable)
@@ -51,7 +51,6 @@ pkg_check_modules(pkgs REQUIRED
                ecore-evas
                notification
                capi-content-media-content
-               status
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
@@ -100,6 +99,7 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.xml DESTINATION /usr/share/packages
 # ui-gadget
 ADD_SUBDIRECTORY(ug)
 
+CONFIGURE_FILE(${CMAKE_BINARY_DIR}/libug-calendar-efl.xml ${CMAKE_BINARY_DIR}/libug-calendar-efl.xml)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/libug-calendar-efl.xml DESTINATION /usr/share/packages)
 
 # i18n
index cc8727b..fd90a36 100755 (executable)
@@ -1,6 +1,6 @@
 Flora License
 
-Version 1.0, May, 2012
+Version 1.0, April, 2013
 
 http://floralicense.org/license/
 
@@ -8,57 +8,187 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
 
 1. Definitions.
 
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Tizen Compliance Specification
+and passes the Tizen Compliance Tests as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.  You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+  2. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+  3. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+  4. If the Work includes a "NOTICE" text file as part of its distribution,
+     then any Derivative Works that You distribute must include a readable
+     copy of the attribution notices contained within such NOTICE file,
+     excluding those notices that do not pertain to any part of
+     the Derivative Works, in at least one of the following places:
+     within a NOTICE text file distributed as part of the Derivative Works;
+     within the Source form or documentation, if provided along with the
+     Derivative Works; or, within a display generated by the Derivative Works,
+     if and wherever such third-party notices normally appear.
+     The contents of the NOTICE file are for informational purposes only
+     and do not modify the License.
+
+You may add Your own attribution notices within Derivative Works
+that You distribute, alongside or as an addendum to the NOTICE text
+from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License. You may add Your own
+copyright statement to Your modifications and may provide additional or
+different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works
+as a whole, provided Your use, reproduction, and distribution of
+the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks.  This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
 
 END OF TERMS AND CONDITIONS
 
 APPENDIX: How to apply the Flora License to your work
 
-To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
 
    Copyright [yyyy] [name of copyright owner]
 
@@ -73,3 +203,4 @@ To apply the Flora License to your work, attach the following boilerplate notice
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
+
index 1137f00..d0b0c1a 100755 (executable)
 #include "cld.h"
 
 typedef struct {
+       Evas_Object *window;
+       Evas_Object *conformant;
        Evas_Object *naviframe;
-       Elm_Object_Item *navi_item;
 
-       Evas_Object *conformant;
+       Elm_Object_Item *navi_item;
 
        Evas_Object *tabbar;
 
@@ -35,9 +36,15 @@ typedef struct {
        save_cancel_cb save_callback;
        save_cancel_cb cancel_callback;
        void *callback_data;
+
+       Ecore_Timer *timer;
+       Ecore_IMF_Context *imf_context;
+
+
 } cal_save_cancel_s;
 
-static void __cal_save_cancel_show_title_toolbar(void *data, Evas_Object *obj, void *event_info)
+
+static void __cal_save_cancel_show_title(void *data, Evas_Object *obj, void *event_info)
 {
        CAL_FN_START;
 
@@ -45,27 +52,10 @@ static void __cal_save_cancel_show_title_toolbar(void *data, Evas_Object *obj, v
 
        cal_save_cancel_s* p = data;
 
-       Elm_Object_Item *navi_item = p->navi_item;
-
-       Evas_Object *tabbar = elm_object_item_part_content_unset(navi_item, "tabbar");
-
-       if (tabbar != NULL) {
-
-               evas_object_hide(tabbar);
-
-               Evas_Object *bottom_save_button = elm_object_item_part_content_unset(navi_item, "toolbar_button1");
-               evas_object_hide(bottom_save_button);
-
-               Evas_Object *bottom_cancel_button = elm_object_item_part_content_unset(navi_item, "prev_btn");
-               evas_object_hide(bottom_cancel_button);
-
-               p->tabbar = tabbar;
-       }
-
-       elm_object_item_signal_emit(navi_item, "elm,state,sip,shown", "");
+       elm_naviframe_item_title_visible_set(p->navi_item, EINA_TRUE);
 }
 
-static void __cal_save_cancel_hide_title_toolbar(void *data, Evas_Object *obj, void *event_info)
+static void __cal_save_cancel_hide_title(void *data, Evas_Object *obj, void *event_info)
 {
        CAL_FN_START;
 
@@ -73,24 +63,10 @@ static void __cal_save_cancel_hide_title_toolbar(void *data, Evas_Object *obj, v
 
        cal_save_cancel_s* p = data;
 
-       Elm_Object_Item *navi_item = p->navi_item;
-
-       if (p->tabbar != NULL) {
-
-               elm_object_item_part_content_set(navi_item, "tabbar", p->tabbar);
+       cal_window_rotation rotation = elm_win_rotation_get(p->window);
 
-               evas_object_show(p->tabbar);
-
-               elm_object_item_part_content_set(navi_item, "toolbar_button1", p->bottom_save_button);
-               evas_object_show(p->bottom_save_button);
-
-               elm_object_item_part_content_set(navi_item, "prev_btn", p->bottom_cancel_button);
-               evas_object_show(p->bottom_cancel_button);
-
-               p->tabbar = NULL;
-       }
-
-       elm_object_item_signal_emit(navi_item, "elm,state,sip,hidden", "");
+       if (rotation == CAL_WINDOW_ROTATION_90 || rotation == CAL_WINDOW_ROTATION_270)
+               elm_naviframe_item_title_visible_set(p->navi_item, EINA_FALSE);
 }
 
 static void __cal_save_cancel_button_callback(void *data, Evas_Object *obj, void *event_info)
@@ -98,8 +74,6 @@ static void __cal_save_cancel_button_callback(void *data, Evas_Object *obj, void
        c_ret_if(!data);
 
        cal_save_cancel_s* p = data;
-
-       __cal_save_cancel_hide_title_toolbar(p, obj, event_info);
 }
 
 static void __cal_save_cancel_title_cancel_button_callback(void *data, Evas_Object *obj, void *event_info)
@@ -139,40 +113,8 @@ static void __cal_save_cancel_save_button_callback(void *data, Evas_Object *obj,
        p->save_callback(p->callback_data, obj, event_info);
 }
 
-static void __cal_save_cancel_input_panel_state_callback(void *data, Ecore_IMF_Context *imf_context, int value)
-{
-       c_ret_if(!data);
-
-       if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW)
-               __cal_save_cancel_show_title_toolbar(data, NULL, NULL);
-       else
-               __cal_save_cancel_hide_title_toolbar(data, NULL, NULL);
-}
-
-void cal_save_cancel_set_input_panel_callback_for_ug(cal_save_cancel_h info, Evas_Object *entry)
-{
-       c_ret_if(!info);
-       c_ret_if(!entry);
-
-       cal_save_cancel_s* p = (cal_save_cancel_s*)info;
-
-       Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(entry);
-       c_ret_if(!imf_context);
-
-       ecore_imf_context_input_panel_event_callback_add(imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, __cal_save_cancel_input_panel_state_callback, p);
-}
-
-void cal_save_cancel_unset_input_panel_callback_for_ug(Evas_Object *entry)
-{
-       c_ret_if(!entry);
-
-       Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(entry);
-       c_ret_if(!imf_context);
-
-       ecore_imf_context_input_panel_event_callback_del(imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, __cal_save_cancel_input_panel_state_callback);
-}
-
-cal_save_cancel_h cal_save_cancel_create(Evas_Object *naviframe, Evas_Object *conformant, save_cancel_cb save_cb, save_cancel_cb cancel_cb, void* data)
+cal_save_cancel_h cal_save_cancel_create(      Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe,
+       save_cancel_cb save_cb, save_cancel_cb cancel_cb, void* data)
 {
        CAL_FN_START;
 
@@ -203,20 +145,16 @@ cal_save_cancel_h cal_save_cancel_create(Evas_Object *naviframe, Evas_Object *co
                p->title_save_button = button;
 
        }
-
-       button = elm_object_item_part_content_get(navi_item, "prev_btn");
-       if (!button) {
+       if (cancel_cb) {
 
                button = cal_util_add_toolbar_button(naviframe, "prev_btn", NULL, __cal_save_cancel_bottom_cancel_button_callback, p);
                c_warn_if(!button, "cal_util_add_toolbar_button() is failed.");
 
                elm_object_style_set(button, "naviframe/end_btn/default");
 
-       } else
-               if (cancel_cb)
-                       evas_object_smart_callback_add(button, "clicked", cancel_cb, data);
+               p->bottom_cancel_button = button;
+       }
 
-       p->bottom_cancel_button = button;
 
        button = cal_util_add_toolbar_button(naviframe, "title_prev_btn", NULL, __cal_save_cancel_title_cancel_button_callback, p);
        c_warn_if(!button, "cal_util_add_toolbar_button() is failed.");
@@ -225,15 +163,13 @@ cal_save_cancel_h cal_save_cancel_create(Evas_Object *naviframe, Evas_Object *co
 
        elm_object_style_set(button, "naviframe/end_btn/default");
 
+       p->window = window;
+       p->conformant = conformant;
        p->naviframe = naviframe;
        p->navi_item = navi_item;
 
-       if (conformant) {
-               p->conformant = conformant;
-
-               evas_object_smart_callback_add(conformant, "virtualkeypad,state,on", __cal_save_cancel_show_title_toolbar, p);
-               evas_object_smart_callback_add(conformant, "virtualkeypad,state,off", __cal_save_cancel_hide_title_toolbar, p);
-       }
+       evas_object_smart_callback_add(conformant, "virtualkeypad,state,on", __cal_save_cancel_hide_title, p);
+       evas_object_smart_callback_add(conformant, "virtualkeypad,state,off", __cal_save_cancel_show_title, p);
 
        return p;
 }
@@ -245,9 +181,6 @@ void cal_save_cancel_destroy(cal_save_cancel_h info)
        cal_save_cancel_s* p = (cal_save_cancel_s*)info;
        c_retm_if(!p, "p is null");
 
-       evas_object_smart_callback_del(p->conformant, "virtualkeypad,state,on", __cal_save_cancel_show_title_toolbar);
-       evas_object_smart_callback_del(p->conformant, "virtualkeypad,state,off", __cal_save_cancel_hide_title_toolbar);
-
        if (p->title_save_button)
                evas_object_del(p->title_save_button);
 
@@ -260,6 +193,9 @@ void cal_save_cancel_destroy(cal_save_cancel_h info)
        if (p->bottom_cancel_button)
                evas_object_del(p->bottom_cancel_button);
 
+       evas_object_smart_callback_del(p->conformant, "virtualkeypad,state,on", __cal_save_cancel_hide_title);
+       evas_object_smart_callback_del(p->conformant, "virtualkeypad,state,off", __cal_save_cancel_show_title);
+
        free(p);
 }
 
index 6d733f1..bed3d27 100755 (executable)
@@ -166,6 +166,14 @@ Evas_Object* cal_util_add_window(const char *name, Evas_Coord* w, Evas_Coord* h)
                *h = height;
        }
 
+       if (elm_win_wm_rotation_supported_get(eo)) {
+               int rots[4] = { CAL_WINDOW_ROTATION_0,
+                       CAL_WINDOW_ROTATION_90,
+                       CAL_WINDOW_ROTATION_180,
+                       CAL_WINDOW_ROTATION_270 };
+               elm_win_wm_rotation_available_rotations_set(eo, &rots, 4);
+       }
+
        CAL_FN_END;
 
        return eo;
@@ -704,13 +712,10 @@ static void __cal_util_edit_field_changed_callback(void *data, Evas_Object *obj,
        c_retm_if(!obj, "obj is null");
 
        if (elm_object_focus_get(data)) {
-               elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
-       }
-       else {
                if (elm_entry_is_empty(obj))
-                       elm_object_signal_emit(data, "elm,state,guidetext,show", "elm");
+                       elm_object_signal_emit(data, "elm,state,rename,hide", "");
                else
-                       elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
+                       elm_object_signal_emit(data, "elm,state,eraser,show", "");
        }
 }
 
@@ -719,9 +724,9 @@ static void __cal_util_edit_field_focused_callback(void *data, Evas_Object *obj,
        c_retm_if(!data, "data is null");
        c_retm_if(!obj, "obj is null");
 
-       elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
+       elm_object_signal_emit(data, "elm,state,eraser,show", "");
+       elm_object_signal_emit(data, "elm,state,rename,hide", "");
 
-       elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
 }
 
 static void __cal_util_edit_field_unfocused_callback(void *data, Evas_Object *obj, void *event_info) // Unfocused callback will show guidetext and hide X marked button.
@@ -729,10 +734,9 @@ static void __cal_util_edit_field_unfocused_callback(void *data, Evas_Object *ob
        c_retm_if(!data, "data is null");
        c_retm_if(!obj, "obj is null");
 
-       if (elm_entry_is_empty(obj))
-               elm_object_signal_emit(data, "elm,state,guidetext,show", "elm");
+       elm_object_signal_emit(data, "elm,state,eraser,hide", "");
+       elm_object_signal_emit(data, "elm,state,rename,show", "");
 
-       elm_object_signal_emit(data, "elm,state,eraser,hide", "elm");
 }
 
 static void __cal_util_edit_field_eraser_clicked_callback(void *data, Evas_Object *obj, const char *emission, const char *source) // When X marked button is clicked, empty entry's contents.
@@ -749,38 +753,53 @@ static void __cal_util_edit_field_clicked_callback(void *data, Evas_Object *obj,
        elm_object_focus_set(data, EINA_TRUE);
 }
 
-Evas_Object * cal_util_add_edit_field(Evas_Object *parent, const char *guide, Eina_Bool single_line, Eina_Bool is_editable)
+Evas_Object * cal_util_add_edit_field(Evas_Object *parent, const char *title, const char *guide, Eina_Bool single_line, Eina_Bool is_editable, Eina_Bool is_no_bg)
 {
        c_retvm_if(!parent, NULL, "parent is null");
 
        Evas_Object *layout = elm_layout_add(parent);
        c_retvm_if(!layout, NULL, "layout is null");
 
-       elm_layout_theme_set(layout, "layout", "editfield", "default");
+       if (CAL_STRLEN(title)) {
+               elm_layout_theme_set(layout, "layout", "dialogue/editfield", "title");
+               elm_object_part_text_set(layout, "elm.text", title);
+       } else  {
+               if(is_no_bg)
+                       elm_layout_theme_set(layout, "layout", "editfield/no_bg", "default");
+               else
+                       elm_layout_theme_set(layout, "layout", "dialogue/editfield", "default");
+       }
 
        Evas_Object *entry = elm_entry_add(parent);
        c_retvm_if(!entry, layout, "entry is null");
 
-       elm_object_part_content_set(layout, "elm.swallow.content", entry);
+       elm_object_part_content_set(layout, "elm.icon.entry", entry);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-       if (guide && guide[0] != '\0')
-               elm_object_part_text_set(layout, "elm.guidetext", guide);
+       if (CAL_STRLEN(guide))
+               elm_object_part_text_set(entry, "elm.guide", guide);
 
        elm_entry_single_line_set(entry, single_line);
        elm_entry_scrollable_set(entry, single_line);
 
+       evas_object_smart_callback_add(entry, "changed", __cal_util_edit_field_changed_callback, layout);
+       evas_object_smart_callback_add(entry, "focused", __cal_util_edit_field_focused_callback, layout);
+       evas_object_smart_callback_add(entry, "unfocused", __cal_util_edit_field_unfocused_callback, layout);
+
+       elm_object_part_content_set(layout, "elm.icon.entry", entry);
+
+       Evas_Object *button = elm_button_add(parent);
+       elm_object_style_set(button, "editfield_clear");
+       elm_object_part_content_set(layout, "elm.icon.eraser", button);
+
        if (is_editable)
-               elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", __cal_util_edit_field_eraser_clicked_callback, entry);
+               evas_object_smart_callback_add(button, "clicked", __cal_util_edit_field_eraser_clicked_callback, entry);
        else {
                elm_entry_editable_set(entry, is_editable);
-               elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
+               elm_object_signal_emit(layout, "elm,state,rename,hide", "");
+               elm_object_signal_emit(layout, "elm,state,eraser,hide", "");
        }
 
-       evas_object_smart_callback_add(entry, "changed", __cal_util_edit_field_changed_callback, layout);
-       evas_object_smart_callback_add(entry, "focused", __cal_util_edit_field_focused_callback, layout);
-       evas_object_smart_callback_add(entry, "unfocused", __cal_util_edit_field_unfocused_callback, layout);
-
        evas_object_show(layout);
 
        elm_object_signal_callback_add(layout, "mouse,clicked,1", "*", __cal_util_edit_field_clicked_callback, entry);
diff --git a/include/appcontrol.h b/include/appcontrol.h
new file mode 100755 (executable)
index 0000000..3819213
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+  *
+  *  Copyright 2012  Samsung Electronics Co., Ltd
+  *
+  *  Licensed under the Flora License, Version 1.0 (the "License");
+  *  you may not use this file except in compliance with the License.
+  *  You may obtain a copy of the License at
+  *
+  *      http://floralicense.org/license/
+  *
+  *  Unless required by applicable law or agreed to in writing, software
+  *  distributed under the License is distributed on an "AS IS" BASIS,
+  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  *  See the License for the specific language governing permissions and
+  *  limitations under the License.
+  */
+
+
+#ifndef __CALENDAR_APPCONTROL_H__
+#define __CALENDAR_APPCONTROL_H__
+
+#define CAL_APPCONTROL_SOCAIL_VIEW "http://tizen.org/appcontrol/operation/social/view"
+#define CAL_APPCONTROL_SOCAIL_PICK "http://tizen.org/appcontrol/operation/social/pick"
+#define CAL_APPCONTROL_SOCAIL_EDIT "http://tizen.org/appcontrol/operation/social/edit"
+#define CAL_APPCONTROL_VIEW "http://tizen.org/appcontrol/operation/view"
+
+#define CAL_APPCONTROL_ITEM_TYPE "http://tizen.org/appcontrol/data/social/item_type"
+#define CAL_APPCONTROL_ITEM_TYPE_EVENT "event"
+#define CAL_APPCONTROL_ITEM_TYPE_TODO "todo"
+
+#define CAL_APPCONTROL_ITEM_ID "http://tizen.org/appcontrol/data/social/item_id"
+
+#define CAL_APPCONTROL_RESULT_TYPE "http://tizen.org/appcontrol/data/social/result_type"
+#define CAL_APPCONTROL_RESULT_TYPE_VCS "vcs"
+#define CAL_APPCONTROL_RESULT_TYPE_ITEM_ID "item_id"
+
+#define CAL_APPCONTROL_PATH "http://tizen.org/appcontrol/data/path"
+
+/* Optional. Default is single */
+#define CAL_APPCONTROL_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode"
+#define CAL_APPCONTROL_SELECTION_MODE_SINGLE "single"
+#define CAL_APPCONTROL_SELECTION_MODE_MULTIPLE "multiple"
+
+/* Optional. Default is false */
+#define CAL_APPCONTROL_RETURN_RESULT "http://tizen.org/appcontrol/data/return_result"
+#define CAL_APPCONTROL_RETURN_RESULT_TRUE "true"
+#define CAL_APPCONTROL_RETURN_RESULT_FALSE "false"
+
+typedef enum {
+       SELECTION_MODE_UNKNOWN = 0,
+       SELECTION_MODE_SINGLE,
+       SELECTION_MODE_MULTIPLE,
+       SELECTION_MODE_MAX,
+} cal_appcontrol_selection_mode;
+
+typedef enum {
+       ITEM_TYPE_UNKNOWN = 0,
+       ITEM_TYPE_EVENT,
+       ITEM_TYPE_TODO,
+       ITEM_TYPE_EVENT_TODO,
+       ITEM_TYPE_VCS,
+       ITEM_TYPE_MAX,
+} cal_appcontrol_item_type;
+
+typedef enum {
+       RESULT_TYPE_UNKNOWN = 0,
+       RESULT_TYPE_VCS,
+       RESULT_TYPE_ITEM_ID,
+       RESULT_TYPE_ITEM_CONTENT,
+
+#ifndef _TIZEN_PUBLIC_
+       RESULT_TYPE_SET_SNOTE,
+#endif
+
+       RESULT_TYPE_MAX,
+} cal_appcontrol_result_type;
+
+typedef enum {
+       RETURN_RESULT_UNKNOWN = 0,
+       RETURN_RESULT_TRUE,
+       RETURN_RESULT_FALSE,
+       RETURN_RESULT_MAX,
+} cal_appcontrol_return_result;
+
+#endif /* __CALENDAR_APPCONTROL_H__ */
index cb6b821..4919433 100755 (executable)
@@ -251,7 +251,7 @@ Evas_Object* cal_util_add_rectangle(Evas_Object *p);
 Evas_Object* cal_util_add_separator(Evas_Object *box, const char *style);
 Evas_Object* cal_util_add_scroller(Evas_Object *p);
 Evas_Object* cal_util_add_box(Evas_Object *p);
-Evas_Object* cal_util_add_edit_field(Evas_Object *parent, const char *guide, Eina_Bool single_line, Eina_Bool is_editable);
+Evas_Object * cal_util_add_edit_field(Evas_Object *parent, const char *title, const char *guide, Eina_Bool single_line, Eina_Bool is_editable, Eina_Bool is_no_bg);
 Evas_Object * cal_util_add_nocontents(Evas_Object *parent, const char *label);
 Evas_Object * cal_util_add_search_nocontents(Evas_Object *parent, const char *label);
 Evas_Object * cal_util_add_popup(Evas_Object *parent, const char *style, const char *title, const char *desc,
index 0e70d45..518534c 100755 (executable)
 #include <contacts.h>
 #include <calendar2.h>
 #include <ui-gadget.h>
-#include <status.h>
+#include <notification.h>
 
 #include "cal-svc.h"
 #include "cld-log.h"
 #include "cld-utils.h"
+#include "appcontrol.h"
 
 #define CAL_QUICKADD_LONG_PRESS_TIME 0.5
 
 #define EMAIL_LINK_FLAG "#email_viewer_link#"
 #endif
 
-#define CAL_APPCONTROL_ITEM_TYPE "itemType"
-#define CAL_APPCONTROL_ITEM_TYPE_EVENT "event"
-#define CAL_APPCONTROL_ITEM_TYPE_TODO "todo"
-#define CAL_APPCONTROL_ITEM_TYPE_VCS "vcs"
-#define CAL_APPCONTROL_EVENT_ID "eventId"
-#define CAL_APPCONTROL_TODO_ID "todoId"
-#define CAL_APPCONTROL_VCS_PATH "path"
-
 #define CAL_APPSVC_PARAM_CALLER "caller"
 #define CAL_APPSVC_PARAM_COUNT "count"
 #define CAL_APPSVC_PARAM_TYPE "type"
@@ -105,13 +98,6 @@ typedef enum ug_type {
        UG_MAX,
 }ug_type;
 
-typedef enum {
-       ITEM_TYPE_UNKNOWN = 0,
-       ITEM_TYPE_EVENT,
-       ITEM_TYPE_TODO,
-       ITEM_TYPE_VCS,
-       ITEM_TYPE_MAX
-}cal_appcontrol_item_type;
 
 typedef struct {
        struct tm stm;
@@ -151,6 +137,14 @@ typedef struct
        Eina_Bool is_deleted;
 }cal_participant;
 
+typedef enum {
+       CAL_WINDOW_ROTATION_0 = 0,
+       CAL_WINDOW_ROTATION_90 = 90,
+       CAL_WINDOW_ROTATION_180 = 180,
+       CAL_WINDOW_ROTATION_270 = 270,
+
+} cal_window_rotation;
+
 typedef struct appdata
 {
        Evas_Object *win;                       //window
@@ -236,6 +230,8 @@ typedef struct appdata
 
        Eina_Bool need_to_show_popup;           // to keep popup for rotating
 
+       cal_window_rotation rotation;
+
 }ug_data;
 
 int is_hour24;
index 06dd72a..831fd10 100755 (executable)
@@ -24,14 +24,10 @@ typedef void* cal_save_cancel_h;
 
 typedef void (*save_cancel_cb)(void *data, Evas_Object *obj, void *event_info);
 
-cal_save_cancel_h cal_save_cancel_create(Evas_Object *naviframe, Evas_Object *conformant, save_cancel_cb save_cb, save_cancel_cb cancel_cb, void* data);
+cal_save_cancel_h cal_save_cancel_create(Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe, save_cancel_cb save_cb, save_cancel_cb cancel_cb, void* data);
 
 void cal_save_cancel_destroy(cal_save_cancel_h info);
 
-void cal_save_cancel_set_input_panel_callback_for_ug(cal_save_cancel_h info, Evas_Object *entry);
-
-void cal_save_cancel_unset_input_panel_callback_for_ug(Evas_Object *entry);
-
 void cal_save_cancel_set_button_text(cal_save_cancel_h info, const char *save_button_text, const char *cancel_button_text);
 
 void cal_save_cancel_set_disabled(cal_save_cancel_h info, Eina_Bool is_disabled_save, Eina_Bool is_disabled_cancel);
index c2ebde9..276212b 100755 (executable)
@@ -5,11 +5,28 @@
        <description>Calendar</description>\r
        <ui-application appid="calendar-efl" exec="/usr/ug/bin/calendar-efl" nodisplay="true" multiple="true" type="capp" taskmanage="false">\r
                <label>calendar-efl</label>\r
+               <icon>${PKGNAME}.png</icon>\r
+               <application-service>\r
+                       <operation name="http://tizen.org/appcontrol/operation/social/pick" />\r
+               </application-service>\r
        </ui-application>\r
        <ui-application appid="calendar-edit-efl" exec="/usr/ug/bin/calendar-edit-efl" nodisplay="true" multiple="true" type="capp" taskmanage="false">\r
                <label>calendar-edit-efl</label>\r
+               <icon>${PKGNAME}.png</icon>\r
+               <application-service>\r
+                       <operation name="http://tizen.org/appcontrol/operation/social/edit" />\r
+               </application-service>\r
        </ui-application>\r
        <ui-application appid="calendar-detail-efl" exec="/usr/ug/bin/calendar-detail-efl" nodisplay="true" multiple="true" type="capp" taskmanage="false">\r
                <label>calendar-detail-efl</label>\r
+               <icon>${PKGNAME}.png</icon>\r
+               <application-service>\r
+                       <operation name="http://tizen.org/appcontrol/operation/view" />\r
+                       <mime name="text/calendar" />\r
+                       <mime name="text/x-vcalendar" />\r
+               </application-service>\r
+               <application-service>\r
+                       <operation name="http://tizen.org/appcontrol/operation/social/view" />\r
+               </application-service>\r
        </ui-application>\r
 </manifest>\r
index ee2501d..0186af6 100755 (executable)
@@ -1,6 +1,7 @@
 Name:       org.tizen.calendar
+
 Summary:    Calendar application
-Version:    0.6.21
+Version:    0.6.22
 Release:    1 
 License:    Flora License, Version 1
 Source0:    %{name}-%{version}.tar.gz
index d23c94c..4f6894c 100755 (executable)
@@ -362,8 +362,8 @@ static void __cal_list_delete_norepeat_popup_response_event_callback(void *data,
        if (NULL != strstr(elm_object_text_get(button), S_("IDS_COM_BODY_DELETE"))) {
                _calendar_delete_record_with_index(p->ad->cid);
 
-               int r = status_message_post(S_("IDS_COM_POP_DELETED"));
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+               int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
        }
 
        evas_object_del(p->popup);
@@ -412,8 +412,8 @@ static void __cal_list_delete_event(cal_list_base_s* p, Eina_Bool is_delete_all)
        else
                _calendar_delete_record_with_index(ad->cid);
 
-       int r = status_message_post(S_("IDS_COM_POP_DELETED"));
-       c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+       int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));
+       c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
 }
 
 static void __cal_list_delete_popup_response_event_callback(void *data, Evas_Object *obj, void *event_info)
index d3bc181..6090eb5 100755 (executable)
@@ -2175,8 +2175,8 @@ static void __cal_list_delete_popup_response_event_callback(void *data, Evas_Obj
 \r
                elm_object_disabled_set(p->bt_delete, EINA_TRUE);\r
 \r
-               int r = status_message_post(S_("IDS_COM_POP_DELETED"));\r
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);\r
+               int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));\r
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);\r
        }\r
 \r
        evas_object_del(p->popup);\r
@@ -2235,8 +2235,8 @@ static void __cal_list_delete_delete_event(cal_list_delete_data* p, Eina_Bool is
 \r
                it = temp;\r
        }\r
-       int r = status_message_post(S_("IDS_COM_POP_DELETED"));\r
-       c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);\r
+       int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));\r
+       c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);\r
 \r
        elm_object_disabled_set(p->bt_delete, EINA_TRUE);\r
 }\r
index ada54b1..a469d16 100755 (executable)
@@ -429,6 +429,62 @@ static Evas_Object * __cal_main_add_base_layout(Evas_Object *conformant)
        return layout;
 }
 
+static void __cal_device_orientation(void *data, Evas_Object *obj, void *event)
+{
+       CAL_FN_START;
+
+       c_retm_if(!data, "user_data is null.");
+
+       struct appdata *ad = data;
+       Eina_Bool is_landscape_mode = EINA_FALSE;
+
+       int rotation = elm_win_rotation_get(obj);
+       c_ret_if(rotation != CAL_WINDOW_ROTATION_0
+               && rotation != CAL_WINDOW_ROTATION_90
+               && rotation != CAL_WINDOW_ROTATION_180
+               && rotation != CAL_WINDOW_ROTATION_270);
+
+       if (ad->rotation == (cal_window_rotation)rotation)
+               return;
+
+       switch (rotation){
+       case CAL_WINDOW_ROTATION_0:
+               ug_send_event(UG_EVENT_ROTATE_PORTRAIT);
+               break;
+       case CAL_WINDOW_ROTATION_90:
+               is_landscape_mode = EINA_TRUE;
+               ug_send_event(UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN);
+               break;
+       case CAL_WINDOW_ROTATION_180:
+               ug_send_event(UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN);
+               break;
+       case CAL_WINDOW_ROTATION_270:
+               is_landscape_mode = EINA_TRUE;
+               ug_send_event(UG_EVENT_ROTATE_LANDSCAPE);
+               break;
+       default:
+               break;
+       }
+
+       ad->rotation = (cal_window_rotation)rotation;
+       ad->is_landscape_mode = is_landscape_mode;
+
+       int width = 0;
+       int height = 0;
+
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
+
+       if (ad->is_landscape_mode) {
+               ad->win_w = height;
+               ad->win_h = width;
+       } else {
+               ad->win_w = width;
+               ad->win_h = height;
+       }
+
+       cal_main_rotation(ad);
+}
+
 static bool cal_create(void *data)
 {
        CAL_FN_START;
@@ -441,6 +497,7 @@ static bool cal_create(void *data)
        c_retv_if(!window, false);
 
        evas_object_smart_callback_add(window, "profile,changed", __cal_main_win_profile_changed_callback, ad);
+       evas_object_smart_callback_add(window, "wm,rotation,changed", __cal_device_orientation, ad);
 
        Evas_Object *bg = cal_util_add_bg(window, EINA_TRUE);
        c_retv_if(!bg, false);
@@ -455,8 +512,6 @@ static bool cal_create(void *data)
        Evas_Object *layout = __cal_main_add_base_layout(conformant);
        c_retv_if(!layout, false);
 
-       evas_object_show(window);
-
        ad->win = window;
        ad->bg = bg;
        ad->conform = conformant;
@@ -691,7 +746,7 @@ static void __cal_main_select_view(service_h service, struct appdata* ad)
 
                                        ad->base_tm = base_time;
 
-                                       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &type);
+                                       r = service_get_extra_data(service, "itemType", &type);
                                        c_warn_if(SERVICE_ERROR_NONE != r,"service_get_extra_data is failed(%d).", r);
 
                                        if (!CAL_STRCMP(type, "todo")) {
@@ -838,62 +893,6 @@ static void cal_service(service_h service, void *user_data)
        CAL_FN_END;
 }
 
-static void cal_device_orientation(app_device_orientation_e orientation, void *user_data)
-{
-       c_retm_if(!user_data, "user_data is null.");
-
-       struct appdata *ad = user_data;
-       int rotate_val = 0;
-       Eina_Bool is_landscape_mode = EINA_FALSE;
-       int width = 0;
-       int height = 0;
-
-       ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
-
-       switch (orientation){
-       case APP_DEVICE_ORIENTATION_0:
-               rotate_val = 0;
-               ug_send_event(UG_EVENT_ROTATE_PORTRAIT);
-               break;
-       case APP_DEVICE_ORIENTATION_90:
-               rotate_val = 90;
-               is_landscape_mode = EINA_TRUE;
-               ug_send_event(UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN);
-               break;
-       case APP_DEVICE_ORIENTATION_180:
-               rotate_val = 180;
-               ug_send_event(UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN);
-               break;
-       case APP_DEVICE_ORIENTATION_270:
-               rotate_val = 270;
-               is_landscape_mode = EINA_TRUE;
-               ug_send_event(UG_EVENT_ROTATE_LANDSCAPE);
-               break;
-       default:
-               break;
-       }
-
-       if (ad->orientation == orientation)
-               return;
-
-       ad->orientation = orientation;
-
-       ad->is_landscape_mode = is_landscape_mode;
-
-       if (ad->is_landscape_mode) {
-               ad->win_w = height;
-               ad->win_h = width;
-       } else {
-               ad->win_w = width;
-               ad->win_h = height;
-       }
-
-       elm_win_rotation_with_resize_set(ad->win, rotate_val);
-
-       cal_main_rotation(ad);
-
-}
-
 static void __cal_language_changed(void *user_data)
 {
        CAL_FN_START;
@@ -941,7 +940,7 @@ int main(int argc, char *argv[])
        event_callback.service = cal_service;
        event_callback.low_memory = NULL;
        event_callback.low_battery = NULL;
-       event_callback.device_orientation = cal_device_orientation;
+       event_callback.device_orientation = NULL;
        event_callback.language_changed = __cal_language_changed;
        event_callback.region_format_changed = __cal_region_format_changed;
 
index 9c58916..1781a98 100755 (executable)
@@ -999,8 +999,8 @@ static void __cal_week_delete_norepeat_popup_response_event_callback(void *data,
 
                _calendar_delete_record(record);
 
-               int r = status_message_post(S_("IDS_COM_POP_DELETED"));
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+               int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
        }
 
        evas_object_del(p->popup);
index 016da86..54286ad 100755 (executable)
@@ -25,6 +25,7 @@
 #include "external-ug.h"
 #include "detail-common.h"
 #include "detail-attendee.h"
+#include "appcontrol.h"
 
 typedef struct {
 
@@ -58,6 +59,7 @@ typedef struct {
        Evas_Object *photo;
        Evas_Object *save_to;
 } cal_detail_ug_data;
+#define CAL_URI_FILE_FORMAT "file://"
 
 static int __cal_detail_ug_initialize(cal_detail_ug_data *data)
 {
@@ -462,7 +464,8 @@ static Evas_Object * __cal_detail_ug_add_note(Evas_Object *box, calendar_record_
 
        Evas_Object *item = cal_dialogue_append_item(box, "1icon", NULL, NULL);
 
-       Evas_Object *edit_field = cal_util_add_edit_field(item, NULL, EINA_FALSE, EINA_FALSE);
+       Evas_Object *edit_field = cal_util_add_edit_field(item, NULL, NULL, EINA_FALSE, EINA_FALSE, EINA_TRUE);
+
        if (!edit_field) {
                ERR("cal_util_add_edit_field() is failed.");
 
@@ -1068,8 +1071,8 @@ static void __cal_detail_save_button_callback(void *user_data, Evas_Object *obj,
        if (error != CALENDAR_ERROR_NONE) {
                ERR("calendar_db_insert_record() is failed(%x)", error);
        } else {
-               int r = status_message_post(S_("IDS_COM_POP_SAVED"));
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+               int r = notification_status_message_post(S_("IDS_COM_POP_SAVED"));
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
        }
 }
 
@@ -1086,8 +1089,8 @@ static void __cal_detail_delete_event(cal_detail_ug_data *data, Eina_Bool is_del
        else
                _calendar_delete_record(record);
 
-       int r = status_message_post(S_("IDS_COM_POP_DELETED"));
-       c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+       int r = notification_status_message_post(S_("IDS_COM_POP_DELETED"));
+       c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
 
        ug_destroy_me(data->ug);
 }
@@ -1339,183 +1342,298 @@ static calendar_record_h inline __cal_detail_ug_get_origin_record(const calendar
        return _calendar_get_record_with_index(index);
 }
 
-static void *__cal_detail_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+static void __cal_detail_ug_get_appcontrol_input_data(service_h service, cal_detail_ug_data *data)
 {
        CAL_FN_START;
 
-       c_retv_if(!ug, NULL);
-       c_retv_if(!service, NULL);
-       c_retv_if(!priv, NULL);
-       c_retv_if(mode != UG_MODE_FULLVIEW, NULL);
+       int r = 0;
+       char *index = 0;
+       char *item_type = NULL;
 
-       cal_detail_ug_data *data = priv;
+       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
+       c_ret_if(r != SERVICE_ERROR_NONE);
 
-       data->ug = ug;
+       if (CAL_STRCMP(CAL_APPCONTROL_ITEM_TYPE_EVENT, item_type)
+               && CAL_STRCMP(CAL_APPCONTROL_ITEM_TYPE_TODO, item_type)) {
+               ERR("Invaild input : %s, %s", CAL_APPCONTROL_ITEM_TYPE, item_type);
 
-       int cid = 0;
-       char *item_type = NULL;
-       char *index = NULL;
-       char *path = NULL;
-       calendar_error_e error = CALENDAR_ERROR_NONE;
+               CAL_FREE(item_type);
 
-       int r = service_get_extra_data(service, "index", &index);
-       if (r == SERVICE_ERROR_NONE)
-               cid = atoi(index);
+               return;
+       }
 
-       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
-       if (r == SERVICE_ERROR_NONE) {
+       CAL_FREE(item_type);
 
-               if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_EVENT)) {
+       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_ID, &index);
+       if (r != SERVICE_ERROR_NONE) {
+               ERR("service_get_extra_data(%s) is failed(%x)", "eventId", r);
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_EVENT_ID, &index);
-                       if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_EVENT_ID, r);
+               CAL_FREE(index);
 
-                               CAL_FREE(index);
+               return;
+       }
 
-                               ug_destroy_me(ug);
+       data->record = _calendar_get_record_with_index(atoi(index));
+}
 
-                               return NULL;
-                       }
+static void __cal_detail_ug_get_record_from_vcs(char *vcs, cal_detail_ug_data *data)
+{
+       c_ret_if(!vcs);
+       c_ret_if(!data);
 
-                       cid = atoi(index);
-                       calendar_record_h record = _calendar_get_record_with_index(cid);
-                       c_retv_if(!record, NULL);
+       int r = 0;
 
-                       calendar_record_destroy(record, true);
+       FILE * file = fopen(vcs, "r");
+       if (!file) {
+               ERR("fopen(%s) is failed.", vcs);
 
-               } else if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_TODO)) {
+               return;
+       }
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_TODO_ID, &index);
-                       if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_TODO_ID, r);
+       struct stat st;
+       r = stat(vcs, &st);
+       c_warn_if(r == -1, "stat(%s) is failed(%d)", vcs, errno);
 
-                               CAL_FREE(index);
+       int size = st.st_size;
+       char *raw_data = calloc(size + 1, sizeof(char));
+       if (!raw_data) {
+               ERR("calloc is failed.");
 
-                               ug_destroy_me(ug);
+               fclose( file );
 
-                               return NULL;
-                       }
+               return;
+       }
 
-                       cid = atoi(index);
-                       calendar_record_h record = _calendar_get_record_with_index(cid);
-                       c_retv_if(!record, NULL);
+       r = fread(raw_data, 1, size, file);
+       fclose( file );
+       if (r < 0)
+               ERR("fread() is failed(%d)", errno);
 
-                       calendar_record_destroy(record, true);
+       calendar_list_h list = NULL;
 
-               } else if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_VCS)) {
+       calendar_error_e error = CALENDAR_ERROR_NONE;
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_VCS_PATH, &path);
-                       if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_VCS_PATH, r);
+       error = calendar_vcalendar_parse_to_calendar(raw_data, &list);
+       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_vcalendar_parse_to_calendar() is failed(%x)", error);
 
-                               CAL_FREE(path);
+       error = calendar_list_first(list);
+       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_first() is failed(%x)", error);
 
-                               ug_destroy_me(ug);
+       calendar_record_h record = NULL;
 
-                               return NULL;
-                       }
+       error = calendar_list_get_current_record_p(list, &record);
+       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
 
-                       FILE * file = fopen(path, "r");
-                       if (!file) {
-                               ERR("fopen(%s) is failed.", path);
+       while (record) {
 
-                               ug_destroy_me(ug);
+               error = calendar_list_get_current_record_p(list, &record);
+               c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
 
-                               return NULL;
-                       }
+               if (_calendar_is_event_or_task(record)) {
 
-                       struct stat st;
-                       r = stat(path, &st);
-                       c_warn_if(r == -1, "stat(%s) is failed(%d)", path, errno);
+                       error = calendar_record_clone(record, &data->record);
+                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_clone() is failed(%x)", error);
 
-                       int size = st.st_size;
-                       char *raw_data = calloc(size + 1, sizeof(char));
-                       if (!raw_data) {
-                               ERR("calloc is failed.");
+                       break;
+               }
 
-                               fclose( file );
+               error = calendar_list_next(list);
 
-                               ug_destroy_me(ug);
+               record = NULL;
 
-                               return NULL;
-                       }
+               error = calendar_list_get_current_record_p(list, &record);
+               c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
+       }
 
-                       r = fread(raw_data, 1, size, file);
-                       fclose( file );
-                       c_retv_if(r < 0, NULL);
+       error = calendar_list_destroy(list, true);
 
-                       calendar_list_h list = NULL;
+       free(raw_data);
+}
 
-                       error = calendar_vcalendar_parse_to_calendar(raw_data, &list);
-                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_vcalendar_parse_to_calendar() is failed(%x)", error);
+static char * __cal_detail_ug_filter_uri_format(const char *uri)
+{
+       if (!strstr(uri, CAL_URI_FILE_FORMAT))
+               return strdup(uri);
+       else
+               return strdup(uri+strlen(CAL_URI_FILE_FORMAT));
+}
 
-                       error = calendar_list_first(list);
-                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_first() is failed(%x)", error);
+/* Only vcs will be supported. */
+static void __cal_detail_ug_get_appcontrol_input_data_old(service_h service, cal_detail_ug_data *data)
+{
+       CAL_FN_START;
 
-                       calendar_record_h record = NULL;
+       int r = 0;
+       char *index = 0;
+       int cid = 0;
 
-                       error = calendar_list_get_current_record_p(list, &record);
-                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
+       char *uri = NULL;
 
-                       while (record) {
+       r = service_get_uri(service, &uri);
+       if (r == SERVICE_ERROR_NONE && CAL_STRLEN(uri)) {
 
-                               error = calendar_list_get_current_record_p(list, &record);
-                               c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
+               char * filtered_uri =  __cal_detail_ug_filter_uri_format(uri);
 
-                               if (_calendar_is_event_or_task(record)) {
+               free(uri);
 
-                                       error = calendar_record_clone(record, &data->record);
-                                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_clone() is failed(%x)", error);
+               __cal_detail_ug_get_record_from_vcs(filtered_uri, data);
 
-                                       break;
-                               }
+               free(filtered_uri);
 
-                               error = calendar_list_next(list);
+               return;
+       }
 
-                               record = NULL;
+       r = service_get_extra_data(service, "index", &index);
+       if (r == SERVICE_ERROR_NONE) {
+               calendar_record_h record = _calendar_get_record_with_index(atoi(index));
+               if (r != SERVICE_ERROR_NONE) {
 
-                               error = calendar_list_get_current_record_p(list, &record);
-                               c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error);
-                       }
+                       ERR("_calendar_get_record_with_index(%d) is failed", cid);
 
-                       error = calendar_list_destroy(list, true);
+                       CAL_FREE(index);
 
-                       free(raw_data);
+                       return;
                }
+
+               CAL_FREE(index);
+
+               data->record = record;
+
+               return;
        }
 
-       if (!data->record) {
-               if (0 < cid)
-                       data->record = _calendar_get_record_with_index(cid);
-               else {
-                       char *record_address = NULL;
+       char *item_type = NULL;
+
+       r = service_get_extra_data(service, "itemType", &item_type);
+       if (r == SERVICE_ERROR_NONE) {
+
+               if (!CAL_STRCMP(item_type, "event")) {
+
+                       r = service_get_extra_data(service, "eventId", &index);
+                       if (r != SERVICE_ERROR_NONE) {
+                               ERR("service_get_extra_data(%s) is failed(%x)", "eventid", r);
+
+                               CAL_FREE(index);
+
+                               return;
+                       }
 
-                       r = service_get_extra_data(service, "record", &record_address);
+                       calendar_record_h record = _calendar_get_record_with_index(atoi(index));
                        if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(record) is failed(%x)", r);
-                       } else {
-                               data->record = (calendar_record_h)strtoul(record_address, NULL, 16);
-                               c_warn_if(!data->record, "strtol(%s, NULL, 16) is failed", record_address);
+
+                               ERR("_calendar_get_record_with_index(%d) is failed", cid);
+
+                               CAL_FREE(index);
+
+                               return;
                        }
 
-                       _calendar_record_type record_type = _calendar_get_record_type(data->record);
+                       CAL_FREE(index);
+
+                       data->record = record;
+
+               } else if (!CAL_STRCMP(item_type, "todo")) {
+
+                       r = service_get_extra_data(service, "todoId", &index);
+                       if (r != SERVICE_ERROR_NONE) {
+                               ERR("service_get_extra_data(%s) is failed(%x)", "todoId", r);
+
+                               CAL_FREE(index);
 
-                       if (record_type != _CALENDAR_RECORD_TYPE_EVENT && record_type != _CALENDAR_RECORD_TYPE_TODO) {
-                               data->instance = data->record;
-                               data->record = __cal_detail_ug_get_origin_record(data->instance);
+                               return;
                        }
 
-                       CAL_FREE(record_address);
-               }
+                       calendar_record_h record = _calendar_get_record_with_index(atoi(index));
+                       if (r != SERVICE_ERROR_NONE) {
 
+                               ERR("_calendar_get_record_with_index(%d) is failed", cid);
+
+                               CAL_FREE(index);
+
+                               return;
+                       }
+
+                       CAL_FREE(index);
+
+                       data->record = record;
+
+               } else if (!CAL_STRCMP(item_type, "vcs")) {
+
+                       char *vcs = NULL;
+
+                       r = service_get_extra_data(service, "path", &vcs);
+                       if (r != SERVICE_ERROR_NONE) {
+                               ERR("service_get_extra_data(%s) is failed(%x)", "path", r);
+
+                               CAL_FREE(vcs);
+
+                               return;
+                       }
+
+                       __cal_detail_ug_get_record_from_vcs(vcs, data);
+
+                       CAL_FREE(vcs);
+               }
        }
 
        CAL_FREE(item_type);
+}
+
+static void *__cal_detail_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+{
+       CAL_FN_START;
+
+       c_retv_if(!ug, NULL);
+       c_retv_if(!service, NULL);
+       c_retv_if(!priv, NULL);
+       c_retv_if(mode != UG_MODE_FULLVIEW, NULL);
+
+       cal_detail_ug_data *data = priv;
+
+       data->ug = ug;
 
-       CAL_FREE(index);
+       int cid = 0;
+       char *item_type = NULL;
+       char *index = NULL;
+       char *path = NULL;
+       calendar_error_e error = CALENDAR_ERROR_NONE;
 
-       CAL_FREE(path);
+       int r = 0;
+
+       char *operation = NULL;
+
+       r = service_get_operation(service, &operation);
+       c_retv_if(r != SERVICE_ERROR_NONE, NULL);
+
+       if (!CAL_STRCMP(operation, CAL_APPCONTROL_SOCAIL_VIEW))
+               __cal_detail_ug_get_appcontrol_input_data(service, data);
+       else
+               __cal_detail_ug_get_appcontrol_input_data_old(service, data);
+
+       CAL_FREE(operation);
+
+       if (!data->record) {
+               char *record_address = NULL;
+
+               r = service_get_extra_data(service, "record", &record_address);
+               if (r != SERVICE_ERROR_NONE) {
+                       ERR("service_get_extra_data(record) is failed(%x)", r);
+
+                       return NULL;
+               } else {
+                       data->record = (calendar_record_h)strtoul(record_address, NULL, 16);
+                       c_warn_if(!data->record, "strtol(%s, NULL, 16) is failed", record_address);
+               }
+
+               _calendar_record_type record_type = _calendar_get_record_type(data->record);
+
+               if (record_type != _CALENDAR_RECORD_TYPE_EVENT && record_type != _CALENDAR_RECORD_TYPE_TODO) {
+                       data->instance = data->record;
+                       data->record = __cal_detail_ug_get_origin_record(data->instance);
+               }
+
+               CAL_FREE(record_address);
+       }
 
        Evas_Object *parent = ug_get_parent_layout(ug);
        c_retv_if(!parent, NULL);
index bb41d71..6349d20 100755 (executable)
@@ -23,6 +23,8 @@
 #include "save-cancel.h"
 
 typedef struct {
+       Evas_Object *window;
+       Evas_Object *conformant;
        Evas_Object *naviframe;
        Evas_Object *ly; // self
 
@@ -319,8 +321,6 @@ static Evas_Object* __cal_edit_alarm_add_entry(Evas_Object *parent, cal_edit_ala
        if (!ic)
                return NULL;
 
-       cal_save_cancel_set_input_panel_callback_for_ug(p->save_cancel, e);
-
        evas_object_smart_callback_add(e, "unfocused", __cal_edit_alarm_entry_unfocused, p);
 
        elm_entry_text_style_user_push(e, "DEFAULT='align=center'");
@@ -692,12 +692,30 @@ static void __cal_edit_alarm_save_button_callback(void *data, Evas_Object *obj,
 static void __cal_edit_alarm_cancel_button_callback(void *data, Evas_Object *obj, void *event_info)
 {
        CAL_FN_START;
+
+       c_retm_if(!data, "data is null");
+
+       cal_edit_alarm_data *p = data;
+
+       Ecore_IMF_Context *imf_context = elm_entry_imf_context_get((Evas_Object *)p->e_custom);
+       c_retm_if(!imf_context, "elm_entry_imf_context_get returned null");
+
+       Ecore_IMF_Input_Panel_State state = ecore_imf_context_input_panel_state_get(imf_context);
+
+       if(state == ECORE_IMF_INPUT_PANEL_STATE_SHOW)   {
+               ecore_imf_context_input_panel_hide(imf_context);
+       }
+       else
+               elm_naviframe_item_pop(p->naviframe);
+
 }
 
-Evas_Object *cal_edit_alarm_create_view(Evas_Object *naviframe, const Cal_Reminder* reminder, cal_edit_alarm_type alarm_type,
-                                                                                                                                                       cal_edit_alarm_changed_callback alarm_changed_callback, void* callback_data)
+Evas_Object *cal_edit_alarm_create_view(Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe,
+       const Cal_Reminder* reminder, cal_edit_alarm_type alarm_type, cal_edit_alarm_changed_callback alarm_changed_callback, void* callback_data)
 {
-       c_retvm_if(!naviframe, NULL, "naviframe is null");
+       c_retv_if(!window, NULL);
+       c_retv_if(!conformant, NULL);
+       c_retv_if(!naviframe, NULL);
 
        cal_edit_alarm_data *p;
        Evas_Object *ly;
@@ -706,6 +724,8 @@ Evas_Object *cal_edit_alarm_create_view(Evas_Object *naviframe, const Cal_Remind
        p = calloc(1, sizeof(cal_edit_alarm_data));
        c_retvm_if(!p, NULL, "p is null");
 
+       p->window = window;
+       p->conformant = conformant;
        p->naviframe = naviframe;
        p->alarm_changed_callback = alarm_changed_callback;
        p->alarm_changed_callback_data = callback_data;
@@ -723,7 +743,7 @@ Evas_Object *cal_edit_alarm_create_view(Evas_Object *naviframe, const Cal_Remind
        Elm_Object_Item* navi_item = elm_naviframe_item_push(p->naviframe, C_("IDS_CLD_BODY_REMINDER"), NULL, NULL, ly, NULL);
        c_retv_if(!navi_item, NULL);
 
-       p->save_cancel = cal_save_cancel_create(p->naviframe, NULL,
+       p->save_cancel = cal_save_cancel_create(p->window, p->conformant, p->naviframe,
                                        __cal_edit_alarm_save_button_callback,
                                        __cal_edit_alarm_cancel_button_callback, p);
 
index d2760e5..1016455 100755 (executable)
@@ -30,6 +30,8 @@ typedef enum {
 
 typedef void (*cal_edit_alarm_changed_callback)(const Cal_Reminder* reminder, void* data);
 
-Evas_Object *cal_edit_alarm_create_view(Evas_Object *naviframe, const Cal_Reminder* reminder,  cal_edit_alarm_type alarm_type, cal_edit_alarm_changed_callback alarm_changed_callback, void* callback_data);
+Evas_Object *cal_edit_alarm_create_view(Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe,
+       const Cal_Reminder* reminder,   cal_edit_alarm_type alarm_type,
+       cal_edit_alarm_changed_callback alarm_changed_callback, void* callback_data);
 
 #endif /* __CALENDAR_EDIT_ALARM_H__ */
index 1ef897b..84c24ce 100755 (executable)
@@ -32,7 +32,9 @@ enum __cal_edit_repeat_freq {
 };
 
 typedef struct {
-       Evas_Object *parent;
+       Evas_Object *window;
+       Evas_Object *conformant;
+       Evas_Object *naviframe;
        Evas_Object *ly; // self
        Evas_Object *genlist;
 
@@ -416,8 +418,6 @@ static Evas_Object* __cal_edit_repeat_add_entry(Evas_Object *parent, cal_edit_re
        if (!ic)
                return NULL;
 
-       cal_save_cancel_set_input_panel_callback_for_ug(p->save_cancel, e);
-
        evas_object_smart_callback_add(e, "unfocused", __cal_edit_repeat_entry_unfocused, p);
        evas_object_smart_callback_add(e, "changed", __cal_edit_repeat_entry_changed_callback, p);
 
@@ -783,28 +783,47 @@ static void __cal_edit_repeat_save_button_callback(void *data, Evas_Object *obj,
        cal_edit_repeat_data *p = data;
 
        p->callback_func(p->callback_data);
-       elm_naviframe_item_pop(p->parent);
+       elm_naviframe_item_pop(p->naviframe);
 }
 
 static void __cal_edit_repeat_cancel_button_callback(void *data, Evas_Object *obj, void *ei)
 {
        CAL_FN_START;
-}
 
+       c_retm_if(!data, "data is null");
+
+       cal_edit_repeat_data *p = data;
+
+       Ecore_IMF_Context *imf_context = elm_entry_imf_context_get((Evas_Object *)p->repeat_occurrence_entry);
+       c_retm_if(!imf_context, "elm_entry_imf_context_get returned null");
+
+       Ecore_IMF_Input_Panel_State state = ecore_imf_context_input_panel_state_get(imf_context);
+
+       if(state == ECORE_IMF_INPUT_PANEL_STATE_SHOW)   {
+               ecore_imf_context_input_panel_hide(imf_context);
+       }
+       else
+               elm_naviframe_item_pop(p->naviframe);
+}
 
-Evas_Object *cal_edit_repeat_create_view(Evas_Object *parent, int freq, calendar_range_type_e range, struct tm* start_date_time, struct tm* until, int* count,
-                                                                                                                                                               cal_edit_repeat_destroy_callback callback_func, void *callback_data)
+Evas_Object *cal_edit_repeat_create_view(Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe,
+       int freq, calendar_range_type_e range, struct tm* start_date_time, struct tm* until, int* count,
+       cal_edit_repeat_destroy_callback callback_func, void *callback_data)
 {
        CAL_FN_START;
 
-       c_retvm_if(!parent, NULL, "parent is null");
+       c_retv_if(!window, NULL);
+       c_retv_if(!conformant, NULL);
+       c_retv_if(!naviframe, NULL);
 
        cal_edit_repeat_data *p = calloc(1, sizeof(cal_edit_repeat_data));
        c_retvm_if(!p, NULL, "p is null");
 
-       p->parent = parent;
+       p->window = window;
+       p->conformant = conformant;
+       p->naviframe = naviframe;
 
-       Evas_Object *ly = cal_util_add_layout(parent, "edit");
+       Evas_Object *ly = cal_util_add_layout(naviframe, "edit");
        if (!ly) {
                ERR("ly is null");
                free(p);
@@ -824,10 +843,10 @@ Evas_Object *cal_edit_repeat_create_view(Evas_Object *parent, int freq, calendar
        evas_object_data_set(ly, "priv", p);
 
        Elm_Object_Item *navi_item = NULL;
-       navi_item = elm_naviframe_item_push(p->parent, C_("IDS_CLD_BODY_REPEAT"), NULL, NULL, ly, NULL);
+       navi_item = elm_naviframe_item_push(p->naviframe, C_("IDS_CLD_BODY_REPEAT"), NULL, NULL, ly, NULL);
        c_retv_if(!navi_item, NULL);
 
-       p->save_cancel = cal_save_cancel_create(p->parent, NULL, __cal_edit_repeat_save_button_callback, __cal_edit_repeat_cancel_button_callback, p);
+       p->save_cancel = cal_save_cancel_create(p->window, p->conformant, p->naviframe, __cal_edit_repeat_save_button_callback, __cal_edit_repeat_cancel_button_callback, p);
 
        __cal_edit_repeat_set_state(p, freq, range, until, count);
 
index c174ae3..e2f5b71 100755 (executable)
@@ -24,9 +24,9 @@
 typedef void (*cal_edit_repeat_destroy_callback)(void *data);
 
 /* Return layout */
-Evas_Object *edit_repeat_create(Evas_Object *parent, Evas_Object *nv, int term, int num, struct tm* until, int* occurrency, int flag, Evas_Object *win);
-Evas_Object *cal_edit_repeat_create_view(Evas_Object *parent, int freq, calendar_range_type_e range, struct tm* start_date_time, struct tm* until, int* occurrency,
-                                                                                                                                                               cal_edit_repeat_destroy_callback callback_func, void *callback_data);
+Evas_Object *cal_edit_repeat_create_view(Evas_Object *window, Evas_Object *conformant, Evas_Object *naviframe,
+       int freq, calendar_range_type_e range, struct tm* start_date_time, struct tm* until, int* occurrency,
+       cal_edit_repeat_destroy_callback callback_func, void *callback_data);
 
 /* return term: enum cals_freq, flag is for weekly */
 int cal_edit_repeat_get_repeat(Evas_Object *ly, calendar_range_type_e *range, struct tm *until, int *occurrency);
index efc3f4f..ba9a560 100755 (executable)
 #include "external-ug.h"
 #include "cld-images.h"
 #include "dialogue.h"
+#include "appcontrol.h"
 
 #define INVALID_TIMEZONE_VALUE (100)
 #define CAL_EDIT_UG_MAX_ATTACHMENT_COUNT 6
 
 typedef struct {
 
+       Elm_Theme *theme;
+
        ui_gadget_h ug;
        cal_appcontrol_item_type item_type;
 
@@ -43,6 +46,7 @@ typedef struct {
        Evas_Object *base_layout;
        Evas_Object *naviframe;
        Evas_Object *window;
+       Evas_Object *conformant;
 
        Evas_Object *parent;
        Evas_Object *popup;
@@ -165,9 +169,6 @@ static int __cal_edit_ug_finish(cal_edit_ug_data *data)
        error = calendar_disconnect();
        c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_disconnect() is failed(%x)", error);
 
-       elm_theme_extension_del(NULL, EDJDIR "/calendar_theme.edj");
-       elm_theme_extension_del(NULL, EDJDIR "/calendar_theme2.edj");
-
        cal_util_disconnect_pattern_generator();
 
        int ret = 0;
@@ -1127,15 +1128,15 @@ static void __cal_edit_ug_title_entry_changed_callback(void *data, Evas_Object *
                __cal_edit_ug_set_record_title(p->event, p->title_str);
 }
 
-static Evas_Object * __cal_edit_ug_title_icon(cal_edit_ug_data* p, Evas_Object *obj)
+static Evas_Object * __cal_edit_ug_title_item(cal_edit_ug_data* p, Evas_Object *obj)
 {
        c_retv_if(!p, NULL);
        c_retv_if(!obj, NULL);
 
-       Evas_Object *ef = cal_util_add_edit_field(obj, S_("IDS_COM_BODY_DETAILS_TITLE"), EINA_FALSE, EINA_TRUE);
+       Evas_Object *ef = cal_util_add_edit_field(obj, NULL, S_("IDS_COM_BODY_DETAILS_TITLE"), EINA_FALSE, EINA_TRUE, EINA_FALSE);
        c_retvm_if(!ef, NULL, "ef is null");
 
-       Evas_Object *entry = elm_object_part_content_get(ef, "elm.swallow.content");
+       Evas_Object *entry = elm_object_part_content_get(ef, "elm.icon.entry");
        c_retvm_if(!entry, ef, "entry is null");
 
        elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
@@ -1150,8 +1151,6 @@ static Evas_Object * __cal_edit_ug_title_icon(cal_edit_ug_data* p, Evas_Object *
        evas_object_smart_callback_add(p->title_entry, "changed", __cal_edit_ug_title_entry_changed_callback, p);
        evas_object_smart_callback_add(p->title_entry, "preedit,changed", __cal_edit_ug_title_entry_changed_callback, p);
 
-       cal_save_cancel_set_input_panel_callback_for_ug(p->save_cancel, p->title_entry);
-
        return ef;
 
 }
@@ -1160,23 +1159,23 @@ static void __cal_edit_ug_update_title_language(Evas_Object *item)
 {
        c_ret_if(!item);
 
-       Evas_Object *edit_field = elm_object_part_content_get(item, "elm.icon");
-       c_ret_if(!edit_field);
+       Evas_Object *entry = elm_object_part_content_get(item, "elm.icon.entry");
+       c_retm_if(!entry, "entry is null");
 
-       elm_object_part_text_set(edit_field, "elm.guidetext", S_("IDS_COM_BODY_DETAILS_TITLE"));
+       elm_object_part_text_set(entry, "elm.guide", S_("IDS_COM_BODY_DETAILS_TITLE"));
 }
 
 static Evas_Object *__cal_edit_ug_add_title(cal_edit_ug_data* p)
 {
        c_retv_if(!p, NULL);
 
-       Evas_Object *item = cal_dialogue_append_item(p->dialogue, "1icon", NULL, NULL);
-       c_retvm_if(!item, NULL, "cal_dialogue_append_item() is failed");
+       Evas_Object *item = __cal_edit_ug_title_item(p, p->dialogue);
+       c_retvm_if(!item, NULL, "__cal_edit_ug_title_item() is failed");
 
-       Evas_Object *editfield = __cal_edit_ug_title_icon(p, item);
-       c_retvm_if(!editfield, NULL, "__cal_edit_ug_title_icon() is failed");
-
-       elm_object_part_content_set(item, "elm.icon", editfield);
+       evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, 0.0);
+       evas_object_size_hint_align_set(item, EVAS_HINT_FILL, 0.0);
+       elm_box_pack_end(p->dialogue, item);
+       evas_object_show(item);
 
        return item;
 }
@@ -1211,15 +1210,16 @@ static Evas_Object * __cal_edit_ug_location_icon(cal_edit_ug_data* p, Evas_Objec
 
        Evas_Object *ly = NULL;
 
-       Evas_Object *ef = cal_util_add_edit_field(obj, C_("IDS_COM_BODY_DETAILS_LOCATION"), EINA_FALSE, EINA_TRUE);
+       Evas_Object *ef = cal_util_add_edit_field(obj, NULL, C_("IDS_COM_BODY_DETAILS_LOCATION"), EINA_FALSE, EINA_TRUE, EINA_TRUE);
        ly = ef;
 
-       p->location_entry = elm_object_part_content_get(ef, "elm.swallow.content");
+       p->location_entry = elm_object_part_content_get(ef, "elm.icon.entry");
        c_retv_if(!p->location_entry, ly);
 
        evas_object_smart_callback_add(p->location_entry, "changed", __cal_edit_ug_location_entry_changed_callback, p);
        evas_object_smart_callback_add(p->location_entry, "preedit,changed", __cal_edit_ug_location_entry_changed_callback, p);
-       cal_save_cancel_set_input_panel_callback_for_ug(p->save_cancel, p->location_entry);
+
+       elm_entry_cursor_end_set(p->location_entry);
 
        elm_entry_cnp_mode_set(p->location_entry, ELM_CNP_MODE_PLAINTEXT);
 
@@ -1241,12 +1241,11 @@ static void __cal_edit_ug_update_location_language(Evas_Object *item)
        Evas_Object *edit_field = elm_object_part_content_get(layout, "editfield/sw");
        c_ret_if(!edit_field);
 
-       elm_object_part_text_set(edit_field, "elm.guidetext", C_("IDS_COM_BODY_DETAILS_LOCATION"));
+       Evas_Object *entry = elm_object_part_content_get(edit_field, "elm.icon.entry");
+       c_retm_if(!entry, "entry is null");
 
-       Evas_Object *button = elm_object_part_content_get(layout, "button/sw");
-       c_ret_if(!button);
+       elm_object_part_text_set(entry, "elm.guide", C_("IDS_COM_BODY_DETAILS_LOCATION"));
 
-       elm_object_text_set(button, C_("IDS_LBS_BODY_MAP"));
 }
 
 static Evas_Object *__cal_edit_ug_add_location(cal_edit_ug_data* p)
@@ -1305,15 +1304,15 @@ static void __cal_edit_ug_note_entry_changed_callback(void *data, Evas_Object *o
 }
 
 
-static Evas_Object * __cal_edit_ug_note_icon(cal_edit_ug_data* p, Evas_Object *obj)
+static Evas_Object * __cal_edit_ug_note_item(cal_edit_ug_data* p, Evas_Object *obj)
 {
        c_retv_if(!p, NULL);
        c_retv_if(!obj, NULL);
 
-       Evas_Object *ef = cal_util_add_edit_field(obj, C_("IDS_CLD_BODY_CREATE_DESCRITION"), EINA_FALSE, EINA_TRUE );
+       Evas_Object *ef = cal_util_add_edit_field(obj, NULL, C_("IDS_CLD_BODY_CREATE_DESCRITION"), EINA_FALSE, EINA_TRUE, EINA_FALSE);
 
        if (ef) {
-               Evas_Object *entry = elm_object_part_content_get(ef, "elm.swallow.content");
+               Evas_Object *entry = elm_object_part_content_get(ef, "elm.icon.entry");
                c_retvm_if(!entry, ef, "entry is null");
 
                evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1350,7 +1349,7 @@ static Evas_Object * __cal_edit_ug_note_icon(cal_edit_ug_data* p, Evas_Object *o
 
                evas_object_smart_callback_add(p->note_entry, "changed", __cal_edit_ug_note_entry_changed_callback, p);
                evas_object_smart_callback_add(p->note_entry, "preedit,changed", __cal_edit_ug_note_entry_changed_callback, p);
-               cal_save_cancel_set_input_panel_callback_for_ug(p->save_cancel, p->note_entry);
+               elm_entry_cursor_end_set(p->note_entry);
 
                return ef;
        }
@@ -1362,24 +1361,24 @@ static void __cal_edit_ug_update_description_language(Evas_Object *item)
 {
        c_ret_if(!item);
 
-       Evas_Object *edit_field = elm_object_part_content_get(item, "elm.icon");
-       c_ret_if(!edit_field);
+       Evas_Object *entry = elm_object_part_content_get(item, "elm.icon.entry");
+       c_retm_if(!entry, "entry is null");
+
+       elm_object_part_text_set(entry, "elm.guide", C_("IDS_CLD_BODY_CREATE_DESCRITION"));
 
-       elm_object_part_text_set(edit_field, "elm.guidetext", C_("IDS_CLD_BODY_CREATE_DESCRITION"));
 }
 
 static Evas_Object *__cal_edit_ug_add_note(cal_edit_ug_data* p)
 {
        c_retv_if(!p, NULL);
 
-       Evas_Object *item = cal_dialogue_append_item(p->dialogue, "1icon",  NULL, NULL);
-       c_retvm_if(!item, NULL, "cal_dialogue_append_item() is failed");
-
-       Evas_Object *editfield = __cal_edit_ug_note_icon(p, item);
-       c_retvm_if(!editfield, NULL, "__cal_edit_ug_location_icon() is failed");
-
+       Evas_Object *item = __cal_edit_ug_note_item(p, p->dialogue);
+       c_retvm_if(!item, NULL, "__cal_edit_ug_note_item() is failed");
 
-       elm_object_part_content_set(item, "elm.icon", editfield);
+       evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, 0.0);
+       evas_object_size_hint_align_set(item, EVAS_HINT_FILL, 0.0);
+       elm_box_pack_end(p->dialogue, item);
+       evas_object_show(item);
 
        return item;
 }
@@ -1481,8 +1480,8 @@ static void __cal_edit_ug_end_date_changed_callback(void *data, Evas_Object* obj
 
        Eina_Bool result = __cal_edit_ug_check_date_validity(p);
        if(!result)     {
-               int r = status_message_post(C_("IDS_CLD_POP_END_TIME_SHOULD_BE_SET_AFTER_START_TIME"));
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+               int r = notification_status_message_post(C_("IDS_CLD_POP_END_TIME_SHOULD_BE_SET_AFTER_START_TIME"));
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
        } else
                __cal_edit_ug_set_record_time(p, p->event);
 
@@ -1840,7 +1839,7 @@ static void __cal_edit_ug_alarm_select_callback(Evas_Object *obj, void *data)
        else
                alarm_type = ALARM_TYPE_TODO;
 
-       cal_edit_alarm_create_view(p->naviframe, reminder, alarm_type, __cal_edit_ug_alarm_changed_callback, obj);
+       cal_edit_alarm_create_view(p->window, p->conformant, p->naviframe, reminder, alarm_type, __cal_edit_ug_alarm_changed_callback, obj);
 
 }
 
@@ -2113,7 +2112,7 @@ static void __cal_edit_ug_repeat_select_callback(Evas_Object *obj, void *data)
 
        cal_edit_ug_data* p = data;
 
-       p->repeat_layout = cal_edit_repeat_create_view(p->naviframe, p->repeat_freq, p->repeat_range, &(p->stm), &(p->repeat_until),&(p->repeat_count),
+       p->repeat_layout = cal_edit_repeat_create_view(p->window, p->conformant, p->naviframe, p->repeat_freq, p->repeat_range, &(p->stm), &(p->repeat_until),&(p->repeat_count),
                        (cal_edit_repeat_destroy_callback)__cal_edit_ug_repeat_callback, p);
        c_retm_if(!p->repeat_layout, "p->repeat_layout is null");
 
@@ -2860,8 +2859,8 @@ static void __cal_edit_ug_save_button_callback(void *data, Evas_Object *obj, voi
 
        c_retm_if(record_index < 0, "cal_edit_save() is failed");
 
-       int r = status_message_post(S_("IDS_COM_POP_SAVED"));
-       c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+       int r = notification_status_message_post(S_("IDS_COM_POP_SAVED"));
+       c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
 
        __cal_edit_ug_send_result_to_detail_ug(p, record_index);
 
@@ -2869,6 +2868,47 @@ static void __cal_edit_ug_save_button_callback(void *data, Evas_Object *obj, voi
 
 }
 
+static Eina_Bool __cal_edit_ug_input_panel_is_shown(cal_edit_ug_data *p)
+{
+       c_retv_if(!p, EINA_FALSE);
+
+       Ecore_IMF_Context* ic = NULL;
+       ic = elm_entry_imf_context_get(p->title_entry);
+       c_retvm_if(!ic, EINA_FALSE, "elm_entry_imf_context_get returned null");
+
+       if(ecore_imf_context_input_panel_state_get(ic) == ECORE_IMF_INPUT_PANEL_STATE_SHOW)     {
+               ecore_imf_context_input_panel_hide(ic);
+               return EINA_TRUE;
+       }
+
+       ic = elm_entry_imf_context_get(p->note_entry);
+       c_retvm_if(!ic, EINA_FALSE, "elm_entry_imf_context_get returned null");
+
+       if(ecore_imf_context_input_panel_state_get(ic) == ECORE_IMF_INPUT_PANEL_STATE_SHOW)     {
+               ecore_imf_context_input_panel_hide(ic);
+               return EINA_TRUE;
+       }
+
+       ic = elm_entry_imf_context_get(p->location_entry);
+       c_retvm_if(!ic, EINA_FALSE, "elm_entry_imf_context_get returned null");
+
+       if(ecore_imf_context_input_panel_state_get(ic) == ECORE_IMF_INPUT_PANEL_STATE_SHOW)     {
+               ecore_imf_context_input_panel_hide(ic);
+               return EINA_TRUE;
+       }
+
+       if(p->multibuttonentry){
+               ic = elm_entry_imf_context_get(elm_multibuttonentry_entry_get(p->multibuttonentry));
+               c_retvm_if(!ic, EINA_FALSE, "elm_entry_imf_context_get returned null");
+
+               if(ecore_imf_context_input_panel_state_get(ic) == ECORE_IMF_INPUT_PANEL_STATE_SHOW)     {
+                       ecore_imf_context_input_panel_hide(ic);
+                       return EINA_TRUE;
+               }
+       }
+
+       return EINA_FALSE;
+}
 
 static void __cal_edit_ug_back_button_callback(void *user_data, Evas_Object *obj, void *ei)
 {
@@ -2880,7 +2920,8 @@ static void __cal_edit_ug_back_button_callback(void *user_data, Evas_Object *obj
 
        c_ret_if(!data->ug);
 
-       ug_destroy_me(data->ug);
+       if(!__cal_edit_ug_input_panel_is_shown(data))
+               ug_destroy_me(data->ug);
 }
 
 static void __cal_edit_ug_show_multi_alarms (cal_edit_ug_data *p)
@@ -3237,7 +3278,7 @@ static void __cal_edit_ug_add_toolbar(cal_edit_ug_data *data, Evas_Object *scrol
 
        __cal_edit_ug_update_naviframe_language(data);
 
-       data->save_cancel = cal_save_cancel_create(data->naviframe, NULL, __cal_edit_ug_save_button_callback, __cal_edit_ug_back_button_callback, data);
+       data->save_cancel = cal_save_cancel_create(data->window, data->conformant, data->naviframe, __cal_edit_ug_save_button_callback, __cal_edit_ug_back_button_callback, data);
 
 }
 
@@ -3341,129 +3382,159 @@ static calendar_record_h inline __cal_edit_ug_get_origin_record(const calendar_r
        return _calendar_get_record_with_index(index);
 }
 
-static void *__cal_edit_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+static void __cal_edit_ug_get_appcontrol_input_data(service_h service, cal_edit_ug_data *data)
 {
        CAL_FN_START;
 
-       c_retv_if(!ug, NULL);
-       c_retv_if(!service, NULL);
-       c_retv_if(!priv, NULL);
-       c_retv_if(mode != UG_MODE_FULLVIEW, NULL);
+       int r = 0;
+       char *index = 0;
+       char *item_type = NULL;
 
-       cal_edit_ug_data *data = priv;
+       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
+       c_ret_if(r != SERVICE_ERROR_NONE);
 
-       data->ug = ug;
+       if (CAL_STRCMP(CAL_APPCONTROL_ITEM_TYPE_EVENT, item_type)
+               && CAL_STRCMP(CAL_APPCONTROL_ITEM_TYPE_TODO, item_type)) {
+               ERR("Invaild input : %s, %s", CAL_APPCONTROL_ITEM_TYPE, item_type);
 
-       int cid = 0;
-       char *item_type = NULL;
-       char *index = NULL;
-       char *path = NULL;
-       calendar_error_e error = CALENDAR_ERROR_NONE;
+               CAL_FREE(item_type);
+
+               return;
+       }
 
-       int r = service_get_extra_data(service, "index", &index);
+       CAL_FREE(item_type);
 
-       if (r == SERVICE_ERROR_NONE)
-               cid = atoi(index);
+       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_ID, &index);
+       if (r != SERVICE_ERROR_NONE) {
+               ERR("service_get_extra_data(%s) is failed(%x)", "eventId", r);
 
-       r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
+               CAL_FREE(index);
+
+               return;
+       }
+
+       data->is_edit_mode = EINA_TRUE;
+       data->record = _calendar_get_record_with_index(atoi(index));
+
+       if (_calendar_is_task_record(data->record))
+               data->item_type == ITEM_TYPE_TODO;
+       else
+               data->item_type == ITEM_TYPE_EVENT;
+}
+
+static void __cal_edit_ug_get_appcontrol_input_data_old(service_h service, cal_edit_ug_data *data)
+{
+       CAL_FN_START;
+
+       int r = 0;
+
+       char *item_type = NULL;
+
+       r = service_get_extra_data(service, "itemType", &item_type);
        if (r == SERVICE_ERROR_NONE) {
 
-               if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_EVENT)) {
+               if (!CAL_STRCMP(item_type, "event")) {
                        data->item_type = ITEM_TYPE_EVENT;
                        data->is_edit_mode = EINA_TRUE;
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_EVENT_ID, &index);
+                       char *index = NULL;
+
+                       r = service_get_extra_data(service, "eventId", &index);
                        if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_EVENT_ID, r);
+                               ERR("service_get_extra_data(%s) is failed(%x)", "eventId", r);
 
                                CAL_FREE(index);
 
-                               ug_destroy_me(ug);
-
-                               return NULL;
+                               return;
                        }
 
-                       cid = atoi(index);
-                       calendar_record_h record = _calendar_get_record_with_index(cid);
+                       calendar_record_h record = _calendar_get_record_with_index(atoi(index));
                        c_retv_if(!record, NULL);
 
-                       calendar_record_destroy(record, true);
+                       CAL_FREE(index);
+
+                       data->record = record;
 
-               } else if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_TODO)) {
+               } else if (!CAL_STRCMP(item_type, "todo")) {
 
                        data->item_type = ITEM_TYPE_TODO;
                        data->is_edit_mode = EINA_TRUE;
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_TODO_ID, &index);
+                       char *index = NULL;
+
+                       r = service_get_extra_data(service, "todoId", &index);
                        if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_TODO_ID, r);
+                               ERR("service_get_extra_data(%s) is failed(%x)", "todoId", r);
 
                                CAL_FREE(index);
 
-                               ug_destroy_me(ug);
-
-                               return NULL;
+                               return;
                        }
 
-                       cid = atoi(index);
-                       calendar_record_h record = _calendar_get_record_with_index(cid);
+                       calendar_record_h record = _calendar_get_record_with_index(atoi(index));
                        c_retv_if(!record, NULL);
 
-                       calendar_record_destroy(record, true);
+                       CAL_FREE(index);
 
-               }
-               else if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_VCS)) {
+                       data->record = record;
+
+               } else if (!CAL_STRCMP(item_type, "vcs")) {
 
                        data->item_type = ITEM_TYPE_VCS;
 
-                       r = service_get_extra_data(service, CAL_APPCONTROL_VCS_PATH, &path);
+                       char *path = NULL;
+
+                       r = service_get_extra_data(service, "path", &path);
                        if (r != SERVICE_ERROR_NONE) {
-                               ERR("service_get_extra_data(%s) is failed(%x)", CAL_APPCONTROL_VCS_PATH, r);
+                               ERR("service_get_extra_data(%s) is failed(%x)", "path", r);
 
                                CAL_FREE(path);
 
-                               ug_destroy_me(ug);
-
-                               return NULL;
+                               return;
                        }
 
                        FILE * file = fopen(path, "r");
                        if (!file) {
                                ERR("fopen(%s) is failed.", path);
 
-                               ug_destroy_me(ug);
+                               CAL_FREE(path);
 
-                               return NULL;
+                               return;
                        }
 
-                       struct stat st;
+                       struct stat st = {0};
                        if (stat(path, &st) != 0) {
                                ERR("Getting file information Error!");
                                fclose(file);
                                CAL_FREE(path);
-                               ug_destroy_me(ug);
 
-                               return NULL;
+                               return;
                        }
 
+                       CAL_FREE(path);
+
                        int size = st.st_size;
                        char *raw_data = calloc(size + 1, sizeof(char));
                        if(!raw_data){
                                ERR("raw_data is NULL!");
                                fclose(file);
                                free(raw_data);
-                               CAL_FREE(path);
-                               ug_destroy_me(ug);
 
-                               return NULL;
+                               return;
                        }
 
                        r = fread(raw_data, 1, size, file);
                        fclose( file );
-                       c_retv_if(r < 0, NULL);
+                       if (r < 0) {
+                               ERR("fread() is failed(%d)", errno);
+
+                               return;
+                       }
 
                        calendar_list_h list = NULL;
 
+                       calendar_error_e error = CALENDAR_ERROR_NONE;
+
                        error = calendar_vcalendar_parse_to_calendar(raw_data, &list);
                        c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_vcalendar_parse_to_calendar() is failed(%x)", error);
 
@@ -3482,84 +3553,114 @@ static void *__cal_edit_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, se
                }
        }
 
-       if (!data->record) {
-               if (0 < cid) {
-                       data->is_edit_mode = EINA_TRUE;
-                       data->record = _calendar_get_record_with_index(cid);
-               }
-               else {
-                       data->is_edit_mode = EINA_FALSE;
-                       char *record_address = NULL;
-
-                       r = service_get_extra_data(service, "record", &record_address);
-                       if(record_address){
-                               data->record = (calendar_record_h)strtoul(record_address, NULL, 16);
-                               c_warn_if(!data->record, "strtol(%s, NULL, 16) is failed", record_address);
-                       }
-                       else    {
-                               char *note_str = NULL;
-                               r = service_get_extra_data(service, "note", &note_str);
+       CAL_FREE(item_type);
+}
 
-                               if(note_str){
-                                       calendar_record_h record = NULL;
-                                       calendar_error_e error = CALENDAR_ERROR_NONE;
-                                       error = calendar_record_create(_calendar_event._uri, &record);
-                                       c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_create() is failed(%x)", error);
+static void __cal_edit_ug_get_ug_input_data(service_h service, cal_edit_ug_data *data)
+{
+       CAL_FN_START;
 
-                                       data->record = record;
-                                       __cal_edit_ug_set_record_note(data->record, note_str);
+       int r = 0;
 
-                                       time_t now = time(NULL);
-                                       localtime_r(&now, &data->base_time);
+       char *index = NULL;
 
-                                       CAL_FREE(note_str);
-                               }
-                       }
+       r = service_get_extra_data(service, "index", &index);
+       if (r == SERVICE_ERROR_NONE) {
+               data->record = _calendar_get_record_with_index(atoi(index));
+               data->is_edit_mode = EINA_TRUE;
+       }
 
-                       int index = _calendar_get_record_index(data->record);
-                       if(index>0)     {
-                               data->is_edit_mode = EINA_TRUE;
-                       }
-                       _calendar_record_type record_type = _calendar_get_record_type(data->record);
-                       ERR("record_type=%d", record_type);
+       char *record_address = NULL;
 
-                       if (record_type != _CALENDAR_RECORD_TYPE_EVENT && record_type != _CALENDAR_RECORD_TYPE_TODO &&  record_type != _CALENDAR_RECORD_TYPE_SEARCH_TODO_CALENDAR) {
-                               data->instance = data->record;
-                               data->record = __cal_edit_ug_get_origin_record(data->instance);
-                       }
+       r = service_get_extra_data(service, "record", &record_address);
+       if (CAL_STRLEN(record_address)) {
+               data->record = (calendar_record_h)strtoul(record_address, NULL, 16);
+
+               if (0 < _calendar_get_record_index(data->record))
+                       data->is_edit_mode = EINA_TRUE;
+
+               _calendar_record_type record_type = _calendar_get_record_type(data->record);
+
+               if (record_type != _CALENDAR_RECORD_TYPE_EVENT && record_type != _CALENDAR_RECORD_TYPE_TODO &&  record_type != _CALENDAR_RECORD_TYPE_SEARCH_TODO_CALENDAR) {
+                       data->instance = data->record;
 
-                       if(record_address)
-                               CAL_FREE(record_address);
+                       data->record = __cal_edit_ug_get_origin_record(data->instance);
                }
 
                if (_calendar_is_task_record(data->record))
                        data->item_type = ITEM_TYPE_TODO;
                else
                        data->item_type = ITEM_TYPE_EVENT;
+       } else {
+               calendar_error_e error = CALENDAR_ERROR_NONE;
+
+               error = calendar_record_create(_calendar_event._uri, &data->record);
+               c_retm_if(error != CALENDAR_ERROR_NONE, "calendar_record_create() is failed(%x)", error);
+
+               data->is_edit_mode = EINA_FALSE;
+
+               data->item_type = ITEM_TYPE_EVENT;
        }
 
+       CAL_FREE(record_address);
 
        //base_time
        char *base_time = NULL;
+
        r = service_get_extra_data(service, "base_time", &base_time);
        c_warn_if(SERVICE_ERROR_NONE != r,"service_get_extra_data is failed(%d).", r);
 
-       if(base_time){
+       if (base_time) {
                long long int lli_time = strtoll(base_time, NULL, 10);
                cal_util_convert_lli_to_tm(NULL, lli_time, &data->base_time);
-               CAL_FREE(base_time);
-       }
 
-       if (error != CALENDAR_ERROR_NONE || data->item_type == ITEM_TYPE_UNKNOWN) {
-               ERR("ERROR!! Invaild parameter!!");
-               ug_destroy_me(ug);
+               free(base_time);
+       } else {
+               struct tm t = {0};
+               struct tm* returned_tm = NULL;
+               time_t now = 0;
+
+               now = time(NULL);
+
+               returned_tm = gmtime_r(&now, &t);
+               if (!returned_tm)
+                       ERR("localtime_r is failed.");
+               else
+                       CAL_MEMCPY(&data->base_time, &t, struct tm);
        }
+}
 
-       CAL_FREE(item_type);
+static void *__cal_edit_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+{
+       CAL_FN_START;
+
+       c_retv_if(!ug, NULL);
+       c_retv_if(!service, NULL);
+       c_retv_if(!priv, NULL);
+       c_retv_if(mode != UG_MODE_FULLVIEW, NULL);
+
+       cal_edit_ug_data *data = priv;
+
+       data->ug = ug;
 
-       CAL_FREE(index);
+       char *operation = NULL;
 
-       CAL_FREE(path);
+       int r = service_get_operation(service, &operation);
+       c_retv_if(r != SERVICE_ERROR_NONE, NULL);
+
+       if (!CAL_STRCMP(operation, CAL_APPCONTROL_SOCAIL_EDIT))
+               __cal_edit_ug_get_appcontrol_input_data(service, data);
+       else if (!CAL_STRCMP(operation, SERVICE_OPERATION_EDIT))
+               __cal_edit_ug_get_appcontrol_input_data_old(service, data);
+       else
+               __cal_edit_ug_get_ug_input_data(service, data);
+
+       CAL_FREE(operation);
+
+       if (!data->record) {
+               ERR("ERROR!! Invaild parameter!!");
+               ug_destroy_me(ug);
+       }
 
        Evas_Object *parent = ug_get_parent_layout(ug);
        c_retv_if(!parent, NULL);
@@ -3567,8 +3668,23 @@ static void *__cal_edit_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, se
        data->window = ug_get_window();
        c_retv_if(!data->window, NULL);
 
-       elm_theme_extension_add(NULL, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme.edj");
-       elm_theme_extension_add(NULL, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme2.edj");
+       data->conformant = ug_get_conformant();
+       if (!data->conformant) {
+               data->conformant = elm_conformant_add(data->window);
+               c_retv_if(!data->conformant, NULL);
+
+               evas_object_size_hint_weight_set(data->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               elm_win_resize_object_add(data->window, data->conformant);
+               evas_object_show(data->conformant);
+       }
+
+       data->theme = elm_theme_new();
+       c_retv_if(!data->theme, NULL);
+
+       elm_theme_ref_set(data->theme, NULL);
+
+       elm_theme_extension_add(data->theme, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme.edj");
+       elm_theme_extension_add(data->theme, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme2.edj");
 
        Evas_Object *base = __cal_edit_ug_create_layout(parent, data);
        c_retv_if(!base, NULL);
@@ -3583,6 +3699,9 @@ static void __cal_edit_ug_destroy_callback(ui_gadget_h ug, service_h service, vo
 
        cal_edit_ug_data *data = priv;
 
+       if (data->save_cancel)
+               cal_save_cancel_destroy(data->save_cancel);
+
        cal_util_delete_evas_object(&data->base_layout);
 
        if (data->timezone_city)
@@ -3608,9 +3727,6 @@ static void __cal_edit_ug_destroy_callback(ui_gadget_h ug, service_h service, vo
        CAL_FREE(data->address);
        CAL_FREE(data->note_str);
 
-       if (data->save_cancel)
-               cal_save_cancel_destroy(data->save_cancel);
-
        if (data->tabbar)
                evas_object_del(data->tabbar);
 
@@ -3623,6 +3739,11 @@ static void __cal_edit_ug_destroy_callback(ui_gadget_h ug, service_h service, vo
        if (data->instance)
                calendar_record_destroy(data->instance, true);
 
+       elm_theme_extension_del(data->theme, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme.edj");
+       elm_theme_extension_del(data->theme, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme2.edj");
+
+       elm_theme_free(data->theme);
+
 }
 
 static void __cal_edit_ug_key_callback(ui_gadget_h ug, enum ug_key_event evt, service_h data, void *priv)
index dca4ac2..8ba5c7e 100755 (executable)
@@ -47,7 +47,6 @@ typedef struct {
        Evas_Object *genlist;
 
        Eina_List *event_list;
-       Eina_List *search_list;
 
        Evas_Object *box;
 
@@ -56,7 +55,7 @@ typedef struct {
        int checked_event_count;
        int added_event_count;
        Evas_Object* searchbar;
-       const char * searchtext;
+       char * searchtext;
        Elm_Object_Item *navi_item;
 }cal_list_ug_data;
 
@@ -79,11 +78,18 @@ static void __cal_list_ug_create_searchbar(cal_list_ug_data *p);
 static char* __cal_list_ug_get_genlist_item_label(void *data, Evas_Object *obj, const char *part);
 static Evas_Object *__cal_list_ug_get_genlist_item_icon(void *data, Evas_Object *obj, const char *part);
 
-static Elm_Genlist_Item_Class itc = {
-       .item_style = "3text.5icon",
+static Elm_Genlist_Item_Class *itc = NULL;
+
+static Elm_Genlist_Item_Class itc_multiple = {
+       .item_style = "3text.4icon.calendar.check",
+       .func.text_get = __cal_list_ug_get_genlist_item_label,
+       .func.content_get = __cal_list_ug_get_genlist_item_icon,
+};
+
+static Elm_Genlist_Item_Class itc_single = {
+       .item_style = "4text.1icon.3.calendar.search",
        .func.text_get = __cal_list_ug_get_genlist_item_label,
        .func.content_get = __cal_list_ug_get_genlist_item_icon,
-       .decorate_all_item_style = "edit_default",
 };
 
 static _calendar_book_color calendar_color;
@@ -163,7 +169,7 @@ static Evas_Object *__cal_list_ug_get_genlist_item_icon(void *data, Evas_Object
 
        cal_list_ug_item_data *item_data = data;
 
-       if (!CAL_STRCMP(part, "elm.edit.icon.1")) {
+       if (!CAL_STRCMP(part, "elm.edit.icon")) {
 
                cal_list_ug_data* p = CAL_UTIL_GET_PRIV_DATA(obj);
                c_retv_if(!p, NULL);
@@ -259,12 +265,12 @@ static char* __cal_list_ug_get_genlist_item_label(void *data, Evas_Object *obj,
                return _calendar_get_summary(record);
        }
 
-       if (!CAL_STRCMP(part, "elm.text.2")) {
+       if (!CAL_STRCMP(part, "elm.text.3")) {
 
                return _calendar_get_location(record);
        }
 
-       if (!CAL_STRCMP(part, "elm.text.3"))
+       if (!CAL_STRCMP(part, "elm.text.2"))
                return _calendar_get_time_str_for_genlist(record);
 
        return NULL;
@@ -347,17 +353,18 @@ static void __cal_list_ug_genlist_item_select_callback(void *data, Evas_Object *
 
                value[0] = strdup(path);
 
-               service_add_extra_data_array(service, CAL_APPCONTROL_PATH, (const char **)value, 1);
+               service_add_extra_data_array(service, CAL_APPCONTROL_PATH, value, 1);
+               service_add_extra_data_array(service, "path", (const char **)value, 1);
 
                free(value[0]);
                free(value);
 
-               service_add_extra_data(service, CAL_APPCONTROL_RESULT, CAL_APPCONTROL_RESULT_SUCCESS);
+               service_add_extra_data(service, "result", "success");
 
                if (p->ugd->item_type == ITEM_TYPE_EVENT)
-                       service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_EVENT);
+                       service_add_extra_data(service, "itemType", "event");
                else
-                       service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_TODO);
+                       service_add_extra_data(service, "itemType", "todo");
 
                ug_send_result(p->ugd->ug, service);
                service_destroy(service);
@@ -434,7 +441,7 @@ static void __cal_list_ug_add_event_to_genlist(cal_list_ug_data *p)
 
                        item_data->record = record;
 
-                       item_data->it = elm_genlist_item_append(p->genlist, &itc, item_data, NULL, ELM_GENLIST_ITEM_NONE, __cal_list_ug_genlist_item_select_callback, item_data);
+                       item_data->it = elm_genlist_item_append(p->genlist, itc, item_data, NULL, ELM_GENLIST_ITEM_NONE, __cal_list_ug_genlist_item_select_callback, item_data);
 
                        added_event_count++;
 
@@ -590,7 +597,7 @@ static void __cal_list_ug_update_event_list_with_keyword(cal_list_ug_data *p)
                c_ret_if(!list);
        }
 
-       __cal_list_ug_append_list_with_iter(&p->search_list, list);
+       __cal_list_ug_append_list_with_iter(&p->event_list, list);
 
        calendar_error_e error = CALENDAR_ERROR_NONE;
 
@@ -633,13 +640,11 @@ static void __cal_list_ug_create_genlist(cal_list_ug_data *p)
        c_ret_if(!genlist);
 
        if (p->ugd->selection_mode == SELECTION_MODE_SINGLE)
-               itc.decorate_all_item_style = NULL;
+               itc = &itc_single;
        else
-               elm_genlist_decorate_mode_set(genlist, EINA_TRUE);
+               itc = &itc_multiple;
 
        evas_object_data_set(genlist, "priv", p);
-       elm_genlist_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_OFF);
-       elm_genlist_block_count_set(genlist, 20);
        elm_genlist_homogeneous_set(genlist, EINA_TRUE);
        evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -656,10 +661,14 @@ static void __cal_list_ug_create_no_contents(cal_list_ug_data *p)
        c_ret_if(!p);
        c_ret_if(!p->ly);
 
-       p->no_contents = cal_util_add_nocontents(p->ly, C_("IDS_CLD_BODY_NO_EVENTS"));
-       c_ret_if(!p->no_contents);
+       if (!p->no_contents) {
 
-       elm_object_part_content_set(p->ly, "sw_nocontents", p->no_contents);
+               p->no_contents = cal_util_add_nocontents(p->ly, C_("IDS_CLD_BODY_NO_EVENTS"));
+               c_ret_if(!p->no_contents);
+
+       }
+
+       elm_object_part_content_set(p->ly, "sw", p->no_contents);
 
        evas_object_show(p->no_contents);
 }
@@ -691,7 +700,11 @@ static void __cal_list_ug_update_callback(const char* view_uri, void *data)
 
        } else {
 
-               p->searchbar = NULL;
+               //p->searchbar = NULL;
+
+               elm_object_part_content_unset(p->ly, "sw");
+
+               evas_object_del(p->box);
 
                p->box = NULL;
 
@@ -830,18 +843,18 @@ static void __cal_list_ug_get_message_content(calendar_record_h record, char *bo
 }
 
 
-static void __cal_list_ug_add_bundle_event_content(service_h service, int record_index, int result_index)
+static char * __cal_list_ug_add_event_content_to_service(service_h service, int record_index, int result_index)
 {
-       c_ret_if(!service);
-       c_ret_if(record_index <= 0);
+       c_retv_if(!service, NULL);
+       c_retv_if(record_index <= 0, NULL);
 
        char key[16] = {0};
-       char value[1024*5] = {0};
+       char value[1024] = {0};
 
        calendar_record_h record = NULL;
 
        record = _calendar_get_record_with_index(record_index);
-       c_ret_if(!record);
+       c_retv_if(!record, NULL);
 
        __cal_list_ug_get_message_content(record, value, sizeof(value));
 
@@ -850,21 +863,23 @@ static void __cal_list_ug_add_bundle_event_content(service_h service, int record
        calendar_error_e error = CALENDAR_ERROR_NONE;
 
        error = calendar_record_destroy(record, true);
-       c_retm_if(error != CALENDAR_ERROR_NONE, "calendar_record_destroy() is failed(%x)", error);
+       c_retvm_if(error != CALENDAR_ERROR_NONE, NULL, "calendar_record_destroy() is failed(%x)", error);
 
        int r = service_add_extra_data(service, key, value);
-       c_ret_if(r != SERVICE_ERROR_NONE);
+       c_retv_if(r != SERVICE_ERROR_NONE, NULL);
+
+       return CAL_STRDUP(value);
 }
 
-static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, int result_index)
+static char * __cal_list_ug_add_vcs_path_to_service(service_h service, int record_index, int result_index)
 {
-       c_ret_if(!service);
-       c_ret_if(record_index <= 0);
+       c_retv_if(!service, NULL);
+       c_retv_if(record_index <= 0, NULL);
 
        calendar_record_h record = NULL;
 
        record = _calendar_get_record_with_index(record_index);
-       c_ret_if(!record);
+       c_retv_if(!record, NULL);
 
        calendar_error_e error = CALENDAR_ERROR_NONE;
 
@@ -876,7 +891,7 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
 
                calendar_record_destroy(record, true);
 
-               return;
+               return NULL;
        }
 
        error = calendar_list_add(list, record);
@@ -887,7 +902,7 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
 
                calendar_record_destroy(record, true);
 
-               return;
+               return NULL;
        }
 
        char *vcs_data = NULL;
@@ -898,7 +913,7 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
 
                calendar_list_destroy(list, true);
 
-               return;
+               return NULL;
        }
 
        if (!CAL_STRLEN(vcs_data)) {
@@ -906,7 +921,7 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
 
                calendar_list_destroy(list, true);
 
-               return;
+               return NULL;
        }
 
        char key[128] = {0};
@@ -923,7 +938,7 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
 
                CAL_FREE(vcs_data);
 
-               return;
+               return NULL;
        }
 
        int r = write(fd, vcs_data, strlen(vcs_data));
@@ -941,10 +956,12 @@ static void __cal_list_ug_add_bundle_vcs(service_h service, int record_index, in
        c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_destroy() is failed(%x)");
 
        r = service_add_extra_data(service, key, value);
-       c_ret_if(r != SERVICE_ERROR_NONE);
+       c_retv_if(r != SERVICE_ERROR_NONE, NULL);
+
+       return CAL_STRDUP(value);
 }
 
-static void __cal_list_ug_add_bundle(service_h service, GList *record_index_list, struct ug_data *ugd)
+static void __cal_list_ug_add_extra_data_from_record_list(service_h service, GList *record_index_list, struct ug_data *ugd)
 {
        c_ret_if(!service);
        c_ret_if(!record_index_list);
@@ -954,34 +971,76 @@ static void __cal_list_ug_add_bundle(service_h service, GList *record_index_list
 
        int result_index = 0;
 
+       char **result_array = NULL;
+
+       result_array = calloc(g_list_length(record_index_list), sizeof(char *));
+       c_ret_if(!result_array);
+
        while (record_index_list && record_index_list->data) {
 
                int record_index = (int)record_index_list->data;
 
-               switch (ugd->mode) {
-               case _MODE_GET_EVT:
-                       __cal_list_ug_add_bundle_event_content(service, record_index, ++result_index);
+               switch (ugd->result_type) {
+                       case RESULT_TYPE_ITEM_CONTENT:
+                               result_array[result_index] = __cal_list_ug_add_event_content_to_service(service, record_index, result_index + 1);
+                               break;
+                       case RESULT_TYPE_VCS:
+                               result_array[result_index] = __cal_list_ug_add_vcs_path_to_service(service, record_index, result_index + 1);
+                               break;
+                       case RESULT_TYPE_ITEM_ID:
+                               result_array[result_index] = g_strdup_printf("%d", record_index);
+                               break;
+                       default:
+                               break;
+               }
+
+               if (!result_array[result_index]) {
+
+                       ERR("Error, result_array[%d] is null.", result_index);
+
+                       free(result_array);
+
+                       return;
+               }
+
+               record_index_list = g_list_next(record_index_list);
+
+               result_index++;
+       }
+
+       int r = 0;
+
+       switch (ugd->result_type) {
+               case RESULT_TYPE_ITEM_CONTENT:
+                       r = service_add_extra_data_array(service, "text", result_array, result_index);
                        break;
-               case _MODE_GET_VCS:
-                       __cal_list_ug_add_bundle_vcs(service, record_index, ++result_index);
+               case RESULT_TYPE_VCS:
+                       r = service_add_extra_data_array(service, "path", result_array, result_index);
+                       c_warn_if(r != SERVICE_ERROR_NONE, "service_add_extra_data_array() is failed(%x).", r);
+
+                       r = service_add_extra_data_array(service, CAL_APPCONTROL_PATH, result_array, result_index);
+                       break;
+               case RESULT_TYPE_ITEM_ID:
+                       r = service_add_extra_data_array(service, CAL_APPCONTROL_ITEM_ID, result_array, result_index);
                        break;
                default:
-                       // do nothing
                        break;
-               }
-
-               record_index_list = g_list_next(record_index_list);
        }
+
+       c_warn_if(r != SERVICE_ERROR_NONE, "service_add_extra_data_array() is failed(%x).", r);
+
+       free(result_array);
 }
 
-static service_h __cal_list_ug_make_bundle(cal_list_ug_data *p, struct ug_data *ugd)
+static service_h __cal_list_ug_create_return_results(cal_list_ug_data *p, struct ug_data *ugd)
 {
        c_retv_if(!p, NULL);
        c_retv_if(!ugd, NULL);
 
        char buf[32] = {'\0'};
 
-       service_h service;
+       service_h service = NULL;
+
        int r = service_create(&service);
        c_retv_if(r != SERVICE_ERROR_NONE, NULL);
 
@@ -997,8 +1056,7 @@ static service_h __cal_list_ug_make_bundle(cal_list_ug_data *p, struct ug_data *
        while (item) {
 
                cal_list_ug_item_data* item_data = elm_object_item_data_get(item);
-               if(!item_data)
-               {
+               if (!item_data) {
                        ERR("elm_object_item_data_get() is failed!");
                        service_destroy(service);
                        return NULL;
@@ -1013,13 +1071,15 @@ static service_h __cal_list_ug_make_bundle(cal_list_ug_data *p, struct ug_data *
        int count = 0;
 
        if (record_index_list) {
-               __cal_list_ug_add_bundle(service, record_index_list, ugd);
+               __cal_list_ug_add_extra_data_from_record_list(service, record_index_list, ugd);
 
                count = g_list_length(record_index_list);
 
                g_list_free(record_index_list);
        }
 
+       c_retv_if(!count, service);
+
        snprintf(buf, sizeof(buf), "%d", count);
 
        r = service_add_extra_data(service, "count", buf);
@@ -1030,43 +1090,16 @@ static service_h __cal_list_ug_make_bundle(cal_list_ug_data *p, struct ug_data *
                return NULL;
        }
 
-       char **value = calloc(count, sizeof(char *));
-       if(!value)      {
-               ERR("value is NULL!");
-               service_destroy(service);
-               return NULL;
-       }
-
-       int i = 0;
-       char key[32] = {0};
-
-       for (i = 0; i < count; i++) {
-               snprintf(key, sizeof(key), "vfile%d", i + 1);
-               service_get_extra_data(service, key, &value[i]);
-       }
-
-       r = service_add_extra_data_array(service, CAL_APPCONTROL_PATH, (const char **)value, count);
-       if(r != SERVICE_ERROR_NONE)
-       {
-               ERR("service_add_extra_data_array() is failed(%d)", r);
-               free(value);
-               service_destroy(service);
-               return NULL;
-       }
-
        if (ugd->item_type == ITEM_TYPE_EVENT)
-               r = service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_EVENT);
-       else
-               r = service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_TODO);
+               r = service_add_extra_data(service, "itemType", "event");
+       else if (ugd->item_type == ITEM_TYPE_TODO)
+               r = service_add_extra_data(service, "itemType", "todo");
 
        c_warn_if(r != SERVICE_ERROR_NONE, "service_add_extra_data() is failed(%d)", r);
 
        r = service_add_extra_data(service, "result", "success");
        c_warn_if(r != SERVICE_ERROR_NONE, "service_add_extra_data() is failed(%d)", r);
 
-       if(value)
-               free(value);
-
        return service;
 }
 
@@ -1087,21 +1120,12 @@ static void __cal_list_ug_attach(void *data, Evas_Object *obj, void *ei)
 
        cal_util_hide_small_information(p->ly);
 
-       switch (ugd->mode) {
-       case _MODE_GET_EVT:
-       case _MODE_GET_VCS:
-               service = __cal_list_ug_make_bundle(p, ugd);
-               c_ret_if(!service);
-               break;
-       default:
-               break;
-       }
+       service = __cal_list_ug_create_return_results(p, ugd);
+       c_ret_if(!service);
 
-       if (service) {
+       ug_send_result(ugd->ug, service);
 
-               ug_send_result(ugd->ug, service);
-               service_destroy(service);
-       }
+       service_destroy(service);
 
        ug_destroy_me(ugd->ug);
 }
@@ -1148,7 +1172,9 @@ static void __cal_list_ug_searchbar_entry_changed_callback(void *data, Evas_Obje
        cal_list_ug_data *p = data;
        c_ret_if(!p);
 
-       p->searchtext = elm_object_text_get(elm_object_part_content_get(p->searchbar, "elm.swallow.content"));
+       CAL_FREE(p->searchtext);
+
+       p->searchtext = CAL_STRDUP(elm_object_text_get(obj));
 
 // TODO: Show search result
        __cal_list_ug_update_callback(_calendar_event._uri, p);
index 02ae2ba..b972524 100755 (executable)
@@ -21,6 +21,7 @@
 
 #include "cld.h"
 #include "ug.h"
+#include "appcontrol.h"
 
 // TODO: get full path from caller
 #define VFILE_PATH "/opt/usr/media/Others"
@@ -80,54 +81,41 @@ static char* __cal_ug_get_file_path(service_h b, const char *key)
        return path;
 }
 
-static enum cld_ug_mode __cal_ug_get_mode(service_h service, const char *key)
+static cal_appcontrol_result_type __cal_ug_get_result_type(service_h service, const char *key)
 {
-       c_retv_if(!service, _MODE_UNKNOWN);
-       c_retv_if(!key, _MODE_UNKNOWN);
+       cal_appcontrol_result_type result_type = RESULT_TYPE_VCS;
+
+       c_retv_if(!service, result_type);
+       c_retv_if(!key, result_type);
 
        char *value = NULL;
 
        int r = service_get_extra_data(service, key, &value);
-       c_retvm_if(r != SERVICE_ERROR_NONE, _MODE_GET_VCS, "%d", r);
+       if (r != SERVICE_ERROR_NONE) {
+               CAL_FREE(value);
 
-       enum cld_ug_mode ret;
+               return result_type;
+       }
 
        if (!CAL_STRCMP(value, "text"))
-               ret =  _MODE_GET_EVT;
-       else if (!CAL_STRCMP(value, "view"))
-               ret =  _MODE_VIEW_VCS;
+               result_type = RESULT_TYPE_ITEM_CONTENT;
 
-       else
-               ret =  _MODE_GET_VCS;
-       free(value);
+       CAL_FREE(value);
 
-       return ret;
+       return result_type;
 }
 
-static inline int __cal_ug_set_ug_data(struct ug_data *ugd, service_h service)
+static void __cal_ug_get_ug_input_data(service_h service, struct ug_data *ugd)
 {
-       c_retv_if(!service, -1);
-       int val;
+       c_ret_if(!service);
 
-       ugd->mode = __cal_ug_get_mode(service, "mode");
+       int val = 0;
+
+       ugd->result_type = __cal_ug_get_result_type(service, "mode");
 
        char *selection_mode = NULL;
        char *item_type = NULL;
 
-       service_get_extra_data(service, CAL_APPCONTROL_SELECTION_MODE, &selection_mode);
-
-       if (!CAL_STRCMP(selection_mode, CAL_APPCONTROL_SELECTION_MODE_SINGLE))
-               ugd->selection_mode = SELECTION_MODE_SINGLE;
-       else
-               ugd->selection_mode = SELECTION_MODE_MULTIPLE;
-
-       service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
-
-       if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_TODO))
-               ugd->item_type = ITEM_TYPE_TODO;
-       else
-               ugd->item_type = ITEM_TYPE_EVENT;
-
        int r = vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &val);
        if (r < 0)
                is_hour24 = 0;
@@ -136,30 +124,8 @@ static inline int __cal_ug_set_ug_data(struct ug_data *ugd, service_h service)
        else
                ERR("vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &val); error");
 
-       switch (ugd->mode) {
-       case _MODE_GET_VCS:
-               ugd->caller = __cal_ug_get_caller(service, "caller");
-               break;
-       case _MODE_VIEW_VCS:
-               ugd->vcs_file = __cal_ug_get_file_name(service, "file");
-               if (!ugd->vcs_file)
-               {
-                       ERR("UG: Invalid filename");
-                       return -1;
-               }
-               break;
-       default:
-               // do nothing
-               break;
-       }
-
-       if (selection_mode)
-               free(selection_mode);
-
-       if (item_type)
-               free(item_type);
+               ugd->selection_mode = SELECTION_MODE_MULTIPLE;
 
-       return 0;
 }
 
 static void __cal_ug_back_button_callback(void *data, Evas_Object *obj, void *ei)
@@ -174,12 +140,12 @@ static void __cal_ug_back_button_callback(void *data, Evas_Object *obj, void *ei
 
        service_create(&service);
 
-       service_add_extra_data(service, CAL_APPCONTROL_RESULT, CAL_APPCONTROL_RESULT_CANCEL);
+       service_add_extra_data(service, "result", "cancel");
 
        if (ugd->item_type == ITEM_TYPE_EVENT)
-               service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_EVENT);
+               service_add_extra_data(service, "itemType", "event");
        else
-               service_add_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, CAL_APPCONTROL_ITEM_TYPE_TODO);
+               service_add_extra_data(service, "itemType", "todo");
 
        ug_send_result(ugd->ug, service);
 
@@ -227,19 +193,7 @@ static Evas_Object *__cal_ug_create(Evas_Object *parent, struct ug_data *ugd)
        elm_object_part_content_set(ugd->base, "elm.swallow.content", ugd->naviframe);
        elm_object_part_content_set(ugd->base, "elm.swallow.bg", ugd->bg);
 
-       switch (ugd->mode) {
-       case _MODE_GET_EVT:
-       case _MODE_GET_VCS:
-
-               cal_list_ug_create(S_("IDS_COM_BODY_CALENDAR"), ugd);
-               break;
-       case _MODE_VIEW_VCS:
-               cal_vcs_viewer_ug_create(ugd);
-               break;
-       default:
-               // do nothing
-               break;
-       }
+       cal_list_ug_create(S_("IDS_COM_BODY_CALENDAR"), ugd);
 
        if (!ugd->cont) {
                evas_object_del(ugd->base);
@@ -257,6 +211,95 @@ static void __cal_ug_free_data(struct ug_data *ugd)
 
        free(ugd->vcs_file);
 }
+static void __cal_ug_get_appcontrol_input_data(service_h service, struct ug_data *ugd)
+{
+       char *selection_mode = NULL;
+
+       service_get_extra_data(service, CAL_APPCONTROL_SELECTION_MODE, &selection_mode);
+
+       if (!CAL_STRCMP(selection_mode, CAL_APPCONTROL_SELECTION_MODE_MULTIPLE))
+               ugd->selection_mode = SELECTION_MODE_MULTIPLE;
+       else
+               ugd->selection_mode = SELECTION_MODE_SINGLE;
+
+       CAL_FREE(selection_mode);
+
+       char *item_type = NULL;
+
+       int r = service_get_extra_data(service, CAL_APPCONTROL_ITEM_TYPE, &item_type);
+       if (r != SERVICE_ERROR_NONE) {
+               ERR("service_get_extra_data(%s) is failed(%x).", CAL_APPCONTROL_ITEM_TYPE, r);
+
+               CAL_FREE(item_type);
+
+               return;
+       }
+
+       if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_EVENT))
+               ugd->item_type = ITEM_TYPE_EVENT;
+       else if (!CAL_STRCMP(item_type, CAL_APPCONTROL_ITEM_TYPE_TODO))
+               ugd->item_type = ITEM_TYPE_TODO;
+       else
+               ugd->item_type = ITEM_TYPE_EVENT_TODO;
+
+       CAL_FREE(item_type);
+
+       char *result_type = NULL;
+
+       r = service_get_extra_data(service, CAL_APPCONTROL_RESULT_TYPE, &result_type);
+       if (r != SERVICE_ERROR_NONE) {
+               ERR("service_get_extra_data(%s) is failed(%x).", CAL_APPCONTROL_RESULT_TYPE, r);
+
+               CAL_FREE(result_type);
+
+               return;
+       }
+
+       if (!CAL_STRCMP(result_type, CAL_APPCONTROL_RESULT_TYPE_ITEM_ID))
+               ugd->result_type = RESULT_TYPE_ITEM_ID;
+       else
+               ugd->result_type = RESULT_TYPE_VCS;
+
+       CAL_FREE(result_type);
+}
+
+static void __cal_ug_get_appcontrol_input_data_old(service_h service, struct ug_data *ugd)
+{
+       int r = 0;
+
+       char *selection_mode = NULL;
+
+       r = service_get_extra_data(service, "selectionMode", &selection_mode);
+       if (r != SERVICE_ERROR_NONE) {
+               ERR("service_get_extra_data(%s) is failed(%x).", "selectionMode", r);
+
+               CAL_FREE(selection_mode);
+
+               return;
+       }
+
+       if (!CAL_STRCMP(selection_mode, "single"))
+               ugd->selection_mode = SELECTION_MODE_SINGLE;
+       else
+               ugd->selection_mode = SELECTION_MODE_MULTIPLE;
+
+       CAL_FREE(selection_mode);
+
+       char *item_type = NULL;
+
+       service_get_extra_data(service, "itemType", &item_type);
+
+       if (!CAL_STRCMP(item_type, "todo"))
+               ugd->item_type = ITEM_TYPE_TODO;
+       else if (!CAL_STRCMP(item_type, "event"))
+               ugd->item_type = ITEM_TYPE_EVENT;
+       else
+               ugd->item_type = ITEM_TYPE_EVENT_TODO;
+
+       CAL_FREE(item_type);
+
+       ugd->result_type = RESULT_TYPE_VCS;
+}
 
 static void *__cal_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
 {
@@ -273,6 +316,20 @@ static void *__cal_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service
        ugd = priv;
        ugd->ug = ug;
 
+       char *operation = NULL;
+
+       r = service_get_operation(service, &operation);
+       c_retvm_if(r != SERVICE_ERROR_NONE, NULL, "service_get_operation() is failed(%x)", r);
+
+       if (!CAL_STRCMP(operation, CAL_APPCONTROL_SOCAIL_PICK))
+               __cal_ug_get_appcontrol_input_data(service, ugd);
+       else if (!CAL_STRCMP(operation, SERVICE_OPERATION_PICK))
+               __cal_ug_get_appcontrol_input_data_old(service, ugd);
+       else
+               __cal_ug_get_ug_input_data(service, ugd);
+
+       CAL_FREE(operation);
+
        cal_util_connect_pattern_generator();
 
        if (mode != UG_MODE_FULLVIEW)
@@ -281,8 +338,6 @@ static void *__cal_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service
        Evas_Object *parent = ug_get_parent_layout(ug);
        c_retv_if(!parent, NULL);
 
-       r = __cal_ug_set_ug_data(ugd, service);
-       c_retv_if(r, NULL);
        calendar_error_e err = CALENDAR_ERROR_NONE;
        err = calendar_connect();
        c_warn_if(err != CALENDAR_ERROR_NONE, "calendar_connect is failed(%d)", err);
@@ -295,6 +350,8 @@ static void *__cal_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, service
                return NULL;
        }
 
+       elm_theme_extension_add(NULL, "/usr/apps/"CALENDAR_PACKAGE"/res/edje/theme3.edj");
+
        base = __cal_ug_create(parent, ugd);
        if (!base) {
                calendar_error_e error = CALENDAR_ERROR_NONE;
index 6c04303..1c00bfa 100755 (executable)
 #include <ui-gadget-module.h>
 #include "cld.h"
 
-#define CAL_APPCONTROL_SELECTION_MODE "selectionMode"
-#define CAL_APPCONTROL_SELECTION_MODE_SINGLE "single"
-#define CAL_APPCONTROL_SELECTION_MODE_MULTIPLE "multiple"
-
-#define CAL_APPCONTROL_RESULT "result"
-#define CAL_APPCONTROL_RESULT_SUCCESS "success"
-#define CAL_APPCONTROL_RESULT_CANCEL "cancel"
-#define CAL_APPCONTROL_RESULT_FAIL "fail"
-
-#define CAL_APPCONTROL_PATH "path"
-
-enum cld_ug_mode {
-       _MODE_UNKNOWN = 0,
-       _MODE_GET_EVT,
-       _MODE_GET_VCS,
-       _MODE_VIEW_VCS,
-       _MODE_SET_SNOTE,
-};
-
-typedef enum {
-       SELECTION_MODE_UNKNOWN = 0,
-       SELECTION_MODE_SINGLE,
-       SELECTION_MODE_MULTIPLE,
-       SELECTION_MODE_MAX,
-}cal_appcontrol_selection_mode;
-
 struct ug_data {
        Evas_Object *base;
        ui_gadget_h ug;
@@ -56,7 +30,6 @@ struct ug_data {
        Evas_Object *cont;
        Evas_Object *bg;
 
-       enum cld_ug_mode mode;
        char *caller;
        char *vcs_file;
 
@@ -64,6 +37,7 @@ struct ug_data {
 
        cal_appcontrol_selection_mode selection_mode;
        cal_appcontrol_item_type item_type;
+       cal_appcontrol_result_type result_type;
 };
 
 void cal_list_ug_create(const char *title, struct ug_data *ugd);
index ad6c53a..c6f4ecd 100755 (executable)
 #define CAL_TEXT_MAX_LEN 1024
 #define CAL_TEXT_SHORT_LEN 256
 
-enum cld_ug_mode {
-       _MODE_UNKNOWN = 0,
-       _MODE_GET_EVT,
-       _MODE_GET_VCS,
-       _MODE_VIEW_VCS,
-};
-
 typedef enum{
        FIRST_DAY_LOCALE_DEFAULT = -1,
        FIRST_DAY_SUNDAY = 0,
@@ -62,10 +55,6 @@ struct ug_data {
        Evas_Object *cont;
        Evas_Object *bg;
 
-       enum cld_ug_mode mode;
-       char *caller;
-       char *vcs_file;
-
        Elm_Object_Item *item_time_zone_on_off;
        Elm_Object_Item *item_time_zone_guide;
        Elm_Object_Item *item_time_zone;
index 3f88dfc..89d8b60 100755 (executable)
@@ -422,8 +422,8 @@ static void __cal_viewer_save_to_calendar_button_callback(void *data, Evas_Objec
 
        if (saved_item_count) {
 
-               int r = status_message_post(S_("IDS_COM_POP_SAVED"));
-               c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r);
+               int r = notification_status_message_post(S_("IDS_COM_POP_SAVED"));
+               c_warn_if(r != NOTIFICATION_ERROR_NONE, "notification_status_message_post() is failed(%d)", r);
        }
 }