1 | /* |
2 | context_p.h - wraps a gpgme context (private part) |
3 | Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB |
4 | |
5 | This file is part of GPGME++. |
6 | |
7 | GPGME++ is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. |
11 | |
12 | GPGME++ is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU Library General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Library General Public License |
18 | along with GPGME++; see the file COPYING.LIB. If not, write to the |
19 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. |
21 | */ |
22 | |
23 | // -*- c++ -*- |
24 | #ifndef __GPGMEPP_CONTEXT_P_H__ |
25 | #define __GPGMEPP_CONTEXT_P_H__ |
26 | |
27 | #include <gpgme++/context.h> |
28 | #include <gpgme++/data.h> |
29 | |
30 | #include <gpgme.h> |
31 | |
32 | namespace GpgME { |
33 | |
34 | |
35 | class Context::Private { |
36 | public: |
37 | enum Operation { |
38 | None = 0, |
39 | |
40 | Encrypt = 0x001, |
41 | Decrypt = 0x002, |
42 | Sign = 0x004, |
43 | Verify = 0x008, |
44 | DecryptAndVerify = Decrypt|Verify, |
45 | SignAndEncrypt = Sign|Encrypt, |
46 | |
47 | Import = 0x010, |
48 | Export = 0x020, // no gpgme_export_result_t, but nevertheless... |
49 | Delete = 0x040, // no gpgme_delete_result_t, but nevertheless... |
50 | |
51 | KeyGen = 0x080, |
52 | KeyList = 0x100, |
53 | TrustList = 0x200, // no gpgme_trustlist_result_t, but nevertheless... |
54 | |
55 | Edit = 0x400, // no gpgme_edit_result_t, but nevertheless... |
56 | CardEdit = 0x800, // no gpgme_card_edit_result_t, but nevertheless... |
57 | |
58 | GetAuditLog = 0x1000, // no gpgme_getauditlog_result_t, but nevertheless... |
59 | |
60 | AssuanTransact = 0x2000, |
61 | Passwd = 0x4000, // no gpgme_passwd_result_t, but nevertheless... |
62 | |
63 | CreateVFS = 0x4000, |
64 | MountVFS = 0x8000, |
65 | |
66 | EndMarker |
67 | }; |
68 | |
69 | Private( gpgme_ctx_t c=0 ); |
70 | ~Private(); |
71 | |
72 | |
73 | gpgme_ctx_t ctx; |
74 | gpgme_io_cbs * iocbs; |
75 | Operation lastop; |
76 | gpgme_error_t lasterr; |
77 | Data lastAssuanInquireData; |
78 | std::auto_ptr<AssuanTransaction> lastAssuanTransaction; |
79 | std::auto_ptr<EditInteractor> lastEditInteractor, lastCardEditInteractor; |
80 | }; |
81 | |
82 | } // namespace GpgME |
83 | |
84 | #endif // __GPGMEPP_CONTEXT_P_H__ |
85 | |