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

Diff of /trunk/Include/wptContext.h

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

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 329 by twoaday, Fri Sep 25 16:08:14 2009 UTC
# Line 1  Line 1 
 /* wptContext.h - Internal file to store private contexts  
  *      Copyright (C) 2001-2005 Timo Schulz  
  *  
  * This file is part of WinPT.  
  *  
  * WinPT is free software; you can redistribute it and/or modify  
  * it under the terms of the GNU General Public License as published by  
  * the Free Software Foundation; either version 2 of the License, or  
  * (at your option) any later version.  
  *  
  * WinPT 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 WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
  */  
   
 #ifndef WPT_CONTEXT_H  
 #define WPT_CONTEXT_H  
   
 struct subclass_s {  
     HWND    dlg;  
     WNDPROC old;        /* old window procedure */  
     WNDPROC current;    /* the subclass window procedure */  
     void * opaque;  
 };  
   
 /* Container for a gpgme key. */  
 struct winpt_key_s {  
     const char  *uid;  
     const char  *keyid;  
     unsigned int key_pair:1;        /* is a complete key. */  
     unsigned int is_protected:1;    /* secret key is protected. */  
     unsigned int update:1;          /* 1=need to reload key. */  
     unsigned int is_v3:1;           /* key is version 3 (RSA/MD5) */  
     unsigned int flags;  
     gpgme_key_t  ctx;  
     struct keycache_s *ext;  
     /* Callback structure if a listview needs to be updated. */  
     struct {  
         listview_ctrl_t ctl;        /* the listview control. */  
         int idx;                    /* selected index. */  
         int new_val;  
     } callback;  
 };  
 typedef struct winpt_key_s * winpt_key_t;  
   
 struct text_input_s {  
     char  *data;    /* input data. */  
     size_t length;  /* length of input data. */  
     int    type;    /* type of data (0=text data for signature) */  
 };  
   
 struct date_s {  
     int          cancel;    /* cancel was hit. */  
     const char * text;      /* text used as the title. */  
     SYSTEMTIME   st;        /* selected time by the user. */  
 };  
   
 struct md_file_s {  
     int             mdalgo;  
     listview_ctrl_t lv;  
 };  
   
 struct secdel_confirm_s {  
     unsigned int       yes:1;   /* if yes=1 user confirmed delete. */  
     listview_ctrl_t    lv_files;/* listview control with the files to delete. */  
 };  
   
 struct import_status_s {  
     int          import_res[14];  
     unsigned int rev_cert:1;  
 };  
   
 struct progress_filter_s {  
     HWND     hwnd;  
     HWND     dlg;  
     HANDLE   thread_hd;  
     int      error;  
     const char *what;  
     int      type;  
     unsigned curr;  
     unsigned total;  
 };  
   
   
 struct URL_ctx_s {  
     const char *title;      /* title for the dialog. */  
     const char *desc;       /* description of what to do. */  
     char url[256];          /* the selected URL. */  
     char proxy[64];  
     int  port;              /* the port to use. */  
     int  cancel;            /* user cancelled operation. */  
     int  check;             /* use strict URL checking. */  
 };  
   
 struct first_start_s {  
     int choice;  
 };  
   
 struct genkey_s {  
     gpgme_key_t newkey;      
     int interactive;  
     unsigned int first_start:1;  
 };  
   
 #endif /* WPT_CONTEXT_H */  
1    /* wptContext.h - Internal file to store private contexts
2     *      Copyright (C) 2001-2006, 2009 Timo Schulz
3     *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (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
14     * GNU General Public License for more details.
15     */
16    #ifndef WPT_CONTEXT_H
17    #define WPT_CONTEXT_H
18    
19    /* Window subclassing context. */
20    struct subclass_s {
21        HWND    dlg;
22        WNDPROC old;        /* old window procedure */
23        WNDPROC current;    /* the subclass window procedure */
24        void * opaque;
25    };
26    
27    /* Container for a gpgme key. */
28    struct winpt_key_s {
29        const char  *uid;               /* pointer to the first uid */
30        const char  *keyid;             /* pointer to the first keyid */
31        unsigned int key_pair:1;        /* is a complete key. */
32        unsigned int is_protected:1;    /* secret key is protected. */
33        unsigned int update:1;          /* 1=need to reload key. */
34        unsigned int is_v3:1;           /* key is version 3 (RSA/MD5) */
35        unsigned int has_photo:1;       /* 1=contains photo-id. */
36        unsigned int flags;
37        gpgme_key_t  ctx;               /* if not NULL, the actualy gpgme key */
38        struct keycache_s *ext;         /* extended key attributes or NULL. */
39        /* Callback structure if a listview needs to be updated. */
40        struct {
41            listview_ctrl_t ctl;        /* the listview control. */
42            int idx;                    /* selected index. */
43            int new_val;                /* new value */
44        } callback;
45        char tmp_keyid[8+1];
46        int internal;
47        unsigned int allocated:1;
48    };
49    typedef struct winpt_key_s * winpt_key_t;
50    
51    /* Text input context for detached sigs. */
52    struct text_input_s {
53        char  *data;    /* input data. */
54        size_t length;  /* length of input data. */
55        int    type;    /* type of data (0=text data for signature) */
56    };
57    
58    /* Date context for the date selection dialog. */
59    struct date_s {
60        int         cancel;     /* cancel was hit. */
61        const char *text;       /* text used as the title. */
62        SYSTEMTIME  st;         /* selected time by the user. */
63    };
64    
65    struct md_file_s {
66        int             mdalgo;
67        listview_ctrl_t lv;
68    };
69    
70    struct secdel_confirm_s {
71        unsigned int    yes:1;    /* if yes=1 user confirmed delete. */
72        listview_ctrl_t lv_files; /* listview with the files to delete. */
73        int             mode;     /* return the wipe mode. */
74        int             passes;   /* number of random passes. */
75    };
76    
77    
78    /* Progress filter context. */
79    struct progress_filter_s {
80        HWND     hwnd;
81        HWND     dlg;
82        HANDLE   thread_hd;
83        int      error;
84        const char *what;
85        int      type;
86        unsigned curr;
87        unsigned total;
88    };
89    
90    /* URL context. */
91    struct URL_ctx_s {
92        const char *title;      /* title for the dialog. */
93        const char *desc;       /* description of what to do. */
94        char url[256];          /* the selected URL. */
95        char proxy[64];
96        int  port;              /* the port to use. */
97        int  cancel;            /* user cancelled operation. */
98        int  check;             /* use strict URL checking. */
99    };
100    typedef struct URL_ctx_s *URL_ctx_t;
101    
102    /* Key generation context */
103    struct genkey_s {
104        gpgme_key_t  newkey;        /* handle to the new key */
105        int          interactive;
106        unsigned int first_start:1;
107        unsigned int cancel:1;
108        char         *fpr;          /* fingerprint of the key. */
109    };
110    
111    #endif /* WPT_CONTEXT_H */

Legend:
Removed from v.23  
changed lines
  Added in v.329

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26