Finalize for 0.4.7.
[gpgme.git] / complus / igpgme.h
1 /* igpgme.h - COM+ class IGpgme
2  *      Copyright (C) 2001 g10 Code GmbH
3  *
4  * This file is part of GPGME.
5  *
6  * GPGME 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  * GPGME 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  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19  */
20
21 #ifndef IGPGME_H
22 #define IGPGME_H 1
23
24 #include <ole2.h>
25
26 DEFINE_GUID(CLSID_Gpgme,      0x3811fd40, 0x7f72, 0x11d5,
27             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
28 #if 0
29 DEFINE_GUID(CLSID_GpgmeData,  0x3811fd41, 0x7f72, 0x11d5,
30             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
31 DEFINE_GUID(CLSID_GpgmeKey,   0x3811fd42, 0x7f72, 0x11d5,
32             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
33 DEFINE_GUID(CLSID_GpgmeRSet,  0x3811fd43, 0x7f72, 0x11d5,
34             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
35 #endif
36
37 DEFINE_GUID(TLBID_Gpgcom,     0x3811fd48, 0x7f72, 0x11d5,
38             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
39 DEFINE_GUID(APPID_Gpgcom,     0x3811fd4f, 0x7f72, 0x11d5,
40             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
41
42
43 DEFINE_GUID(IID_IGpgme,       0x3811fd50, 0x7f72, 0x11d5,
44             0x8c, 0x9e, 0x00, 0x80, 0xad, 0x19, 0x0c, 0xd5);
45
46 typedef struct IGpgme IGpgme;
47
48 void igpgme_register_exit_event (HANDLE ev);
49 IClassFactory *igpgme_factory_new( CLSID *r_clsid );
50 void igpgme_factory_release ( IClassFactory *factory );
51
52
53 /********************************************
54  ***** The IGpgme interface *****************
55  ********************************************/
56
57 #define ICOM_INTERFACE IGpgme
58
59 #define IGpgme_METHODS \
60     ICOM_METHOD1(HRESULT,GetVersion,    BSTR*,) \
61     ICOM_METHOD1(HRESULT,GetEngineInfo, BSTR*,) \
62     ICOM_METHOD(HRESULT,Cancel)               \
63     ICOM_METHOD1(HRESULT,SetArmor,BOOL,)        \
64     ICOM_METHOD1(HRESULT,GetArmor,BOOL*,)       \
65     ICOM_METHOD1(HRESULT,SetTextmode,BOOL,)     \
66     ICOM_METHOD1(HRESULT,GetTextmode,BOOL*,)    \
67     ICOM_METHOD1(HRESULT,SetPlaintext,VARIANT,)    \
68     ICOM_METHOD1(HRESULT,GetPlaintext,VARIANT*,)   \
69     ICOM_METHOD1(HRESULT,SetCiphertext,VARIANT,)   \
70     ICOM_METHOD1(HRESULT,GetCiphertext,VARIANT*,)  \
71     ICOM_METHOD(HRESULT,ClearRecipients)      \
72     ICOM_METHOD2(HRESULT,AddRecipient,BSTR,,signed short int,)  \
73     ICOM_METHOD(HRESULT,ResetSignKeys)      \
74     ICOM_METHOD1(HRESULT,AddSignKey,BSTR,)  \
75     ICOM_METHOD(HRESULT,Encrypt)            \
76     ICOM_METHOD1(HRESULT,Sign,signed short int,)   \
77     ICOM_METHOD1(HRESULT,SignEncrypt,signed short int,)
78
79 #if 0
80     ICOM_METHOD1(HRESULT,SetKeylistMode,)      
81     ICOM_METHOD1(HRESULT,SetPassphraseCB,)      
82     ICOM_METHOD1(HRESULT,SetProgressCB,)      
83     ICOM_METHOD1(HRESULT,SignersClear,)      
84     ICOM_METHOD1(HRESULT,SignersAdd,)      
85     ICOM_METHOD1(HRESULT,SignersEnum,)      
86     ICOM_METHOD1(HRESULT,GetSigStatus,)   
87     ICOM_METHOD1(HRESULT,GetNotation,) 
88 #endif
89
90 #define IGpgme_IMETHODS \
91     IDispatch_IMETHODS \
92     IGpgme_METHODS
93
94 ICOM_DEFINE(IGpgme,IDispatch)
95 #undef ICOM_INTERFACE
96
97
98 /*** IUnknown methods ***/
99 #define IGpgme_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
100 #define IGpgme_AddRef(p)             ICOM_CALL (AddRef,p)
101 #define IGpgme_Release(p)            ICOM_CALL (Release,p)
102 /*** IGpgme methods ***/
103 #define IGpgme_GetVersion(p,r)       ICOM_CALL1(GetVersion,p,r)
104 #define IGpgme_GetEngineInfo(p,r)    ICOM_CALL1(GetEngineInfo,p,r)
105 #define IGpgme_Cancel(p,a)           ICOM_CALL1(Cancel,p,a)             
106 #define IGpgme_SetArmor(p,a)         ICOM_CALL1(SetArmor,p,a)      
107 #define IGpgme_GetArmor(p,a)         ICOM_CALL1(GetArmor,p,a)      
108 #define IGpgme_SetTextmode(p,a)      ICOM_CALL1(SetTextmode,p,a)      
109 #define IGpgme_GetTextmode(p,a)      ICOM_CALL1(GetTextmode,p,a)      
110 #define IGpgme_SetPlaintext(p,a)     ICOM_CALL1(SetPlaintext,p,a)
111 #define IGpgme_GetPlaintext(p,a)     ICOM_CALL1(GetPlaintext,p,a)
112 #define IGpgme_SetCiphertext(p,a)    ICOM_CALL1(SetCiphertext,p,a)
113 #define IGpgme_GetCiphertext(p,a)    ICOM_CALL1(GetCiphertext,p,a)
114 #define IGpgme_ClearRecipients(p)    ICOM_CALL (ClearRecipients,p)
115 #define IGpgme_AddRecipient(p,a,b)   ICOM_CALL2(AddRecipient,p,a,b)
116 #define IGpgme_ResetSignKeys(p)      ICOM_CALL (ResetSignKeys,p)
117 #define IGpgme_AddSignKey(p,a)       ICOM_CALL (AddSignKey,p,a)
118 #define IGpgme_Encrypt(p)            ICOM_CALL (Encrypt,p)
119 #define IGpgme_Sign(p,a)             ICOM_CALL (Sign,p,a)
120 #define IGpgme_SignEncrypt(p,a)      ICOM_CALL (SignEncrypt,p,a)
121 #if 0
122 #define IGpgme_SetKeylistMode(p,a)   ICOM_CALL1(SetKeylistMode,p,a)      
123 #define IGpgme_SetPassphraseCB(p,a)  ICOM_CALL1(SetPassphraseCB,p,a)     
124 #define IGpgme_SetProgressCB(p,a)    ICOM_CALL1(SetProgressCB,p,a)     
125 #define IGpgme_SignersClear(p,a)     ICOM_CALL1(SignersClear,p,a)     
126 #define IGpgme_SignersAdd(p,a)       ICOM_CALL1(SignersAdd,p,a)     
127 #define IGpgme_SignersEnum(p,a)      ICOM_CALL1(SignersEnum,p,a)     
128 #define IGpgme_GetSigStatus(p,a)     ICOM_CALL1(GetSigStatus,p,a)      
129 #define IGpgme_GetSigKey(p,a)        ICOM_CALL1(GetSigKey,p,a)
130 #define IGpgme_GetNotation(p,a)      ICOM_CALL1(GetNotation,p,a)      
131 #endif
132
133
134 #if 0
135 /********************************************
136  ***** The IGpgmeKey interface **************
137  ********************************************/
138
139 #define ICOM_INTERFACE IGpgmeKey
140
141 #define IGpgmeKey_METHODS \
142     ICOM_METHOD1(HRESULT,GetVersion,    BSTR,) \
143     ICOM_METHOD1(HRESULT,GetEngineInfo, BSTR,)
144
145
146 #define IGpgmeKey_IMETHODS \
147     IUnknown_IMETHODS \
148     IGpgmeKey_METHODS
149
150 ICOM_DEFINE(IGpgmeKey,IUnknown)
151 #undef ICOM_INTERFACE
152
153 /*** IUnknown methods ***/
154 #define IGpgmeKey_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
155 #define IGpgmeKey_AddRef(p)             ICOM_CALL (AddRef,p)
156 #define IGpgmeKey_Release(p)            ICOM_CALL (Release,p)
157 /*** IGpgmeKey methods ***/
158 #define IGpgmeKey_GetVersion(p,r)       ICOM_CALL1(GetVersion,p,r)
159 #define IGpgmeKey_GetEngineInfo(p,r)    ICOM_CALL1(GetEngineInfo,p,r)
160 #endif
161
162 #endif /*IGPGME_H*/
163