Efl.Ui.Text : all related interfaces
Summary: Change summary: Removed : - efl_ui_text_selectable.eo and add it functionality into efl_text_interactive.eo - efl_ui_text_editable.eo because it is same as efl_ui_text.eo (just set one property by default) Modifications: - Move all Text Input enums and functionality from efl_ui_text class into its own interface, this interface will be implemented at efl_ui_internal_text_interactive class. - Rename selection_allowed property to selectable (same as other "editable" property) in efl_text_interactive - Add select_all function into efl_text_interactive interface - Add have_selection property into efl_text_interactive interface - Move user_change , selection_start/change/clear and undo/redo events into efl_text_interactive interface. - Move methods and events of copy/paste/cut into efl_ui_text - Fix password-related functionality - Remove context menu clear and add_item methods. (these should be added later with better design) - Remove Validation event from EFL_UI_TEXT. (these should be added later with better design) Reviewers: woohyun, tasn, segfaultxavi, zmike, bu5hm4n Subscribers: stefan_schmidt, a.srour, q66, zmike, segfaultxavi, cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D10711
This commit is contained in:
parent
25900bee0f
commit
c00db387c3
|
@ -514,10 +514,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
"blur { 3, ox = 1, oy = 1, color = 'black' }"
|
||||
"blend { color = 'lime' }";
|
||||
|
||||
o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win,
|
||||
efl_ui_text_scrollable_set(efl_added, 1),
|
||||
efl_text_multiline_set(efl_added, 1));
|
||||
efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed_hack, win);
|
||||
o = code = efl_add(EFL_UI_TEXT_CLASS, win,
|
||||
efl_ui_text_scrollable_set(efl_added, EINA_TRUE),
|
||||
efl_text_interactive_editable_set(efl_added, EINA_TRUE),
|
||||
efl_text_multiline_set(efl_added, EINA_TRUE));
|
||||
efl_event_callback_add(o, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER, _code_changed_hack, win);
|
||||
|
||||
// Insert filter code inside style string: DEFAULT='blah blah <here>'
|
||||
efl_gfx_filter_program_set(o, code_filter, "code");
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# include <elm_general.h>
|
||||
# include <efl_text_interactive.eo.h>
|
||||
# include <efl_ui_text.eo.h>
|
||||
# include <efl_ui_text_editable.eo.h>
|
||||
# include <efl_ui_text_async.eo.h>
|
||||
|
||||
#define NUM_ITEMS 400
|
||||
|
|
|
@ -146,7 +146,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
|
|||
#include "interfaces/efl_ui_draggable.eo.h"
|
||||
#include "interfaces/efl_ui_scrollable.eo.h"
|
||||
#include "interfaces/efl_ui_scrollbar.eo.h"
|
||||
#include "interfaces/efl_ui_text_selectable.eo.h"
|
||||
#include "interfaces/efl_ui_container_selectable.eo.h"
|
||||
#include "interfaces/efl_ui_zoom.eo.h"
|
||||
|
||||
|
@ -213,6 +212,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
|
|||
#include "interfaces/efl_text_format.eo.h"
|
||||
#include "interfaces/efl_text_markup.eo.h"
|
||||
#include "interfaces/efl_text_markup_util.eo.h"
|
||||
#include "interfaces/efl_input_text.eo.h"
|
||||
|
||||
/**
|
||||
* @brief Get a proxy object referring to a part of an object.
|
||||
|
|
|
@ -0,0 +1,274 @@
|
|||
enum @beta Efl.Input_Text.Panel_Layout_Type
|
||||
{
|
||||
[[Input panel (virtual keyboard) layout types.
|
||||
Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired.
|
||||
]]
|
||||
normal, [[Default layout.]]
|
||||
number, [[Number layout.]]
|
||||
email, [[Email layout.]]
|
||||
url, [[URL layout.]]
|
||||
phonenumber, [[Phone Number layout.]]
|
||||
ip, [[IP layout.]]
|
||||
month, [[Month layout.]]
|
||||
numberonly, [[Number Only layout.]]
|
||||
invalid, [[Never use this.]]
|
||||
hex, [[Hexadecimal layout.]]
|
||||
terminal, [[Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization).]]
|
||||
password, [[Like normal, but no auto-correct, no auto-capitalization etc.]]
|
||||
datetime, [[Date and time layout
|
||||
|
||||
@since 1.8]]
|
||||
emoticon, [[Emoticon layout
|
||||
|
||||
@since 1.10]]
|
||||
voice [[Voice layout, but if the IME does not support voice layout, then normal layout will be shown.
|
||||
|
||||
@since 1.19]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Input_Text.Panel_Language_Type
|
||||
{
|
||||
[[Input panel (virtual keyboard) language modes.
|
||||
]]
|
||||
automatic, [[Automatic]]
|
||||
alphabet [[Alphabet]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Input_Text.Capitalize_Type
|
||||
{
|
||||
[[Autocapitalization Types.
|
||||
Choose method of auto-capitalization.
|
||||
]]
|
||||
none, [[No auto-capitalization when typing.]]
|
||||
word, [[Autocapitalize each word typed.]]
|
||||
sentence, [[Autocapitalize the start of each sentence.]]
|
||||
allcharacter [[Autocapitalize all letters.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Input_Text.Panel_Return_Key_Type
|
||||
{
|
||||
[["Return" Key types on the input panel (virtual keyboard).
|
||||
]]
|
||||
default, [[Default.]]
|
||||
done, [[Done.]]
|
||||
go, [[Go.]]
|
||||
join, [[Join.]]
|
||||
login, [[Login.]]
|
||||
next, [[Next.]]
|
||||
search, [[Search string or magnifier icon.]]
|
||||
send, [[Send.]]
|
||||
signin [[Sign-in
|
||||
|
||||
@since 1.8]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Input_Text.Panel_Return_Key_State
|
||||
{
|
||||
[["Return" Key state on the input panel (virtual keyboard).
|
||||
]]
|
||||
auto, [[The return key on input panel is disabled when the entry has no text,
|
||||
if entry has text, return key is enabled.
|
||||
]]
|
||||
enabled, [[The return key on input panel is enabled.]]
|
||||
disabled, [[The return key on input panel is disabled.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Input_Text.Hints_Type
|
||||
{
|
||||
[[Enumeration that defines the types of Input Hints.
|
||||
|
||||
@since 1.12
|
||||
]]
|
||||
none = 0, [[No active hints
|
||||
|
||||
@since 1.12]]
|
||||
auto_complete = 1 << 0, [[Suggest word auto completion
|
||||
|
||||
@since 1.12]]
|
||||
sensitive_data = 1 << 1, [[Typed text should not be stored.
|
||||
|
||||
@since 1.12]]
|
||||
autofill_credit_card_expiration_date = 0x100, [[ Autofill hint for a credit card expiration date
|
||||
|
||||
@since 1.21]]
|
||||
autofill_credit_card_expiration_day = 0x200, [[Autofill hint for a credit card expiration day
|
||||
|
||||
@since 1.21]]
|
||||
autofill_credit_card_expiration_month = 0x300, [[ Autofill hint for a credit card expiration month
|
||||
|
||||
@since 1.21]]
|
||||
autofill_credit_card_expiration_year = 0x400, [[ Autofill hint for a credit card expiration year
|
||||
|
||||
@since 1.21]]
|
||||
autofill_credit_card_number = 0x500, [[ Autofill hint for a credit card number
|
||||
|
||||
@since 1.21]]
|
||||
autofill_email_address = 0x600, [[ Autofill hint for an email address
|
||||
|
||||
@since 1.21]]
|
||||
autofill_name = 0x700, [[ Autofill hint for a user's real name
|
||||
|
||||
@since 1.21]]
|
||||
autofill_phone = 0x800, [[ Autofill hint for a phone number
|
||||
|
||||
@since 1.21]]
|
||||
autofill_postal_address = 0x900, [[ Autofill hint for a postal address
|
||||
|
||||
@since 1.21]]
|
||||
autofill_postal_code = 0xA00, [[ Autofill hint for a postal code
|
||||
|
||||
@since 1.21]]
|
||||
autofill_id = 0xB00 [[ Autofill hint for a user's ID
|
||||
|
||||
@since 1.21]]
|
||||
}
|
||||
|
||||
interface @beta Efl.Input_Text {
|
||||
[[All the functionality relating to input hints
|
||||
]]
|
||||
methods {
|
||||
@property input_panel_show_on_demand {
|
||||
[[Set/Get the attribute to show the input panel in case of only a user's explicit Mouse Up event.
|
||||
It doesn't request to show the input panel even though it has focus.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event.
|
||||
(Focus event will be ignored.)
|
||||
]]
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: I don't understand why this is needed in addition to Layout
|
||||
@property input_panel_language {
|
||||
[[The language mode of the input panel.
|
||||
This API can be used if you want to show the alphabet keyboard mode.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
lang: Efl.Input_Text.Panel_Language_Type; [[Language to be set to the input panel.]]
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: What is this?
|
||||
@property input_panel_layout_variation {
|
||||
[[The input panel layout variation of the entry.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
variation: int; [[Layout variation type.]]
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: input_capitalize/capitalization ?
|
||||
@property autocapitalization {
|
||||
[[The autocapitalization type on the immodule.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
autocapital_type: Efl.Input_Text.Capitalize_Type; [[The type of autocapitalization.]]
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: rename
|
||||
@property predictable {
|
||||
[[Whether the entry should allow predictive text.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
prediction: bool; [[Whether the entry should allow predictive text.]]
|
||||
}
|
||||
}
|
||||
// FIXME: I agree with Mike, looks bad
|
||||
@property input_hint {
|
||||
[[The input hint which allows input methods to fine-tune their behavior.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
hints: Efl.Input_Text.Hints_Type; [[Input hint.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_layout {
|
||||
[[The input panel layout of the entry.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
layout: Efl.Input_Text.Panel_Layout_Type(Efl.Input_Text.Panel_Layout_Type.invalid); [[Layout type.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_return_key_type {
|
||||
[[The "return" key type. This type is used to set string or icon on the "return" key of the input panel.
|
||||
An input panel displays the string or icon associated with this type.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
return_key_type: Efl.Input_Text.Panel_Return_Key_Type; [[The type of "return" key on the input panel.]]
|
||||
}
|
||||
}
|
||||
// FIXME: shouldn't this be "autoshow" or something?
|
||||
@property input_panel_autoshow {
|
||||
[[The attribute to show the input panel automatically.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
enabled: bool; [[If $true, the input panel is appeared when entry is clicked or has a focus.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property input_panel_return_key_state {
|
||||
[[State for the return key on the input panel see @Efl.Input_Text.Panel_Return_Key_State.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
state: Efl.Input_Text.Panel_Return_Key_State; [[Enable state for return key, see @Efl.Input_Text.Panel_Return_Key_State.]]
|
||||
}
|
||||
}
|
||||
|
||||
input_panel_show {
|
||||
[[Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types and so on.
|
||||
|
||||
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
|
||||
This API can be used in the case of manually controlling by using @.input_panel_autoshow.set(en, $false).
|
||||
]]
|
||||
}
|
||||
|
||||
input_panel_hide {
|
||||
[[Hide the input panel (virtual keyboard).
|
||||
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
|
||||
This API can be used in the case of manually controlling by using @.input_panel_autoshow.set(en, $false).
|
||||
]]
|
||||
}
|
||||
|
||||
@property input_panel_imdata {
|
||||
[[Set/Get the input panel-specific data to deliver to the input panel.
|
||||
|
||||
This API is used by applications to deliver specific data to the input panel.
|
||||
The data format MUST be negotiated by both application and the input panel.
|
||||
The size and format of data are defined by the input panel.
|
||||
]]
|
||||
values {
|
||||
value: slice<ubyte>; [[The specific data to be set/get to the input panel.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@
|
|||
#include "interfaces/efl_text_style.eo.c"
|
||||
#include "interfaces/efl_text_format.eo.c"
|
||||
#include "interfaces/efl_text_markup.eo.c"
|
||||
#include "interfaces/efl_input_text.eo.c"
|
||||
|
||||
#include "interfaces/efl_gfx_entity.eo.c"
|
||||
#include "interfaces/efl_gfx_buffer.eo.c"
|
||||
|
@ -72,7 +73,6 @@
|
|||
#include "interfaces/efl_ui_scrollable.eo.c"
|
||||
#include "interfaces/efl_ui_scrollbar.eo.c"
|
||||
#include "interfaces/efl_ui_container_selectable.eo.c"
|
||||
#include "interfaces/efl_ui_text_selectable.eo.c"
|
||||
|
||||
#include "interfaces/efl_ui_zoom.eo.c"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ enum Efl.Text_Bidirectional_Type {
|
|||
inherit [[Inherit text type]]
|
||||
}
|
||||
|
||||
struct @beta Efl.Ui.Text_Change_Info {
|
||||
struct @beta Efl.Text_Change_Info {
|
||||
[[This structure includes all the information about content changes.
|
||||
|
||||
It's meant to be used to implement undo/redo.
|
||||
|
@ -22,4 +22,11 @@ struct @beta Efl.Ui.Text_Change_Info {
|
|||
merge: bool; [[$true if can be merged with the previous one. Used for example with insertion when something is already selected]]
|
||||
}
|
||||
|
||||
struct @beta Efl.Text_Range {
|
||||
[[This structure includes text position range (from/to).
|
||||
]]
|
||||
start: int; [[The start postion.]]
|
||||
end: int; [[The end position.]]
|
||||
}
|
||||
|
||||
struct @extern @beta Efl.Text_Attribute_Handle; [[EFL text annotations data structure]]
|
|
@ -1,13 +0,0 @@
|
|||
interface @beta Efl.Ui.Text_Selectable
|
||||
{
|
||||
[[Efl UI text selectable interface]]
|
||||
event_c_prefix: efl_ui;
|
||||
events {
|
||||
selection,paste: void; [[Called when selection is pasted]]
|
||||
selection,copy: void; [[Called when selection is copied]]
|
||||
selection,cut: void; [[Called when selection is cut]]
|
||||
selection,start: void; [[Called at selection start]]
|
||||
selection,changed: void; [[Called when selection is changed]]
|
||||
selection,cleared: void; [[Called when selection is cleared]]
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ pub_legacy_eo_files = [
|
|||
'efl_ui_scrollable.eo',
|
||||
'efl_ui_scrollbar.eo',
|
||||
'efl_ui_container_selectable.eo',
|
||||
'efl_ui_text_selectable.eo',
|
||||
'efl_ui_zoom.eo',
|
||||
]
|
||||
|
||||
|
@ -94,6 +93,7 @@ pub_eo_files = [
|
|||
'efl_gfx_text_class.eo',
|
||||
'efl_gfx_size_class.eo',
|
||||
'efl_cached_item.eo',
|
||||
'efl_input_text.eo',
|
||||
]
|
||||
|
||||
foreach eo_file : pub_eo_files
|
||||
|
|
|
@ -227,7 +227,6 @@ typedef void (*Context_Item_Clicked_Cb)(void *data, Eo *obj, void *event_info);
|
|||
|
||||
# include <efl_text_interactive.eo.h>
|
||||
# include <efl_ui_text.eo.h>
|
||||
# include <efl_ui_text_editable.eo.h>
|
||||
# include <efl_ui_text_async.eo.h>
|
||||
|
||||
# include <efl_ui_animation_view.eo.h>
|
||||
|
|
|
@ -13,11 +13,11 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
|
|||
}
|
||||
}
|
||||
@property selection_allowed {
|
||||
[[Whether or not selection is allowed on this object]]
|
||||
[[Whether or not selection is allowed on this object.]]
|
||||
set {}
|
||||
get {}
|
||||
values {
|
||||
allowed: bool; [[$true if enabled, $false otherwise]]
|
||||
allowed: bool; [[$true if enabled, $false otherwise.]]
|
||||
}
|
||||
}
|
||||
@property selection_cursors {
|
||||
|
@ -50,11 +50,34 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
|
|||
if not, the entry is read-only and no user input is allowed.]]
|
||||
}
|
||||
}
|
||||
select_none {
|
||||
all_unselect {
|
||||
[[Clears the selection.]]
|
||||
}
|
||||
all_select {
|
||||
[[Select all the content.]]
|
||||
}
|
||||
@property have_selection {
|
||||
[[Whether the entry have a selected text.
|
||||
]]
|
||||
get {
|
||||
}
|
||||
values {
|
||||
selected: bool; [[If $true, entry have selected text, $false otherwise.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
events {
|
||||
text,selection,changed: void; [[The selection on the object has changed. Query using @.selection_cursors]]
|
||||
preedit,changed: void; [[Called when entry preedit changed.]]
|
||||
have_selection,changed: bool; [[Called when @.have_selection property value changed.]]
|
||||
selection,changed: Efl.Text_Range; [[Called when selection has changed. Query using @.selection_cursors.]]
|
||||
redo,request: void; [[Called when redo is requested]]
|
||||
undo,request: void; [[Called when undo is requested]]
|
||||
changed,user: Efl.Text_Change_Info; [[The content has changed due to user interaction.]]
|
||||
// FIXME: efl_ui_text doesn't support anchor callbacks yet.
|
||||
//anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
|
||||
//anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
|
||||
//anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
|
||||
//anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
|
||||
//anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ field_create(Eo *obj, Efl_Ui_Clock_Type field_type)
|
|||
field_obj = efl_add(EFL_UI_TEXT_CLASS,obj,
|
||||
efl_text_multiline_set(efl_added, EINA_FALSE),
|
||||
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
|
||||
efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
|
||||
efl_input_text_input_panel_autoshow_set(efl_added, EINA_FALSE),
|
||||
efl_ui_text_context_menu_disabled_set(efl_added, EINA_TRUE));
|
||||
}
|
||||
evas_object_data_set(field_obj, "_field_type", (void *)field_type);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive
|
||||
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive, Efl.Input_Text
|
||||
{
|
||||
[[An internal object in charge of the interactive aspect of the text widget.
|
||||
|
||||
|
@ -11,6 +11,23 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements
|
|||
Efl.Text_Interactive.selection_allowed { get; set; }
|
||||
Efl.Text_Interactive.selection_cursors { get; }
|
||||
Efl.Text_Interactive.editable { get; set; }
|
||||
Efl.Text_Interactive.select_none;
|
||||
Efl.Text_Interactive.all_unselect;
|
||||
Efl.Text_Interactive.all_select;
|
||||
Efl.Text_Interactive.have_selection {get; }
|
||||
Efl.Text.text { set; }
|
||||
Efl.Text_Markup.markup { set; }
|
||||
Efl.Input_Text.input_panel_show_on_demand { get; set; }
|
||||
Efl.Input_Text.input_panel_language { get; set; }
|
||||
Efl.Input_Text.input_panel_layout_variation { get; set; }
|
||||
Efl.Input_Text.autocapitalization { get; set; }
|
||||
Efl.Input_Text.input_panel_return_key_state { get; set; }
|
||||
Efl.Input_Text.predictable { get; set; }
|
||||
Efl.Input_Text.input_hint { get; set; }
|
||||
Efl.Input_Text.input_panel_layout { get; set; }
|
||||
Efl.Input_Text.input_panel_return_key_type { get; set; }
|
||||
Efl.Input_Text.input_panel_autoshow { get; set; }
|
||||
Efl.Input_Text.input_panel_show;
|
||||
Efl.Input_Text.input_panel_hide;
|
||||
Efl.Input_Text.input_panel_imdata { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -472,7 +472,7 @@ _mouse_clicked_signal_cb(void *data EINA_UNUSED,
|
|||
{
|
||||
Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
|
||||
|
||||
if (sd->editable) efl_ui_text_input_panel_show(sd->entry);
|
||||
if (sd->editable) efl_input_text_input_panel_show(sd->entry);
|
||||
|
||||
efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL);
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd)
|
|||
efl_text_multiline_set(efl_added, EINA_FALSE),
|
||||
efl_text_set(efl_added, ""),
|
||||
efl_ui_text_cnp_mode_set(efl_added, EFL_UI_SELECTION_FORMAT_MARKUP),
|
||||
efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
|
||||
efl_input_text_input_panel_autoshow_set(efl_added, EINA_FALSE),
|
||||
efl_text_interactive_editable_set(efl_added, EINA_TRUE),
|
||||
efl_composite_attach(obj, efl_added));
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,97 +1,12 @@
|
|||
/* FIXME - Text object must stop using Context_Item_Clicked_Cb! */
|
||||
/* Legacy-only function pointer types, for the legacy EO classes (genlist, etc...) */
|
||||
type @beta @extern Context_Item_Clicked_Cb: __undefined_type; [[Evas smart callback type]]
|
||||
|
||||
struct @beta Efl.Ui.Validate_Content_Info
|
||||
{
|
||||
[[Validate content information.]]
|
||||
text: string; [[Validate content text]]
|
||||
signal: string; [[Validate content signal]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Ui.Autocapital_Type
|
||||
{
|
||||
[[Autocapitalization Types.
|
||||
Choose method of auto-capitalization.
|
||||
]]
|
||||
none, [[No auto-capitalization when typing.]]
|
||||
word, [[Autocapitalize each word typed.]]
|
||||
sentence, [[Autocapitalize the start of each sentence.]]
|
||||
allcharacter [[Autocapitalize all letters.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Ui.Input_Panel_Language_Type
|
||||
{
|
||||
[[Input panel (virtual keyboard) language modes.
|
||||
]]
|
||||
automatic, [[Automatic]]
|
||||
alphabet [[Alphabet]]
|
||||
}
|
||||
|
||||
|
||||
enum @beta Efl.Ui.Input_Hints
|
||||
{
|
||||
[[Enumeration that defines the types of Input Hints.]]
|
||||
none = 0, [[No active hints.]]
|
||||
auto_complete = 1 << 0, [[Suggest word auto completion.]]
|
||||
sensitive_data = 1 << 1, [[Typed text should not be stored.]]
|
||||
}
|
||||
|
||||
|
||||
enum @beta Efl.Ui.Input_Panel_Layout
|
||||
{
|
||||
[[Input panel (virtual keyboard) layout types.
|
||||
Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired.
|
||||
]]
|
||||
normal, [[Default layout.]]
|
||||
number, [[Number layout.]]
|
||||
email, [[Email layout.]]
|
||||
url, [[URL layout.]]
|
||||
phonenumber, [[Phone Number layout.]]
|
||||
ip, [[IP layout.]]
|
||||
month, [[Month layout.]]
|
||||
numberonly, [[Number Only layout.]]
|
||||
invalid, [[Never use this.]]
|
||||
hex, [[Hexadecimal layout.]]
|
||||
terminal, [[Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization).]]
|
||||
password, [[Like normal, but no auto-correct, no auto-capitalization etc.]]
|
||||
datetime, [[Date and time layout.]]
|
||||
emoticon, [[Emoticon layout.]]
|
||||
voice [[Voice layout, but if the IME does not support voice layout, then normal layout will be shown.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Ui.Input_Panel_Return_Key_Type
|
||||
{
|
||||
[["Return" Key types on the input panel (virtual keyboard).
|
||||
]]
|
||||
default, [[Default.]]
|
||||
done, [[Done.]]
|
||||
go, [[Go.]]
|
||||
join, [[Join.]]
|
||||
login, [[Login.]]
|
||||
next, [[Next.]]
|
||||
search, [[Search string or magnifier icon.]]
|
||||
send, [[Send.]]
|
||||
signin [[Sign-in.]]
|
||||
}
|
||||
enum @beta Efl.Ui.Icon_Type
|
||||
{
|
||||
[[Icon types.]]
|
||||
none, [[Icon has no type set.]]
|
||||
file, [[Icon is of type file.]]
|
||||
standard [[Icon is of type standard.]]
|
||||
}
|
||||
|
||||
class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickable,
|
||||
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File,
|
||||
Efl.Ui.Text_Selectable
|
||||
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, Efl.Input_Text
|
||||
composites
|
||||
Efl.Text_Interactive, Efl.Text_Markup
|
||||
{
|
||||
[[A flexible text widget which can be static (as a label) or editable by
|
||||
the user (as a text entry). It provides all sorts of editing facilities
|
||||
like automatic scrollbars, virtual keyboard, clipboard, configurable
|
||||
context menus, password mode or autocapitalization, for example.]]
|
||||
context menus or autocapitalization, for example.]]
|
||||
methods {
|
||||
@property scrollable {
|
||||
[[Enable or disable scrolling in the widget.
|
||||
|
@ -104,20 +19,6 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
scroll: bool; [[$true to enable scrolling. Default is $false.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_show_on_demand {
|
||||
[[The attribute to show the input panel in case of only a user's explicit Mouse Up event.
|
||||
It doesn't request to show the input panel even though it has focus.
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event.
|
||||
(Focus event will be ignored.)
|
||||
]]
|
||||
}
|
||||
}
|
||||
@property context_menu_disabled {
|
||||
[[This disables the entry's contextual (longpress) menu.]]
|
||||
set {
|
||||
|
@ -144,19 +45,6 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
format: Efl.Ui.Selection_Format; [[Format for copy & paste.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_language {
|
||||
[[The language mode of the input panel.
|
||||
|
||||
This API can be used if you want to show the alphabet keyboard mode.
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
lang: Efl.Ui.Input_Panel_Language_Type; [[Language to be set to the input panel.]]
|
||||
}
|
||||
}
|
||||
@property selection_handler_disabled {
|
||||
[[This disables the entry's selection handlers.]]
|
||||
set {
|
||||
|
@ -167,117 +55,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
disabled: bool; [[If $true, the selection handlers are disabled.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_layout_variation {
|
||||
[[Set the input panel layout variation of the entry
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
variation: int; [[Layout variation type.]]
|
||||
}
|
||||
}
|
||||
@property autocapital_type {
|
||||
[[Set the autocapitalization type on the immodule.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
autocapital_type: Efl.Ui.Autocapital_Type; [[The type of autocapitalization.]]
|
||||
}
|
||||
}
|
||||
@property password_mode {
|
||||
[[Sets the entry to password mode.
|
||||
|
||||
In password mode entries are implicitly single line and the display of
|
||||
any text inside them is replaced with asterisks (*).
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
password: bool; [[If true, password mode is enabled.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_return_key_disabled {
|
||||
[[Set the return key on the input panel to be disabled.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
disabled: bool; [[The state to put in in: $true for
|
||||
disabled, $false for enabled.]]
|
||||
}
|
||||
}
|
||||
@property prediction_allow {
|
||||
[[Whether the entry should allow predictive text.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
prediction: bool; [[Whether the entry should allow predictive text.]]
|
||||
}
|
||||
}
|
||||
@property input_hint {
|
||||
[[Sets the input hint which allows input methods to fine-tune their behavior.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
hints: Efl.Ui.Input_Hints; [[Input hint.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_layout {
|
||||
[[Set the input panel layout of the entry.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
layout: Efl.Ui.Input_Panel_Layout(Efl.Ui.Input_Panel_Layout.invalid); [[Layout type.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_return_key_type {
|
||||
[[Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
|
||||
|
||||
An input panel displays the string or icon associated with this type.
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
return_key_type: Efl.Ui.Input_Panel_Return_Key_Type; [[The type of "return" key on the input panel.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_enabled {
|
||||
[[Sets the attribute to show the input panel automatically.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
enabled: bool; [[If $true, the input panel is appeared when entry is clicked or has a focus.]]
|
||||
}
|
||||
}
|
||||
@property input_panel_return_key_autoenabled {
|
||||
[[Whether the return key on the input panel is disabled automatically when entry has no text.
|
||||
|
||||
If $enabled is $true, the return key on input panel is disabled when the entry has no text.
|
||||
The return key on the input panel is automatically enabled when the entry has text.
|
||||
]]
|
||||
set {
|
||||
}
|
||||
values {
|
||||
enabled: bool(false); [[If $true, the return key is automatically disabled when the entry has no text.]]
|
||||
}
|
||||
}
|
||||
@property item_factory {
|
||||
[[The factory that provides item in the text e.g.
|
||||
"emoticon/happy" or "href=file://image.jpg" etc.
|
||||
|
@ -297,80 +75,15 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
[[Creates and returns a new cursor for the text.]]
|
||||
return: Efl.Text.Cursor @move; [[Text cursor.]]
|
||||
}
|
||||
input_panel_show {
|
||||
[[Show the input panel (virtual keyboard) based on the input panel property of entry such as layout,
|
||||
autocapital types and so on.
|
||||
|
||||
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
|
||||
This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false).
|
||||
]]
|
||||
}
|
||||
selection_copy {
|
||||
[[This executes a "copy" action on the selected text in the entry.]]
|
||||
}
|
||||
context_menu_clear {
|
||||
[[This clears and frees the items in a entry's contextual (longpress)
|
||||
menu.
|
||||
|
||||
See also @.context_menu_item_add.
|
||||
]]
|
||||
}
|
||||
input_panel_imdata_set {
|
||||
[[Set the input panel-specific data to deliver to the input panel.
|
||||
|
||||
This API is used by applications to deliver specific data to the input panel.
|
||||
The data format MUST be negotiated by both application and the input panel.
|
||||
The size and format of data are defined by the input panel.
|
||||
]]
|
||||
params {
|
||||
@in data: const(void_ptr); [[The specific data to be set to the input panel.]]
|
||||
@in len: int; [[The length of data, in bytes, to send to the input panel.]]
|
||||
}
|
||||
}
|
||||
input_panel_imdata_get @const {
|
||||
[[Get the specific data of the current input panel.]]
|
||||
params {
|
||||
@inout data: void; [[The specific data to be obtained from the input panel.]]
|
||||
@out len: int; [[The length of data.]]
|
||||
}
|
||||
}
|
||||
selection_paste {
|
||||
[[This executes a "paste" action in the entry.]]
|
||||
}
|
||||
input_panel_hide {
|
||||
[[Hide the input panel (virtual keyboard).
|
||||
|
||||
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
|
||||
This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false)
|
||||
]]
|
||||
}
|
||||
cursor_selection_end {
|
||||
[[This ends a selection within the entry as though
|
||||
the user had just released the mouse button while making a selection.]]
|
||||
}
|
||||
selection_cut {
|
||||
[[This executes a "cut" action on the selected text in the entry.]]
|
||||
}
|
||||
context_menu_item_add {
|
||||
[[This adds an item to the entry's contextual menu.
|
||||
|
||||
A longpress on an entry will make the contextual menu show up unless this
|
||||
has been disabled with @.context_menu_disabled.set.
|
||||
By default this menu provides a few options like enabling selection mode,
|
||||
which is useful on embedded devices that need to be explicit about it.
|
||||
When a selection exists it also shows the copy and cut actions.
|
||||
|
||||
With this function, developers can add other options to this menu to
|
||||
perform any action they deem necessary.
|
||||
]]
|
||||
params {
|
||||
@in label: string @optional; [[The item's text label.]]
|
||||
@in icon_file: string @optional; [[The item's icon file.]]
|
||||
@in icon_type: Efl.Ui.Icon_Type; [[The item's icon type.]]
|
||||
@in func: Context_Item_Clicked_Cb @optional; [[The callback to execute when the item is clicked.]]
|
||||
@in data: const(void_ptr) @optional; [[The data to associate with the item for related functions.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
Efl.Object.constructor;
|
||||
|
@ -389,6 +102,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
Efl.Ui.Focus.Object.on_focus_update;
|
||||
Efl.Ui.Widget.interest_region { get; }
|
||||
Efl.Ui.Widget.disabled {set;}
|
||||
Efl.Text_Format.password {set;}
|
||||
//Efl.Ui.Widget.widget_sub_object_del;
|
||||
//Elm.Interface_Scrollable.policy { set; }
|
||||
//Elm.Interface_Scrollable.bounce_allow { set; }
|
||||
|
@ -423,23 +137,10 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
|
|||
Efl.Part.part_get;
|
||||
}
|
||||
events {
|
||||
selection,paste: void; [[Called when selection is pasted.]]
|
||||
selection,copy: void; [[Called when selection is copied.]]
|
||||
selection,cut: void; [[Called when selection is cut.]]
|
||||
changed: void; [[Called when entry changes]]
|
||||
/* can be $NULL, tag nullable once Eolian supports it */
|
||||
changed,user: Efl.Ui.Text_Change_Info;
|
||||
[[The text object has changed due to user interaction]]
|
||||
validate: Efl.Ui.Validate_Content_Info; [[Called when validating]]
|
||||
context,open: void; [[Called when context menu was opened]]
|
||||
preedit,changed: void; [[Called when entry preedit changed]]
|
||||
press: void; [[Called when entry pressed]]
|
||||
redo,request: void; [[Called when redo is requested]]
|
||||
undo,request: void; [[Called when undo is requested]]
|
||||
aborted: void; [[Called when entry is aborted]]
|
||||
// FIXME: efl_ui_text doesn't support anchor callbacks yet.
|
||||
//anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
|
||||
//anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
|
||||
//anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
|
||||
//anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
|
||||
//anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
|
||||
cursor,changed,manual: void; [[Called on manual cursor change]]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
|
|||
}
|
||||
SIG_FWD(CHANGED, ELM_FILESELECTOR_ENTRY_EVENT_CHANGED)
|
||||
SIG_FWD(PRESS, ELM_FILESELECTOR_ENTRY_EVENT_PRESS)
|
||||
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE)
|
||||
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY)
|
||||
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT)
|
||||
SIG_FWD(SELECTION_PASTE, EFL_UI_TEXT_EVENT_SELECTION_PASTE)
|
||||
SIG_FWD(SELECTION_COPY, EFL_UI_TEXT_EVENT_SELECTION_COPY)
|
||||
SIG_FWD(SELECTION_CUT, EFL_UI_TEXT_EVENT_SELECTION_CUT)
|
||||
#undef SIG_FWD
|
||||
|
||||
#define SIG_FWD(name, event) \
|
||||
|
@ -249,9 +249,9 @@ _elm_fileselector_entry_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Ent
|
|||
SIG_FWD(CHANGED, ELM_ENTRY_EVENT_CHANGED);
|
||||
SIG_FWD(ACTIVATED, ELM_ENTRY_EVENT_ACTIVATED);
|
||||
SIG_FWD(PRESS, ELM_ENTRY_EVENT_PRESS);
|
||||
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE);
|
||||
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY);
|
||||
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT);
|
||||
SIG_FWD(SELECTION_PASTE, EFL_UI_TEXT_EVENT_SELECTION_PASTE);
|
||||
SIG_FWD(SELECTION_COPY, EFL_UI_TEXT_EVENT_SELECTION_COPY);
|
||||
SIG_FWD(SELECTION_CUT, EFL_UI_TEXT_EVENT_SELECTION_CUT);
|
||||
#undef SIG_FWD
|
||||
#define SIG_FWD(name, event) \
|
||||
evas_object_smart_callback_add(priv->entry, event, _##name##_fwd, obj)
|
||||
|
|
|
@ -1588,7 +1588,7 @@ _paste_cb(void *data,
|
|||
|
||||
if (!sd) return;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
|
||||
(data, EFL_UI_TEXT_EVENT_SELECTION_PASTE, NULL);
|
||||
|
||||
sd->selection_asked = EINA_TRUE;
|
||||
|
||||
|
@ -1643,7 +1643,7 @@ _cut_cb(void *data,
|
|||
|
||||
if (!sd) return;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_CUT, NULL);
|
||||
(data, EFL_UI_TEXT_EVENT_SELECTION_CUT, NULL);
|
||||
/* Store it */
|
||||
sd->sel_mode = EINA_FALSE;
|
||||
if (!_elm_config->desktop_entry)
|
||||
|
@ -1667,7 +1667,7 @@ _copy_cb(void *data,
|
|||
|
||||
if (!sd) return;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_COPY, NULL);
|
||||
(data, EFL_UI_TEXT_EVENT_SELECTION_COPY, NULL);
|
||||
sd->sel_mode = EINA_FALSE;
|
||||
if (!_elm_config->desktop_entry)
|
||||
{
|
||||
|
@ -2338,8 +2338,10 @@ _entry_selection_start_signal_cb(void *data,
|
|||
{
|
||||
if (entry != data) elm_entry_select_none(entry);
|
||||
}
|
||||
|
||||
Eina_Bool b_value = EINA_TRUE;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_START, NULL);
|
||||
(data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
|
||||
|
||||
elm_object_focus_set(data, EINA_TRUE);
|
||||
}
|
||||
|
@ -2382,8 +2384,12 @@ _entry_selection_changed_signal_cb(void *data,
|
|||
|
||||
if (!sd) return;
|
||||
sd->have_selection = EINA_TRUE;
|
||||
Efl_Text_Range range = {0};
|
||||
//FIXME how to get selection range in legacy !?
|
||||
range.start = 0;
|
||||
range.end = 0;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_CHANGED, NULL);
|
||||
(data, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, &range);
|
||||
// XXX: still try primary selection even if on wl in case it's
|
||||
// supported
|
||||
// if (!_entry_win_is_wl(data))
|
||||
|
@ -2405,8 +2411,9 @@ _entry_selection_cleared_signal_cb(void *data,
|
|||
if (!sd->have_selection) return;
|
||||
|
||||
sd->have_selection = EINA_FALSE;
|
||||
Eina_Bool b_value = sd->have_selection;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
|
||||
(data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
|
||||
// XXX: still try primary selection even if on wl in case it's
|
||||
// supported
|
||||
// if (!_entry_win_is_wl(data))
|
||||
|
@ -2447,7 +2454,7 @@ _entry_paste_request_signal_cb(void *data,
|
|||
// supported
|
||||
// if ((type == ELM_SEL_TYPE_PRIMARY) && _entry_win_is_wl(data)) return;
|
||||
efl_event_callback_legacy_call
|
||||
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
|
||||
(data, EFL_UI_TEXT_EVENT_SELECTION_PASTE, NULL);
|
||||
|
||||
top = _entry_win_get(data);
|
||||
if (top)
|
||||
|
@ -4442,8 +4449,11 @@ _elm_entry_select_none(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
|
|||
edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
|
||||
}
|
||||
if (sd->have_selection)
|
||||
efl_event_callback_legacy_call
|
||||
(obj, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
|
||||
{
|
||||
Eina_Bool b_value = sd->have_selection;
|
||||
efl_event_callback_legacy_call
|
||||
(obj, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
|
||||
}
|
||||
|
||||
sd->have_selection = EINA_FALSE;
|
||||
edje_object_part_text_select_none(sd->entry_edje, "elm.text");
|
||||
|
|
Loading…
Reference in New Issue