merge the formfield patch from ooo-build
[ooovba.git] / autodoc / inc / ary / info / all_dts.hxx
blobb00543b50de2af9acb28e49db31563b58fbab7ca
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: all_dts.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 ARY_INFO_ALL_DTS_HXX
32 #define ARY_INFO_ALL_DTS_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 // COMPONENTS
39 // PARAMETERS
42 namespace ary
44 namespace info
47 class DocuDisplay;
49 class DocuToken
51 public:
52 virtual ~DocuToken() {}
54 void StoreAt(
55 DocuDisplay & o_rDisplay ) const;
56 bool IsWhite() const;
58 private:
59 virtual void do_StoreAt(
60 DocuDisplay & o_rDisplay ) const = 0;
61 virtual bool inq_IsWhite() const = 0;
64 class DT_Text : public DocuToken
66 public:
67 DT_Text(
68 const char * i_sText )
69 : sText( i_sText ) {}
71 const String & Text() const { return sText; }
73 private:
74 virtual void do_StoreAt(
75 DocuDisplay & o_rDisplay ) const;
76 virtual bool inq_IsWhite() const;
78 String sText;
81 class DT_MaybeLink : public DocuToken
83 public:
84 DT_MaybeLink(
85 const char * i_sText,
86 bool i_bIsGlobal,
87 bool i_bIsFunction )
88 : sText( i_sText ),
89 bIsGlobal(i_bIsGlobal),
90 bIsFunction(i_bIsFunction) { }
92 const String & Text() const { return sText; }
93 bool IsAbsolute() const { return bIsGlobal; }
94 bool IsFunction() const { return bIsFunction; }
96 private:
97 virtual void do_StoreAt(
98 DocuDisplay & o_rDisplay ) const;
99 virtual bool inq_IsWhite() const;
101 String sText;
102 bool bIsGlobal;
103 bool bIsFunction;
106 class DT_Whitespace : public DocuToken
108 public:
109 DT_Whitespace(
110 UINT8 i_nLength )
111 : nLength( i_nLength ) {}
112 UINT8 Length() const { return nLength; }
114 private:
115 virtual void do_StoreAt(
116 DocuDisplay & o_rDisplay ) const;
117 virtual bool inq_IsWhite() const;
119 UINT8 nLength;
123 class DT_Eol : public DocuToken
125 virtual void do_StoreAt(
126 DocuDisplay & o_rDisplay ) const;
127 virtual bool inq_IsWhite() const;
130 class DT_Xml : public DocuToken
132 public:
133 DT_Xml(
134 const char * i_sText )
135 : sText( i_sText ) {}
137 const String & Text() const { return sText; }
139 private:
140 virtual void do_StoreAt(
141 DocuDisplay & o_rDisplay ) const;
142 virtual bool inq_IsWhite() const;
144 String sText;
148 // IMPLEMENTATION
150 inline void
151 DocuToken::StoreAt( DocuDisplay & o_rDisplay ) const
152 { do_StoreAt(o_rDisplay); }
153 inline bool
154 DocuToken::IsWhite() const
155 { return inq_IsWhite(); }
162 #endif