3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef _PURPLE_E2EE_H_
23 #define _PURPLE_E2EE_H_
26 * @section_id: libpurple-e2ee
27 * @short_description: <filename>e2ee.h</filename>
28 * @title: End-to-end Encryption API
31 typedef struct _PurpleE2eeState PurpleE2eeState
;
33 typedef struct _PurpleE2eeProvider PurpleE2eeProvider
;
36 #include "conversation.h"
38 typedef GList
* (*PurpleE2eeConvMenuCallback
)(PurpleConversation
*conv
);
42 /**************************************************************************/
43 /* Encryption states for conversations. */
44 /**************************************************************************/
47 * purple_e2ee_state_new:
48 * @provider: The E2EE provider that created this state.
50 * Creates new E2EE state.
52 * State objects are global (shared between multiple conversations).
54 * Returns: New E2EE state.
57 purple_e2ee_state_new(PurpleE2eeProvider
*provider
);
60 * purple_e2ee_state_ref:
61 * @state: The E2EE state.
63 * Increment the reference count.
66 purple_e2ee_state_ref(PurpleE2eeState
*state
);
69 * purple_e2ee_state_unref:
70 * @state: The E2EE state.
72 * Decrement the reference count.
74 * If the reference count reaches zero, the state will be freed.
76 * Returns: @state or %NULL if the reference count reached zero.
79 purple_e2ee_state_unref(PurpleE2eeState
*state
);
82 * purple_e2ee_state_get_provider:
83 * @state: The E2EE state.
85 * Gets the provider of specified E2EE state.
87 * Returns: The provider for this state.
90 purple_e2ee_state_get_provider(PurpleE2eeState
*state
);
93 * purple_e2ee_state_set_name:
94 * @state: The E2EE state.
95 * @name: The localized name.
97 * Sets the name for the E2EE state.
100 purple_e2ee_state_set_name(PurpleE2eeState
*state
, const gchar
*name
);
103 * purple_e2ee_state_get_name:
104 * @state: The E2EE state.
106 * Gets the name of the E2EE state.
108 * Returns: The localized name.
111 purple_e2ee_state_get_name(PurpleE2eeState
*state
);
114 * purple_e2ee_state_set_stock_icon:
115 * @state: The E2EE state.
116 * @stock_icon: The stock icon identifier.
118 * Sets the icon for the E2EE state.
121 purple_e2ee_state_set_stock_icon(PurpleE2eeState
*state
,
122 const gchar
*stock_icon
);
125 * purple_e2ee_state_get_stock_icon:
126 * @state: The E2EE state.
128 * Gets the icon of the E2EE state.
130 * Returns: The stock icon identifier.
133 purple_e2ee_state_get_stock_icon(PurpleE2eeState
*state
);
136 /**************************************************************************/
137 /* Encryption providers API. */
138 /**************************************************************************/
141 * purple_e2ee_provider_new:
143 * Creates new E2EE provider.
145 * Returns: New E2EE provider.
148 purple_e2ee_provider_new(void);
151 * purple_e2ee_provider_free:
152 * @provider: The provider.
154 * Destroys the E2EE provider.
156 * The provider have to be unregistered prior.
159 purple_e2ee_provider_free(PurpleE2eeProvider
*provider
);
162 * purple_e2ee_provider_register:
163 * @provider: The E2EE provider.
165 * Registers the E2EE provider.
167 * Currently, there is no support for multiple E2EE providers - only the first
170 * Returns: %TRUE, if the provider was successfully registered,
174 purple_e2ee_provider_register(PurpleE2eeProvider
*provider
);
177 * purple_e2ee_provider_unregister:
178 * @provider: The E2EE provider.
180 * Unregisters the E2EE provider.
183 purple_e2ee_provider_unregister(PurpleE2eeProvider
*provider
);
186 * purple_e2ee_provider_get_main:
188 * Gets main E2EE provider.
190 * Returns: The main E2EE provider.
193 purple_e2ee_provider_get_main(void);
196 * purple_e2ee_provider_set_name:
197 * @provider: The E2EE provider.
198 * @name: The localized name.
200 * Sets the name for the E2EE provider.
203 purple_e2ee_provider_set_name(PurpleE2eeProvider
*provider
, const gchar
*name
);
206 * purple_e2ee_provider_get_name:
207 * @provider: The E2EE provider.
209 * Gets the name of the E2EE provider.
211 * Returns: The localized name of specified E2EE provider.
214 purple_e2ee_provider_get_name(PurpleE2eeProvider
*provider
);
217 * purple_e2ee_provider_set_conv_menu_cb:
218 * @provider: The E2EE provider.
219 * @conv_menu_cb: (scope call): The callback.
221 * Sets the conversation menu callback for the E2EE provider.
223 * The function is called, when user extends the E2EE menu for the conversation
224 * specified in its parameter.
226 * Function should return the GList of PurpleMenuAction objects.
229 purple_e2ee_provider_set_conv_menu_cb(PurpleE2eeProvider
*provider
,
230 PurpleE2eeConvMenuCallback conv_menu_cb
);
233 * purple_e2ee_provider_get_conv_menu_cb:
234 * @provider: The E2EE provider.
236 * Gets the conversation menu callback of the E2EE provider.
238 * Returns: The callback.
240 PurpleE2eeConvMenuCallback
241 purple_e2ee_provider_get_conv_menu_cb(PurpleE2eeProvider
*provider
);
244 * purple_e2ee_provider_get_conv_menu_actions:
245 * @provider: The E2EE provider.
246 * @conv: The conversation.
248 * Returns: (element-type PurpleMenuAction) (transfer full): The list of
249 * actions for an E2EE menu.
252 purple_e2ee_provider_get_conv_menu_actions(PurpleE2eeProvider
*provider
,
253 PurpleConversation
*conv
);
257 #endif /* _PURPLE_E2EE_H_ */