summaryrefslogtreecommitdiff
path: root/include/ui-gadget.h
blob: 0ebcc38c510ec1e8233aa49521bdb6fcef0dd279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
/*
 *  UI Gadget
 *
 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact: Jayoun Lee <airjany@samsung.com>, Jinwoo Nam <jwoo.nam@samsung.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT 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 __UI_GADGET_H__
#define __UI_GADGET_H__

/**
 * @file	ui-gadget.h
 * @version	0.1
 * @brief	This file contains the public API of the UI gadget library
 */

/**
 * @addtogroup APPLICATION_FRAMEWORK
 * @{
 *
 * @defgroup	UI_Gadget UI gadget library
 * @version	0.1
 * @brief	A library to develop/use a UI gadget
 */

/**
 * @addtogroup UI_Gadget
 * @{
 *
 * @defgroup	UI_Gadget_For_User User API Reference Guide
 * @brief	A module to use a UI gadget. Caller uses this module and APIs.
 *
 * @section Header To Use Them:
 * @code
 * #include <ui-gadget.h>
 * @endcode
 */

/**
 * @addtogroup UI_Gadget_For_User
 * @{
 */

#include <X11/Xlib.h>
#include <app.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * struct ui_gadget is an opaque type representing a UI gadget
 * @see ug_create(), ug_destroy()
 * @see ug_get_layout(), ug_get_parent_layout(), ug_get_mode()
 */
typedef struct ui_gadget_s *ui_gadget_h;

/**
 * UI gadget mode
 * @see ug_create()
 * @see ug_get_mode()
 */
enum ug_mode {
	UG_MODE_FULLVIEW, /**< Fullview mode */
	UG_MODE_FRAMEVIEW, /**< Frameview mode */
	UG_MODE_INVALID, /**< Invalid mode */
	UG_MODE_MAX
};

/**
 * UI gadget event
 * @see ug_send_event()
 */
enum ug_event {
	UG_EVENT_NONE = 0x00,		/**< No event */
	UG_EVENT_LOW_MEMORY,		/**< Low memory event */
	UG_EVENT_LOW_BATTERY,		/**< Low battery event */
	UG_EVENT_LANG_CHANGE,		/**< Language change event */
	UG_EVENT_ROTATE_PORTRAIT,	/**< Rotate event: Portrait */
	UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN,	/**< Rotate event: Portrait upsidedown */
	UG_EVENT_ROTATE_LANDSCAPE,	/**< Rotate event: Landscape */
	UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN,
			/**< Rotate event: Landscape upsidedown */
	UG_EVENT_REGION_CHANGE,		/**< Region change event */
	UG_EVENT_MAX
};

/**
 * UI gadget key event
 * @see ug_send_key_event()
 */
enum ug_key_event {
	UG_KEY_EVENT_NONE = 0x00,	/**< No event */
	UG_KEY_EVENT_END,		/**< End key event */
	UG_KEY_EVENT_MAX
};

/**
 * UI gadget option
 *
 * @see ug_init()
 */
enum ug_option {
	UG_OPT_INDICATOR_ENABLE = 0x00,
			/**< Indicator option:
			Enable with both portrait and landscape window */
	UG_OPT_INDICATOR_PORTRAIT_ONLY = 0x01,
			/**< Indicator option: Enable with portrait window */
	UG_OPT_INDICATOR_LANDSCAPE_ONLY = 0x02,
			/**< Indicator option: Enable with landscape window */
	UG_OPT_INDICATOR_DISABLE = 0x03,
			/**< Indicator option:
			Disable with both portrait and landscape view window */
	UG_OPT_INDICATOR_MANUAL = 0x04,
			/**< Indicator option:
			Indicator will be handled manually */
	UG_OPT_OVERLAP_ENABLE = 0x08,
			/**< Overlap option: Enable indicator overlap  */
	UG_OPT_MAX
};

#define GET_OPT_INDICATOR_VAL(opt) opt % UG_OPT_OVERLAP_ENABLE
#define GET_OPT_OVERLAP_VAL(opt) opt & UG_OPT_OVERLAP_ENABLE

/**
 * UI gadget callback type
 * @see ug_create()
 */
struct ug_cbs {
	/** layout callback */
	void (*layout_cb) (ui_gadget_h ug, enum ug_mode mode,
				void *priv);
	/** result callback */
	void (*result_cb) (ui_gadget_h ug, service_h result, void *priv);
	/** destroy callback */
	void (*destroy_cb) (ui_gadget_h ug, void *priv);
	/** private data */
	void *priv;
};

/**
 * Easy-to-use macro of ug_init() for EFL
 * @see ug_init()
 */
