2017-05-30 20:47:16 +00:00
|
|
|
using Dino.Entities;
|
2018-01-12 20:03:09 +00:00
|
|
|
using Xmpp;
|
2017-05-30 20:47:16 +00:00
|
|
|
|
2017-03-11 00:25:45 +00:00
|
|
|
namespace Dino.Plugins {
|
|
|
|
|
2017-03-11 21:48:35 +00:00
|
|
|
public enum Priority {
|
|
|
|
LOWEST,
|
|
|
|
LOWER,
|
|
|
|
DEFAULT,
|
|
|
|
HIGHER,
|
|
|
|
HIGHEST
|
|
|
|
}
|
|
|
|
|
2017-05-04 20:05:48 +00:00
|
|
|
public enum WidgetType {
|
2022-02-14 13:55:59 +00:00
|
|
|
GTK3,
|
|
|
|
GTK4
|
2017-05-04 20:05:48 +00:00
|
|
|
}
|
|
|
|
|
2017-03-11 00:25:45 +00:00
|
|
|
public interface RootInterface : Object {
|
|
|
|
public abstract void registered(Dino.Application app);
|
|
|
|
|
|
|
|
public abstract void shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface EncryptionListEntry : Object {
|
|
|
|
public abstract Entities.Encryption encryption { get; }
|
|
|
|
public abstract string name { get; }
|
|
|
|
|
2019-08-02 01:15:12 +00:00
|
|
|
public abstract void encryption_activated(Entities.Conversation conversation, Plugins.SetInputFieldStatus callback);
|
2020-03-28 13:46:51 +00:00
|
|
|
public abstract Object? get_encryption_icon(Entities.Conversation conversation, ContentItem content_item);
|
2022-02-14 13:55:59 +00:00
|
|
|
public abstract string? get_encryption_icon_name(Entities.Conversation conversation, ContentItem content_item);
|
|
|
|
|
2017-03-11 00:25:45 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 11:17:17 +00:00
|
|
|
public interface CallEncryptionEntry : Object {
|
|
|
|
public abstract CallEncryptionWidget? get_widget(Account account, Xmpp.Xep.Jingle.ContentEncryption encryption);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface CallEncryptionWidget : Object {
|
|
|
|
public abstract string? get_title();
|
|
|
|
public abstract bool show_keys();
|
|
|
|
public abstract string? get_icon_name();
|
|
|
|
}
|
|
|
|
|
2017-03-11 21:48:35 +00:00
|
|
|
public abstract class AccountSettingsEntry : Object {
|
|
|
|
public abstract string id { get; }
|
|
|
|
public virtual Priority priority { get { return Priority.DEFAULT; } }
|
|
|
|
public abstract string name { get; }
|
|
|
|
public virtual int16 label_top_padding { get { return -1; } }
|
|
|
|
|
|
|
|
public abstract signal void activated();
|
|
|
|
public abstract void deactivate();
|
2022-02-14 13:55:59 +00:00
|
|
|
|
|
|
|
public abstract void set_account(Account account);
|
|
|
|
public abstract Object? get_widget(WidgetType type);
|
2017-03-11 21:48:35 +00:00
|
|
|
}
|
|
|
|
|
2017-05-04 20:05:48 +00:00
|
|
|
public interface ContactDetailsProvider : Object {
|
2017-05-30 20:47:16 +00:00
|
|
|
public abstract string id { get; }
|
|
|
|
|
2017-05-04 20:05:48 +00:00
|
|
|
public abstract void populate(Conversation conversation, ContactDetails contact_details, WidgetType type);
|
2017-05-30 20:47:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public class ContactDetails : Object {
|
|
|
|
public signal void save();
|
2017-05-04 20:05:48 +00:00
|
|
|
public signal void add(string category, string label, string? desc, Object widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface TextCommand : Object {
|
|
|
|
public abstract string cmd { get; }
|
|
|
|
|
|
|
|
public abstract string? handle_command(string? text, Entities.Conversation? conversation);
|
2017-05-30 20:47:16 +00:00
|
|
|
}
|
|
|
|
|
2017-05-04 20:05:48 +00:00
|
|
|
public interface ConversationTitlebarEntry : Object {
|
2017-08-02 15:29:55 +00:00
|
|
|
public abstract string id { get; }
|
|
|
|
public abstract double order { get; }
|
2022-02-14 13:55:59 +00:00
|
|
|
public abstract Object? get_widget(WidgetType type);
|
2017-08-02 15:29:55 +00:00
|
|
|
|
|
|
|
public abstract void set_conversation(Conversation conversation);
|
2019-09-30 00:11:23 +00:00
|
|
|
public abstract void unset_conversation();
|
2017-08-02 15:29:55 +00:00
|
|
|
}
|
|
|
|
|
2017-08-27 21:55:49 +00:00
|
|
|
public abstract interface ConversationItemPopulator : Object {
|
|
|
|
public abstract string id { get; }
|
|
|
|
public abstract void init(Conversation conversation, ConversationItemCollection summary, WidgetType type);
|
|
|
|
public abstract void close(Conversation conversation);
|
|
|
|
}
|
|
|
|
|
2018-06-19 16:07:00 +00:00
|
|
|
public abstract interface ConversationAdditionPopulator : ConversationItemPopulator {
|
|
|
|
public virtual void populate_timespan(Conversation conversation, DateTime from, DateTime to) { }
|
|
|
|
}
|
|
|
|
|
2021-03-19 22:07:40 +00:00
|
|
|
public abstract interface VideoCallPlugin : Object {
|
2021-04-17 12:50:31 +00:00
|
|
|
|
2022-02-02 20:37:05 +00:00
|
|
|
public abstract bool supports(string? media);
|
2021-03-19 22:07:40 +00:00
|
|
|
// Video widget
|
|
|
|
public abstract VideoCallWidget? create_widget(WidgetType type);
|
|
|
|
|
|
|
|
// Devices
|
|
|
|
public signal void devices_changed(string media, bool incoming);
|
|
|
|
public abstract Gee.List<MediaDevice> get_devices(string media, bool incoming);
|
2022-02-12 13:35:44 +00:00
|
|
|
public abstract MediaDevice? get_preferred_device(string media, bool incoming);
|
|
|
|
public abstract MediaDevice? get_device(Xmpp.Xep.JingleRtp.Stream? stream, bool incoming);
|
|
|
|
public abstract void set_pause(Xmpp.Xep.JingleRtp.Stream? stream, bool pause);
|
|
|
|
public abstract void set_device(Xmpp.Xep.JingleRtp.Stream? stream, MediaDevice? device);
|
2021-11-04 16:33:08 +00:00
|
|
|
|
|
|
|
public abstract void dump_dot();
|
2021-03-19 22:07:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public abstract interface VideoCallWidget : Object {
|
|
|
|
public signal void resolution_changed(uint width, uint height);
|
2022-02-12 13:35:44 +00:00
|
|
|
public abstract void display_stream(Xmpp.Xep.JingleRtp.Stream? stream, Jid jid);
|
2021-03-19 22:07:40 +00:00
|
|
|
public abstract void display_device(MediaDevice device);
|
|
|
|
public abstract void detach();
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract interface MediaDevice : Object {
|
2022-02-08 20:57:48 +00:00
|
|
|
public abstract string id { owned get; }
|
|
|
|
public abstract string display_name { owned get; }
|
2022-02-12 13:35:44 +00:00
|
|
|
public abstract string? detail_name { owned get; }
|
|
|
|
|
|
|
|
public abstract string? media { owned get; }
|
|
|
|
public abstract bool incoming { get; }
|
2021-03-19 22:07:40 +00:00
|
|
|
}
|
|
|
|
|
2018-06-19 10:52:00 +00:00
|
|
|
public abstract interface NotificationPopulator : Object {
|
|
|
|
public abstract string id { get; }
|
|
|
|
public abstract void init(Conversation conversation, NotificationCollection summary, WidgetType type);
|
|
|
|
public abstract void close(Conversation conversation);
|
|
|
|
}
|
|
|
|
|
2017-08-27 21:55:49 +00:00
|
|
|
public abstract class MetaConversationItem : Object {
|
2018-06-19 16:07:00 +00:00
|
|
|
public virtual string populator_id { get; set; }
|
2020-01-22 00:24:14 +00:00
|
|
|
public virtual Jid? jid { get; set; default=null; }
|
2020-12-04 18:11:27 +00:00
|
|
|
public virtual DateTime time { get; set; default = new DateTime.now_utc(); }
|
|
|
|
public virtual int secondary_sort_indicator { get; set; }
|
2020-01-21 23:09:06 +00:00
|
|
|
public virtual Encryption encryption { get; set; default = Encryption.NONE; }
|
|
|
|
public virtual Entities.Message.Marked mark { get; set; default = Entities.Message.Marked.NONE; }
|
2017-08-27 21:55:49 +00:00
|
|
|
|
2020-04-03 20:49:59 +00:00
|
|
|
public bool can_merge { get; set; default=false; }
|
|
|
|
public bool requires_avatar { get; set; default=false; }
|
|
|
|
public bool requires_header { get; set; default=false; }
|
|
|
|
public bool in_edit_mode { get; set; default=false; }
|
2017-08-27 21:55:49 +00:00
|
|
|
|
2022-02-14 13:55:59 +00:00
|
|
|
public abstract Object? get_widget(ConversationItemWidgetInterface outer, WidgetType type);
|
2020-04-03 20:49:59 +00:00
|
|
|
public abstract Gee.List<MessageAction>? get_item_actions(WidgetType type);
|
|
|
|
}
|
|
|
|
|
2022-02-14 13:55:59 +00:00
|
|
|
public interface ConversationItemWidgetInterface: Object {
|
2023-01-06 12:19:42 +00:00
|
|
|
public abstract void set_widget(Object object, WidgetType type, int priority);
|
2022-02-14 13:55:59 +00:00
|
|
|
}
|
|
|
|
|
2020-04-03 20:49:59 +00:00
|
|
|
public delegate void MessageActionEvoked(Object button, Plugins.MetaConversationItem evoked_on, Object widget);
|
|
|
|
public class MessageAction : Object {
|
2023-01-29 22:06:01 +00:00
|
|
|
public bool sensitive = true;
|
2020-04-03 20:49:59 +00:00
|
|
|
public string icon_name;
|
2023-01-24 17:57:04 +00:00
|
|
|
public string? tooltip;
|
2022-10-11 11:37:48 +00:00
|
|
|
public Object? popover;
|
|
|
|
public MessageActionEvoked? callback;
|
2017-08-27 21:55:49 +00:00
|
|
|
}
|
|
|
|
|
2018-06-11 06:11:04 +00:00
|
|
|
public abstract class MetaConversationNotification : Object {
|
|
|
|
public abstract Object? get_widget(WidgetType type);
|
|
|
|
}
|
|
|
|
|
2017-08-27 21:55:49 +00:00
|
|
|
public interface ConversationItemCollection : Object {
|
2019-05-25 19:57:23 +00:00
|
|
|
public signal void inserted_item(MetaConversationItem item);
|
|
|
|
public signal void removed_item(MetaConversationItem item);
|
|
|
|
|
|
|
|
public abstract void insert_item(MetaConversationItem item);
|
|
|
|
public abstract void remove_item(MetaConversationItem item);
|
2017-08-27 21:55:49 +00:00
|
|
|
}
|
|
|
|
|
2018-06-19 10:52:00 +00:00
|
|
|
public interface NotificationCollection : Object {
|
2018-06-11 06:11:04 +00:00
|
|
|
public signal void add_meta_notification(MetaConversationNotification item);
|
|
|
|
public signal void remove_meta_notification(MetaConversationNotification item);
|
2017-08-27 21:55:49 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 01:15:12 +00:00
|
|
|
public delegate void SetInputFieldStatus(InputFieldStatus field_status);
|
|
|
|
public class InputFieldStatus : Object {
|
|
|
|
public enum MessageType {
|
|
|
|
NONE,
|
|
|
|
INFO,
|
|
|
|
WARNING,
|
|
|
|
ERROR
|
|
|
|
}
|
|
|
|
public enum InputState {
|
|
|
|
NORMAL,
|
|
|
|
DISABLED,
|
|
|
|
NO_SEND
|
|
|
|
}
|
|
|
|
|
|
|
|
public string? message;
|
|
|
|
public MessageType message_type;
|
|
|
|
public InputState input_state;
|
2020-04-22 18:04:03 +00:00
|
|
|
public bool contains_markup;
|
2019-08-02 01:15:12 +00:00
|
|
|
|
2020-04-22 18:04:03 +00:00
|
|
|
public InputFieldStatus(string? message, MessageType message_type, InputState input_state, bool contains_markup = false) {
|
2019-08-02 01:15:12 +00:00
|
|
|
this.message = message;
|
|
|
|
this.message_type = message_type;
|
|
|
|
this.input_state = input_state;
|
2020-04-22 18:04:03 +00:00
|
|
|
this.contains_markup = contains_markup;
|
2019-08-02 01:15:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-02 15:29:55 +00:00
|
|
|
}
|