merge the formfield patch from ooo-build
[ooovba.git] / extensions / test / ole / AxTestComponents / Basic.h
blobf7216c5f85581003b0d101e661fa9277308aee79
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Basic.h,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 // Basic.h : Declaration of the CBasic
32 #ifndef __BASIC_H_
33 #define __BASIC_H_
35 #include "resource.h" // main symbols
36 //#include "AxTestComponents.h"
37 #import "AxTestComponents.tlb" no_namespace no_implementation raw_interfaces_only named_guids
38 //#include "AxTestComponents.h"
39 /////////////////////////////////////////////////////////////////////////////
40 // CBasic
41 class ATL_NO_VTABLE CBasic :
42 public CComObjectRootEx<CComSingleThreadModel>,
43 public CComCoClass<CBasic, &CLSID_Basic>,
44 public IDispatchImpl<IBasic, &IID_IBasic, &LIBID_AXTESTCOMPONENTSLib>
46 public:
47 CBasic();
48 ~CBasic();
50 DECLARE_REGISTRY_RESOURCEID(IDR_BASIC)
52 DECLARE_PROTECT_FINAL_CONSTRUCT()
54 BEGIN_COM_MAP(CBasic)
55 COM_INTERFACE_ENTRY(IBasic)
56 COM_INTERFACE_ENTRY(IDispatch)
57 END_COM_MAP()
59 // IBasic
60 public:
61 STDMETHOD(outMore)(/*[out]*/long* val1, /*[out]*/long* val2);
62 STDMETHOD(inMulDimArrayByte2)(LPSAFEARRAY val);
63 STDMETHOD(inMulDimArrayByte)(LPSAFEARRAY val);
64 STDMETHOD(inMulDimArrayVariant2)(LPSAFEARRAY val);
65 STDMETHOD(inMulDimArrayLong2)(LPSAFEARRAY val);
66 STDMETHOD(inMulDimArrayVariant)(LPSAFEARRAY val);
67 STDMETHOD(inMulDimArrayLong)( LPSAFEARRAY val);
68 STDMETHOD(inoutSequenceObject)(LPSAFEARRAY* val);
69 STDMETHOD(inoutSequenceDouble)(LPSAFEARRAY * val);
70 STDMETHOD(inoutSequenceFloat)(LPSAFEARRAY * val);
71 STDMETHOD(inoutSequenceString)(LPSAFEARRAY* val);
72 STDMETHOD(inoutSequenceLong)(LPSAFEARRAY * val);
73 STDMETHOD(inoutSequenceShort)(LPSAFEARRAY * val);
74 STDMETHOD(inoutSequenceByte)(LPSAFEARRAY * val);
75 STDMETHOD(outSequenceObject)(/*[out]*/ LPSAFEARRAY* val);
76 STDMETHOD(outSequenceDouble)(/*[out]*/ LPSAFEARRAY* val);
77 STDMETHOD(outSequenceFloat)(/*[out]*/ LPSAFEARRAY* val);
78 STDMETHOD(outSequenceString)(/*[out]*/ LPSAFEARRAY* val);
79 STDMETHOD(outSequenceLong)(/*[out]*/ LPSAFEARRAY* val);
80 STDMETHOD(outSequenceShort)(/*[out]*/ LPSAFEARRAY* val);
81 STDMETHOD(outSequenceByte)(/*[out]*/ LPSAFEARRAY* val);
82 STDMETHOD(inSequenceObject)(LPSAFEARRAY ar);
83 STDMETHOD(inSequenceDouble)(LPSAFEARRAY ar);
84 STDMETHOD(inSequenceFloat)(LPSAFEARRAY ar);
85 STDMETHOD(inSequenceString)(LPSAFEARRAY ar);
86 STDMETHOD(inSequenceShort)(LPSAFEARRAY ar);
87 STDMETHOD(inSequenceByte)(LPSAFEARRAY ar);
88 STDMETHOD(inSequenceLong)(LPSAFEARRAY ar);
89 STDMETHOD(mixed1)(
90 /* [out][in] */ unsigned char *aChar,
91 /* [out][in] */ float *aFloat,
92 /* [out][in] */ VARIANT *aVar);
93 STDMETHOD(get_prpObject)(/*[out, retval]*/ IDispatch* *pVal);
94 STDMETHOD(put_prpObject)(/*[in]*/ IDispatch* newVal);
95 STDMETHOD(get_prpArray)(/*[out, retval]*/ LPSAFEARRAY *pVal);
96 STDMETHOD(put_prpArray)(/*[in]*/ LPSAFEARRAY newVal);
97 STDMETHOD(get_prpVariant)(/*[out, retval]*/ VARIANT *pVal);
98 STDMETHOD(put_prpVariant)(/*[in]*/ VARIANT newVal);
99 STDMETHOD(get_prpDouble)(/*[out, retval]*/ double *pVal);
100 STDMETHOD(put_prpDouble)(/*[in]*/ double newVal);
101 STDMETHOD(get_prpFloat)(/*[out, retval]*/ float *pVal);
102 STDMETHOD(put_prpFloat)(/*[in]*/ float newVal);
103 STDMETHOD(get_prpString)(/*[out, retval]*/ BSTR *pVal);
104 STDMETHOD(put_prpString)(/*[in]*/ BSTR newVal);
105 STDMETHOD(get_prpLong)(/*[out, retval]*/ long *pVal);
106 STDMETHOD(put_prpLong)(/*[in]*/ long newVal);
107 STDMETHOD(get_prpShort)(/*[out, retval]*/ short *pVal);
108 STDMETHOD(put_prpShort)(/*[in]*/ short newVal);
109 STDMETHOD(get_prpByte)(/*[out, retval]*/ unsigned char *pVal);
110 STDMETHOD(put_prpByte)(/*[in]*/ unsigned char newVal);
111 STDMETHOD(get_prpBool)(/*[out, retval]*/ VARIANT_BOOL *pVal);
112 STDMETHOD(put_prpBool)(/*[in]*/ VARIANT_BOOL newVal);
114 STDMETHOD(outObject)(/*[out]*/ IDispatch* *val);
115 STDMETHOD(outArray)(/*[out]*/ LPSAFEARRAY * val);
116 STDMETHOD(outVariant)(/*[out]*/ VARIANT* val);
117 STDMETHOD(outDouble)(/*[out]*/ double* val);
118 STDMETHOD(outFloat)(/*[out]*/ float* val);
119 STDMETHOD(outString)(/*[out]*/ BSTR* val);
120 STDMETHOD(outLong)(/*[out]*/ long* val);
121 STDMETHOD(outShort)(/*[out]*/ short* val);
122 STDMETHOD(outByte)(/*[out]*/ unsigned char* val);
123 STDMETHOD(outBool)(/*[out]*/ VARIANT_BOOL* val);
125 STDMETHOD(inoutObject)(/*[in,out]*/ IDispatch* *val);
126 STDMETHOD(inoutArray)(/*[in,out]*/ LPSAFEARRAY * val);
127 STDMETHOD(inoutVariant)(/*[in,out]*/ VARIANT * val);
128 STDMETHOD(inoutDouble)(/*[in,out]*/ double * val);
129 STDMETHOD(inoutFloat)(/*[in,out]*/ float * val);
130 STDMETHOD(inoutString)(/*[in, out]*/ BSTR* val);
131 STDMETHOD(inoutLong)(/*[in,out]*/ long * val);
132 STDMETHOD(inoutShort)(/*[in,out]*/ short* val);
133 STDMETHOD(inoutByte)(/*[in,out]*/ unsigned char* val);
134 STDMETHOD(inoutBool)(/*[in,out]*/ VARIANT_BOOL* val);
137 STDMETHOD(inObject)(/*[in]*/ IDispatch* val);
138 STDMETHOD(inArray)(/*[in]*/ LPSAFEARRAY val);
139 STDMETHOD(inVariant)(/*[in]*/ VARIANT val);
140 STDMETHOD(inDouble)(/*[in]*/ double val);
141 STDMETHOD(inFloat)(/*[in]*/ float val);
142 STDMETHOD(inString)(/*[in]*/ BSTR val);
143 STDMETHOD(inLong)(/*[in]*/ long val);
144 STDMETHOD(inShort)(/*[in]*/ short val);
145 STDMETHOD(inByte)(/*[in]*/ unsigned char val);
146 STDMETHOD(inBool)(/*[in]*/ VARIANT_BOOL val);
149 STDMETHOD(optional1)(/*[in]*/ long val1, /*[in, optional]*/ VARIANT* val2);
150 STDMETHOD(optional2)(/*[out]*/ long* val1,/*[out, optional]*/ VARIANT* val2);
151 STDMETHOD(optional3)(/*[in, optional]*/ VARIANT* val1,/*[in, optional]*/ VARIANT* val2);
152 STDMETHOD(optional4)(/*[in, out, optional]*/ VARIANT* val1,/*[in, out, optional]*/ VARIANT* val2);
153 STDMETHOD(optional5)(/*[out, optional]*/ VARIANT* val1,/*[out, optional]*/ VARIANT* val2);
156 STDMETHOD(defaultvalue1)(/*[in, defaultvalue(10)]*/ long val1,
157 /*[in, defaultvalue(3.14)]*/ double* val2,
158 // /*[in, defaultvalue(10)]*/ VARIANT val3,
159 /*[in, defaultvalue(100)]*/ VARIANT* val4);
161 STDMETHOD(defaultvalue2)(/*[in, out, defaultvalue(10)]*/ long* val1,
162 /*[in, out, defaultvalue(3.14)]*/ double* val2,
163 // /*[in, out, defaultvalue(10)]*/ VARIANT* val3,
164 /*[in, out, defaultvalue(100)]*/ VARIANT* val4);
166 STDMETHOD(varargfunc1)(/*[in]*/ long val1,/*[in]*/ LPSAFEARRAY val2);
168 STDMETHOD(varargfunc2)(/*[out]*/ long* val1, /*[out]*/ SAFEARRAY ** val2);
171 // members for property implementations
172 unsigned char m_cPrpByte;
173 short m_nPrpShort;
174 long m_lPrpLong;
175 float m_fPrpFloat;
176 double m_dPrpDouble;
177 CComPtr<IDispatch> m_PrpObject;
178 CComPtr<IUnknown> m_prpUnknown;
180 CComBSTR m_bstrPrpString;
181 CComVariant m_PropVariant;
182 LPSAFEARRAY m_PrpArray;
183 protected:
184 VARIANT_BOOL m_bool;
185 unsigned char m_byte;
186 short m_short;
187 long m_long;
188 long m_long2;
189 float m_float;
190 double m_double;
191 CComVariant m_var1;
192 CComVariant m_var2;
193 CComVariant m_var3;
194 CComVariant m_var4;
195 CComBSTR m_bstr;
196 CY m_cy;
197 DATE m_date;
198 DECIMAL m_decimal;
199 SCODE m_scode;
200 SAFEARRAY * m_safearray;
201 CComPtr<IDispatch> m_obj;
202 CComPtr<IUnknown> m_unknown;
204 SAFEARRAY * m_arByte;
205 SAFEARRAY * m_arShort;
206 SAFEARRAY * m_arLong;
207 SAFEARRAY * m_arString;
208 SAFEARRAY * m_arVariant;
209 SAFEARRAY * m_arFloat;
210 SAFEARRAY * m_arDouble;
211 SAFEARRAY * m_arObject;
212 SAFEARRAY * m_arByteDim2;
214 static void printArray(LPSAFEARRAY val, BSTR message, VARTYPE type);
215 static void printMulArray(LPSAFEARRAY val, VARTYPE type);
218 public:
219 STDMETHOD(inSequenceByteDim2)(LPSAFEARRAY val);
220 STDMETHOD(inCurrency)(CY val);
221 STDMETHOD(outCurrency)(CY* val);
222 STDMETHOD(inoutCurrency)(CY* val);
223 STDMETHOD(inDate)(DATE val);
224 STDMETHOD(outDate)(DATE* val);
225 STDMETHOD(inoutDate)(DATE* val);
226 STDMETHOD(get_prpCurrency)(CY* pVal);
227 STDMETHOD(put_prpCurrency)(CY newVal);
228 STDMETHOD(get_prpDate)(DATE* pVal);
229 STDMETHOD(put_prpDate)(DATE newVal);
230 STDMETHOD(inDecimal)(DECIMAL val);
231 STDMETHOD(outDecimal)(DECIMAL* val);
232 STDMETHOD(inoutDecimal)(DECIMAL* val);
233 STDMETHOD(get_prpDecimal)(DECIMAL* pVal);
234 STDMETHOD(put_prpDecimal)(DECIMAL newVal);
235 STDMETHOD(inSCode)(SCODE val);
236 STDMETHOD(outScode)(SCODE* val);
237 STDMETHOD(inoutSCode)(SCODE* val);
238 STDMETHOD(get_prpSCode)(SCODE* pVal);
239 STDMETHOD(put_prpSCode)(SCODE newVal);
240 STDMETHOD(inrefLong)(LONG* val);
241 STDMETHOD(inrefVariant)(VARIANT* val);
242 STDMETHOD(inrefDecimal)(DECIMAL* val);
243 STDMETHOD(get_prpRefLong)(long* pVal);
244 STDMETHOD(putref_prpRefLong)(long* newVal);
245 STDMETHOD(get_prprefVariant)(VARIANT* pVal);
246 STDMETHOD(putref_prprefVariant)(VARIANT* newVal);
247 STDMETHOD(get_prprefDecimal)(DECIMAL* pVal);
248 STDMETHOD(putref_prprefDecimal)(DECIMAL* newVal);
249 STDMETHOD(optional6)(VARIANT* val1, VARIANT* val2, VARIANT* val3, VARIANT* val4);
250 STDMETHOD(optional7)(VARIANT* val1, VARIANT* val2, VARIANT* val3, VARIANT* val4);
252 STDMETHOD(get_prpMultiArg1)(VARIANT* val1, VARIANT* val2, VARIANT* pVal);
253 //STDMETHOD(get_prpMultiArg1)(VARIANT* val1, VARIANT* pVal);
254 STDMETHOD(put_prpMultiArg1)(VARIANT* val1, VARIANT* val2, VARIANT* newVal);
255 //STDMETHOD(put_prpMultiArg1)(VARIANT* val1, VARIANT* newVal);
256 STDMETHOD(get_prpMultiArg2)(VARIANT val1, VARIANT* pVal);
257 STDMETHOD(put_prpMultiArg2)(VARIANT val1, VARIANT newVal);
258 STDMETHOD(prpMultiArg2GetValues)(VARIANT* val1, VARIANT* valProperty);
259 STDMETHOD(get_prpMultiArg3)(LONG* val1, LONG* pVal);
260 STDMETHOD(put_prpMultiArg3)(LONG* val1, LONG newVal);
262 // IFoo Methods
263 public:
264 STDMETHOD(inUnknown)(IUnknown* val);
265 STDMETHOD(outUnknown)(IUnknown** val);
266 STDMETHOD(inoutUnknown)(IUnknown** val);
267 STDMETHOD(get_prpUnknown)(IUnknown** pVal);
268 STDMETHOD(put_prpUnknown)(IUnknown* newVal);
271 #endif //__BASIC_H_