merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / mergedcomponentdata.hxx
blob6cda735aeaa963021d0992c62765dbeaabde0735
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: mergedcomponentdata.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. */
33 #ifndef CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
34 #define CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
36 #include "valuenode.hxx"
38 #include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
40 #ifndef INCLUDED_MEMORY
41 #include <memory>
42 #define INCLUDED_MEMORY
43 #endif
45 namespace configmgr
47 // -----------------------------------------------------------------------------
48 class OTreeNodeFactory;
49 // -----------------------------------------------------------------------------
50 namespace backend
52 // -----------------------------------------------------------------------------
53 namespace backenduno = ::com::sun::star::configuration::backend;
55 // -----------------------------------------------------------------------------
57 class MergedComponentData
59 public:
60 MergedComponentData();
61 ~MergedComponentData();
63 bool hasSchema() const;
64 bool hasTemplates() const;
65 bool hasTemplate(rtl::OUString const & _aTemplateName) const;
67 rtl::OUString getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const;
69 ISubtree const * getSchemaTree() const { return m_pSchemaTree.get(); }
70 ISubtree const * getTemplatesTree() const { return m_pTemplatesTree.get(); }
71 ISubtree const * findTemplate(rtl::OUString const & _aTemplateName) const;
73 ISubtree * getSchemaTree() { return m_pSchemaTree.get(); }
74 ISubtree * getTemplatesTree() { return m_pTemplatesTree.get(); }
76 std::auto_ptr<INode> instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const;
78 void clear();
80 ISubtree * setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot);
81 ISubtree * addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate);
82 void setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree);
84 std::auto_ptr<ISubtree> extractSchemaTree();
85 std::auto_ptr<ISubtree> extractTemplatesTree();
86 std::auto_ptr<INode> extractTemplateNode(rtl::OUString const & _aTemplateName);
87 private:
88 std::auto_ptr<ISubtree> m_pSchemaTree;
89 std::auto_ptr<ISubtree> m_pTemplatesTree;
92 // -----------------------------------------------------------------------------
94 } // namespace backend
95 // -----------------------------------------------------------------------------
97 } // namespace configmgr
98 #endif