merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / configdefaultprovider.hxx
blobc8eff20009a7ec804b61722ca2f36b7198b6b55c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: configdefaultprovider.hxx,v $
10 * $Revision: 1.8 $
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 CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
32 #define CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
34 #include "utility.hxx"
35 #include <com/sun/star/uno/Exception.hpp>
36 #include <rtl/ref.hxx>
38 #ifndef INCLUDED_MEMORY
39 #include <memory>
40 #define INCLUDED_MEMORY
41 #endif
43 namespace configmgr
45 //-----------------------------------------------------------------------------
46 class ISubtree;
47 class IDefaultableTreeManager;
48 class RequestOptions;
49 class TreeManager;
51 namespace uno = com::sun::star::uno;
52 //-----------------------------------------------------------------------------
53 namespace configuration
55 //-----------------------------------------------------------------------------
57 class Tree;
58 class NodeRef;
59 //-----------------------------------------------------------------------------
61 /// provides access to the default for a given request
62 class DefaultProviderProxy;
64 class DefaultProvider
66 rtl::Reference< DefaultProviderProxy > m_aProxy;
67 public:
68 // factory methods
69 static DefaultProvider createEmpty();
70 static DefaultProvider create(rtl::Reference< Tree > const& _aRootTree,
71 RequestOptions const& _xOptions,
72 rtl::Reference< TreeManager > const & _xDefaultProvider,
73 IDefaultableTreeManager* _pDefaultableTree);
75 // actual c'tor
76 explicit
77 DefaultProvider(rtl::Reference< DefaultProviderProxy > const& _xProviderProxy);
79 // standard c/d-tors to make compiler barrier
80 DefaultProvider(DefaultProvider const& _aOther);
81 DefaultProvider& operator=(DefaultProvider const& _aOther);
82 ~DefaultProvider();
84 bool isValid() const { return !! m_aProxy.is(); }
86 /// tries to load a default instance of the specified node
87 std::auto_ptr<ISubtree> getDefaultTree(rtl::Reference< Tree > const& _aTree, NodeRef const& _aNode) const SAL_THROW((com::sun::star::uno::Exception));
89 /// tries to load default data into the specified tree
90 bool fetchDefaultData(rtl::Reference< Tree > const& _aTreeRef) const SAL_THROW((com::sun::star::uno::Exception));
93 //-----------------------------------------------------------------------------
98 #endif // CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_