From 5ba95ef6b7be3bc7f3a8333f9db78577e1c259bc Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 30 May 2017 22:47:16 +0200 Subject: Conversation details dialog --- libdino/src/plugin/interfaces.vala | 17 +++++++++++++++-- libdino/src/plugin/registry.vala | 11 +++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'libdino/src/plugin') 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 encryption_list_entries = new ArrayList(); internal ArrayList account_settings_entries = new ArrayList(); + internal ArrayList contact_details_entries = new ArrayList(); 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 -- cgit v1.2.3-70-g09d2