aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r--libdino/src/plugin/interfaces.vala12
-rw-r--r--libdino/src/plugin/registry.vala21
2 files changed, 31 insertions, 2 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 705cdfe1..178ca1ab 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -53,4 +53,14 @@ public class ContactDetails : Object {
public signal void add(string category, string label, string desc, Widget widget);
}
-} \ No newline at end of file
+public abstract class ConversationTitlebarEntry : Object {
+ public abstract string id { get; }
+ public abstract double order { get; }
+ public abstract ConversationTitlebarWidget get_widget();
+}
+
+public interface ConversationTitlebarWidget : Gtk.Widget {
+ public abstract void set_conversation(Conversation conversation);
+}
+
+}
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index e1ba605d..01d18d5f 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -6,6 +6,15 @@ public class Registry {
internal ArrayList<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>();
internal ArrayList<AccountSettingsEntry> account_settings_entries = new ArrayList<AccountSettingsEntry>();
internal ArrayList<ContactDetailsProvider> contact_details_entries = new ArrayList<ContactDetailsProvider>();
+ internal Gee.Collection<ConversationTitlebarEntry> conversation_titlebar_entries = new Gee.TreeSet<ConversationTitlebarEntry>((a, b) => {
+ if (a.order < b.order) {
+ return -1;
+ } else if (a.order > b.order) {
+ return 1;
+ } else {
+ return 0;
+ }
+ });
public bool register_encryption_list_entry(EncryptionListEntry entry) {
lock(encryption_list_entries) {
@@ -39,6 +48,16 @@ public class Registry {
return true;
}
}
+
+ public bool register_contact_titlebar_entry(ConversationTitlebarEntry entry) {
+ lock(conversation_titlebar_entries) {
+ foreach(ConversationTitlebarEntry e in conversation_titlebar_entries) {
+ if (e.id == entry.id) return false;
+ }
+ conversation_titlebar_entries.add(entry);
+ return true;
+ }
+ }
}
-} \ No newline at end of file
+}