1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: setaccess.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_configmgr.hxx"
34 #include "setaccess.hxx"
35 #include "accessimpl.hxx"
36 #include "apinotifierimpl.hxx"
37 #include "apinodeaccess.hxx"
43 //------------------------------------------------------------------------------------------------------------------
44 rtl::OUString SAL_CALL
BasicSetAccess::getHierarchicalName( ) throw(uno::RuntimeException
)
46 return configapi::implGetHierarchicalName( getNode() );
49 //------------------------------------------------------------------------------------------------------------------
50 rtl::OUString SAL_CALL
BasicSetAccess::composeHierarchicalName( const rtl::OUString
& sRelativeName
)
51 throw(css::lang::IllegalArgumentException
, css::lang::NoSupportException
, uno::RuntimeException
)
53 return configapi::implComposeHierarchicalName( getNode(), sRelativeName
);
56 //------------------------------------------------------------------------------------------------------------------
58 // XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
59 //-----------------------------------------------------------------------------------
61 uno::Type SAL_CALL
BasicSetAccess::getElementType( ) throw(uno::RuntimeException
)
63 return configapi::implGetElementType( getNode() );
66 //-----------------------------------------------------------------------------------
67 sal_Bool SAL_CALL
BasicSetAccess::hasElements( ) throw(uno::RuntimeException
)
69 return configapi::implHasElements( getNode() );
73 //-----------------------------------------------------------------------------------
75 rtl::OUString SAL_CALL
BasicSetAccess::getExactName( const rtl::OUString
& rApproximateName
) throw(uno::RuntimeException
)
77 return configapi::implGetExactName( getNode(), rApproximateName
);
81 //-----------------------------------------------------------------------------------
83 css::beans::Property SAL_CALL
BasicSetAccess::getAsProperty( ) throw(uno::RuntimeException
)
85 return configapi::implGetAsProperty( getNode() );
89 //-----------------------------------------------------------------------------------
91 uno::Sequence
< css::beans::Property
> SAL_CALL
BasicSetAccess::getProperties( ) throw (uno::RuntimeException
)
93 return configapi::implGetProperties( getNode() );
96 css::beans::Property SAL_CALL
BasicSetAccess::getPropertyByName( const rtl::OUString
& aName
)
97 throw (css::beans::UnknownPropertyException
, uno::RuntimeException
)
99 return configapi::implGetPropertyByName( getNode(), aName
);
102 sal_Bool SAL_CALL
BasicSetAccess::hasPropertyByName( const rtl::OUString
& name
) throw (uno::RuntimeException
)
104 return configapi::implHasPropertyByName( getNode(), name
);
109 //-----------------------------------------------------------------------------------
111 sal_Bool SAL_CALL
BasicSetAccess::hasByName( const rtl::OUString
& sName
) throw(uno::RuntimeException
)
113 return configapi::implHasByName( getNode(), sName
);
116 //-----------------------------------------------------------------------------------
117 uno::Any SAL_CALL
BasicSetAccess::getByName( const rtl::OUString
& sName
)
118 throw(css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
)
120 return configapi::implGetByName( getNode(), sName
);
123 //-----------------------------------------------------------------------------------
124 uno::Sequence
< rtl::OUString
> SAL_CALL
BasicSetAccess::getElementNames( ) throw( uno::RuntimeException
)
126 return configapi::implGetElementNames( getNode() );
129 // XHierarchicalNameAccess
130 //-----------------------------------------------------------------------------------
131 sal_Bool SAL_CALL
BasicSetAccess::hasByHierarchicalName( const rtl::OUString
& sName
) throw(uno::RuntimeException
)
133 return configapi::implHasByHierarchicalName( getNode(), sName
);
136 //-----------------------------------------------------------------------------------
137 uno::Any SAL_CALL
BasicSetAccess::getByHierarchicalName( const rtl::OUString
& sName
)
138 throw(css::container::NoSuchElementException
, uno::RuntimeException
)
140 return configapi::implGetByHierarchicalName( getNode(), sName
);
145 //-----------------------------------------------------------------------------------
147 void SAL_CALL
BasicSetAccess::addContainerListener( const uno::Reference
< css::container::XContainerListener
>& xListener
)
148 throw(uno::RuntimeException
)
150 configapi::implAddListener( getNode(), xListener
);
153 void SAL_CALL
BasicSetAccess::removeContainerListener( const uno::Reference
< css::container::XContainerListener
>& xListener
)
154 throw(uno::RuntimeException
)
156 configapi::implRemoveListener( getNode(), xListener
);
159 //-----------------------------------------------------------------------------------
160 // Set-specific interfaces
161 //-----------------------------------------------------------------------------------
163 // XTemplateContainer
164 //-----------------------------------------------------------------------------------
165 rtl::OUString SAL_CALL
BasicSetAccess::getElementTemplateName( )
166 throw(uno::RuntimeException
)
168 return configapi::implGetElementTemplateName( getNode() );
172 //-----------------------------------------------------------------------------------
173 rtl::OUString SAL_CALL
BasicSetAccess::escapeString( const rtl::OUString
& aString
)
174 throw(css::lang::IllegalArgumentException
, uno::RuntimeException
)
179 rtl::OUString SAL_CALL
BasicSetAccess::unescapeString( const rtl::OUString
& aEscapedString
)
180 throw(css::lang::IllegalArgumentException
, uno::RuntimeException
)
182 return aEscapedString
;
185 //-----------------------------------------------------------------------------------
186 } // namespace configmgr