xref: /trunk/main/autodoc/inc/ary/info/all_dts.hxx (revision cdf0e10c)
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 ARY_INFO_ALL_DTS_HXX
29 #define ARY_INFO_ALL_DTS_HXX
30 
31 
32 
33 // USED SERVICES
34 	// BASE CLASSES
35 	// COMPONENTS
36 	// PARAMETERS
37 
38 
39 namespace ary
40 {
41 namespace info
42 {
43 
44 class DocuDisplay;
45 
46 class DocuToken
47 {
48   public:
49 	virtual			 	~DocuToken() {}
50 
51     void                StoreAt(
52                             DocuDisplay &       o_rDisplay ) const;
53     bool                IsWhite() const;
54 
55   private:
56     virtual void        do_StoreAt(
57                             DocuDisplay &       o_rDisplay ) const = 0;
58     virtual bool        inq_IsWhite() const = 0;
59 };
60 
61 class DT_Text : public DocuToken
62 {
63   public:
64 						DT_Text(
65 							const char *		i_sText )
66 												:	sText( i_sText ) {}
67 
68     const String  &     Text() const            { return sText; }
69 
70   private:
71     virtual void        do_StoreAt(
72                             DocuDisplay &       o_rDisplay ) const;
73     virtual bool        inq_IsWhite() const;
74 
75 	String 				sText;
76 };
77 
78 class DT_MaybeLink : public DocuToken
79 {
80   public:
81 						DT_MaybeLink(
82 							const char *		i_sText,
83                             bool                i_bIsGlobal,
84                             bool                i_bIsFunction  )
85 												:	sText( i_sText ),
86                                                     bIsGlobal(i_bIsGlobal),
87                                                     bIsFunction(i_bIsFunction) { }
88 
89     const String  &     Text() const            { return sText; }
90     bool                IsAbsolute() const      { return bIsGlobal; }
91     bool                IsFunction() const      { return bIsFunction; }
92 
93   private:
94     virtual void        do_StoreAt(
95                             DocuDisplay &       o_rDisplay ) const;
96     virtual bool        inq_IsWhite() const;
97 
98 	String 				sText;
99     bool                bIsGlobal;
100     bool                bIsFunction;
101 };
102 
103 class DT_Whitespace : public DocuToken
104 {
105   public:
106 						DT_Whitespace(
107 							UINT8				i_nLength )
108 												:	nLength( i_nLength ) {}
109     UINT8               Length() const          { return nLength; }
110 
111   private:
112     virtual void        do_StoreAt(
113                             DocuDisplay &       o_rDisplay ) const;
114     virtual bool        inq_IsWhite() const;
115 
116 	UINT8				nLength;
117 };
118 
119 
120 class DT_Eol : public DocuToken
121 {
122     virtual void        do_StoreAt(
123                             DocuDisplay &       o_rDisplay ) const;
124     virtual bool        inq_IsWhite() const;
125 };
126 
127 class DT_Xml : public DocuToken
128 {
129   public:
130 						DT_Xml(
131 							const char *		i_sText )
132 												:	sText( i_sText ) {}
133 
134     const String  &     Text() const            { return sText; }
135 
136   private:
137     virtual void        do_StoreAt(
138                             DocuDisplay &       o_rDisplay ) const;
139     virtual bool        inq_IsWhite() const;
140 
141 	String 				sText;
142 };
143 
144 
145 // IMPLEMENTATION
146 
147 inline void
148 DocuToken::StoreAt( DocuDisplay & o_rDisplay ) const
149     { do_StoreAt(o_rDisplay); }
150 inline bool
151 DocuToken::IsWhite() const
152     { return inq_IsWhite(); }
153 
154 
155 
156 }
157 }
158 
159 #endif
160 
161