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: configaccess.hxx,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 #ifndef __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_
32 #define __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_
34 //_______________________________________
37 #include <threadhelp/threadhelpbase.hxx>
38 #include <macros/debug.hxx>
41 //_______________________________________
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 //_______________________________________
47 #include <rtl/ustring.hxx>
49 //_______________________________________
54 //_______________________________________
57 //_______________________________________
59 @short implements a simple configuration access
60 @descr Sometimes it's better to have direct config access
61 instead of using soecialize config items of the svtools
62 project. This class can wrapp such configuration access.
64 class ConfigAccess
: public ThreadHelpBase
66 //___________________________________
71 /** represent the possible modes of the internal wrapped configuration access */
74 /// config isn't used yet
76 /// config access is open for reading only
78 /// config access is open for reading/writing data
82 //___________________________________
88 reference to the uno service manager
89 It's neccessary to instanciate own needed services.
91 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xSMGR
;
93 /** hold an opened configuration alive */
94 css::uno::Reference
< css::uno::XInterface
> m_xConfig
;
96 /** knows the root of the opened config access point */
97 ::rtl::OUString m_sRoot
;
99 /** represent the current open mode */
102 //___________________________________
103 // native interface methods
107 ConfigAccess( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xSMGR
,
108 const ::rtl::OUString
& sRoot
);
109 virtual ~ConfigAccess();
111 virtual void open ( EOpenMode eMode
);
112 virtual void close ( );
113 virtual EOpenMode
getMode( ) const;
115 virtual const css::uno::Reference
< css::uno::XInterface
>& cfg();
118 } // namespace framework
120 #endif // __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_