#define UG_INIT_EFL(win, opt) \
	ug_init((Display *)ecore_x_display_get(), elm_win_xwindow_get(win), \
		win, opt)

/**
 * Easy-to-use macro of ug_init() for GTK
 * @see ug_init()
 */
#define UG_INIT_GTK(win, opt) \
	win ?  ug_init(gdk_display_get_default(), win, \
	GDK_WINDOW_XWINDOW(GTK_WIDGET(win)->window), win, opt) : -1

/**
 * \par Description:
 * This function initializes default window, display, xwindow id, and indicator state.
 *
 * \par Purpose:
 * First of all, to use UI gadgets in an application, default window to draw the UI gadgets has to be registered. Besides, to change indicator state for the full-view UI gadget, display and xwindow id have to be registered, and to restore application's indicator state, default indicator option has to be registered. This function is used for registering them.
 *
 * \par Typical use case:
 * Application developers who want to use UI gadget MUST register display, xwindow id, default window, and option with the function at first.
 *
 * \par Method of function operation:
 * Register display, xwindow id, default window, and option.
 *
 * \par Context of function:
 * None
 *
 * \note If you are unfamiliar with display and xwindow id, please use following macros: UG_INIT_EFL, UG_INIT_GTK. The macros kindly generate proper functions to get display and xwindow id.
 *
 * @param[in] disp Default display
 * @param[in] xid Default xwindow id of default window
 * @param[in] win Default window object, it is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *)
 * @param[in] opt Default indicator state to restore application's indicator state
 * @return 0 on success, -1 on error
 *
 * \pre None
 * \post None
 * \see UG_INIT_EFL(), UG_INIT_GTK()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * Evas_Object *win;
 * ...
 * // create window
 * ...
 * ug_init((Display *)ecore_x_display_get(), elm_win_xwindow_get(win), win, UG_OPT_INDICATOR_ENABLE);
 * // for convenience you can use following macro: ELM_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE);
 * ...
 * \endcode
 */
int ug_init(Display *disp, Window xid, void *win, enum ug_option opt);

/**
 * \par Description:
 * This function creates a UI gadget
 *
 * \par Purpose:
 * This function is used for creating a UI gadget instance. In addition, following callbacks could be registered with the function: layout callback, result callback, and destroy callback. (see struct ug_cbs)
 *
 * \par Typical use case:
 * Anyone who want to create UI gadget could use the function.
 *
 * \par Method of function operation:
 * First, the UI gadget with given name is dynamically loaded(dlopen). Next, state operations of loaded UI gadget are invoked according to its lifecycle. There are three callbacks which could be registered with the function: layout callback, result callback, and destroy callback. If the state is changed to "Create", the layout callback is invoked for layout arrangement. If ug_send_result() is invoked in the loaded UI gadget , the result callback is invoked. And, if ug_destroy_me() is invoked in the loaded UI gadget , the destroy callback is invoked.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @param[in] parent parent's UI gadget. If the UI gadget uses the function, the parent has to be the UI gadget. Otherwise, if an application uses the function, the parent has to be NULL
 * @param[in] name name of UI gadget
 * @param[in] mode mode of UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
 * @param[in] service argument for the UI gadget  (see \ref service_PG "Tizen managed api reference guide")
 * @param[in] cbs callback functions (layout callback, result callback, destroy callback, see struct ug_cbs) and private data.
 * @return The pointer of UI gadget, NULL on error
 *
 * \pre ug_init()
 * \post None
 * \see struct ug_cbs, enum ug_mode
 * \remarks If you passed "service", you MUST release it using service_destroy() after ug_create()
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * service_h service;
 * ui_gadget_h ug;
 * struct ug_cbs cbs = {0, };
 *
 * // set callbacks: layout callback, result callback, destroy callback
 * cbs.layout_cb = _layout_cb;
 * cbs.result_cb = _result_cb;
 * cbs.destroy_cb = _destroy_cb;
 * cbs.priv = user_data;
 *
 * // create arguments
 * service_create(&service);
 * service_add_extra_data(service, "Content", "Hello");
 *
 * // create "helloUG-efl" UI gadget instance
 * ug = ug_create(NULL, "helloUG-efl", UG_MODE_FULLVIEW, service, &cbs);
 *
 * // release arguments
 * service_destroy(b);
 * ...
 * \endcode
 */
ui_gadget_h ug_create(ui_gadget_h parent, const char *name,
					enum ug_mode mode, service_h service,
					struct ug_cbs *cbs);

