1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski #include "precompiled_desktop.hxx"
25*b1cdbd2cSJim Jagielski #include "sal/config.h"
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski #include "boost/noncopyable.hpp"
28*b1cdbd2cSJim Jagielski #include "com/sun/star/awt/MessageBoxButtons.hpp"
29*b1cdbd2cSJim Jagielski #include "com/sun/star/awt/Rectangle.hpp"
30*b1cdbd2cSJim Jagielski #include "com/sun/star/awt/XMessageBox.hpp"
31*b1cdbd2cSJim Jagielski #include "com/sun/star/awt/XMessageBoxFactory.hpp"
32*b1cdbd2cSJim Jagielski #include "com/sun/star/awt/XWindowPeer.hpp"
33*b1cdbd2cSJim Jagielski #include "com/sun/star/beans/PropertyValue.hpp"
34*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/DispatchDescriptor.hpp"
35*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/XDesktop.hpp"
36*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/XDispatch.hpp"
37*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/XDispatchProvider.hpp"
38*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/XFrame.hpp"
39*b1cdbd2cSJim Jagielski #include "com/sun/star/frame/XStatusListener.hpp"
40*b1cdbd2cSJim Jagielski #include "com/sun/star/lang/XComponent.hpp"
41*b1cdbd2cSJim Jagielski #include "com/sun/star/lang/XMultiComponentFactory.hpp"
42*b1cdbd2cSJim Jagielski #include "com/sun/star/lang/XServiceInfo.hpp"
43*b1cdbd2cSJim Jagielski #include "com/sun/star/registry/XRegistryKey.hpp"
44*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/DeploymentException.hpp"
45*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/Exception.hpp"
46*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/Reference.hxx"
47*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/RuntimeException.hpp"
48*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/Sequence.hxx"
49*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/XComponentContext.hpp"
50*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/XInterface.hpp"
51*b1cdbd2cSJim Jagielski #include "com/sun/star/util/URL.hpp"
52*b1cdbd2cSJim Jagielski #include "cppuhelper/factory.hxx"
53*b1cdbd2cSJim Jagielski #include "cppuhelper/implbase2.hxx"
54*b1cdbd2cSJim Jagielski #include "cppuhelper/implementationentry.hxx"
55*b1cdbd2cSJim Jagielski #include "cppuhelper/weak.hxx"
56*b1cdbd2cSJim Jagielski #include "osl/diagnose.h"
57*b1cdbd2cSJim Jagielski #include "rtl/textenc.h"
58*b1cdbd2cSJim Jagielski #include "rtl/ustring.h"
59*b1cdbd2cSJim Jagielski #include "rtl/ustring.hxx"
60*b1cdbd2cSJim Jagielski #include "sal/types.h"
61*b1cdbd2cSJim Jagielski #include "uno/lbnames.h"
62*b1cdbd2cSJim Jagielski
63*b1cdbd2cSJim Jagielski namespace {
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski namespace css = com::sun::star;
66*b1cdbd2cSJim Jagielski
67*b1cdbd2cSJim Jagielski class Provider:
68*b1cdbd2cSJim Jagielski public cppu::WeakImplHelper2<
69*b1cdbd2cSJim Jagielski css::lang::XServiceInfo, css::frame::XDispatchProvider >,
70*b1cdbd2cSJim Jagielski private boost::noncopyable
71*b1cdbd2cSJim Jagielski {
72*b1cdbd2cSJim Jagielski public:
static_create(css::uno::Reference<css::uno::XComponentContext> const & xContext)73*b1cdbd2cSJim Jagielski static css::uno::Reference< css::uno::XInterface > SAL_CALL static_create(
74*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > const & xContext)
75*b1cdbd2cSJim Jagielski SAL_THROW((css::uno::Exception))
76*b1cdbd2cSJim Jagielski { return static_cast< cppu::OWeakObject * >(new Provider(xContext)); }
77*b1cdbd2cSJim Jagielski
78*b1cdbd2cSJim Jagielski static rtl::OUString SAL_CALL static_getImplementationName();
79*b1cdbd2cSJim Jagielski
80*b1cdbd2cSJim Jagielski static css::uno::Sequence< rtl::OUString > SAL_CALL
81*b1cdbd2cSJim Jagielski static_getSupportedServiceNames();
82*b1cdbd2cSJim Jagielski
83*b1cdbd2cSJim Jagielski private:
Provider(css::uno::Reference<css::uno::XComponentContext> const & context)84*b1cdbd2cSJim Jagielski Provider(
85*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > const & context):
86*b1cdbd2cSJim Jagielski context_(context) { OSL_ASSERT(context.is()); }
87*b1cdbd2cSJim Jagielski
~Provider()88*b1cdbd2cSJim Jagielski virtual ~Provider() {}
89*b1cdbd2cSJim Jagielski
getImplementationName()90*b1cdbd2cSJim Jagielski virtual rtl::OUString SAL_CALL getImplementationName()
91*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
92*b1cdbd2cSJim Jagielski { return static_getImplementationName(); }
93*b1cdbd2cSJim Jagielski
supportsService(rtl::OUString const & ServiceName)94*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
95*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
96*b1cdbd2cSJim Jagielski { return ServiceName == getSupportedServiceNames()[0]; } //TODO
97*b1cdbd2cSJim Jagielski
98*b1cdbd2cSJim Jagielski virtual css::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames()99*b1cdbd2cSJim Jagielski getSupportedServiceNames() throw (css::uno::RuntimeException)
100*b1cdbd2cSJim Jagielski { return static_getSupportedServiceNames(); }
101*b1cdbd2cSJim Jagielski
102*b1cdbd2cSJim Jagielski virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(
103*b1cdbd2cSJim Jagielski css::util::URL const &, rtl::OUString const &, sal_Int32)
104*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException);
105*b1cdbd2cSJim Jagielski
106*b1cdbd2cSJim Jagielski virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > >
107*b1cdbd2cSJim Jagielski SAL_CALL queryDispatches(
108*b1cdbd2cSJim Jagielski css::uno::Sequence< css::frame::DispatchDescriptor > const & Requests)
109*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException);
110*b1cdbd2cSJim Jagielski
111*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > context_;
112*b1cdbd2cSJim Jagielski };
113*b1cdbd2cSJim Jagielski
static_getImplementationName()114*b1cdbd2cSJim Jagielski rtl::OUString Provider::static_getImplementationName() {
115*b1cdbd2cSJim Jagielski return rtl::OUString(
116*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
117*b1cdbd2cSJim Jagielski "com.sun.star.comp.test.deployment.active_native"));
118*b1cdbd2cSJim Jagielski }
119*b1cdbd2cSJim Jagielski
static_getSupportedServiceNames()120*b1cdbd2cSJim Jagielski css::uno::Sequence< rtl::OUString > Provider::static_getSupportedServiceNames()
121*b1cdbd2cSJim Jagielski {
122*b1cdbd2cSJim Jagielski rtl::OUString name(
123*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
124*b1cdbd2cSJim Jagielski "com.sun.star.test.deployment.active_native"));
125*b1cdbd2cSJim Jagielski return css::uno::Sequence< rtl::OUString >(&name, 1);
126*b1cdbd2cSJim Jagielski }
127*b1cdbd2cSJim Jagielski
queryDispatch(css::util::URL const &,rtl::OUString const &,sal_Int32)128*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XDispatch > Provider::queryDispatch(
129*b1cdbd2cSJim Jagielski css::util::URL const &, rtl::OUString const &, sal_Int32)
130*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
131*b1cdbd2cSJim Jagielski {
132*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XDispatch > dispatch;
133*b1cdbd2cSJim Jagielski if (!(context_->getValueByName(
134*b1cdbd2cSJim Jagielski rtl::OUString(
135*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
136*b1cdbd2cSJim Jagielski "/singletons/com.sun.star.test.deployment."
137*b1cdbd2cSJim Jagielski "active_native_singleton"))) >>=
138*b1cdbd2cSJim Jagielski dispatch) ||
139*b1cdbd2cSJim Jagielski !dispatch.is())
140*b1cdbd2cSJim Jagielski {
141*b1cdbd2cSJim Jagielski throw css::uno::DeploymentException(
142*b1cdbd2cSJim Jagielski rtl::OUString(
143*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
144*b1cdbd2cSJim Jagielski "component context fails to supply singleton"
145*b1cdbd2cSJim Jagielski " com.sun.star.test.deployment.active_native_singleton of"
146*b1cdbd2cSJim Jagielski " type com.sun.star.frame.XDispatch")),
147*b1cdbd2cSJim Jagielski context_);
148*b1cdbd2cSJim Jagielski }
149*b1cdbd2cSJim Jagielski return dispatch;
150*b1cdbd2cSJim Jagielski }
151*b1cdbd2cSJim Jagielski
152*b1cdbd2cSJim Jagielski css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > >
queryDispatches(css::uno::Sequence<css::frame::DispatchDescriptor> const & Requests)153*b1cdbd2cSJim Jagielski Provider::queryDispatches(
154*b1cdbd2cSJim Jagielski css::uno::Sequence< css::frame::DispatchDescriptor > const & Requests)
155*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
156*b1cdbd2cSJim Jagielski {
157*b1cdbd2cSJim Jagielski css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > s(
158*b1cdbd2cSJim Jagielski Requests.getLength());
159*b1cdbd2cSJim Jagielski for (sal_Int32 i = 0; i < s.getLength(); ++i) {
160*b1cdbd2cSJim Jagielski s[i] = queryDispatch(
161*b1cdbd2cSJim Jagielski Requests[i].FeatureURL, Requests[i].FrameName,
162*b1cdbd2cSJim Jagielski Requests[i].SearchFlags);
163*b1cdbd2cSJim Jagielski }
164*b1cdbd2cSJim Jagielski return s;
165*b1cdbd2cSJim Jagielski }
166*b1cdbd2cSJim Jagielski
167*b1cdbd2cSJim Jagielski class Dispatch:
168*b1cdbd2cSJim Jagielski public cppu::WeakImplHelper2<
169*b1cdbd2cSJim Jagielski css::lang::XServiceInfo, css::frame::XDispatch >,
170*b1cdbd2cSJim Jagielski private boost::noncopyable
171*b1cdbd2cSJim Jagielski {
172*b1cdbd2cSJim Jagielski public:
static_create(css::uno::Reference<css::uno::XComponentContext> const & xContext)173*b1cdbd2cSJim Jagielski static css::uno::Reference< css::uno::XInterface > SAL_CALL static_create(
174*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > const & xContext)
175*b1cdbd2cSJim Jagielski SAL_THROW((css::uno::Exception))
176*b1cdbd2cSJim Jagielski { return static_cast< cppu::OWeakObject * >(new Dispatch(xContext)); }
177*b1cdbd2cSJim Jagielski
178*b1cdbd2cSJim Jagielski static rtl::OUString SAL_CALL static_getImplementationName();
179*b1cdbd2cSJim Jagielski
180*b1cdbd2cSJim Jagielski static css::uno::Sequence< rtl::OUString > SAL_CALL
static_getSupportedServiceNames()181*b1cdbd2cSJim Jagielski static_getSupportedServiceNames()
182*b1cdbd2cSJim Jagielski { return css::uno::Sequence< rtl::OUString >(); }
183*b1cdbd2cSJim Jagielski
184*b1cdbd2cSJim Jagielski private:
Dispatch(css::uno::Reference<css::uno::XComponentContext> const & context)185*b1cdbd2cSJim Jagielski Dispatch(
186*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > const & context):
187*b1cdbd2cSJim Jagielski context_(context) { OSL_ASSERT(context.is()); }
188*b1cdbd2cSJim Jagielski
~Dispatch()189*b1cdbd2cSJim Jagielski virtual ~Dispatch() {}
190*b1cdbd2cSJim Jagielski
getImplementationName()191*b1cdbd2cSJim Jagielski virtual rtl::OUString SAL_CALL getImplementationName()
192*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
193*b1cdbd2cSJim Jagielski { return static_getImplementationName(); }
194*b1cdbd2cSJim Jagielski
supportsService(rtl::OUString const &)195*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL supportsService(rtl::OUString const &)
196*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
197*b1cdbd2cSJim Jagielski { return false; } //TODO
198*b1cdbd2cSJim Jagielski
199*b1cdbd2cSJim Jagielski virtual css::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames()200*b1cdbd2cSJim Jagielski getSupportedServiceNames() throw (css::uno::RuntimeException)
201*b1cdbd2cSJim Jagielski { return static_getSupportedServiceNames(); }
202*b1cdbd2cSJim Jagielski
203*b1cdbd2cSJim Jagielski virtual void SAL_CALL dispatch(
204*b1cdbd2cSJim Jagielski css::util::URL const &,
205*b1cdbd2cSJim Jagielski css::uno::Sequence< css::beans::PropertyValue > const &)
206*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException);
207*b1cdbd2cSJim Jagielski
addStatusListener(css::uno::Reference<css::frame::XStatusListener> const &,css::util::URL const &)208*b1cdbd2cSJim Jagielski virtual void SAL_CALL addStatusListener(
209*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XStatusListener > const &,
210*b1cdbd2cSJim Jagielski css::util::URL const &)
211*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
212*b1cdbd2cSJim Jagielski {}
213*b1cdbd2cSJim Jagielski
removeStatusListener(css::uno::Reference<css::frame::XStatusListener> const &,css::util::URL const &)214*b1cdbd2cSJim Jagielski virtual void SAL_CALL removeStatusListener(
215*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XStatusListener > const &,
216*b1cdbd2cSJim Jagielski css::util::URL const &)
217*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
218*b1cdbd2cSJim Jagielski {}
219*b1cdbd2cSJim Jagielski
220*b1cdbd2cSJim Jagielski css::uno::Reference< css::uno::XComponentContext > context_;
221*b1cdbd2cSJim Jagielski };
222*b1cdbd2cSJim Jagielski
static_getImplementationName()223*b1cdbd2cSJim Jagielski rtl::OUString Dispatch::static_getImplementationName() {
224*b1cdbd2cSJim Jagielski return rtl::OUString(
225*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
226*b1cdbd2cSJim Jagielski "com.sun.star.comp.test.deployment.active_native_singleton"));
227*b1cdbd2cSJim Jagielski }
228*b1cdbd2cSJim Jagielski
dispatch(css::util::URL const &,css::uno::Sequence<css::beans::PropertyValue> const &)229*b1cdbd2cSJim Jagielski void Dispatch::dispatch(
230*b1cdbd2cSJim Jagielski css::util::URL const &,
231*b1cdbd2cSJim Jagielski css::uno::Sequence< css::beans::PropertyValue > const &)
232*b1cdbd2cSJim Jagielski throw (css::uno::RuntimeException)
233*b1cdbd2cSJim Jagielski {
234*b1cdbd2cSJim Jagielski css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
235*b1cdbd2cSJim Jagielski context_->getServiceManager(), css::uno::UNO_SET_THROW);
236*b1cdbd2cSJim Jagielski css::uno::Reference< css::awt::XMessageBox > box(
237*b1cdbd2cSJim Jagielski css::uno::Reference< css::awt::XMessageBoxFactory >(
238*b1cdbd2cSJim Jagielski smgr->createInstanceWithContext(
239*b1cdbd2cSJim Jagielski rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
240*b1cdbd2cSJim Jagielski "com.sun.star.awt.Toolkit")), context_),
241*b1cdbd2cSJim Jagielski css::uno::UNO_QUERY_THROW)->createMessageBox(
242*b1cdbd2cSJim Jagielski css::uno::Reference< css::awt::XWindowPeer >(
243*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XFrame >(
244*b1cdbd2cSJim Jagielski css::uno::Reference< css::frame::XDesktop >(
245*b1cdbd2cSJim Jagielski smgr->createInstanceWithContext(
246*b1cdbd2cSJim Jagielski rtl::OUString(
247*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
248*b1cdbd2cSJim Jagielski "com.sun.star.frame.Desktop")),
249*b1cdbd2cSJim Jagielski context_),
250*b1cdbd2cSJim Jagielski css::uno::UNO_QUERY_THROW)->getCurrentFrame(),
251*b1cdbd2cSJim Jagielski css::uno::UNO_SET_THROW)->getComponentWindow(),
252*b1cdbd2cSJim Jagielski css::uno::UNO_QUERY_THROW),
253*b1cdbd2cSJim Jagielski css::awt::MessageBoxType_INFOBOX,
254*b1cdbd2cSJim Jagielski css::awt::MessageBoxButtons::BUTTONS_OK,
255*b1cdbd2cSJim Jagielski rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("active")),
256*b1cdbd2cSJim Jagielski rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("native"))),
257*b1cdbd2cSJim Jagielski css::uno::UNO_SET_THROW);
258*b1cdbd2cSJim Jagielski box->execute();
259*b1cdbd2cSJim Jagielski css::uno::Reference< css::lang::XComponent >(
260*b1cdbd2cSJim Jagielski box, css::uno::UNO_QUERY_THROW)->dispose();
261*b1cdbd2cSJim Jagielski }
262*b1cdbd2cSJim Jagielski
263*b1cdbd2cSJim Jagielski static cppu::ImplementationEntry const services[] = {
264*b1cdbd2cSJim Jagielski { &Provider::static_create, &Provider::static_getImplementationName,
265*b1cdbd2cSJim Jagielski &Provider::static_getSupportedServiceNames,
266*b1cdbd2cSJim Jagielski &cppu::createSingleComponentFactory, 0, 0 },
267*b1cdbd2cSJim Jagielski { &Dispatch::static_create, &Dispatch::static_getImplementationName,
268*b1cdbd2cSJim Jagielski &Dispatch::static_getSupportedServiceNames,
269*b1cdbd2cSJim Jagielski &cppu::createSingleComponentFactory, 0, 0 },
270*b1cdbd2cSJim Jagielski { 0, 0, 0, 0, 0, 0 }
271*b1cdbd2cSJim Jagielski };
272*b1cdbd2cSJim Jagielski
273*b1cdbd2cSJim Jagielski }
274*b1cdbd2cSJim Jagielski
component_getFactory(char const * pImplName,void * pServiceManager,void * pRegistryKey)275*b1cdbd2cSJim Jagielski extern "C" void * SAL_CALL component_getFactory(
276*b1cdbd2cSJim Jagielski char const * pImplName, void * pServiceManager, void * pRegistryKey)
277*b1cdbd2cSJim Jagielski {
278*b1cdbd2cSJim Jagielski return cppu::component_getFactoryHelper(
279*b1cdbd2cSJim Jagielski pImplName, pServiceManager, pRegistryKey, services);
280*b1cdbd2cSJim Jagielski }
281*b1cdbd2cSJim Jagielski
component_getImplementationEnvironment(char const ** ppEnvTypeName,uno_Environment **)282*b1cdbd2cSJim Jagielski extern "C" void SAL_CALL component_getImplementationEnvironment(
283*b1cdbd2cSJim Jagielski char const ** ppEnvTypeName, uno_Environment **)
284*b1cdbd2cSJim Jagielski {
285*b1cdbd2cSJim Jagielski *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
286*b1cdbd2cSJim Jagielski }
287*b1cdbd2cSJim Jagielski
component_writeInfo(void * pServiceManager,void * pRegistryKey)288*b1cdbd2cSJim Jagielski extern "C" sal_Bool SAL_CALL component_writeInfo(
289*b1cdbd2cSJim Jagielski void * pServiceManager, void * pRegistryKey)
290*b1cdbd2cSJim Jagielski {
291*b1cdbd2cSJim Jagielski if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) {
292*b1cdbd2cSJim Jagielski return false;
293*b1cdbd2cSJim Jagielski }
294*b1cdbd2cSJim Jagielski try {
295*b1cdbd2cSJim Jagielski css::uno::Reference< css::registry::XRegistryKey >(
296*b1cdbd2cSJim Jagielski (css::uno::Reference< css::registry::XRegistryKey >(
297*b1cdbd2cSJim Jagielski static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
298*b1cdbd2cSJim Jagielski createKey(
299*b1cdbd2cSJim Jagielski rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
300*b1cdbd2cSJim Jagielski Dispatch::static_getImplementationName() +
301*b1cdbd2cSJim Jagielski rtl::OUString(
302*b1cdbd2cSJim Jagielski RTL_CONSTASCII_USTRINGPARAM(
303*b1cdbd2cSJim Jagielski "/UNO/SINGLETONS/com.sun.star.test.deployment."
304*b1cdbd2cSJim Jagielski "active_native_singleton")))),
305*b1cdbd2cSJim Jagielski css::uno::UNO_SET_THROW)->
306*b1cdbd2cSJim Jagielski setStringValue(Dispatch::static_getImplementationName());
307*b1cdbd2cSJim Jagielski } catch (css::uno::Exception & e) {
308*b1cdbd2cSJim Jagielski (void) e;
309*b1cdbd2cSJim Jagielski OSL_TRACE(
310*b1cdbd2cSJim Jagielski "active_native component_writeInfo exception: %s",
311*b1cdbd2cSJim Jagielski rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
312*b1cdbd2cSJim Jagielski return false;
313*b1cdbd2cSJim Jagielski }
314*b1cdbd2cSJim Jagielski return true;
315*b1cdbd2cSJim Jagielski }
316