File: ui.h

package info (click to toggle)
pidgin-otr 4.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,408 kB
  • ctags: 565
  • sloc: sh: 11,542; ansic: 5,487; makefile: 35
file content (84 lines) | stat: -rw-r--r-- 2,474 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 *  Off-the-Record Messaging plugin for pidgin
 *  Copyright (C) 2004-2012  Ian Goldberg, Rob Smits,
 *                           Chris Alexander, Willy Lew,
 *                           Nikita Borisov
 *                           <otr@cypherpunks.ca>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License as
 *  published by the Free Software Foundation.
 *
 *  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 02110-1301 USA
 */

#ifndef __OTRG_UI_H__
#define __OTRG_UI_H__

#include <libotr/context.h>

/* Global and per-buddy preferences */
typedef struct {
    OtrlPolicy policy;
    gboolean avoid_logging_otr;
    gboolean show_otr_button;
} OtrgUiPrefs;

typedef struct {
    void (*init)(void);

    void (*cleanup)(void);

    void (*update_fingerprint)(void);

    void (*update_keylist)(void);

    void (*config_buddy)(PurpleBuddy *buddy);

    void (*get_prefs)(OtrgUiPrefs *prefsp, PurpleAccount *account,
	    const char *name);
} OtrgUiUiOps;

/* Set the UI ops */
void otrg_ui_set_ui_ops(const OtrgUiUiOps *ops);

/* Get the UI ops */
const OtrgUiUiOps *otrg_ui_get_ui_ops(void);

/* Initialize the UI subsystem */
void otrg_ui_init(void);

/* Deinitialize the UI subsystem */
void otrg_ui_cleanup(void);

/* Call this function when the DSA key is updated; it will redraw the
 * UI. */
void otrg_ui_update_fingerprint(void);

/* Update the keylist, if it's visible */
void otrg_ui_update_keylist(void);

/* Send an OTR Query Message to attempt to start a connection */
void otrg_ui_connect_connection(ConnContext *context);

/* Drop a context to PLAINTEXT state */
void otrg_ui_disconnect_connection(ConnContext *context);

/* Forget a fingerprint */
void otrg_ui_forget_fingerprint(Fingerprint *fingerprint);

/* Configure OTR for a particular buddy */
void otrg_ui_config_buddy(PurpleBuddy *buddy);

/* Load the preferences for a particular account / username */
void otrg_ui_get_prefs(OtrgUiPrefs *prefsp, PurpleAccount *account,
	const char *name);

#endif