summaryrefslogtreecommitdiff
path: root/libpurple/purplecontact.h
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2022-11-23 22:41:43 -0600
committerGary Kramlich <grim@reaperworld.com>2022-11-23 22:41:43 -0600
commitb1cc3927ee5e13b8d898e06042d9f9cbfd336020 (patch)
tree91be384578121aae6dfd215930e1e1ae453a0ac2 /libpurple/purplecontact.h
parent2408294fa344f7839e0de2e41012763ee6b794df (diff)
downloadpidgin-b1cc3927ee5e13b8d898e06042d9f9cbfd336020.tar.gz
Make PurpleContact derivable
We want to make PurpleContact derivable so that we can subclass it with PurpleAccount. This will make things easier for everyone as we start moving everything to PurpleContact as an account will just be a contact. Testing Done: Ran the unit tests and built the docs. Reviewed at https://reviews.imfreedom.org/r/2081/
Diffstat (limited to 'libpurple/purplecontact.h')
-rw-r--r--libpurple/purplecontact.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/libpurple/purplecontact.h b/libpurple/purplecontact.h
index 16182b9bb8..04cd0e231a 100644
--- a/libpurple/purplecontact.h
+++ b/libpurple/purplecontact.h
@@ -34,7 +34,8 @@
G_BEGIN_DECLS
#define PURPLE_TYPE_CONTACT (purple_contact_get_type())
-G_DECLARE_FINAL_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT, GObject)
+G_DECLARE_DERIVABLE_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT,
+ GObject)
/**
* PurpleContactPermission:
@@ -59,6 +60,26 @@ typedef enum {
#include <libpurple/purpleperson.h>
/**
+ * PurpleContactClass:
+ * @get_account: A virtual method whose sole purpose is to allow
+ * [class@Purple.Account] to subclass [class@Purple.Contact].
+ *
+ * The class struct for [class@Purple.Contact].
+ *
+ * Since: 3.0.0
+ */
+struct _PurpleContactClass {
+ /*< private >*/
+ GObjectClass parent;
+
+ /*< public >*/
+ PurpleAccount *(*get_account)(PurpleContact *contact);
+
+ /*< private >*/
+ gpointer reserved[4];
+};
+
+/**
* PurpleContact:
*
* A representation of a user. Contacts are used everywhere you need to refer to