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: treenodefactory.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 CONFIGMGR_TREE_NODEFACTORY_HXX
32 #define CONFIGMGR_TREE_NODEFACTORY_HXX
34 #include "valuenode.hxx"
36 #ifndef INCLUDED_MEMORY
38 #define INCLUDED_MEMORY
40 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
41 #pragma warning(disable : 4350)
46 namespace uno
= ::com::sun::star::uno
;
48 //==========================================================================
50 class OTreeNodeFactory
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 //==========================================================================
88 std::auto_ptr
<INode
> base_ptr(std::auto_ptr
<ISubtree
> pNode
)
89 { return std::auto_ptr
<INode
>(pNode
.release()); }
90 //==========================================================================
92 std::auto_ptr
<INode
> base_ptr(std::auto_ptr
<ValueNode
> pNode
)
93 { return std::auto_ptr
<INode
>(pNode
.release()); }
94 //==========================================================================
97 } // namespace configmgr