merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / treenodefactory.hxx
blob06d8791587c7d384fd9639da3d3623b9f43e1fde
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: treenodefactory.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_TREE_NODEFACTORY_HXX
32 #define CONFIGMGR_TREE_NODEFACTORY_HXX
34 #include "valuenode.hxx"
36 #ifndef INCLUDED_MEMORY
37 #include <memory>
38 #define INCLUDED_MEMORY
39 #endif
40 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
41 #pragma warning(disable : 4350)
42 #endif
43 namespace configmgr
46 namespace uno = ::com::sun::star::uno;
48 //==========================================================================
50 class OTreeNodeFactory
52 public:
53 //= ValueNodes ============================================================
54 std::auto_ptr<ValueNode> createValueNode(
55 rtl::OUString const& aName,
56 uno::Any const& aValue,
57 node::Attributes _aAttrs);
59 //-----------------------------------------------
60 std::auto_ptr<ValueNode> createValueNode(
61 rtl::OUString const& aName,
62 uno::Any const& aValue,
63 uno::Any const& aDefault,
64 node::Attributes _aAttrs);
66 //-----------------------------------------------
67 std::auto_ptr<ValueNode> createNullValueNode(
68 rtl::OUString const& aName,
69 uno::Type const& aType,
70 node::Attributes _aAttrs);
72 //= ISubtree ============================================================
73 std::auto_ptr<ISubtree> createGroupNode(
74 rtl::OUString const& aName,
75 node::Attributes _aAttrs);
77 //-----------------------------------------------
78 std::auto_ptr<ISubtree> createSetNode(
79 rtl::OUString const& aName,
80 rtl::OUString const& _rTemplateName,
81 rtl::OUString const& _rTemplateModule,
82 node::Attributes _aAttrs);
85 OTreeNodeFactory& getDefaultTreeNodeFactory();
86 //==========================================================================
87 inline
88 std::auto_ptr<INode> base_ptr(std::auto_ptr<ISubtree> pNode)
89 { return std::auto_ptr<INode>(pNode.release()); }
90 //==========================================================================
91 inline
92 std::auto_ptr<INode> base_ptr(std::auto_ptr<ValueNode> pNode)
93 { return std::auto_ptr<INode>(pNode.release()); }
94 //==========================================================================
97 } // namespace configmgr
99 #endif