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