Input Widget

Input Widget — The main Talkatu input widget.

Functions

Properties

TalkatuInputSendBinding send-binding Read / Write / Construct

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkTextView
                    ╰── TalkatuView
                        ╰── TalkatuInput

Implemented Interfaces

TalkatuInput implements AtkImplementorIface, GtkBuildable, GtkScrollable and TalkatuMessage.

Description

TalkatuInput handles all of the details for sending messages.

Functions

talkatu_input_new ()

GtkWidget *
talkatu_input_new (void);

Creates a new TalkatuInput instance.

Returns

The new TalkatuInput instance.

[transfer full]

talkatu_input_set_send_binding ()

void
talkatu_input_set_send_binding (TalkatuInput *input,
                                TalkatuInputSendBinding bindings);

Sets the bindings for when the send-message signal should be emitted.

Parameters

input

The TalkatuInput instance.

 

bindings

The TalkatuInputSendBinding value.

 

talkatu_input_get_send_binding ()

TalkatuInputSendBinding
talkatu_input_get_send_binding (TalkatuInput *input);

Gets the TalkatuInputSendBinding which determines when send-message signal will be emitted.

Parameters

input

The TalkatuInput instance.

 

talkatu_input_send_message ()

void
talkatu_input_send_message (TalkatuInput *input);

Emits the signal that input is trying to send a message. This is used for cases like the optional send button in TalkatuEditor and other instances where the user has performed an action to send a message.

Parameters

input

The TalkatuInput instance.

 

Types and Values

enum TalkatuInputSendBinding

Flags for assigning and determining which key bindings should be used to send a message.

Members

TALKATU_INPUT_SEND_BINDING_RETURN

Represents return.

 

TALKATU_INPUT_SEND_BINDING_KP_ENTER

Represents enter.

 

TALKATU_INPUT_SEND_BINDING_SHIFT_RETURN

Represents shift-return.

 

TALKATU_INPUT_SEND_BINDING_CONTROL_RETURN

Represents control-return.

 

TALKATU_TYPE_INPUT

#define TALKATU_TYPE_INPUT (talkatu_input_get_type())

The standard _get_type macro for TalkatuInput.

struct TalkatuInputClass

struct TalkatuInputClass {
	void (*should_send_message)(TalkatuInput *input, TalkatuInputSendBinding binding);
	void (*send_message)(TalkatuInput *input);
};

The backing class to TalkatuInput instances.

Members

should_send_message ()

The class handler for the “should_send_message” signal.

 

send_message ()

The class handler for the “send_message” signal.

 

TalkatuInput

typedef struct _TalkatuInput TalkatuInput;

TalkatuInput is the main input widget for Talkatu. It supports WYSIWYG input for both HTML and Markdown as well as plain text.

It implements TalkatuMessage which means it can be written directly to TalkatuHistory with talkatu_history_write_message(). That also means that it can handle attachments. Currently this is only supported programatically.

It provides keybinds for pasting images as well as emitting a signal when the user has pressed a developer defined keybinding to "send" the message.

Property Details

The “send-binding” property

  “send-binding”             TalkatuInputSendBinding

The keybindings that will trigger the send signal.

Owner: TalkatuInput

Flags: Read / Write / Construct

Default value: TALKATU_INPUT_SEND_BINDING_RETURN | TALKATU_INPUT_SEND_BINDING_KP_ENTER

Signal Details

The “send-message” signal

void
user_function (TalkatuInput *talkatuinput,
               gpointer      user_data)

Emitted when a message should be sent.

Parameters

talkatuinput

The TalkatuInput instance.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

The “should-send-message” signal

void
user_function (TalkatuInput           *talkatuinput,
               TalkatuInputSendBinding arg1,
               gpointer                user_data)

Emitted when a potential keybinding to send the message is entered to determine if the message should be sent.

Parameters

talkatuinput

The TalkatuInput instance.

 

arg1

The TalkatuInputSendBinding that was entered.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action