pidgin/pidginnotifiable.h

Wed, 01 Jan 2025 15:32:28 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 01 Jan 2025 15:32:28 -0600
changeset 43120
a7fd7e06c486
parent 42789
497c03200a99
permissions
-rw-r--r--

Prepare for the 2.90.1 release

Testing Done:
Ran `meson dist`

Reviewed at https://reviews.imfreedom.org/r/3716/

42757
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <pidgin.h> may be included directly"
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PIDGIN_NOTIFIABLE_H
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PIDGIN_NOTIFIABLE_H
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include <purple.h>
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include "pidginversion.h"
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 G_BEGIN_DECLS
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 /**
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 * PidginNotifiable:
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * An interface for notifiable items.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * This should be implemented by anything that wants to show attention or a
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * badge in a [class@DisplayWindow].
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 * The [property@Notifiable:needs-attention] property is used to determine if
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * a badge and/or other steps should be taken to signify that the user needs to
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * look at this item.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 * The [property@Notifiable:notification-count] determines how many
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 * notifications there are which can be used in a badge or other elements.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 * Since: 3.0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 */
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 #define PIDGIN_TYPE_NOTIFIABLE (pidgin_notifiable_get_type())
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 PIDGIN_AVAILABLE_IN_3_0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 G_DECLARE_INTERFACE(PidginNotifiable, pidgin_notifiable, PIDGIN, NOTIFIABLE,
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 GObject)
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 struct _PidginNotifiableInterface {
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 /*< private >*/
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 GTypeInterface parent;
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 /*< private >*/
42789
497c03200a99 Fix a typo in the PidginNotifiableInterface struct
Gary Kramlich <grim@reaperworld.com>
parents: 42757
diff changeset
68 gpointer reserved[4];
42757
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 };
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 /**
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * pidgin_notifiable_get_needs_attention:
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * @notifiable: The instance.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * Gets whether or not this notifiable needs attention.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 * Returns: %TRUE if attention is needed, otherwise %FALSE.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * Since: 3.0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 */
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 PIDGIN_AVAILABLE_IN_3_0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 gboolean pidgin_notifiable_get_needs_attention(PidginNotifiable *notifiable);
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 /**
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 * pidgin_notifiable_get_notification_count:
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 * @notifiable: The instance.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * Gets the number of notifications.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * It's up the the consumer to decide if the exact number or an estimate, like
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 * `10+` is displayed.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * Returns: The number of notifications.
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 *
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * Since: 3.0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 */
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 PIDGIN_AVAILABLE_IN_3_0
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 guint pidgin_notifiable_get_notification_count(PidginNotifiable *notifiable);
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 G_END_DECLS
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101
7c639ab519a1 Create PidginNotifiable interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 #endif /* PIDGIN_NOTIFIABLE_H */

mercurial