* @file e2ee.h End-to-end encryption API * Purple is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA typedef struct _PurpleE2eeState PurpleE2eeState; typedef struct _PurpleE2eeProvider PurpleE2eeProvider; #include "conversation.h" typedef GList * (*PurpleE2eeConvMenuCallback)(PurpleConversation *conv); /**************************************************************************/ /** @name Encryption states for conversations. */ /**************************************************************************/ * Creates new E2EE state. * State objects are global (shared between multiple conversations). * @param provider The E2EE provider that created this state. * @return New E2EE state. purple_e2ee_state_new(PurpleE2eeProvider *provider); * Increment the reference count. * @param state The E2EE state. purple_e2ee_state_ref(PurpleE2eeState *state); * Decrement the reference count. * If the reference count reaches zero, the state will be freed. * @param state The E2EE state. * @return @a state or @c NULL if the reference count reached zero. purple_e2ee_state_unref(PurpleE2eeState *state); * Gets the provider of specified E2EE state. * @param state The E2EE state. * @return The provider for this state. purple_e2ee_state_get_provider(PurpleE2eeState *state); * Sets the name for the E2EE state. * @param state The E2EE state. * @param name The localized name. purple_e2ee_state_set_name(PurpleE2eeState *state, const gchar *name); * Gets the name of the E2EE state. * @param state The E2EE state. * @return The localized name. purple_e2ee_state_get_name(PurpleE2eeState *state); * Sets the icon for the E2EE state. * @param state The E2EE state. * @param stock_icon The stock icon identifier. purple_e2ee_state_set_stock_icon(PurpleE2eeState *state, const gchar *stock_icon); * Gets the icon of the E2EE state. * @param state The E2EE state. * @return The stock icon identifier. purple_e2ee_state_get_stock_icon(PurpleE2eeState *state); /**************************************************************************/ /** @name Encryption providers API. */ /**************************************************************************/ * Creates new E2EE provider. * @return New E2EE provider. purple_e2ee_provider_new(void); * Destroys the E2EE provider. * The provider have to be unregistered prior. * @param provider The provider. purple_e2ee_provider_free(PurpleE2eeProvider *provider); * Registers the E2EE provider. * Currently, there is no support for multiple E2EE providers - only the first * @param provider The E2EE provider. * @return @c TRUE, if the provider was successfully registered, purple_e2ee_provider_register(PurpleE2eeProvider *provider); * Unregisters the E2EE provider. * @param provider The E2EE provider. purple_e2ee_provider_unregister(PurpleE2eeProvider *provider); * Gets main E2EE provider. * @return The main E2EE provider. purple_e2ee_provider_get_main(void); * Sets the name for the E2EE provider. * @param provider The E2EE provider. * @param name The localized name. purple_e2ee_provider_set_name(PurpleE2eeProvider *provider, const gchar *name); * Gets the name of the E2EE provider. * @param provider The E2EE provider. * @return The localized name of specified E2EE provider. purple_e2ee_provider_get_name(PurpleE2eeProvider *provider); * Sets the conversation menu callback for the E2EE provider. * The function is called, when user extends the E2EE menu for the conversation * specified in its parameter. * Function should return the GList of PurpleMenuAction objects. * @param provider The E2EE provider. * @param conv_menu_cb The callback. purple_e2ee_provider_set_conv_menu_cb(PurpleE2eeProvider *provider, PurpleE2eeConvMenuCallback conv_menu_cb); * Gets the conversation menu callback of the E2EE provider. * @param provider The E2EE provider. PurpleE2eeConvMenuCallback purple_e2ee_provider_get_conv_menu_cb(PurpleE2eeProvider *provider); #endif /* _PURPLE_E2EE_H_ */