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 #ifndef __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_
21 #define __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
24 #include <macros/debug.hxx>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <rtl/ustring.hxx>
31 #include <fwidllapi.h>
36 //_______________________________________
38 @short implements a simple configuration access
39 @descr Sometimes it's better to have direct config access
40 instead of using soecialize config items of the svtools
41 project. This class can wrapp such configuration access.
43 class FWI_DLLPUBLIC ConfigAccess
: public ThreadHelpBase
49 /** represent the possible modes of the internal wrapped configuration access */
52 /// config isn't used yet
54 /// config access is open for reading only
56 /// config access is open for reading/writing data
60 //___________________________________
66 reference to the uno service manager
67 It's neccessary to instanciate own needed services.
69 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
71 /** hold an opened configuration alive */
72 css::uno::Reference
< css::uno::XInterface
> m_xConfig
;
74 /** knows the root of the opened config access point */
77 /** represent the current open mode */
80 //___________________________________
81 // native interface methods
85 ConfigAccess( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
86 const OUString
& sRoot
);
87 virtual ~ConfigAccess();
89 virtual void open ( EOpenMode eMode
);
90 virtual void close ( );
91 virtual EOpenMode
getMode( ) const;
93 virtual const css::uno::Reference
< css::uno::XInterface
>& cfg();
96 } // namespace framework
98 #endif // __FRAMEWORK_CONFIG_CONFIGACCESS_HXX_
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */