From: Kyuho Jo Date: Tue, 28 Jul 2015 05:40:27 +0000 (+0900) Subject: [minicontrol] New guide and tutorial. X-Git-Tag: tizen_3.0/TD_SYNC/20161201~667^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96fe52eb5dbf6a74e759b5d247634da10b4e9f62;p=sdk%2Fonline-doc.git [minicontrol] New guide and tutorial. Change-Id: I77d04bfae3bd64c859eac9eb1d5a35b9b949d555 Signed-off-by: Kyuho Jo --- diff --git a/org.tizen.guides/html/images/minicontrol-on-lockscreen.png b/org.tizen.guides/html/images/minicontrol-on-lockscreen.png new file mode 100644 index 0000000..37cb28e Binary files /dev/null and b/org.tizen.guides/html/images/minicontrol-on-lockscreen.png differ diff --git a/org.tizen.guides/html/images/minicontrol-on-quickpanel.png b/org.tizen.guides/html/images/minicontrol-on-quickpanel.png new file mode 100644 index 0000000..b06615a Binary files /dev/null and b/org.tizen.guides/html/images/minicontrol-on-quickpanel.png differ diff --git a/org.tizen.guides/html/native/app/minicontrol_n.htm b/org.tizen.guides/html/native/app/minicontrol_n.htm new file mode 100644 index 0000000..02cb4f5 --- /dev/null +++ b/org.tizen.guides/html/native/app/minicontrol_n.htm @@ -0,0 +1,92 @@ + + + + + + + + + + + + + Minicontrol + + + + + +
+ +

Minicontrol

+

Minicontrol is small application view can be shown on Quick panel or lock screen.

+ + + + + + +
+

Figure: Minicontrol on Quick panel

+

minicontrol-on-quickpanel

+
+

Figure: Minicontrol on lock screen

+

minicontrol-on-lockscreen

+
+ +

There are two kinds of minicontol API.

+
    +
  • + minicontrol provider API : API for creating minicontrols of your application +

    The Tizen Minicontrol provider API requires the http://tizen.org/privilege/minicontrol.provider privilege.

    +
  • +
  • + minicontrol viewer API : API for hosting minicontrols likes lock screen +

    The Tizen Minicontrol viewer API requires the http://tizen.org/privilege/minicontrol.viewer privilege.

    +
  • +
+
+

To create the minicontrol :

+
  • To create a minicontrol, use the minicontrol_create_window() function, which returns a Evas_Object of minicontrol window
  • +
  • To send a request to , use the minicontrol_send_event() function to get a minicontrol handle and set the details.
+
+

To host minicontrols :

+
  • To host mincontrols, use the minicontrol_viewer_set_event_cb() function for listening the request from minicontrol providers.
  • +
  • When you get the creation request from minicontrol provider, use the minicontrol_viewer_add() function to add the minicontrol on your application.
+ + + +
+ +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.tutorials/html/images/minicontrol.png b/org.tizen.tutorials/html/images/minicontrol.png new file mode 100644 index 0000000..46c7a68 Binary files /dev/null and b/org.tizen.tutorials/html/images/minicontrol.png differ diff --git a/org.tizen.tutorials/html/native/app_framework/minicontrol_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/minicontrol_tutorial_n.htm new file mode 100644 index 0000000..4696098 --- /dev/null +++ b/org.tizen.tutorials/html/native/app_framework/minicontrol_tutorial_n.htm @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + Minicontrol: Creating a minicontrol + + + + +
+
+

Mobile native

+
+ +
+ +
+

Minicontrol: Creating a minicontrol

+ + +

This tutorial demonstrates how you can create minicontrols on the Quick panel or the lock screen, and hide a minicontrol viewer.

+ +

Warm-up

+

Become familiar with the Minicontrol API basics by learning about:

+ + + +

Creating a minicontrol on Quick panel

+ +

To create a minicontrol of your application:

+ +
    +
  1. To use the functions and data types of the Minicontrol API, include the <minicontrol_provider.h> header file in your application:

    +
    +#include <minicontrol_provider.h>
    +
    +
  2. +
  3. To create a minicontrol, use the minicontrol_create_window() function:

    + +
    +Evas_Object *win;
    +
    +win = minicontrol_create_window("mini-sample", MINICONTROL_TARGET_VIEWER_QUICK_PANEL, NULL);
    +evas_object_resize(win, 480, 140);
    +evas_object_show(win);
    +
    + +

    To create a minicontrol on Quick panel, the target_viewer parameter must be set to MINICONTROL_TARGET_VIEWER_QUICK_PANEL.

  4. + +
  5. Add a text label on the minicontrol using the elm_label_add() function:

    + +
    +label = elm_label_add(win);
    +elm_object_text_set(label, "mini-sample");
    +evas_object_resize(label, 480, 140);
    +evas_object_show(label);
    +
    +
+ +

Hiding Quick panel

+

To hide Quick panel:

+
    +
  1. +

    Add a button on the minicontrol

    +
  2. +
    +button = elm_button_add(win);
    +elm_object_text_set(button, "Click to hide.");
    +evas_object_move(button, 0, 50);
    +evas_object_resize(button, 200, 50);
    +evas_object_show(button);
    +
    +
  3. +

    Add an event handler callback function

    +
  4. +
    +evas_object_smart_callback_add(button, "clicked", _button_clicked_cb, win);
    +
    +
  5. +

    Define callback function for hiding Quickpanel

    +
  6. +
    +static void _button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
    +{
    +	Evas_Object *win = data;
    +	minicontrol_send_event(win, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL);
    +}
    +
    +
+ +

Figure: Minicontrol on quick panel

+

minicontrol-on-quickpanel

+ + + + +
+ +Go to top + + + + + + + \ No newline at end of file