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 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_cppuhelper.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "sal/config.h"
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include "test/cppuhelper/propertysetmixin/XSupplier.hpp"
34*cdf0e10cSrcweir #include "test/cppuhelper/propertysetmixin/XTest3.hpp"
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include "com/sun/star/beans/Ambiguous.hpp"
37*cdf0e10cSrcweir #include "com/sun/star/beans/Defaulted.hpp"
38*cdf0e10cSrcweir #include "com/sun/star/beans/Optional.hpp"
39*cdf0e10cSrcweir #include "com/sun/star/beans/PropertyVetoException.hpp"
40*cdf0e10cSrcweir #include "com/sun/star/beans/UnknownPropertyException.hpp"
41*cdf0e10cSrcweir #include "com/sun/star/lang/XComponent.hpp"
42*cdf0e10cSrcweir #include "cppuhelper/propertysetmixin.hxx"
43*cdf0e10cSrcweir #include "cppuhelper/factory.hxx"
44*cdf0e10cSrcweir #include "cppuhelper/implbase1.hxx"
45*cdf0e10cSrcweir #include "cppuhelper/implementationentry.hxx"
46*cdf0e10cSrcweir #include "cppuhelper/queryinterface.hxx"
47*cdf0e10cSrcweir #include "cppuhelper/weak.hxx"
48*cdf0e10cSrcweir #include "com/sun/star/uno/Any.hxx"
49*cdf0e10cSrcweir #include "com/sun/star/uno/Exception.hpp"
50*cdf0e10cSrcweir #include "com/sun/star/uno/Reference.hxx"
51*cdf0e10cSrcweir #include "com/sun/star/uno/RuntimeException.hpp"
52*cdf0e10cSrcweir #include "com/sun/star/uno/Sequence.hxx"
53*cdf0e10cSrcweir #include "com/sun/star/uno/Type.hxx"
54*cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp"
55*cdf0e10cSrcweir #include "com/sun/star/uno/XInterface.hpp"
56*cdf0e10cSrcweir #include "osl/mutex.hxx"
57*cdf0e10cSrcweir #include "rtl/ustring.h"
58*cdf0e10cSrcweir #include "rtl/ustring.hxx"
59*cdf0e10cSrcweir #include "sal/types.h"
60*cdf0e10cSrcweir #include "uno/lbnames.h"
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir namespace com { namespace sun { namespace star {
63*cdf0e10cSrcweir     class XEventListener;
64*cdf0e10cSrcweir } } }
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir namespace css = com::sun::star;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir namespace {
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir class Empty1:
71*cdf0e10cSrcweir     public cppu::OWeakObject, public css::lang::XComponent,
72*cdf0e10cSrcweir     public cppu::PropertySetMixin< css::lang::XComponent >
73*cdf0e10cSrcweir {
74*cdf0e10cSrcweir public:
75*cdf0e10cSrcweir     explicit Empty1(
76*cdf0e10cSrcweir         css::uno::Reference< css::uno::XComponentContext > const & context):
77*cdf0e10cSrcweir         cppu::PropertySetMixin< css::lang::XComponent >(
78*cdf0e10cSrcweir             context, static_cast< Implements >(0),
79*cdf0e10cSrcweir             css::uno::Sequence< rtl::OUString >())
80*cdf0e10cSrcweir     {}
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
83*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw () { OWeakObject::acquire(); }
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     virtual void SAL_CALL release() throw () { OWeakObject::release(); }
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir     virtual void SAL_CALL dispose() throw (css::uno::RuntimeException) {
90*cdf0e10cSrcweir         cppu::PropertySetMixin< css::lang::XComponent >::dispose();
91*cdf0e10cSrcweir     }
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(
94*cdf0e10cSrcweir         css::uno::Reference< css::lang::XEventListener > const &)
95*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
96*cdf0e10cSrcweir     {}
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(
99*cdf0e10cSrcweir         css::uno::Reference< css::lang::XEventListener > const &)
100*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
101*cdf0e10cSrcweir     {}
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir private:
104*cdf0e10cSrcweir     Empty1(Empty1 &); // not defined
105*cdf0e10cSrcweir     void operator =(Empty1 &); // not defined
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     virtual ~Empty1() {}
108*cdf0e10cSrcweir };
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir css::uno::Any Empty1::queryInterface(css::uno::Type const & type)
111*cdf0e10cSrcweir     throw (css::uno::RuntimeException)
112*cdf0e10cSrcweir {
113*cdf0e10cSrcweir     css::uno::Any a(OWeakObject::queryInterface(type));
114*cdf0e10cSrcweir     if (a.hasValue()) {
115*cdf0e10cSrcweir         return a;
116*cdf0e10cSrcweir     }
117*cdf0e10cSrcweir     a = cppu::queryInterface(
118*cdf0e10cSrcweir         type, static_cast< css::lang::XComponent * >(this));
119*cdf0e10cSrcweir     return a.hasValue()
120*cdf0e10cSrcweir         ? a
121*cdf0e10cSrcweir         : cppu::PropertySetMixin< css::lang::XComponent >::queryInterface(
122*cdf0e10cSrcweir             type);
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir class Empty2:
126*cdf0e10cSrcweir     public cppu::OWeakObject, public css::lang::XComponent,
127*cdf0e10cSrcweir     public cppu::PropertySetMixin< css::lang::XComponent >
128*cdf0e10cSrcweir {
129*cdf0e10cSrcweir public:
130*cdf0e10cSrcweir     explicit Empty2(
131*cdf0e10cSrcweir         css::uno::Reference< css::uno::XComponentContext > const & context):
132*cdf0e10cSrcweir         cppu::PropertySetMixin< css::lang::XComponent >(
133*cdf0e10cSrcweir             context,
134*cdf0e10cSrcweir             static_cast< Implements >(
135*cdf0e10cSrcweir                 IMPLEMENTS_PROPERTY_SET | IMPLEMENTS_FAST_PROPERTY_SET
136*cdf0e10cSrcweir                 | IMPLEMENTS_PROPERTY_ACCESS),
137*cdf0e10cSrcweir             css::uno::Sequence< rtl::OUString >())
138*cdf0e10cSrcweir     {}
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
141*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw () { OWeakObject::acquire(); }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     virtual void SAL_CALL release() throw () { OWeakObject::release(); }
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir     virtual void SAL_CALL dispose() throw (css::uno::RuntimeException) {
148*cdf0e10cSrcweir         cppu::PropertySetMixin< css::lang::XComponent >::dispose();
149*cdf0e10cSrcweir     }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(
152*cdf0e10cSrcweir         css::uno::Reference< css::lang::XEventListener > const &)
153*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
154*cdf0e10cSrcweir     {}
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(
157*cdf0e10cSrcweir         css::uno::Reference< css::lang::XEventListener > const &)
158*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
159*cdf0e10cSrcweir     {}
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir private:
162*cdf0e10cSrcweir     Empty2(Empty2 &); // not defined
163*cdf0e10cSrcweir     void operator =(Empty2 &); // not defined
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir     virtual ~Empty2() {}
166*cdf0e10cSrcweir };
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir css::uno::Any Empty2::queryInterface(css::uno::Type const & type)
169*cdf0e10cSrcweir     throw (css::uno::RuntimeException)
170*cdf0e10cSrcweir {
171*cdf0e10cSrcweir     css::uno::Any a(OWeakObject::queryInterface(type));
172*cdf0e10cSrcweir     if (a.hasValue()) {
173*cdf0e10cSrcweir         return a;
174*cdf0e10cSrcweir     }
175*cdf0e10cSrcweir     a = cppu::queryInterface(
176*cdf0e10cSrcweir         type, static_cast< css::lang::XComponent * >(this));
177*cdf0e10cSrcweir     return a.hasValue()
178*cdf0e10cSrcweir         ? a
179*cdf0e10cSrcweir         : cppu::PropertySetMixin< css::lang::XComponent >::queryInterface(
180*cdf0e10cSrcweir             type);
181*cdf0e10cSrcweir }
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir css::uno::Sequence< rtl::OUString > sequenceThird() {
184*cdf0e10cSrcweir     css::uno::Sequence< rtl::OUString > s(1);
185*cdf0e10cSrcweir     s[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third"));
186*cdf0e10cSrcweir     return s;
187*cdf0e10cSrcweir }
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir class Full:
190*cdf0e10cSrcweir     public cppu::OWeakObject, public test::cppuhelper::propertysetmixin::XTest3,
191*cdf0e10cSrcweir     public cppu::PropertySetMixin<
192*cdf0e10cSrcweir     test::cppuhelper::propertysetmixin::XTest3 >
193*cdf0e10cSrcweir {
194*cdf0e10cSrcweir public:
195*cdf0e10cSrcweir     explicit Full(
196*cdf0e10cSrcweir         css::uno::Reference< css::uno::XComponentContext > const & context):
197*cdf0e10cSrcweir         cppu::PropertySetMixin<
198*cdf0e10cSrcweir         test::cppuhelper::propertysetmixin::XTest3 >(
199*cdf0e10cSrcweir             context,
200*cdf0e10cSrcweir             static_cast< Implements >(
201*cdf0e10cSrcweir                 IMPLEMENTS_PROPERTY_SET | IMPLEMENTS_FAST_PROPERTY_SET
202*cdf0e10cSrcweir                 | IMPLEMENTS_PROPERTY_ACCESS),
203*cdf0e10cSrcweir             sequenceThird()),
204*cdf0e10cSrcweir         m_a1(0),
205*cdf0e10cSrcweir         m_a2(
206*cdf0e10cSrcweir             css::beans::Defaulted< css::beans::Optional< sal_Int32 > >(
207*cdf0e10cSrcweir                 css::beans::Optional< sal_Int32 >(), true),
208*cdf0e10cSrcweir             false)
209*cdf0e10cSrcweir     {}
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
212*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw () { OWeakObject::acquire(); }
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     virtual void SAL_CALL release() throw () { OWeakObject::release(); }
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getFirst() throw (css::uno::RuntimeException);
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir     virtual void SAL_CALL setFirst(sal_Int32 value)
221*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     virtual
224*cdf0e10cSrcweir     css::beans::Ambiguous<
225*cdf0e10cSrcweir         css::beans::Defaulted< css::beans::Optional< sal_Int32 > > >
226*cdf0e10cSrcweir     SAL_CALL getSecond()
227*cdf0e10cSrcweir         throw (
228*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir     virtual void SAL_CALL setSecond(
231*cdf0e10cSrcweir         css::beans::Ambiguous<
232*cdf0e10cSrcweir         css::beans::Defaulted< css::beans::Optional< ::sal_Int32 > > > const &
233*cdf0e10cSrcweir         value)
234*cdf0e10cSrcweir         throw (
235*cdf0e10cSrcweir             css::beans::PropertyVetoException,
236*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getThird()
239*cdf0e10cSrcweir         throw (
240*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir     virtual void SAL_CALL setThird(sal_Int32 value)
243*cdf0e10cSrcweir         throw (
244*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getFourth()
247*cdf0e10cSrcweir         throw (
248*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir     virtual void SAL_CALL setFourth(sal_Int32 value)
251*cdf0e10cSrcweir         throw (
252*cdf0e10cSrcweir             css::beans::UnknownPropertyException, css::uno::RuntimeException);
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir private:
255*cdf0e10cSrcweir     Full(Full &); // not defined
256*cdf0e10cSrcweir     void operator =(Full &); // not defined
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir     virtual ~Full() {}
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir     osl::Mutex m_mutex;
261*cdf0e10cSrcweir     sal_Int32 m_a1;
262*cdf0e10cSrcweir     css::beans::Ambiguous<
263*cdf0e10cSrcweir         css::beans::Defaulted< css::beans::Optional< sal_Int32 > > > m_a2;
264*cdf0e10cSrcweir };
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir css::uno::Any Full::queryInterface(css::uno::Type const & type)
267*cdf0e10cSrcweir     throw (css::uno::RuntimeException)
268*cdf0e10cSrcweir {
269*cdf0e10cSrcweir     css::uno::Any a(OWeakObject::queryInterface(type));
270*cdf0e10cSrcweir     if (a.hasValue()) {
271*cdf0e10cSrcweir         return a;
272*cdf0e10cSrcweir     }
273*cdf0e10cSrcweir     a = cppu::queryInterface(
274*cdf0e10cSrcweir         type,
275*cdf0e10cSrcweir         static_cast< test::cppuhelper::propertysetmixin::XTest3 * >(this));
276*cdf0e10cSrcweir     return a.hasValue()
277*cdf0e10cSrcweir         ? a
278*cdf0e10cSrcweir         : (cppu::PropertySetMixin<
279*cdf0e10cSrcweir            test::cppuhelper::propertysetmixin::XTest3 >::queryInterface(
280*cdf0e10cSrcweir                type));
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir sal_Int32 Full::getFirst() throw (css::uno::RuntimeException) {
284*cdf0e10cSrcweir     osl::MutexGuard g(m_mutex);
285*cdf0e10cSrcweir     return m_a1;
286*cdf0e10cSrcweir }
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir void Full::setFirst(sal_Int32 value) throw (css::uno::RuntimeException) {
289*cdf0e10cSrcweir     prepareSet(
290*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("First")), css::uno::Any(),
291*cdf0e10cSrcweir         css::uno::Any(), 0);
292*cdf0e10cSrcweir     osl::MutexGuard g(m_mutex);
293*cdf0e10cSrcweir     m_a1 = value;
294*cdf0e10cSrcweir }
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir css::beans::Ambiguous<
297*cdf0e10cSrcweir     css::beans::Defaulted< css::beans::Optional< sal_Int32 > > >
298*cdf0e10cSrcweir Full::getSecond()
299*cdf0e10cSrcweir     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
300*cdf0e10cSrcweir {
301*cdf0e10cSrcweir     osl::MutexGuard g(m_mutex);
302*cdf0e10cSrcweir     return m_a2;
303*cdf0e10cSrcweir }
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir void Full::setSecond(
306*cdf0e10cSrcweir     css::beans::Ambiguous<
307*cdf0e10cSrcweir     css::beans::Defaulted< css::beans::Optional< ::sal_Int32 > > > const &
308*cdf0e10cSrcweir     value)
309*cdf0e10cSrcweir     throw (
310*cdf0e10cSrcweir         css::beans::PropertyVetoException, css::beans::UnknownPropertyException,
311*cdf0e10cSrcweir         css::uno::RuntimeException)
312*cdf0e10cSrcweir {
313*cdf0e10cSrcweir     css::uno::Any v;
314*cdf0e10cSrcweir     if (value.Value.Value.IsPresent) {
315*cdf0e10cSrcweir         v <<= value.Value.Value.Value;
316*cdf0e10cSrcweir     }
317*cdf0e10cSrcweir     BoundListeners l;
318*cdf0e10cSrcweir     prepareSet(
319*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second")), css::uno::Any(),
320*cdf0e10cSrcweir         v, &l);
321*cdf0e10cSrcweir     {
322*cdf0e10cSrcweir         osl::MutexGuard g(m_mutex);
323*cdf0e10cSrcweir         m_a2 = value;
324*cdf0e10cSrcweir     }
325*cdf0e10cSrcweir     l.notify();
326*cdf0e10cSrcweir }
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir sal_Int32 Full::getThird()
329*cdf0e10cSrcweir     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
330*cdf0e10cSrcweir {
331*cdf0e10cSrcweir     throw css::beans::UnknownPropertyException(
332*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")),
333*cdf0e10cSrcweir         static_cast< cppu::OWeakObject * >(this));
334*cdf0e10cSrcweir }
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir void Full::setThird(sal_Int32)
337*cdf0e10cSrcweir     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
338*cdf0e10cSrcweir {
339*cdf0e10cSrcweir     throw css::beans::UnknownPropertyException(
340*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")),
341*cdf0e10cSrcweir         static_cast< cppu::OWeakObject * >(this));
342*cdf0e10cSrcweir }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir sal_Int32 Full::getFourth()
345*cdf0e10cSrcweir     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
346*cdf0e10cSrcweir {
347*cdf0e10cSrcweir     throw css::beans::UnknownPropertyException(
348*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")),
349*cdf0e10cSrcweir         static_cast< cppu::OWeakObject * >(this));
350*cdf0e10cSrcweir }
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir void Full::setFourth(sal_Int32)
353*cdf0e10cSrcweir     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
354*cdf0e10cSrcweir {
355*cdf0e10cSrcweir     throw css::beans::UnknownPropertyException(
356*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")),
357*cdf0e10cSrcweir         static_cast< cppu::OWeakObject * >(this));
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir class Supplier:
361*cdf0e10cSrcweir     public cppu::WeakImplHelper1<
362*cdf0e10cSrcweir     test::cppuhelper::propertysetmixin::XSupplier >
363*cdf0e10cSrcweir {
364*cdf0e10cSrcweir public:
365*cdf0e10cSrcweir     explicit Supplier(
366*cdf0e10cSrcweir         css::uno::Reference< css::uno::XComponentContext > const & context):
367*cdf0e10cSrcweir         m_context(context) {}
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir     virtual css::uno::Reference< css::lang::XComponent > SAL_CALL getEmpty1()
370*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
371*cdf0e10cSrcweir     { return new Empty1(m_context); }
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir     virtual css::uno::Reference< css::lang::XComponent > SAL_CALL getEmpty2()
374*cdf0e10cSrcweir         throw (css::uno::RuntimeException)
375*cdf0e10cSrcweir     { return new Empty2(m_context); }
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir     virtual css::uno::Reference< test::cppuhelper::propertysetmixin::XTest3 >
378*cdf0e10cSrcweir     SAL_CALL getFull() throw (css::uno::RuntimeException)
379*cdf0e10cSrcweir     { return new Full(m_context); }
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir private:
382*cdf0e10cSrcweir     Supplier(Supplier &); // not defined
383*cdf0e10cSrcweir     void operator =(Supplier &); // not defined
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir     virtual ~Supplier() {}
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir     css::uno::Reference< css::uno::XComponentContext > m_context;
388*cdf0e10cSrcweir };
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir css::uno::Reference< css::uno::XInterface > SAL_CALL create(
391*cdf0e10cSrcweir     css::uno::Reference< css::uno::XComponentContext > const & context)
392*cdf0e10cSrcweir     SAL_THROW((css::uno::Exception))
393*cdf0e10cSrcweir {
394*cdf0e10cSrcweir     return static_cast< cppu::OWeakObject * >(new Supplier(context));
395*cdf0e10cSrcweir }
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir rtl::OUString SAL_CALL getImplementationName() {
398*cdf0e10cSrcweir     return rtl::OUString(
399*cdf0e10cSrcweir         RTL_CONSTASCII_USTRINGPARAM(
400*cdf0e10cSrcweir             "test.cppuhelper.propertysetmixin.comp.CppSupplier"));
401*cdf0e10cSrcweir }
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() {
404*cdf0e10cSrcweir     css::uno::Sequence< rtl::OUString > s(1);
405*cdf0e10cSrcweir     s[0] = rtl::OUString(
406*cdf0e10cSrcweir         RTL_CONSTASCII_USTRINGPARAM(
407*cdf0e10cSrcweir             "test.cppuhelper.propertysetmixin.CppSupplier"));
408*cdf0e10cSrcweir     return s;
409*cdf0e10cSrcweir }
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir cppu::ImplementationEntry entries[] = {
412*cdf0e10cSrcweir     { &create, &getImplementationName, &getSupportedServiceNames,
413*cdf0e10cSrcweir       &cppu::createSingleComponentFactory, 0, 0 },
414*cdf0e10cSrcweir     { 0, 0, 0, 0, 0, 0 } };
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir }
417*cdf0e10cSrcweir 
418*cdf0e10cSrcweir extern "C" void * SAL_CALL component_getFactory(
419*cdf0e10cSrcweir     char const * implName, void * serviceManager, void * registryKey)
420*cdf0e10cSrcweir {
421*cdf0e10cSrcweir     return cppu::component_getFactoryHelper(
422*cdf0e10cSrcweir         implName, serviceManager, registryKey, entries);
423*cdf0e10cSrcweir }
424*cdf0e10cSrcweir 
425*cdf0e10cSrcweir extern "C" void SAL_CALL component_getImplementationEnvironment(
426*cdf0e10cSrcweir     char const ** envTypeName, uno_Environment **)
427*cdf0e10cSrcweir {
428*cdf0e10cSrcweir     *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
429*cdf0e10cSrcweir }
430