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: treechangefactory.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_CHANGEFACTORY_HXX
32 #define CONFIGMGR_TREE_CHANGEFACTORY_HXX
36 #ifndef INCLUDED_MEMORY
38 #define INCLUDED_MEMORY
45 namespace uno
= ::com::sun::star::uno
;
47 //==========================================================================
49 class OTreeChangeFactory
52 //-----------------------------------------------
53 std::auto_ptr
<SubtreeChange
> createSetNodeChange(
54 rtl::OUString
const& _aName
,
55 rtl::OUString
const& _aTemplateName
,
56 rtl::OUString
const& _aTemplateModule
,
57 node::Attributes _aAttrs
,
58 bool _bToDefault
= false);
59 //-----------------------------------------------
61 //= Set Changes ============================================================
62 std::auto_ptr
<AddNode
> createAddNodeChange(
63 rtl::Reference
< data::TreeSegment
> const & _aNewTree
,
64 rtl::OUString
const& _aName
,
65 bool _bToDefault
= false);
67 //-----------------------------------------------
68 std::auto_ptr
<RemoveNode
> createRemoveNodeChange(
69 rtl::OUString
const& _aName
,
70 bool _bToDefault
= false);
72 //= special case: Dummy ISubtree ============================================================
73 static std::auto_ptr
<SubtreeChange
> createDummyChange(
74 rtl::OUString
const& _aName
,
75 rtl::OUString
const& _aElementTypeName
);
77 //-----------------------------------------------
80 OTreeChangeFactory
& getDefaultTreeChangeFactory();
81 //==========================================================================
83 std::auto_ptr
<Change
> base_ptr(std::auto_ptr
<SubtreeChange
> pChange
)
84 { return std::auto_ptr
<Change
>(pChange
.release()); }
85 //==========================================================================
87 std::auto_ptr
<Change
> base_ptr(std::auto_ptr
<ValueChange
> pChange
)
88 { return std::auto_ptr
<Change
>(pChange
.release()); }
89 //==========================================================================
91 std::auto_ptr
<Change
> base_ptr(std::auto_ptr
<AddNode
> pChange
)
92 { return std::auto_ptr
<Change
>(pChange
.release()); }
93 //==========================================================================
95 std::auto_ptr
<Change
> base_ptr(std::auto_ptr
<RemoveNode
> pChange
)
96 { return std::auto_ptr
<Change
>(pChange
.release()); }
97 //==========================================================================
99 bool isGenericSetElementType(rtl::OUString
const& _aElementType
);
100 bool isDummySetElementModule(rtl::OUString
const& _aElementModule
);
101 rtl::OUString
getGenericSetElementType();
102 rtl::OUString
getDummySetElementModule();
103 //==========================================================================
105 } // namespace configmgr