21 |
#ifndef GPGOE_H |
#ifndef GPGOE_H |
22 |
#define GPGOE_H |
#define GPGOE_H |
23 |
|
|
24 |
/* dummy until gettext support is finished. */ |
/* gettext support. */ |
25 |
#define _(X) (X) |
const char *gettext (const char *msgid); |
26 |
|
#define _(X) gettext ((X)) |
27 |
|
|
28 |
|
|
29 |
#include <malloc.h> |
#include <malloc.h> |
30 |
/* wrapper around free. */ |
/* safe wrapper around free. */ |
31 |
#define free_if_alloc(ptr) \ |
#define free_if_alloc(ptr) \ |
32 |
do { \ |
do { \ |
33 |
if (ptr) free (ptr); \ |
if (ptr) free (ptr); \ |
45 |
|
|
46 |
#define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len) |
#define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len) |
47 |
|
|
48 |
/* OE5 V5.x/V6 command id's. */ |
/* Dialog IDs for the various operations. */ |
49 |
#define ID_OE5_SELECTALL 40125 |
#define ID_OE_SELECTALL 40125 |
50 |
#define ID_OE5_COPY 40484 |
#define ID_OE_COPY 40484 |
51 |
#define ID_OE5_PASTE 40231 |
#define ID_OE_PASTE 40231 |
52 |
#define ID_OE5_ENCRYPT 40260 |
#define ID_OE_SAVE_ATT 40104 |
53 |
#define ID_OE5_SIGN 40299 |
|
54 |
#define ID_OE5_SEND 40411 |
/* Common dialogs (Get{Open,Save}FileName) */ |
55 |
#define ID_OE5_PREVMSG 40145 |
#define ID_OF_OK 1 |
56 |
#define ID_OE5_NEXTMSG 40146 |
#define ID_OF_CANCEL 2 |
57 |
|
#define ID_OF_OPEN_FILE 1152 |
58 |
/* Common dialogs (GetOpenFileName) */ |
#define ID_OF_SAVE_FILE 1148 |
|
#define OF_IDOK 1 |
|
|
#define OF_IDFILE 1152 |
|
59 |
|
|
60 |
|
|
61 |
/* Context for the recipient list. */ |
/* Context for the recipient list. */ |
70 |
struct plugin_ctx_s { |
struct plugin_ctx_s { |
71 |
HWND msg_wnd, main_wnd, addr_wnd; |
HWND msg_wnd, main_wnd, addr_wnd; |
72 |
HWND to_wnd, cc_wnd, bcc_wnd; |
HWND to_wnd, cc_wnd, bcc_wnd; |
73 |
|
HWND attach; |
74 |
char *to; |
char *to; |
75 |
char *cc; |
char *cc; |
76 |
char *bcc; |
char *bcc; |
79 |
recip_list_t rset; |
recip_list_t rset; |
80 |
char errbuf[256]; |
char errbuf[256]; |
81 |
char *orig_text; |
char *orig_text; |
82 |
|
int use_utf8; |
83 |
}; |
}; |
84 |
typedef struct plugin_ctx_s *plugin_ctx_t; |
typedef struct plugin_ctx_s *plugin_ctx_t; |
85 |
|
|
86 |
/* Viewer context. */ |
/* Viewer context. */ |
87 |
struct viewer_ctx_s { |
struct viewer_ctx_s { |
88 |
|
HWND main_wnd; |
89 |
const char *msg; |
const char *msg; |
90 |
}; |
}; |
91 |
typedef struct viewer_ctx_s *viewer_ctx_t; |
typedef struct viewer_ctx_s *viewer_ctx_t; |
96 |
/*EXPORT*/ int gpgoe_remove (void); |
/*EXPORT*/ int gpgoe_remove (void); |
97 |
|
|
98 |
/*-- OEProc.c --*/ |
/*-- OEProc.c --*/ |
99 |
|
extern plugin_ctx_t oe_plug; |
100 |
extern HINSTANCE mod_hinst_dll; |
extern HINSTANCE mod_hinst_dll; |
101 |
|
extern HANDLE plugin_active; |
102 |
|
|
103 |
|
/* support for the mailer window. */ |
104 |
extern WNDPROC oe_proc_old; |
extern WNDPROC oe_proc_old; |
105 |
LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); |
LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, |
106 |
|
WPARAM wparam, LPARAM lparam); |
107 |
|
|
108 |
|
/* support for the common dialogs. */ |
109 |
|
extern WNDPROC of_proc_old; |
110 |
|
LRESULT CALLBACK of_proc (HWND hwnd, UINT msg, |
111 |
|
WPARAM wparam, LPARAM lparam); |
112 |
|
|
113 |
|
/* support for the main window. */ |
114 |
|
extern WNDPROC oe_main_proc_old; |
115 |
|
LRESULT CALLBACK oe_main_proc (HWND hwnd, UINT msg, |
116 |
|
WPARAM wparam, LPARAM lparam); |
117 |
|
|
118 |
|
|
119 |
/*-- OECrypto.c --*/ |
/*-- OECrypto.c --*/ |
120 |
gpgme_error_t oe_handle_mail (plugin_ctx_t ctx); |
gpgme_error_t oe_handle_mail (plugin_ctx_t ctx); |
121 |
|
gpgme_error_t oe_decrypt_msg (HWND main_wnd, char **r_msg); |
122 |
|
|
123 |
/*-- OEMisc.c --*/ |
/*-- OEMisc.c --*/ |
124 |
|
void center_window (HWND hwndChild, HWND parent); |
125 |
char* utf8_to_native (const char *string); |
char* utf8_to_native (const char *string); |
126 |
|
char* native_to_utf8 (const char *string); |
127 |
char* get_clip_text (HWND hwnd); |
char* get_clip_text (HWND hwnd); |
128 |
int set_clip_text (HWND hwnd, const char *text, int nbytes); |
int set_clip_text (HWND hwnd, const char *text, int nbytes); |
129 |
void show_error (HWND hwnd, const char *caption, |
void show_error (HWND hwnd, const char *caption, |
130 |
UINT type, const char *fmt, ...); |
UINT type, const char *fmt, ...); |
131 |
void* xcalloc (size_t n, size_t m); |
void* xcalloc (size_t n, size_t m); |
132 |
char* xstrdup (const char *s); |
char* xstrdup (const char *s); |
133 |
|
void xfree (void *p); |
134 |
|
void quote_msg_text (const char *inp, char **r_outp); |
135 |
|
|
136 |
/*-- dialogs --*/ |
/*-- dialogs --*/ |
137 |
BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, |
BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, |
151 |
int prev_was_bad, int fd); |
int prev_was_bad, int fd); |
152 |
void free_pass_cb (pass_cb_t cb); |
void free_pass_cb (pass_cb_t cb); |
153 |
pass_cb_t new_pass_cb (HWND main); |
pass_cb_t new_pass_cb (HWND main); |
154 |
|
int pass_cb_cancelled (pass_cb_t cb); |
155 |
|
void free_pass_cache (void); |
156 |
|
|
157 |
|
/*-- OENLS.c --*/ |
158 |
|
int setup_gettext (void); |
159 |
|
|
160 |
#endif /* GPGOE_H */ |
#endif /* GPGOE_H */ |