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