/**
 * \par Description:
 * This function pauses all UI gadgets
 *
 * \par Purpose:
 * This function is used for pausing UI gadgets with "Running" state. Eventually, state of the UI gadgets would be "Stopped."
 *
 * \par Typical use case:
 * Application developers who want to pause loaded UI gadgets could use the function.
 *
 * \par Method of function operation:
 * "Pause" state operations of UI gadgets with "Running" state in the UI gadget tree are invoked by post-order traversal.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @return 0 on success, -1 on error
 *
 * \pre ug_init()
 * \post None
 * \see ug_resume()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // pause all UI gadget instances
 * ug_pause();
 * ...
 * \endcode
 */
int ug_pause(void);

/**
 * \par Description:
 * This function resumes all UI gadgets
 *
 * \par Purpose:
 * This function is used for resuming UI gadgets with "Stopped" state. Eventually, state of all UI gadgets would be "Running."
 *
 * \par Typical use case:
 * Application developers who want to resume loaded UI gadgets could use the function.
 *
 * \par Method of function operation:
 * "Resume" state operations of UI gadgets with "Stopped" state in the UI gadget tree are invoked by post-order traversal.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @return 0 on success, -1 on error
 *
 * \pre ug_init()
 * \post None
 * \see ug_pause()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // resume all UI gadget instances
 * ug_resume();
 * ...
 * \endcode
 */
int ug_resume(void);

/**
 * \par Description:
 * This function destroys the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for destroying given UI gadget instance and its children. Eventually, state of the instance would be "Destroyed."
 *
 * \par Typical use case:
 * Anyone who want to destroy specific UI gadget could use the function.
 *
 * \par Method of function operation:
 * "Destroy" state operations of the given UI gadget instance and its children are invoked.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @return 0 on success, -1 on error
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see ug_destroy_all()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // destroy UI gadget instance
 * ug_destroy(ug);
 * ...
 * \endcode
 */
int ug_destroy(ui_gadget_h ug);

/**
 * \par Description:
 * This function destroys all UI gadgets of an application
 *
 * \par Purpose:
 * This function is used for destroying all UI gadgets. Eventually, state of all UI gadgets would be "Destroyed."
 *
 * \par Typical use case:
 * Application developers who want to destroy loaded UI gadgets could use the function.
 *
 * \par Method of function operation:
 * "Destroy" state operations of all UI gadgets in the UI gadget tree are invoked by post-order traversal.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @return 0 on success, -1 on error
 *
 * \pre ug_init()
 * \post None
 * \see ug_destroy()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // destroy all UI gadget instances
 * ug_destroy_all();
 * ...
 * \endcode
 */
int ug_destroy_all(void);

/**
 * \par Description:
 * This function gets base layout of the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for getting base layout pointer of given UI gadget instance.
 *
 * \par Typical use case:
 * Anyone who want to get base layout of UI gadget could use the function.
 *
 * \par Method of function operation:
 * This function returns base layout pointer which is created in "Create" operation of the given UI gadget instance.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @return The pointer of base layout, NULL on error. The result value is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *)
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see ug_get_parent_layout()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * Evas_Object *ly;
 * // get a base layout
 * ly = (Evas_Object *)ug_get_layout(ug);
 * ...
 * \endcode
 */
void *ug_get_layout(ui_gadget_h ug);

/**
 * \par Description:
 * This function gets base layout of parent of the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for getting base layout pointer of parent of the given UI gadget instance.
 *
 * \par Typical use case:
 * Anyone who want to get base layout of UI gadget's parent could use the function.
 *
 * \par Method of function operation:
 * This function returns base layout pointer which is created in "Create" operation of parent of the given UI gadget instance.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @return The pointer of base layout, NULL on error. The result value is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *)
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see ug_get_layout()
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * Evas_Object *ly;
 * // get a base layout of parent of the given UI gadget instance
 * ly = (Evas_Object *)ug_get_parent_layout(ug);
 * ...
 * \endcode
 */
void *ug_get_parent_layout(ui_gadget_h ug);

/**
 * \par Description:
 * This function gets default window
 *
 * \par Purpose:
 * This function is used for getting default window which is registered with ug_init()
 *
 * \par Typical use case:
 * Anyone who want to get default window could use the function.
 *
 * \par Method of function operation:
 * This function returns default window pointer which is registered with ug_init()
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @return The pointer of default window, NULL on error. The result value is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *)
 *
 * \pre ug_init()
 * \post None
 * \see None
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * Evas_Object *win;
 * // get default window
 * win = (Evas_Object *)ug_get_window();
 * ...
 * \endcode
 */
void *ug_get_window(void);

/**
 * \par Description:
 * This function gets ug conformant
 *
 * \par Purpose:
 * This function is used for getting ug conformant
 *
 * \par Typical use case:
 * Anyone who want to get ug conformant could use the function.
 *
 * \par Method of function operation:
 * This function returns ug conformant pointer
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @return The pointer of default window, NULL on error. The result value is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *)
 *
 * \pre ug_init()
 * \post None
 * \see None
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * Evas_Object *conform;
 * // get default window
 * conform = (Evas_Object *)ug_get_conformant();
 * ...
 * \endcode
 */
