merged tag ooo/DEV300_m102
[LibreOffice.git] / configmgr / source / groupnode.cxx
blob59c0f89df5d1b7ea79ee668600737139ebb72b9d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include "precompiled_configmgr.hxx"
29 #include "sal/config.h"
31 #include "rtl/ref.hxx"
32 #include "rtl/ustring.hxx"
34 #include "data.hxx"
35 #include "groupnode.hxx"
36 #include "node.hxx"
37 #include "nodemap.hxx"
39 namespace configmgr {
41 GroupNode::GroupNode(
42 int layer, bool extensible, rtl::OUString const & templateName):
43 Node(layer), extensible_(extensible), templateName_(templateName),
44 mandatory_(Data::NO_LAYER)
47 rtl::Reference< Node > GroupNode::clone(bool keepTemplateName) const {
48 return new GroupNode(*this, keepTemplateName);
51 NodeMap & GroupNode::getMembers() {
52 return members_;
55 rtl::OUString GroupNode::getTemplateName() const {
56 return templateName_;
59 void GroupNode::setMandatory(int layer) {
60 mandatory_ = layer;
63 int GroupNode::getMandatory() const {
64 return mandatory_;
67 bool GroupNode::isExtensible() const {
68 return extensible_;
71 GroupNode::GroupNode(GroupNode const & other, bool keepTemplateName):
72 Node(other), extensible_(other.extensible_), mandatory_(other.mandatory_)
74 cloneNodeMap(other.members_, &members_);
75 if (keepTemplateName) {
76 templateName_ = other.templateName_;
80 GroupNode::~GroupNode() {}
82 Node::Kind GroupNode::kind() const {
83 return KIND_GROUP;
86 void GroupNode::clear() {
87 members_.clear();