merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / treechangelist.hxx
blob5d291cb5f2e1a89ad25b5395053e1d351ec6ecab
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: treechangelist.hxx,v $
10 * $Revision: 1.6 $
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 /* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
34 #ifndef CONFIGMGR_TREECHANGELIST_HXX
35 #define CONFIGMGR_TREECHANGELIST_HXX
37 #include "change.hxx"
38 #include "attributes.hxx"
39 #include "configpath.hxx"
40 #include "requestoptions.hxx"
42 namespace configmgr
45 ////////////////////////////////////////////////////////////////////////////////
47 //==========================================================================
48 //= TreeChangeList
49 //==========================================================================
50 struct TreeChangeList
52 TreeChangeList(const RequestOptions& _aOptions,
53 const configuration::AbsolutePath& _rRootPath,
54 const SubtreeChange& _aSubtree,
55 treeop::DeepChildCopy _doDeepCopy)
56 : root(_aSubtree,_doDeepCopy)
57 , m_aLocation(_rRootPath)
58 , m_aOptions(_aOptions)
61 /** ctor
62 @param _rRootPath path to the root of the whole to-be-updated subtree
64 TreeChangeList( const RequestOptions& _aOptions,
65 const configuration::AbsolutePath& _rRootPath,
66 const node::Attributes& _rAttr = node::Attributes())
67 : root(_rRootPath.getLocalName().getName(), _rAttr)
68 , m_aLocation(_rRootPath)
69 , m_aOptions(_aOptions)
72 /** ctor
73 @param _rLocalName relative path within the to-be-updated subtree
75 TreeChangeList( const RequestOptions& _aOptions,
76 const configuration::AbsolutePath& _rRootPath,
77 rtl::OUString const & _rChildTemplateName,
78 rtl::OUString const & _rChildTemplateModule,
79 const node::Attributes& _rAttr = node::Attributes())
80 : root(_rRootPath.getLocalName().getName(), _rChildTemplateName, _rChildTemplateModule, _rAttr)
81 , m_aLocation(_rRootPath)
82 , m_aOptions(_aOptions)
85 /** ctor
86 @param _rTreeList list to initialize the path, no childs are copied
88 TreeChangeList( const TreeChangeList& _rTree, treeop::NoChildCopy _rNoCopy)
89 : root(_rTree.root, _rNoCopy)
90 , m_aLocation(_rTree.m_aLocation)
91 , m_aOptions(_rTree.m_aOptions)
92 {}
94 /// is root a change for the module root
95 bool isModuleRootChange() const { return m_aLocation.getDepth() <= 1; }
97 /// get the module these changes belong to
98 rtl::OUString getModuleName() const { return m_aLocation.getModuleName(); }
100 /// get the full path to the root (location + root-name)
101 void setRootPath(const configuration::AbsolutePath& _rRootPath)
102 { m_aLocation = _rRootPath; }
104 /// get the full path to the root (location + root-name)
105 configuration::AbsolutePath const& getRootNodePath() const { return m_aLocation; }
107 /// get the full path to the root (location)
108 configuration::AbsolutePath getRootContextPath() const { return m_aLocation.getParentPath(); }
110 RequestOptions const & getOptions() const { return m_aOptions; }
112 public:
113 SubtreeChange root; // the root of the whole tree of updates
114 private:
115 configuration::AbsolutePath m_aLocation; // absolute path to the parent of the node corresponding to this->root
116 RequestOptions m_aOptions; // options for the tree that is concerned by these changes
118 //----------------------------------------------------------------------------
120 } // namespace configmgr
122 #endif