1 |
/* wptRegistry.h - Win32 Registry headerfile |
2 |
* Copyright (C) 2000-2005 Timo Schulz |
3 |
* |
4 |
* This file is part of WinPT. |
5 |
* |
6 |
* WinPT is free software; you can redistribute it and/or |
7 |
* modify it under the terms of the GNU General Public License |
8 |
* as published by the Free Software Foundation; either version 2 |
9 |
* of the License, or (at your option) any later version. |
10 |
* |
11 |
* WinPT is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with WinPT; if not, write to the Free Software Foundation, |
18 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#ifndef WPT_REGISTRY_H |
22 |
#define WPT_REGISTRY_H |
23 |
|
24 |
/* Symbolic configuration IDs */ |
25 |
enum cfg_t { |
26 |
CFG_INVALID=0, |
27 |
CFG_CACHETIME, |
28 |
CFG_WORDWRAP, |
29 |
CFG_FASTMODE, |
30 |
CFG_VIEWER, |
31 |
CFG_KEYLISTMODE, |
32 |
CFG_WIPEMODE, |
33 |
CFG_ALWAYSTRUST, |
34 |
CFG_AUTOBACKUP, |
35 |
CFG_AUTOBAKMODE, |
36 |
CFG_DISHOTKEYS, |
37 |
CFG_NOZIP_MMEDIA, |
38 |
CFG_EXPERT, |
39 |
CFG_FM_PROGRESS, |
40 |
/* end of id list */ |
41 |
CFG_AUTOBAKPATH, |
42 |
CFG_KSERV_CONF, |
43 |
}; |
44 |
|
45 |
|
46 |
struct reg_hotkey_s { |
47 |
const char *reg_entry; |
48 |
char key[2]; /* the hotkey as a char ('A'). */ |
49 |
int enabled; /* 1=enable this hotkey. */ |
50 |
}; |
51 |
typedef struct reg_hotkey_s * reg_hotkey_t; |
52 |
|
53 |
struct winpt_reg_prefs_s { |
54 |
int no_hotkeys; /* disable ALL hotkeys */ |
55 |
int word_wrap; /* set word wrapping (0 means to disable it) */ |
56 |
int cache_time; /* caching time for passphrase */ |
57 |
int use_tmpfiles; /* use tempfiles for gpg communication */ |
58 |
int use_viewer; /* use clipboard viewer for displaying plaintext */ |
59 |
int no_zip_mmedia; /* disable compression for multi-media files (movies, music) */ |
60 |
int keylist_mode; /* normal=0 minimal=1 or */ |
61 |
int wipe_mode; /* simple=0, dod=1, gutmann=2 */ |
62 |
int always_trust; /* skip key validation (1 means yes) */ |
63 |
int auto_backup; /* automatic backup (1 means activated) */ |
64 |
struct { |
65 |
int mode; /* backup mode */ |
66 |
char *path; /* keyring backup path */ |
67 |
} backup; |
68 |
char *kserv_conf; /* path to the keyserver config file. */ |
69 |
int expert; /* run in expert mode. */ |
70 |
struct { |
71 |
int progress; /* show the progress bar dialog. */ |
72 |
} fm; |
73 |
char *homedir; /* mobile home directory. */ |
74 |
|
75 |
/* Actual no registry options but virtual options. */ |
76 |
struct { |
77 |
unsigned int ask_cert_level:1; |
78 |
} gpg; |
79 |
}; |
80 |
|
81 |
extern reg_hotkey_s reg_hotkeys[]; |
82 |
extern winpt_reg_prefs_s reg_prefs; |
83 |
|
84 |
/*-- wptHotkey.cpp --*/ |
85 |
void hotkeys_modify (void); |
86 |
void hotkey_disable (reg_hotkey_t rhk); |
87 |
void hotkey_enable (reg_hotkey_t rhk, const char * key); |
88 |
|
89 |
/*-- wptRegistry.cpp --*/ |
90 |
void free_reg_prefs (void); |
91 |
int regist_inst_gnupg (int create_mokey); |
92 |
int regist_inst_winpt (int with_ext, int *created); |
93 |
int create_file_type (const char * exefile, const char * ext, |
94 |
const char * extname, char *iconfile ); |
95 |
int set_reg_winpt_single (int id, int val); |
96 |
int get_reg_winpt_single (int id); |
97 |
int set_reg_winpt_prefs (winpt_reg_prefs_s * opt); |
98 |
int get_reg_winpt_prefs (winpt_reg_prefs_s * opt); |
99 |
char* get_reg_entry( HKEY root_key, const char * dir, const char * key ); |
100 |
int set_reg_entry( HKEY root_key, const char * dir, const char * key, |
101 |
const char * value ); |
102 |
int set_reg_key( HKEY root_key, const char * dir, const char * key, |
103 |
const char * value ); |
104 |
int set_reg_entry_gpg( const char * key, const char * value ); |
105 |
int set_reg_entry_mo( const char * value ); |
106 |
char* get_reg_entry_gpg( const char * key ); |
107 |
char* get_reg_entry_mo( void ); |
108 |
void get_reg_proxy_prefs( char ** host, int * port, |
109 |
char ** user, char ** pass ); |
110 |
int set_reg_proxy_prefs( const char * host, int port, |
111 |
const char * user, const char * pass ); |
112 |
int set_reg_entry_keyserver( const char * name, const char * val ); |
113 |
char * get_reg_entry_keyserver( const char * name ); |
114 |
int set_reg_winpt_flag( const char * name, int val ); |
115 |
int get_reg_winpt_flag( const char * name ); |
116 |
|
117 |
#endif /* WPT_REGISTRY_H */ |