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: sdocdist.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 ADC_CPP_SDOCDIST_HXX
32 #define ADC_CPP_SDOCDIST_HXX
38 #include "cxt2ary.hxx"
39 #include <ary/info/docstore.hxx>
46 using ary::Documentation
;
48 /** Implementation struct for cpp::ContextForAry.
51 struct ContextForAry::S_DocuDistributor
: public ary::info::DocuStore
54 S_DocuDistributor() : pCurRe(0) {}
55 ~S_DocuDistributor() {}
57 void Reset() { pCurRe
= 0; pLastStoredDocu
= 0; }
59 void SetCurrentlyStoredRe(
62 void Event_LineBreak();
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
84 Dyn
<ary::doc::Node
> pLastStoredDocu
;
90 /* The implementation is in header, though not all inline, because this file
91 is included in cxt2ary.cxx only!
97 S_DocuDistributor::SetCurrentlyStoredRe( ary::cpp::CppEntity
& io_rRe
)
100 if ( pLastStoredDocu
)
101 pCurRe
->Set_Docu( *pLastStoredDocu
.Release() );
106 S_DocuDistributor::Event_LineBreak()
113 S_DocuDistributor::do_Store2CurFile( DYN
ary::doc::Node
& let_drDocu
)
121 S_DocuDistributor::do_Store2CurNamespace( DYN
ary::doc::Node
& let_drDocu
)
129 S_DocuDistributor::do_Store2ConnectedDeclaration( DYN
ary::doc::Node
& let_drDocu
)
132 pCurRe
->Set_Docu(let_drDocu
);
134 pLastStoredDocu
= &let_drDocu
;
139 S_DocuDistributor::do_Store2Glossary( DYN
ary::doc::Node
& let_drDocu
,
140 const String
& // i_sExplainedTerm
149 S_DocuDistributor::do_Store2GlobalTexts( DYN
ary::doc::Node
& let_drDocu
,
150 ary::info::GlobalTextId
// i_nId