aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r--libdino/src/plugin/interfaces.vala37
-rw-r--r--libdino/src/plugin/loader.vala2
-rw-r--r--libdino/src/plugin/registry.vala9
3 files changed, 47 insertions, 1 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index dab058af..eadbb085 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -29,6 +29,16 @@ public interface EncryptionListEntry : Object {
public abstract Object? get_encryption_icon(Entities.Conversation conversation, ContentItem content_item);
}
+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();
+}
+
public abstract class AccountSettingsEntry : Object {
public abstract string id { get; }
public virtual Priority priority { get { return Priority.DEFAULT; } }
@@ -84,6 +94,33 @@ public abstract interface ConversationAdditionPopulator : ConversationItemPopula
public virtual void populate_timespan(Conversation conversation, DateTime from, DateTime to) { }
}
+public abstract interface VideoCallPlugin : Object {
+
+ public abstract bool supports(string media);
+ // 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);
+ 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);
+}
+
+public abstract interface VideoCallWidget : Object {
+ public signal void resolution_changed(uint width, uint height);
+ public abstract void display_stream(Xmpp.Xep.JingleRtp.Stream stream); // TODO: Multi participant
+ public abstract void display_device(MediaDevice device);
+ public abstract void detach();
+}
+
+public abstract interface MediaDevice : Object {
+ public abstract string id { get; }
+ public abstract string display_name { get; }
+ public abstract string detail_name { get; }
+}
+
public abstract interface NotificationPopulator : Object {
public abstract string id { get; }
public abstract void init(Conversation conversation, NotificationCollection summary, WidgetType type);
diff --git a/libdino/src/plugin/loader.vala b/libdino/src/plugin/loader.vala
index 102bf3f9..8b0d93ad 100644
--- a/libdino/src/plugin/loader.vala
+++ b/libdino/src/plugin/loader.vala
@@ -26,7 +26,7 @@ public class Loader : Object {
this.search_paths = app.search_path_generator.get_plugin_paths();
}
- public void loadAll() throws Error {
+ public void load_all() throws Error {
if (Module.supported() == false) {
throw new Error(-1, 0, "Plugins are not supported");
}
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index e3f73855..e28c4de7 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -4,6 +4,7 @@ namespace Dino.Plugins {
public class Registry {
internal ArrayList<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>();
+ internal HashMap<string, CallEncryptionEntry> call_encryption_entries = new HashMap<string, CallEncryptionEntry>();
internal ArrayList<AccountSettingsEntry> account_settings_entries = new ArrayList<AccountSettingsEntry>();
internal ArrayList<ContactDetailsProvider> contact_details_entries = new ArrayList<ContactDetailsProvider>();
internal Map<string, TextCommand> text_commands = new HashMap<string, TextCommand>();
@@ -12,6 +13,7 @@ public class Registry {
internal Gee.Collection<ConversationTitlebarEntry> conversation_titlebar_entries = new Gee.TreeSet<ConversationTitlebarEntry>((a, b) => {
return (int)(a.order - b.order);
});
+ public VideoCallPlugin? video_call_plugin;
public bool register_encryption_list_entry(EncryptionListEntry entry) {
lock(encryption_list_entries) {
@@ -24,6 +26,13 @@ public class Registry {
}
}
+ public bool register_call_entryption_entry(string ns, CallEncryptionEntry entry) {
+ lock (call_encryption_entries) {
+ call_encryption_entries[ns] = entry;
+ }
+ return true;
+ }
+
public bool register_account_settings_entry(AccountSettingsEntry entry) {
lock(account_settings_entries) {
foreach(var e in account_settings_entries) {