void *ug_get_conformant(void);

/**
 * \par Description:
 * This function gets mode of the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for getting mode of the given UI gadget instance. Mode could be UG_MODE_FULLVIEW or UG_MODE_FRAMEVIEW.
 *
 * \par Typical use case:
 * Anyone who want to get mode of UI gadget could use the function.
 *
 * \par Method of function operation:
 * This function returns mode which is registered with ug_create()
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @return UI gadget mode of the given UI gadget instance (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see enum ug_mode
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * enum ug_mode mode;
 * // get mode (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
 * mode = ug_get_mode(ug);
 * ...
 * \endcode
 */
enum ug_mode ug_get_mode(ui_gadget_h ug);

/**
 * \par Description:
 * This function propagates the given system event to all UI gadgets
 *
 * \par Purpose:
 * This function is used for propagating the given system event. Available system events are low memory, low battery, language changed, and window rotate event.
 *
 * \par Typical use case:
 * Application developers who want to propagate system event to all UI gadgets could use the function.
 *
 * \par Method of function operation:
 * Event operations of all UI gadgets in the UI gadget tree are invoked by post-order traversal.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @param[in] event UI gadget event. (see enum ug_event)
 * @return 0 on success, -1 on error
 *
 * \pre ug_init()
 * \post None
 * \see enum ug_event
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // propagate low battery event to all UI gadget instances
 * ug_send_event(UG_EVENT_LOW_BATTERY);
 * ...
 * \endcode
 */
int ug_send_event(enum ug_event event);

/**
 * \par Description:
 * This function send key event to full view top UI gadget
 *
 * \par Purpose:
 * This function is used for sending key event to full view top UI gadget. Available key events are end event.
 *
 * \par Typical use case:
 * Application developers who want to send key event to full view top UI gadget could use the function.
 *
 * \par Method of function operation:
 * Key event operation of full view top UI gadget in the UI gadget tree are invoked.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init()
 *
 * @param[in] event UI gadget key event. (see enum ug_key_event)
 * @return 0 on success, -1 on error
 *
 * \pre ug_init()
 * \post None
 * \see enum ug_key_event
 * \remarks None
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // send key event callback to full view top UI gadget instances
 * ug_send_key_event(UG_KEY_EVENT_END);
 * ...
 * \endcode
 */
int ug_send_key_event(enum ug_key_event event);

/**
 * \par Description:
 * This function sends message to the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for sending message to created UI gadget. The message have to be composed with service handle.
 *
 * \par Typical use case:
 * Anyone who want to send message to created UI gadget.
 *
 * \par Method of function operation:
 * Message operation of given UI gadget instance is invoked.
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @param[in] msg message to send, which is service type (see \ref service_PG "Tizen managed api reference guide")
 * @return 0 on success, -1 on error
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see None
 * \remarks After send your message, you have to release it using service_destroy()
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * // make a message with service
 * service_h msg;
 * service_create(&msg)
 * service_add_extra_data(msg, "Content", "Hello");
 *
 * // send the message
 * ug_send_message(ug, msg);
 *
 * // release the message
 * service_destroy(msg);
 * ...
 * \endcode
 */
int ug_send_message(ui_gadget_h ug, service_h msg);

/**
 * \par Description:
 * This function disable transition effect of the given UI gadget instance
 *
 * \par Purpose:
 * This function is used for disabling transition effect of created UI gadget.
 *
 * \par Typical use case:
 * Anyone who want to disable transition effect of created UI gadget.
 *
 * \par Method of function operation:
 * No transition effect of given UI gadget is invoked
 *
 * \par Context of function:
 * This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
 *
 * @param[in] ug The UI gadget
 * @return 0 on success, -1 on error
 *
 * \pre ug_init(), ug_create()
 * \post None
 * \see None
 * \remarks Before show layout of given UI gadget, ug_disable_effect() should be called.
 *
 * \par Sample code:
 * \code
 * #include <ui-gadget.h>
 * ...
 * static void layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
 * {
 * ...
 * base = ug_get_layout(ug);
 * switch (mode) {
 * case UG_MODE_FULLVIEW:
 * // disable effect
 * ug_disable_effect(ug);
 * evas_object_show(base);
 * ...
 * \endcode
 */
int ug_disable_effect(ui_gadget_h ug);

#ifdef __cplusplus
}
#endif
/**
 * @} @} @}
 */
#endif				/* __UI_GADGET_H__ */