Update ooo320-m1
[ooovba.git] / autodoc / source / parser / cpp / sdocdist.hxx
blob8584371ed3eae8d56baf8ce6c2851a63a1d21e29
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: sdocdist.hxx,v $
10 * $Revision: 1.4 $
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 ADC_CPP_SDOCDIST_HXX
32 #define ADC_CPP_SDOCDIST_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include "cxt2ary.hxx"
39 #include <ary/info/docstore.hxx>
40 // COMPONENTS
41 // PARAMETERS
43 namespace cpp
46 using ary::Documentation;
48 /** Implementation struct for cpp::ContextForAry.
51 struct ContextForAry::S_DocuDistributor : public ary::info::DocuStore
53 public:
54 S_DocuDistributor() : pCurRe(0) {}
55 ~S_DocuDistributor() {}
57 void Reset() { pCurRe = 0; pLastStoredDocu = 0; }
59 void SetCurrentlyStoredRe(
60 ary::cpp::CppEntity &
61 io_rRe );
62 void Event_LineBreak();
64 private:
65 // Interface ary::info::DocuStore
66 virtual void do_Store2CurFile(
67 DYN ary::doc::Node& let_drDocu );
68 virtual void do_Store2CurNamespace(
69 DYN ary::doc::Node& let_drDocu );
71 virtual void do_Store2ConnectedDeclaration(
72 DYN ary::doc::Node& let_drDocu );
74 virtual void do_Store2Glossary(
75 DYN ary::doc::Node& let_drDocu,
76 const String & i_sExplainedTerm );
77 virtual void do_Store2GlobalTexts(
78 DYN ary::doc::Node& let_drDocu,
79 ary::info::GlobalTextId
80 i_nId );
81 // DATA
82 ary::cpp::CppEntity *
83 pCurRe;
84 Dyn<ary::doc::Node> pLastStoredDocu;
88 // IMPLEMENTATION
90 /* The implementation is in header, though not all inline, because this file
91 is included in cxt2ary.cxx only!
95 void
96 ContextForAry::
97 S_DocuDistributor::SetCurrentlyStoredRe( ary::cpp::CppEntity & io_rRe )
99 pCurRe = &io_rRe;
100 if ( pLastStoredDocu )
101 pCurRe->Set_Docu( *pLastStoredDocu.Release() );
104 inline void
105 ContextForAry::
106 S_DocuDistributor::Event_LineBreak()
108 pCurRe = 0;
111 void
112 ContextForAry::
113 S_DocuDistributor::do_Store2CurFile( DYN ary::doc::Node & let_drDocu )
115 // KORR_FUTURE
116 delete &let_drDocu;
119 void
120 ContextForAry::
121 S_DocuDistributor::do_Store2CurNamespace( DYN ary::doc::Node & let_drDocu )
123 // KORR_FUTURE
124 delete &let_drDocu;
127 void
128 ContextForAry::
129 S_DocuDistributor::do_Store2ConnectedDeclaration( DYN ary::doc::Node & let_drDocu )
131 if ( pCurRe != 0 )
132 pCurRe->Set_Docu(let_drDocu);
133 else
134 pLastStoredDocu = &let_drDocu;
137 void
138 ContextForAry::
139 S_DocuDistributor::do_Store2Glossary( DYN ary::doc::Node & let_drDocu,
140 const String & // i_sExplainedTerm
143 // KORR_FUTURE
144 delete &let_drDocu;
147 void
148 ContextForAry::
149 S_DocuDistributor::do_Store2GlobalTexts( DYN ary::doc::Node & let_drDocu,
150 ary::info::GlobalTextId // i_nId
153 // KORR_FUTURE
154 delete &let_drDocu;
160 } // namespace cpp
161 #endif