1 |
/* wptRegistry.h - Win32 Registry headerfile |
/* wptRegistry.h - Registry interface |
2 |
* Copyright (C) 2000-2006 Timo Schulz |
* Copyright (C) 2000-2007 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* General Public License for more details. |
* General Public License for more details. |
|
* |
|
|
* You should have received a copy of the GNU General Public License |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
15 |
*/ |
*/ |
|
|
|
16 |
#ifndef WPT_REGISTRY_H |
#ifndef WPT_REGISTRY_H |
17 |
#define WPT_REGISTRY_H |
#define WPT_REGISTRY_H |
18 |
|
|
|
#include "wptKeyserver.h" |
|
19 |
|
|
20 |
/* Symbolic configuration IDs */ |
/* Symbolic configuration IDs */ |
21 |
enum cfg_t { |
enum cfg_t { |
22 |
CFG_INVALID=0, |
CFG_INVALID=0, |
23 |
CFG_CACHETIME, |
CFG_CACHETIME, |
24 |
CFG_WORDWRAP, |
CFG_WORDWRAP, |
25 |
CFG_FASTMODE, |
CFG_FILEEXT, |
26 |
CFG_VIEWER, |
CFG_VIEWER, |
|
CFG_WIPEMODE, |
|
27 |
CFG_ALWAYSTRUST, |
CFG_ALWAYSTRUST, |
28 |
CFG_AUTOBACKUP, |
CFG_AUTOBACKUP, |
29 |
CFG_AUTOBAKMODE, |
CFG_AUTOBAKMODE, |
31 |
CFG_NOZIP_MMEDIA, |
CFG_NOZIP_MMEDIA, |
32 |
CFG_EXPERT, |
CFG_EXPERT, |
33 |
CFG_FM_PROGRESS, |
CFG_FM_PROGRESS, |
34 |
|
CFG_BACKUP_INC_SKR, |
35 |
/* end of id list */ |
/* end of id list */ |
36 |
CFG_AUTOBAKPATH, |
CFG_AUTOBAKPATH, |
37 |
CFG_KSERV_CONF, |
CFG_KSERV_CONF, |
38 |
}; |
}; |
39 |
|
|
40 |
|
extern const char *cfg[]; |
41 |
|
|
42 |
struct winpt_reg_prefs_s { |
struct winpt_prefs_s { |
43 |
int no_hotkeys; /* disable ALL hotkeys */ |
int no_hotkeys; /* disable ALL hotkeys */ |
44 |
int word_wrap; /* set word wrapping (0 means to disable it) */ |
int word_wrap; /* set word wrapping (0 means to disable it) */ |
45 |
int cache_time; /* caching time for passphrase */ |
int cache_time; /* caching time for passphrase */ |
|
int use_tmpfiles; /* use tempfiles for gpg communication */ |
|
46 |
int use_viewer; /* use clipboard viewer for displaying plaintext */ |
int use_viewer; /* use clipboard viewer for displaying plaintext */ |
47 |
int no_zip_mmedia; /* disable compression for multi-media files (movies, music) */ |
int no_zip_mmedia; /* disable compression for multi-media files (movies, music) */ |
|
int wipe_mode; /* simple=0, dod=1, gutmann=2 */ |
|
48 |
int always_trust; /* skip key validation (1 means yes) */ |
int always_trust; /* skip key validation (1 means yes) */ |
49 |
int auto_backup; /* automatic backup (1 means activated) */ |
int auto_backup; /* automatic backup (1 means activated) */ |
50 |
|
int default_ext; /* 1 = GPG, PGP otherwise. */ |
51 |
|
int no_safe_pwd_ctrl; /* disable the additional 'safe' window hooks. */ |
52 |
struct { |
struct { |
53 |
|
int include_secr;/* including secret keyrings. */ |
54 |
int mode; /* backup mode */ |
int mode; /* backup mode */ |
55 |
char *path; /* keyring backup path */ |
char *path; /* keyring backup path */ |
56 |
} backup; |
} backup; |
67 |
unsigned int ask_cert_expire:1; |
unsigned int ask_cert_expire:1; |
68 |
} gpg; |
} gpg; |
69 |
}; |
}; |
70 |
|
typedef struct winpt_prefs_s *winpt_prefs_t; |
71 |
extern winpt_reg_prefs_s reg_prefs; |
extern winpt_prefs_s reg_prefs; |
72 |
|
|
73 |
/*-- wptRegistry.cpp --*/ |
/*-- wptRegistry.cpp --*/ |
74 |
void free_reg_prefs (void); |
void free_reg_prefs (void); |
75 |
int regist_inst_gnupg (int create_mokey); |
int regist_inst_gnupg (int create_mokey); |
76 |
int regist_inst_winpt (int with_ext, int *created); |
int regist_inst_winpt (int with_ext, int *created); |
|
int create_file_type (const char * exefile, const char * ext, |
|
|
const char * extname, char *iconfile ); |
|
77 |
int set_reg_winpt_single (int id, int val); |
int set_reg_winpt_single (int id, int val); |
78 |
int get_reg_winpt_single (int id); |
int get_reg_winpt_single (int id); |
79 |
int set_reg_winpt_prefs (winpt_reg_prefs_s * opt); |
int set_reg_winpt_prefs (winpt_prefs_t opt); |
80 |
int get_reg_winpt_prefs (winpt_reg_prefs_s * opt); |
int get_reg_winpt_prefs (winpt_prefs_t opt); |
81 |
char* get_reg_entry( HKEY root_key, const char * dir, const char * key ); |
char* get_reg_entry (HKEY root_key, const char *dir, const char *key); |
82 |
int set_reg_entry( HKEY root_key, const char * dir, const char * key, |
int set_reg_entry (HKEY root_key, const char * dir, const char * key, |
83 |
const char * value ); |
const char *value); |
84 |
int set_reg_key( HKEY root_key, const char * dir, const char * key, |
int set_reg_key (HKEY root_key, const char * dir, const char * key, |
85 |
const char * value ); |
const char * value); |
86 |
int set_reg_entry_gpg( const char * key, const char * value ); |
int set_reg_entry_gpg (const char *key, const char *value); |
87 |
int set_reg_entry_mo( const char * value ); |
char* get_reg_entry_gpg (const char * key); |
88 |
char* get_reg_entry_gpg( const char * key ); |
char* get_reg_entry_mo (void); |
89 |
char* get_reg_entry_mo( void ); |
int set_reg_entry_keyserver (const char * name, const char *val); |
90 |
void get_reg_proxy_prefs (keyserver_proxy_t prox); |
char* get_reg_entry_keyserver( const char * name ); |
|
int set_reg_proxy_prefs (keyserver_proxy_t prox); |
|
|
int set_reg_entry_keyserver( const char * name, const char * val ); |
|
|
char * get_reg_entry_keyserver( const char * name ); |
|
91 |
int set_reg_winpt_flag (const char *name, int val); |
int set_reg_winpt_flag (const char *name, int val); |
92 |
int get_reg_winpt_flag (const char *name); |
int get_reg_winpt_flag (const char *name); |
93 |
char* get_reg_entry_gpg4win (const char *path); |
char* get_reg_entry_gpg4win (const char *path); |