1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef ADC_DOCU_PE_HXX
29 #define ADC_DOCU_PE_HXX
30 
31 
32 
33 // USED SERVICES
34 	// BASE CLASSES
35 #include <adoc/tokintpr.hxx>
36 	// COMPONENTS
37 	// PARAMETERS
38 
39 namespace ary
40 {
41 namespace doc
42 {
43     class OldCppDocu;
44 }
45 namespace info
46 {
47     class AtTag;
48 }
49 }
50 
51 
52 
53 namespace adoc
54 {
55 
56 
57 class Adoc_PE : public TokenInterpreter
58 {
59   public:
60 						Adoc_PE();
61 						~Adoc_PE();
62 
63 	virtual void		Hdl_at_std(
64 							const Tok_at_std &	i_rTok );
65 	virtual void		Hdl_at_base(
66 							const Tok_at_base &	i_rTok );
67 	virtual void		Hdl_at_exception(
68 							const Tok_at_exception &
69 												i_rTok );
70 	virtual void		Hdl_at_impl(
71 							const Tok_at_impl &	i_rTok );
72 	virtual void		Hdl_at_key(
73 							const Tok_at_key &	i_rTok );
74 	virtual void		Hdl_at_param(
75 							const Tok_at_param &
76 												i_rTok );
77 	virtual void		Hdl_at_see(
78 							const Tok_at_see &	i_rTok );
79 	virtual void		Hdl_at_template(
80 							const Tok_at_template &
81 												i_rTok );
82 	virtual void		Hdl_at_interface(
83 							const Tok_at_interface &
84 												i_rTok );
85 	virtual void		Hdl_at_internal(
86 							const Tok_at_internal &
87 												i_rTok );
88 	virtual void		Hdl_at_obsolete(
89 							const Tok_at_obsolete &
90 												i_rTok );
91 	virtual void		Hdl_at_module(
92 							const Tok_at_module &
93 												i_rTok );
94 	virtual void		Hdl_at_file(
95 							const Tok_at_file &	i_rTok );
96 	virtual void		Hdl_at_gloss(
97 							const Tok_at_gloss &
98 												i_rTok );
99 	virtual void		Hdl_at_global(
100 							const Tok_at_global &
101 												i_rTok );
102 	virtual void		Hdl_at_include(
103 							const Tok_at_include &
104 												i_rTok );
105 	virtual void		Hdl_at_label(
106 							const Tok_at_label &
107 												i_rTok );
108 	virtual void		Hdl_at_since(
109 							const Tok_at_since &
110 												i_rTok );
111 	virtual void		Hdl_at_HTML(
112 							const Tok_at_HTML &
113 												i_rTok );
114 	virtual void		Hdl_at_NOHTML(
115 							const Tok_at_NOHTML &
116 												i_rTok );
117 
118 	virtual void		Hdl_DocWord(
119 							const Tok_DocWord &	i_rTok );
120 
121 	virtual void		Hdl_Whitespace(
122 							const Tok_Whitespace &
123 												i_rTok );
124 	virtual void		Hdl_LineStart(
125 							const Tok_LineStart &
126 												i_rTok );
127 	virtual void		Hdl_Eol(
128 							const Tok_Eol &		i_rTok );
129 
130 	virtual void		Hdl_EoDocu(
131 							const Tok_EoDocu &	i_rTok );
132 
133 
134 	DYN ary::doc::OldCppDocu *
135 						ReleaseJustParsedDocu();
136 
137 	bool				IsComplete() const;
138 
139   private:
140     void                InstallAtTag(
141                             DYN ary::info::AtTag *
142                                                 let_dpTag,
143                             bool                i_bImplicit = false );  /// True for implicit @short and @descr.
144 	ary::doc::OldCppDocu &
145 						CurDocu();
146 	ary::info::AtTag &	CurAtTag();
147     bool                UsesHtmlInDocuText();
148 
149     void                RenameCurShortTag();
150     void                FinishCurShortTag();
151 
152 
153 	// DATA
154     enum E_TagState
155     {
156         ts_new,
157         ts_std
158     };
159     enum E_DocuState
160     {
161         ds_wait_for_short = 0,
162         ds_in_short,
163         ds_1newline_after_short,
164         ds_in_descr,
165         ds_std
166     };
167 
168 	Dyn<ary::doc::OldCppDocu>
169 						pCurDocu;
170 	ary::info::AtTag *	pCurAtTag;
171     uintt               nLineCountInDocu;
172 	UINT8				nCurSpecialMeaningTokens;
173 	UINT8				nCurSubtractFromLineStart;
174     E_TagState          eCurTagState;
175     E_DocuState         eDocuState;
176 	bool                bIsComplete;
177     bool                bUsesHtmlInDocuText;
178 };
179 
180 
181 // IMPLEMENTATION
182 inline bool
183 Adoc_PE::IsComplete() const
184 {
185 	return bIsComplete;
186 }
187 
188 
189 
190 
191 }   // namespace adoc
192 #endif
193