1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sal/config.h"
24 #include "boost/noncopyable.hpp"
25 #include "com/sun/star/beans/NamedValue.hpp"
26 #include "com/sun/star/beans/Property.hpp"
27 #include "com/sun/star/beans/XProperty.hpp"
28 #include "com/sun/star/container/NoSuchElementException.hpp"
29 #include "com/sun/star/container/XHierarchicalNameAccess.hpp"
30 #include "com/sun/star/container/XNamed.hpp"
31 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
32 #include "com/sun/star/lang/XServiceInfo.hpp"
33 #include "com/sun/star/registry/InvalidRegistryException.hpp"
34 #include "com/sun/star/registry/InvalidValueException.hpp"
35 #include "com/sun/star/registry/MergeConflictException.hpp"
36 #include "com/sun/star/registry/RegistryKeyType.hpp"
37 #include "com/sun/star/registry/RegistryValueType.hpp"
38 #include "com/sun/star/registry/XRegistryKey.hpp"
39 #include "com/sun/star/registry/XSimpleRegistry.hpp"
40 #include "com/sun/star/uno/Any.hxx"
41 #include "com/sun/star/uno/DeploymentException.hpp"
42 #include "com/sun/star/uno/Exception.hpp"
43 #include "com/sun/star/uno/Reference.hxx"
44 #include "com/sun/star/uno/RuntimeException.hpp"
45 #include "com/sun/star/uno/Sequence.hxx"
46 #include "com/sun/star/uno/Type.hxx"
47 #include "com/sun/star/uno/TypeClass.hpp"
48 #include "com/sun/star/uno/XComponentContext.hpp"
49 #include "com/sun/star/uno/XInterface.hpp"
50 #include "com/sun/star/util/XFlushable.hpp"
51 #include "cppu/unotype.hxx"
52 #include "cppuhelper/implbase1.hxx"
53 #include "cppuhelper/implbase3.hxx"
54 #include "cppuhelper/weak.hxx"
55 #include "osl/mutex.hxx"
56 #include "rtl/ustring.h"
57 #include "rtl/ustring.hxx"
58 #include "sal/types.h"
60 #include "configurationregistry.hxx"
62 namespace com
{ namespace sun
{ namespace star
{ namespace util
{
66 namespace configmgr
{ namespace configuration_registry
{
71 public cppu::WeakImplHelper3
<
72 css::lang::XServiceInfo
, css::registry::XSimpleRegistry
,
73 css::util::XFlushable
>,
74 private boost::noncopyable
77 Service(css::uno::Reference
< css::uno::XComponentContext
> const & context
);
82 virtual OUString SAL_CALL
getImplementationName()
83 throw (css::uno::RuntimeException
)
84 { return configuration_registry::getImplementationName(); }
86 virtual sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
)
87 throw (css::uno::RuntimeException
)
88 { return ServiceName
== getSupportedServiceNames()[0]; } //TODO
90 virtual css::uno::Sequence
< OUString
> SAL_CALL
91 getSupportedServiceNames() throw (css::uno::RuntimeException
)
92 { return configuration_registry::getSupportedServiceNames(); }
94 virtual OUString SAL_CALL
getURL() throw (css::uno::RuntimeException
);
96 virtual void SAL_CALL
open(
97 OUString
const & rURL
, sal_Bool bReadOnly
, sal_Bool
)
99 css::registry::InvalidRegistryException
,
100 css::uno::RuntimeException
);
102 virtual sal_Bool SAL_CALL
isValid() throw (css::uno::RuntimeException
);
104 virtual void SAL_CALL
close()
106 css::registry::InvalidRegistryException
,
107 css::uno::RuntimeException
);
109 virtual void SAL_CALL
destroy()
111 css::registry::InvalidRegistryException
,
112 css::uno::RuntimeException
);
114 virtual css::uno::Reference
< css::registry::XRegistryKey
> SAL_CALL
117 css::registry::InvalidRegistryException
,
118 css::uno::RuntimeException
);
120 virtual sal_Bool SAL_CALL
isReadOnly() throw (css::uno::RuntimeException
);
122 virtual void SAL_CALL
mergeKey(OUString
const &, OUString
const &)
124 css::registry::InvalidRegistryException
,
125 css::registry::MergeConflictException
, css::uno::RuntimeException
);
127 virtual void SAL_CALL
flush() throw (css::uno::RuntimeException
);
129 virtual void SAL_CALL
addFlushListener(
130 css::uno::Reference
< css::util::XFlushListener
> const &)
131 throw (css::uno::RuntimeException
);
133 virtual void SAL_CALL
removeFlushListener(
134 css::uno::Reference
< css::util::XFlushListener
> const &)
135 throw (css::uno::RuntimeException
);
139 void checkValid_RuntimeException();
143 css::uno::Reference
< css::lang::XMultiServiceFactory
> provider_
;
145 css::uno::Reference
< css::uno::XInterface
> access_
;
149 friend class RegistryKey
;
153 public cppu::WeakImplHelper1
< css::registry::XRegistryKey
>,
154 private boost::noncopyable
157 RegistryKey(Service
& service
, css::uno::Any
const & value
):
158 service_(service
), value_(value
) {}
161 virtual ~RegistryKey() {}
163 virtual OUString SAL_CALL
getKeyName()
164 throw (css::uno::RuntimeException
);
166 virtual sal_Bool SAL_CALL
isReadOnly()
168 css::registry::InvalidRegistryException
,
169 css::uno::RuntimeException
);
171 virtual sal_Bool SAL_CALL
isValid() throw (css::uno::RuntimeException
);
173 virtual css::registry::RegistryKeyType SAL_CALL
getKeyType(
176 css::registry::InvalidRegistryException
,
177 css::uno::RuntimeException
);
179 virtual css::registry::RegistryValueType SAL_CALL
getValueType()
181 css::registry::InvalidRegistryException
,
182 css::uno::RuntimeException
);
184 virtual sal_Int32 SAL_CALL
getLongValue()
186 css::registry::InvalidRegistryException
,
187 css::registry::InvalidValueException
, css::uno::RuntimeException
);
189 virtual void SAL_CALL
setLongValue(sal_Int32
)
191 css::registry::InvalidRegistryException
,
192 css::uno::RuntimeException
);
194 virtual css::uno::Sequence
< sal_Int32
> SAL_CALL
getLongListValue()
196 css::registry::InvalidRegistryException
,
197 css::registry::InvalidValueException
, css::uno::RuntimeException
);
199 virtual void SAL_CALL
setLongListValue(
200 css::uno::Sequence
< sal_Int32
> const &)
202 css::registry::InvalidRegistryException
,
203 css::uno::RuntimeException
);
205 virtual OUString SAL_CALL
getAsciiValue()
207 css::registry::InvalidRegistryException
,
208 css::registry::InvalidValueException
, css::uno::RuntimeException
);
210 virtual void SAL_CALL
setAsciiValue(OUString
const &)
212 css::registry::InvalidRegistryException
,
213 css::uno::RuntimeException
);
215 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAsciiListValue()
217 css::registry::InvalidRegistryException
,
218 css::registry::InvalidValueException
, css::uno::RuntimeException
);
220 virtual void SAL_CALL
setAsciiListValue(
221 css::uno::Sequence
< OUString
> const &)
223 css::registry::InvalidRegistryException
,
224 css::uno::RuntimeException
);
226 virtual OUString SAL_CALL
getStringValue()
228 css::registry::InvalidRegistryException
,
229 css::registry::InvalidValueException
, css::uno::RuntimeException
);
231 virtual void SAL_CALL
setStringValue(OUString
const &)
233 css::registry::InvalidRegistryException
,
234 css::uno::RuntimeException
);
236 virtual css::uno::Sequence
< OUString
> SAL_CALL
getStringListValue()
238 css::registry::InvalidRegistryException
,
239 css::registry::InvalidValueException
, css::uno::RuntimeException
);
241 virtual void SAL_CALL
setStringListValue(
242 css::uno::Sequence
< OUString
> const &)
244 css::registry::InvalidRegistryException
,
245 css::uno::RuntimeException
);
247 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getBinaryValue()
249 css::registry::InvalidRegistryException
,
250 css::registry::InvalidValueException
, css::uno::RuntimeException
);
252 virtual void SAL_CALL
setBinaryValue(css::uno::Sequence
< sal_Int8
> const &)
254 css::registry::InvalidRegistryException
,
255 css::uno::RuntimeException
);
257 virtual css::uno::Reference
< css::registry::XRegistryKey
> SAL_CALL
openKey(
258 OUString
const & aKeyName
)
260 css::registry::InvalidRegistryException
,
261 css::uno::RuntimeException
);
263 virtual css::uno::Reference
< css::registry::XRegistryKey
> SAL_CALL
264 createKey(OUString
const &)
266 css::registry::InvalidRegistryException
,
267 css::uno::RuntimeException
);
269 virtual void SAL_CALL
closeKey()
271 css::registry::InvalidRegistryException
,
272 css::uno::RuntimeException
);
274 virtual void SAL_CALL
deleteKey(OUString
const &)
276 css::registry::InvalidRegistryException
,
277 css::uno::RuntimeException
);
280 css::uno::Sequence
< css::uno::Reference
< css::registry::XRegistryKey
> >
283 css::registry::InvalidRegistryException
,
284 css::uno::RuntimeException
);
286 virtual css::uno::Sequence
< OUString
> SAL_CALL
getKeyNames()
288 css::registry::InvalidRegistryException
,
289 css::uno::RuntimeException
);
291 virtual sal_Bool SAL_CALL
createLink(
292 OUString
const &, OUString
const &)
294 css::registry::InvalidRegistryException
,
295 css::uno::RuntimeException
);
297 virtual void SAL_CALL
deleteLink(OUString
const &)
299 css::registry::InvalidRegistryException
,
300 css::uno::RuntimeException
);
302 virtual OUString SAL_CALL
getLinkTarget(OUString
const &)
304 css::registry::InvalidRegistryException
,
305 css::uno::RuntimeException
);
307 virtual OUString SAL_CALL
getResolvedName(
308 OUString
const & aKeyName
)
310 css::registry::InvalidRegistryException
,
311 css::uno::RuntimeException
);
314 css::uno::Any value_
;
318 css::uno::Reference
< css::uno::XComponentContext
> const & context
)
320 assert(context
.is());
322 provider_
= css::uno::Reference
< css::lang::XMultiServiceFactory
>(
323 context
->getServiceManager()->createInstanceWithContext(
324 OUString("com.sun.star.configuration.DefaultProvider"),
326 css::uno::UNO_QUERY_THROW
);
327 } catch (css::uno::RuntimeException
&) {
329 } catch (css::uno::Exception
& e
) {
330 throw css::uno::DeploymentException(
331 (OUString("component context fails to supply service"
332 " com.sun.star.configuration.DefaultProvider of type"
333 " com.sun.star.lang.XMultiServiceFactory: ") +
339 OUString
Service::getURL() throw (css::uno::RuntimeException
) {
340 osl::MutexGuard
g(mutex_
);
341 checkValid_RuntimeException();
345 void Service::open(OUString
const & rURL
, sal_Bool bReadOnly
, sal_Bool
)
346 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
349 osl::MutexGuard
g(mutex_
);
353 css::uno::Sequence
< css::uno::Any
> args(1);
354 args
[0] <<= css::beans::NamedValue(
355 OUString("nodepath"),
356 css::uno::makeAny(rURL
));
358 access_
= provider_
->createInstanceWithArguments(
360 ? OUString("com.sun.star.configuration.ConfigurationAccess")
361 : OUString("com.sun.star.configuration.ConfigurationUpdateAccess")),
363 } catch (css::uno::RuntimeException
&) {
365 } catch (css::uno::Exception
& e
) {
366 throw css::uno::RuntimeException(
367 (OUString("com.sun.star.configuration.ConfigurationRegistry: open"
370 static_cast< cppu::OWeakObject
* >(this));
373 readOnly_
= bReadOnly
;
376 sal_Bool
Service::isValid() throw (css::uno::RuntimeException
) {
377 osl::MutexGuard
g(mutex_
);
381 void Service::close()
382 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
384 osl::MutexGuard
g(mutex_
);
389 void Service::destroy()
390 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
392 throw css::uno::RuntimeException(
393 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
395 static_cast< cppu::OWeakObject
* >(this));
398 css::uno::Reference
< css::registry::XRegistryKey
> Service::getRootKey()
399 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
401 osl::MutexGuard
g(mutex_
);
403 return new RegistryKey(*this, css::uno::makeAny(access_
));
406 sal_Bool
Service::isReadOnly() throw (css::uno::RuntimeException
) {
407 osl::MutexGuard
g(mutex_
);
408 checkValid_RuntimeException();
412 void Service::mergeKey(OUString
const &, OUString
const &)
414 css::registry::InvalidRegistryException
,
415 css::registry::MergeConflictException
, css::uno::RuntimeException
)
417 throw css::uno::RuntimeException(
418 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
420 static_cast< cppu::OWeakObject
* >(this));
423 void Service::flush() throw (css::uno::RuntimeException
)
425 throw css::uno::RuntimeException(
426 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
428 static_cast< cppu::OWeakObject
* >(this));
431 void Service::addFlushListener(
432 css::uno::Reference
< css::util::XFlushListener
> const &)
433 throw (css::uno::RuntimeException
)
435 throw css::uno::RuntimeException(
436 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
438 static_cast< cppu::OWeakObject
* >(this));
441 void Service::removeFlushListener(
442 css::uno::Reference
< css::util::XFlushListener
> const &)
443 throw (css::uno::RuntimeException
)
445 throw css::uno::RuntimeException(
446 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
448 static_cast< cppu::OWeakObject
* >(this));
451 void Service::checkValid() {
453 throw css::registry::InvalidRegistryException(
454 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
456 static_cast< cppu::OWeakObject
* >(this));
460 void Service::checkValid_RuntimeException() {
462 throw css::uno::RuntimeException(
463 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
465 static_cast< cppu::OWeakObject
* >(this));
469 void Service::doClose() {
473 OUString
RegistryKey::getKeyName() throw (css::uno::RuntimeException
) {
474 osl::MutexGuard
g(service_
.mutex_
);
475 service_
.checkValid_RuntimeException();
476 css::uno::Reference
< css::container::XNamed
> named
;
477 if (value_
>>= named
) {
478 return named
->getName();
480 throw css::uno::RuntimeException(
481 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
483 static_cast< cppu::OWeakObject
* >(this));
486 sal_Bool
RegistryKey::isReadOnly()
487 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
489 osl::MutexGuard
g(service_
.mutex_
);
490 service_
.checkValid_RuntimeException();
491 return service_
.readOnly_
; //TODO: read-only sub-nodes in update access?
494 sal_Bool
RegistryKey::isValid() throw (css::uno::RuntimeException
) {
495 return service_
.isValid();
498 css::registry::RegistryKeyType
RegistryKey::getKeyType(OUString
const &)
499 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
501 osl::MutexGuard
g(service_
.mutex_
);
502 service_
.checkValid();
503 return css::registry::RegistryKeyType_KEY
;
506 css::registry::RegistryValueType
RegistryKey::getValueType()
507 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
509 osl::MutexGuard
g(service_
.mutex_
);
510 service_
.checkValid();
511 css::uno::Type
t(value_
.getValueType());
512 switch (t
.getTypeClass()) {
513 case css::uno::TypeClass_LONG
:
514 return css::registry::RegistryValueType_LONG
;
515 case css::uno::TypeClass_STRING
:
516 return css::registry::RegistryValueType_STRING
;
517 case css::uno::TypeClass_SEQUENCE
:
518 if (t
== cppu::UnoType
< css::uno::Sequence
< sal_Int8
> >::get()) {
519 return css::registry::RegistryValueType_BINARY
;
520 } else if (t
== cppu::UnoType
< css::uno::Sequence
< sal_Int32
> >::get())
522 return css::registry::RegistryValueType_LONGLIST
;
524 cppu::UnoType
< css::uno::Sequence
< OUString
> >::get())
526 return css::registry::RegistryValueType_STRINGLIST
;
530 return css::registry::RegistryValueType_NOT_DEFINED
;
534 sal_Int32
RegistryKey::getLongValue()
536 css::registry::InvalidRegistryException
,
537 css::registry::InvalidValueException
, css::uno::RuntimeException
)
539 osl::MutexGuard
g(service_
.mutex_
);
540 service_
.checkValid();
545 throw css::registry::InvalidValueException(
546 OUString("com.sun.star.configuration.ConfigurationRegistry"),
547 static_cast< cppu::OWeakObject
* >(this));
550 void RegistryKey::setLongValue(sal_Int32
)
551 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
553 throw css::uno::RuntimeException(
554 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
556 static_cast< cppu::OWeakObject
* >(this));
559 css::uno::Sequence
< sal_Int32
> RegistryKey::getLongListValue()
561 css::registry::InvalidRegistryException
,
562 css::registry::InvalidValueException
, css::uno::RuntimeException
)
564 osl::MutexGuard
g(service_
.mutex_
);
565 service_
.checkValid();
566 css::uno::Sequence
< sal_Int32
> v
;
570 throw css::registry::InvalidValueException(
571 OUString("com.sun.star.configuration.ConfigurationRegistry"),
572 static_cast< cppu::OWeakObject
* >(this));
575 void RegistryKey::setLongListValue(css::uno::Sequence
< sal_Int32
> const &)
576 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
578 throw css::uno::RuntimeException(
579 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
581 static_cast< cppu::OWeakObject
* >(this));
584 OUString
RegistryKey::getAsciiValue()
586 css::registry::InvalidRegistryException
,
587 css::registry::InvalidValueException
, css::uno::RuntimeException
)
589 osl::MutexGuard
g(service_
.mutex_
);
590 service_
.checkValid();
595 throw css::registry::InvalidValueException(
596 OUString("com.sun.star.configuration.ConfigurationRegistry"),
597 static_cast< cppu::OWeakObject
* >(this));
600 void RegistryKey::setAsciiValue(OUString
const &)
601 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
603 throw css::uno::RuntimeException(
604 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
606 static_cast< cppu::OWeakObject
* >(this));
609 css::uno::Sequence
< OUString
> RegistryKey::getAsciiListValue()
611 css::registry::InvalidRegistryException
,
612 css::registry::InvalidValueException
, css::uno::RuntimeException
)
614 osl::MutexGuard
g(service_
.mutex_
);
615 service_
.checkValid();
616 css::uno::Sequence
< OUString
> v
;
620 throw css::registry::InvalidValueException(
621 OUString("com.sun.star.configuration.ConfigurationRegistry"),
622 static_cast< cppu::OWeakObject
* >(this));
625 void RegistryKey::setAsciiListValue(css::uno::Sequence
< OUString
> const &)
626 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
628 throw css::uno::RuntimeException(
629 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
631 static_cast< cppu::OWeakObject
* >(this));
634 OUString
RegistryKey::getStringValue()
636 css::registry::InvalidRegistryException
,
637 css::registry::InvalidValueException
, css::uno::RuntimeException
)
639 osl::MutexGuard
g(service_
.mutex_
);
640 service_
.checkValid();
645 throw css::registry::InvalidValueException(
646 OUString("com.sun.star.configuration.ConfigurationRegistry"),
647 static_cast< cppu::OWeakObject
* >(this));
650 void RegistryKey::setStringValue(OUString
const &)
651 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
653 throw css::uno::RuntimeException(
654 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
656 static_cast< cppu::OWeakObject
* >(this));
659 css::uno::Sequence
< OUString
> RegistryKey::getStringListValue()
661 css::registry::InvalidRegistryException
,
662 css::registry::InvalidValueException
, css::uno::RuntimeException
)
664 osl::MutexGuard
g(service_
.mutex_
);
665 service_
.checkValid();
666 css::uno::Sequence
< OUString
> v
;
670 throw css::registry::InvalidValueException(
671 OUString("com.sun.star.configuration.ConfigurationRegistry"),
672 static_cast< cppu::OWeakObject
* >(this));
675 void RegistryKey::setStringListValue(
676 css::uno::Sequence
< OUString
> const &)
677 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
679 throw css::uno::RuntimeException(
680 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
682 static_cast< cppu::OWeakObject
* >(this));
685 css::uno::Sequence
< sal_Int8
> RegistryKey::getBinaryValue()
687 css::registry::InvalidRegistryException
,
688 css::registry::InvalidValueException
, css::uno::RuntimeException
)
690 osl::MutexGuard
g(service_
.mutex_
);
691 service_
.checkValid();
692 css::uno::Sequence
< sal_Int8
> v
;
696 throw css::registry::InvalidValueException(
697 OUString("com.sun.star.configuration.ConfigurationRegistry"),
698 static_cast< cppu::OWeakObject
* >(this));
701 void RegistryKey::setBinaryValue(css::uno::Sequence
< sal_Int8
> const &)
702 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
704 throw css::uno::RuntimeException(
705 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
707 static_cast< cppu::OWeakObject
* >(this));
710 css::uno::Reference
< css::registry::XRegistryKey
> RegistryKey::openKey(
711 OUString
const & aKeyName
)
712 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
714 osl::MutexGuard
g(service_
.mutex_
);
715 service_
.checkValid_RuntimeException();
716 css::uno::Reference
< css::container::XHierarchicalNameAccess
> access
;
717 if (value_
>>= access
) {
719 return new RegistryKey(
720 service_
, access
->getByHierarchicalName(aKeyName
));
721 } catch (css::container::NoSuchElementException
&) {}
723 return css::uno::Reference
< css::registry::XRegistryKey
>();
726 css::uno::Reference
< css::registry::XRegistryKey
> RegistryKey::createKey(
729 css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
731 throw css::uno::RuntimeException(
732 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
734 static_cast< cppu::OWeakObject
* >(this));
737 void RegistryKey::closeKey()
739 css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
741 osl::MutexGuard
g(service_
.mutex_
);
742 service_
.checkValid_RuntimeException();
745 void RegistryKey::deleteKey(OUString
const &)
746 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
748 throw css::uno::RuntimeException(
749 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
751 static_cast< cppu::OWeakObject
* >(this));
754 css::uno::Sequence
< css::uno::Reference
< css::registry::XRegistryKey
> >
755 RegistryKey::openKeys()
756 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
758 throw css::uno::RuntimeException(
759 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
761 static_cast< cppu::OWeakObject
* >(this));
764 css::uno::Sequence
< OUString
> RegistryKey::getKeyNames()
765 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
767 throw css::uno::RuntimeException(
768 OUString("com.sun.star.configuration.ConfigurationRegistry: not"
770 static_cast< cppu::OWeakObject
* >(this));
773 sal_Bool
RegistryKey::createLink(OUString
const &, OUString
const &)
774 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
776 osl::MutexGuard
g(service_
.mutex_
);
777 service_
.checkValid_RuntimeException();
781 void RegistryKey::deleteLink(OUString
const &)
782 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
784 osl::MutexGuard
g(service_
.mutex_
);
785 service_
.checkValid_RuntimeException();
788 OUString
RegistryKey::getLinkTarget(OUString
const &)
789 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
791 osl::MutexGuard
g(service_
.mutex_
);
792 service_
.checkValid_RuntimeException();
796 OUString
RegistryKey::getResolvedName(OUString
const & aKeyName
)
797 throw (css::registry::InvalidRegistryException
, css::uno::RuntimeException
)
799 osl::MutexGuard
g(service_
.mutex_
);
800 service_
.checkValid_RuntimeException();
806 css::uno::Reference
< css::uno::XInterface
> create(
807 css::uno::Reference
< css::uno::XComponentContext
> const & context
)
809 return static_cast< cppu::OWeakObject
* >(new Service(context
));
812 OUString
getImplementationName() {
813 return OUString("com.sun.star.comp.configuration.ConfigurationRegistry");
816 css::uno::Sequence
< OUString
> getSupportedServiceNames() {
817 OUString
name("com.sun.star.configuration.ConfigurationRegistry");
818 return css::uno::Sequence
< OUString
>(&name
, 1);
823 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */