d6e4a19b15206f08ace72287478fd5063cb77218
[platform/core/uifw/mmi-manager.git] / src / mmimgr / mmi-manager.h
1 /*
2 * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24 #ifndef __MMI_MANAGER_H__
25 #define __MMI_MANAGER_H__
26
27 #include "mmi-client.h"
28
29 MMI_API extern int MMI_MANAGER_EVENT_FOCUS_CHANGE;
30 MMI_API extern int MMI_MANAGER_EVENT_STATE_CHANGE;
31
32 typedef struct
33 {
34         int timestamp;
35         mmi_client *cur_focus;
36         mmi_client *new_focus;
37 } mmi_manager_event_focus_change;
38
39 typedef struct
40 {
41         int timestamp;
42         mmi_client *client;
43         mmi_state from_state;
44         mmi_state to_state;
45 } mmi_manager_event_state_change;
46
47 int mmi_manager_set_focus_client(mmi_client *client);
48 int mmi_manager_set_state(mmi_client *client, mmi_state state);
49 int mmi_manager_remove_client_from_focus_candidates(mmi_client *client);
50 int mmi_manager_remove_focus_client(mmi_client *client);
51
52 mmi_client* mmi_manager_get_focus_client(void);
53
54 void mmi_manager_init(void);
55 void mmi_manager_loop_begin(void);
56 void mmi_manager_loop_end(void);
57 void mmi_manager_shutdown(void);
58
59 #endif //__MMI_MANAGER_H__