aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r--libdino/src/plugin/interfaces.vala17
-rw-r--r--libdino/src/plugin/registry.vala11
2 files changed, 26 insertions, 2 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 35c93786..705cdfe1 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -1,5 +1,7 @@
using Gtk;
+using Dino.Entities;
+
namespace Dino.Plugins {
public enum Priority {
@@ -20,7 +22,7 @@ public interface EncryptionListEntry : Object {
public abstract Entities.Encryption encryption { get; }
public abstract string name { get; }
- public abstract bool can_encrypt(Entities.Conversation conversation);
+ public abstract bool can_encrypt(Conversation conversation);
}
public abstract class AccountSettingsEntry : Object {
@@ -33,11 +35,22 @@ public abstract class AccountSettingsEntry : Object {
}
public interface AccountSettingsWidget : Gtk.Widget {
- public abstract void set_account(Entities.Account account);
+ public abstract void set_account(Account account);
public abstract signal void activated();
public abstract void deactivate();
}
+public abstract class ContactDetailsProvider : Object {
+ public abstract string id { get; }
+
+ public abstract void populate(Conversation conversation, ContactDetails contact_details);
+}
+
+public class ContactDetails : Object {
+ public signal void save();
+ public signal void add(string category, string label, string desc, Widget widget);
+}
+
} \ No newline at end of file
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index 27cac6f3..e1ba605d 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -5,6 +5,7 @@ namespace Dino.Plugins {
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>();
public bool register_encryption_list_entry(EncryptionListEntry entry) {
lock(encryption_list_entries) {
@@ -28,6 +29,16 @@ public class Registry {
return true;
}
}
+
+ public bool register_contact_details_entry(ContactDetailsProvider entry) {
+ lock(contact_details_entries) {
+ foreach(ContactDetailsProvider e in contact_details_entries) {
+ if (e.id == entry.id) return false;
+ }
+ contact_details_entries.add(entry);
+ return true;
+ }
+ }
}
} \ No newline at end of file