Mon, 12 Dec 2022 23:38:47 -0600
Create PurpleAvatar to represent avatars
Testing Done:
Ran the unit tests and manually verified the docs.
Reviewed at https://reviews.imfreedom.org/r/2092/
|
41090
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
1 | /* |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
4 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
5 | * This library is free software; you can redistribute it and/or |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU Lesser General Public |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
7 | * License as published by the Free Software Foundation; either |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
8 | * version 2 of the License, or (at your option) any later version. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
9 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
10 | * This library is distributed in the hope that it will be useful, |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
13 | * Lesser General Public License for more details. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
14 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU Lesser General Public License |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
16 | * along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
17 | */ |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
18 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
19 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
20 | # error "only <purple.h> may be included directly" |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
21 | #endif |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
22 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_SQLITE_HISTORY_ADAPTER_H |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
24 | #define PURPLE_SQLITE_HISTORY_ADAPTER_H |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
25 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
27 | #include <glib-object.h> |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
28 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
29 | #include <purplehistoryadapter.h> |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
30 | #include <purplemessage.h> |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
31 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
32 | G_BEGIN_DECLS |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
33 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
34 | /** |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
35 | * PurpleSqliteHistoryAdapter: |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
36 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
37 | * #PurpleSqliteHistoryAdapter is a class that allows interfacing with an |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
38 | * SQLite database to store history. It is a subclass of @PurpleHistoryAdapter. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
39 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
40 | * Since: 3.0.0 |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
41 | */ |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
42 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
43 | #define PURPLE_TYPE_SQLITE_HISTORY_ADAPTER (purple_sqlite_history_adapter_get_type()) |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
44 | G_DECLARE_FINAL_TYPE(PurpleSqliteHistoryAdapter, purple_sqlite_history_adapter, |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
45 | PURPLE, SQLITE_HISTORY_ADAPTER, PurpleHistoryAdapter) |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
46 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
47 | /** |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
48 | * purple_sqlite_history_adapter_new: |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
49 | * @filename: The filename of the sqlite database. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
50 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
51 | * Creates a new #PurpleHistoryAdapter. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
52 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
53 | * Returns: (transfer full): The new #PurpleSqliteHistoryAdapter instance. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
54 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
55 | * Since: 3.0.0 |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
56 | */ |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
57 | PurpleHistoryAdapter *purple_sqlite_history_adapter_new(const gchar *filename); |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
58 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
59 | /** |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
60 | * purple_sqlite_history_adapter_get_filename |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
61 | * @adapter: The #PurpleSqliteHistoryAdapter instance |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
62 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
63 | * Gets the filename of the sqlite database. |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
64 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
65 | * Returns: The filename that the @adapter reads and writes to |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
66 | * |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
67 | * Since: 3.0.0 |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
68 | */ |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
69 | const gchar *purple_sqlite_history_adapter_get_filename(PurpleSqliteHistoryAdapter *adapter); |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
70 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
71 | G_END_DECLS |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
72 | |
|
741992355ead
GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents:
diff
changeset
|
73 | #endif /* PURPLE_SQLITE_HISTORY_ADAPTER */ |