/[winpt]/trunk/Include/wptFileManager.h
ViewVC logotype

Diff of /trunk/Include/wptFileManager.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC revision 37 by werner, Thu Oct 27 19:12:40 2005 UTC
# Line 1  Line 1 
1  /* wptFileManager.h - File manager routines  /* wptFileManager.h - File manager routines
2   *      Copyright (C) 2001-2005 Timo Schulz   *      Copyright (C) 2001-2005 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
6   * WinPT is free software; you can redistribute it and/or   * WinPT is free software; you can redistribute it and/or
7   * modify it under the terms of the GNU General Public License   * modify it under the terms of the GNU General Public License
8   * as published by the Free Software Foundation; either version 2   * as published by the Free Software Foundation; either version 2
9   * of the License, or (at your option) any later version.   * of the License, or (at your option) any later version.
10   *     *  
11   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
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.
15   *   *
16   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19   */   */
20    
21  #ifndef WPT_FILE_MANAGER_H  #ifndef WPT_FILE_MANAGER_H
22  #define WPT_FILE_MANAGER_H  #define WPT_FILE_MANAGER_H
23    
24  /* File manager commands. */  /* File manager commands. */
25  enum {  enum fm_cmd_t {
26      FM_NONE         = 0,      FM_NONE         = 0,
27      FM_ENCRYPT      = 1,              FM_ENCRYPT      = 1,        
28      FM_SYMENC       = 2,              FM_SYMENC       = 2,        
29      FM_DECRYPT      = 3,              FM_DECRYPT      = 3,        
30      FM_SIGN         = 4,      FM_SIGN         = 4,
31      FM_SIGNENCRYPT  = 5,      FM_SIGNENCRYPT  = 5,
32      FM_VERIFY       = 6,      FM_VERIFY       = 6,
33      FM_IMPORT       = 7,      FM_IMPORT       = 7,
34      FM_LIST         = 8,      FM_LIST         = 8,
35      FM_WIPE         = 9,      FM_WIPE         = 9,
36      FM_ENCRYPT_DIR  = 10,      FM_ENCRYPT_DIR  = 10,
37  };  };
38    
39  /* Sort by constants. */  /* Sort by constants. */
40  enum {  enum fm_sort_t {
41      FM_SORT_NONE    = 0,      FM_SORT_NONE    = 0,
42      FM_SORT_STAT    = 1,      FM_SORT_STAT    = 1,
43      FM_SORT_NAME    = 2,      FM_SORT_NAME    = 2,
44      FM_SORT_OP      = 3      FM_SORT_OP      = 3
45  };  };
46    
47  /* File manager handle. */  /* File manager handle. */
48  struct fm_state_s {  struct fm_state_s {
49      gpgme_ctx_t ctx;            /* currently used gpgme context. */      gpgme_ctx_t ctx;            /* currently used gpgme context. */
50      gpgme_key_t *recp;          /* selected recipients. */      gpgme_key_t *recp;          /* selected recipients. */
51      int         n_recp;      int         n_recp;
52      char *output;               /* output file name. */      char *output;               /* output file name. */
53      char *opaque;      char *opaque;
54      int cancel;                 /* 1=if user cancelled operation. */      int cancel;                 /* 1=if user cancelled operation. */
55      HWND dlg;                   /* handle to the calling dialog. */      HWND dlg;                   /* handle to the calling dialog. */
56      struct passphrase_cb_s pass_cb;      struct passphrase_cb_s pass_cb;
57      struct progress_filter_s *prog_cb;      struct progress_filter_s *prog_cb;
58      int init_cb;      int init_cb;
59      int cache_cb;      int cache_cb;
60      gpgme_sig_mode_t sigmode;   /* used signature mode. */      gpgme_sig_mode_t sigmode;   /* used signature mode. */
61      struct {      struct {
62          unsigned int revcert:1;          unsigned int revcert:1;
63          unsigned int has_seckey:1;          unsigned int has_seckey:1;
64      } import;      } import;
65      unsigned int wipe:1;        /* 1=if original file should be wiped. */      unsigned int wipe:1;        /* 1=if original file should be wiped. */
66      unsigned int req_signer:1;  /* 1=if user wants to select a signer. */      unsigned int req_signer:1;  /* 1=if user wants to select a signer. */
67  };  };
68  typedef struct fm_state_s * fm_state_t;  typedef struct fm_state_s * fm_state_t;
69    
70  /* Gpg file handle. */  /* Gpg file handle. */
71  struct file_data_s {  struct file_data_s {
72      struct gpgme_data_cbs   cbs;      struct gpgme_data_cbs   cbs;
73      FILE             *handle;      FILE             *handle;
74      gpgme_data_t     dat;      gpgme_data_t     dat;
75      unsigned long    size;      unsigned long    size;
76      unsigned long    off;      unsigned long    off;
77      void             *cb_value;      void             *cb_value;
78  };  };
79  typedef struct file_data_s *file_data_t;  typedef struct file_data_s *file_data_t;
80    
81  /*-- wptFileCBS.cpp --*/  /*-- wptFileCBS.cpp --*/
82  gpgme_error_t gpg_file_data_new (const char *fname, int for_read,  gpgme_error_t gpg_file_data_new (const char *fname, int for_read,
83                                   file_data_t *r_cb);                                   file_data_t *r_cb);
84  void          gpg_file_data_release (file_data_t cb);  void          gpg_file_data_release (file_data_t cb);
85  void          gpg_file_data_set_cb (file_data_t ctx,  void          gpg_file_data_set_cb (file_data_t ctx,
86                                      struct progress_filter_s *pfx);                                      struct progress_filter_s *pfx);
87    
88  /*-- wptFileManager.cpp --*/  /*-- wptFileManager.cpp --*/
89  char * fm_quote_file (const char * name);  char * fm_quote_file (const char * name);
90  int fm_parse_command_line (char * cmdl);  int fm_parse_command_line (char * cmdl);
91  int fm_parse_files (listview_ctrl_t lv, HWND dlg, int cmd);  int fm_parse_files (listview_ctrl_t lv, HWND dlg, int cmd);
92  int fm_state_new (fm_state_t *ctx);  int fm_state_new (fm_state_t *ctx);
93  void fm_state_release (fm_state_t ctx);  void fm_state_release (fm_state_t ctx);
94  int fm_build (listview_ctrl_t *lv, HWND ctrl);  int fm_build (listview_ctrl_t *lv, HWND ctrl);
95  void fm_delete (listview_ctrl_t lv);  void fm_delete (listview_ctrl_t lv);
96  int fm_add_dropped_files (listview_ctrl_t lv, HDROP dd_files);  int fm_add_dropped_files (listview_ctrl_t lv, HDROP dd_files);
97  int fm_add_opened_files (listview_ctrl_t lv, HWND dlg);  int fm_add_opened_files (listview_ctrl_t lv, HWND dlg);
98  void fm_remove_crit_file_attrs (const char *fname, int force);  void fm_remove_crit_file_attrs (const char *fname, int force);
99  int fm_get_current_pos (listview_ctrl_t lv);  int fm_get_current_pos (listview_ctrl_t lv);
100  int fm_sort (listview_ctrl_t lv, int sortby);  int fm_sort (listview_ctrl_t lv, int sortby);
101  void fm_print_md (listview_ctrl_t lv, HWND dlg, int mdalgo);  void fm_print_md (listview_ctrl_t lv, HWND dlg, int mdalgo);
102  int fm_assume_onepass_sig (const char * fname);  int fm_assume_onepass_sig (const char * fname);
103  int fm_check_file_type (listview_ctrl_t lv, int pos, int fm_cmd);  int fm_check_file_type (listview_ctrl_t lv, int pos, int fm_cmd);
104  int fm_send_file (listview_ctrl_t lv);  int fm_send_file (listview_ctrl_t lv);
105    
106  /*-- ccommands --*/  /*-- ccommands --*/
107  int fm_encrypt (fm_state_t c, const char * name, int sign);  int fm_encrypt (fm_state_t c, const char * name, int sign);
108  int fm_sym_encrypt (fm_state_t c, const char * name);  int fm_sym_encrypt (fm_state_t c, const char * name);
109  int fm_decrypt (fm_state_t c, const char * name);  int fm_decrypt (fm_state_t c, const char * name);
110  int fm_sign (fm_state_t c, const char * name);  int fm_sign (fm_state_t c, const char * name);
111  int fm_verify (fm_state_t c, int detached, const char * name);  int fm_verify (fm_state_t c, int detached, const char * name);
112  int fm_import(fm_state_t c, const char *name);  int fm_import(fm_state_t c, const char *name);
113  int fm_wipe (const char * name);  int fm_wipe (const char * name);
114  int fm_list (const char * name, HWND dlg);  int fm_list (const char * name, HWND dlg);
115  int fm_encrypt_directory (fm_state_t c, const char * name);  int fm_encrypt_directory (fm_state_t c, const char * name);
116  int fm_verify_pasted_detsig (listview_ctrl_t lv, HWND dlg);  int fm_verify_pasted_detsig (listview_ctrl_t lv, HWND dlg);
117  int fm_assume_onepass_sig (const char * fname);  int fm_assume_onepass_sig (const char * fname);
118    
119  #endif /* WPT_FILE_MANAGER_H */  #endif /* WPT_FILE_MANAGER_H */

Legend:
Removed from v.32  
changed lines
  Added in v.37

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26