2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "mcfcontext.h"
21 #include "mcfeventcallback.h"
23 #ifndef __MCF_CONTROLLER_H__
24 #define __MCF_CONTROLLER_H__
30 enum McfInternalSignal {
34 MCF_SIG_INPMODE_CHANGE,
39 MCF_SIG_MOUSE_LONG_PRESS,
40 MCF_SIG_MOUSE_RELEASE,
48 * @brief The base class to work as a soft-based keyboard
50 * This class implements all functions for working as a soft-based keyboard
51 * In side of ISE developer, they can modify it by their requirements.
56 static CMCFController* sInstance; /* For singleton */
61 static CMCFController* get_instance();
64 void set_event_callback(IMCFEventCallback *callback);
67 mcfboolean process_button_pressed_event(mcfwindow window, mcfint x, mcfint y, mcfbyte keyindex, mcftouchdevice touchid);
68 mcfboolean process_button_long_pressed_event(mcfwindow window, mcfbyte keyindex, mcftouchdevice touchid);
69 mcfboolean process_button_repeat_pressed_event(mcfwindow window, mcfbyte keyindex, mcftouchdevice touchid);
70 mcfboolean process_button_move_event(mcfwindow window, mcfint x, mcfint y, mcfbyte keyindex, mcftouchdevice touchid);
71 mcfboolean process_button_release_event(mcfwindow window, mcfint x, mcfint y, mcfbyte keyindex, mcftouchdevice touchid);
73 mcfboolean configure_autopopup_window(mcfwindow window, mcfbyte keyindex, McfRectangle* rect);
75 mcfboolean check_event_transition_enabled(const McfLayoutKeyConfigure *btnFrom, const McfLayoutKeyConfigure *btnTo);
76 MCFKeyModifier get_drag_key_modifier(mcfint deltax, mcfint deltay, mcffloat dist,
77 mcfboolean check_farthest,mcftouchdevice touchid, mcfbyte extraOption);
80 void handle_engine_signal(McfInternalSignal signal, mcfwindow skipwindow = MCFWINDOW_INVALID);
81 mcfboolean process_input_mode_change(const mcfbyte mode, mcfboolean saveMultikeys = TRUE);
82 mcfboolean process_display_change(const mcfint degree);
84 mcfboolean mouse_press(mcfwindow window, mcfint x, mcfint y, mcftouchdevice touchid = 0);
85 mcfboolean mouse_release(mcfwindow window, mcfint x, mcfint y, mcftouchdevice touchid = 0);
86 mcfboolean mouse_move(mcfwindow window, mcfint x, mcfint y, mcftouchdevice touchid = 0);
87 mcfboolean timer_event(const mcf32 id);
89 mcfboolean set_longkey_duration(mcflong msc);
90 mcfboolean set_longkey_cancel_dist(mcfshort dist);
91 mcfboolean set_repeatkey_duration(mcflong msc);
92 mcfboolean set_short_longkey_duration(mcflong msc);
94 mcfboolean set_button_delay_duration(mcflong msc);
96 void clear_multikey_buffer();
98 MCFDebugMode get_debug_mode();
99 void set_debug_mode(MCFDebugMode mode);
101 void disable_input_events(mcfboolean disabled);
104 /* Interval time(msc) for checking long key event */
105 mcflong mLongkeyDuration;
106 mcfshort mLongkeyCancelDist;
107 mcflong mRepeatKeyDuration;
108 mcflong mShortLongkeyDuration;
110 mcflong mButtonDelayDuration;
112 IMCFEventCallback *mEventCallback;
114 MCFDebugMode mDebugMode;
115 mcfint mDebugVariable;
117 mcfint mRepeatKeySeq;
119 mcfboolean mInputEventsDisabled;
121 /* FIXME : A workaround for restoring multikeyidx, should be implemented after designing whole usecases */
122 #define MAX_MULTIKEY_BUFFER 50
123 mcfshort mMultiKeyBuffer[MAX_MULTIKEY_BUFFER][3]; /* 0 for layout, 1 for keyindex, 2 for value */
130 #endif //__MCF_CONTROLLER_H__