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_DISPLAY_HDIMPL_HXX
29 #define ADC_DISPLAY_HDIMPL_HXX
30 
31 // BASE CLASSES
32 #include <udm/html/htmlitem.hxx>
33 // USED SERVICES
34 #include "easywri.hxx"
35 #include <cosv/bstream.hxx>
36 #include <ary/ary_disp.hxx>
37 #include <ary/cpp/c_namesp.hxx>
38 #include <ary/cpp/c_ce.hxx>
39 #include "aryattrs.hxx"     // For compatibility with earlier times, when those funtions were in this header.
40 
41 
42 namespace ary
43 {
44  	namespace cpp
45     {
46         class CodeEntity;
47         class Class;
48      	class DisplayGate;
49         class Function;
50         class DefineEntity;
51         class OperationSignature;
52     }
53 
54     class QualifiedName;
55 }
56 namespace csi
57 {
58  	namespace xml
59     {
60         class Element;
61     }
62  	namespace html
63     {
64         class Table;
65     }
66 }
67 
68 namespace adcdisp
69 {
70  	class ParameterTable;
71 }
72 
73 class OuputPage_Environment;
74 class Docu_Display;
75 
76 class HtmlDisplay_Impl
77 {
78   public:
79                         ~HtmlDisplay_Impl();
80 
81     const OuputPage_Environment &
82                         Env() const             { return *pEnv; }
83 
84     // ACCESS
85     OuputPage_Environment &
86                         Env()                   { return *pEnv; }
87     EasyWriter &        Easy()                  { return aWriteHelper; }
88     csi::xml::Element & CurOut()                { return aWriteHelper.Out(); }
89 
90   protected:
91                         HtmlDisplay_Impl(
92                             OuputPage_Environment &
93                                                 io_rEnv );
94   private:
95 	// DATA
96     OuputPage_Environment *
97                         pEnv;
98     EasyWriter          aWriteHelper;
99 };
100 
101 
102 namespace dshelp
103 {
104 
105 void                DisplaySlot(
106                         ary::Display &      o_rDisplay,
107                         const ary::AryGroup &
108                                             i_rGroup,
109                         ary::SlotAccessId   i_nSlot );
110 
111 
112 const char *        PathUp(
113                         uintt                   i_nLevels );
114 const char *        PathPerLevelsUp(
115                         uintt                   i_nLevels,
116                         const char *            i_nPathBelowDestinationLevel );
117 
118 const char *        PathPerRoot(
119                         const OuputPage_Environment &
120                                                 i_rEnv,
121                         const char *            i_sPathFromRootDir );
122 const char *        PathPerNamespace(
123                         const OuputPage_Environment &
124                                                 i_rEnv,
125                         const char *            i_sPathFromNamespaceDir );
126 
127 void                Create_ChildListLabel(
128                         csi::xml::Element &     o_rParentElement,
129                         const char *            i_sLabel );
130 DYN csi::html::Table &
131                     Create_ChildListTable(
132                         const char *            i_sTitle );
133 
134 const char *        HtmlFileName(
135                         const char *            i_sPrefix,
136                         const char *            i_sEntityName );
137 
138 inline const char *
139 ClassFileName( const char * i_sClassLocalName )
140     { return HtmlFileName( "c-", i_sClassLocalName); }
141 inline const char *
142 EnumFileName( const char * i_sEnumLocalName )
143     { return HtmlFileName( "e-", i_sEnumLocalName); }
144 inline const char *
145 TypedefFileName( const char * i_sTypedefLocalName )
146     { return HtmlFileName( "t-", i_sTypedefLocalName); }
147 inline const char *
148 FileFileName( const char * i_sFileLocalName )
149     { return HtmlFileName( "f-", i_sFileLocalName); }
150 
151 const char *        Path2Class(
152                         uintt                   i_nLevelsUp,
153                         const char *            i_sClassLocalName );
154 
155 const char *        Path2Child(
156                         const char *            i_sFileName,
157                         const char *            i_sSubDir = 0 );
158 
159 const char *        Path2ChildNamespace(
160                         const char *            i_sLocalName );
161 
162 String              OperationLink(
163                         const ary::cpp::Gate &  i_gate,
164                         const String  &         i_sOpName,
165                         ary::cpp::Ce_id         i_nOpId,
166                         const char *            i_sPrePath = "" );
167 const char *        DataLink(
168                         const String  &         i_sLocalName,
169                         const char *            i_sPrePath = ""  );
170 
171 inline String
172 OperationLabel( const String  &                      i_sOpName,
173                 ary::cpp::Ce_id                      i_nOpId,
174                 const ary::cpp::Gate &               i_gate )
175     { return String(OperationLink(i_gate, i_sOpName, i_nOpId) + 1); }     // Skip '#' in front.
176 inline const char *
177 DataLabel( const String  &         i_sLocalName )
178     { return DataLink(i_sLocalName) + 1; }     // Skip '#' in front.
179 
180 
181 void                Get_LinkedTypeText(
182                         csi::xml::Element &     o_rOut,
183                         const OuputPage_Environment &
184                                                 i_rEnv,
185                         ary::cpp::Type_id       i_nId,
186                         bool                    i_bWithAbsolutifier = true );
187 
188 
189 const char *        Link2Ce(
190                         const OuputPage_Environment &
191                                                 i_rEnv,
192                         const ary::cpp::CodeEntity &
193                                                 i_rCe );
194 
195 const char *        Link2CppDefinition(
196                         const OuputPage_Environment &
197                                                 i_rEnv,
198                         const ary::cpp::DefineEntity &
199                                                 i_rDef );
200 
201 const ary::cpp::CodeEntity *
202                     FindUnambiguousCe(
203                         const OuputPage_Environment &
204                                                 i_rEnv,
205                         const ary::QualifiedName &
206                                                 i_rQuName,
207                         const ary::cpp::Class * i_pJustDocumentedClass );
208 
209 void                ShowDocu_On(
210                         csi::xml::Element &     o_rOut,
211                         Docu_Display &          io_rDisplay,
212                         const ary::cpp::CppEntity &
213                                                 i_rRE );
214 
215 void                WriteOut_TokenList(
216                         csi::xml::Element &     o_rOut,
217                         const StringVector &    i_rTokens,
218                         const char *            i_sSeparator );
219 
220 void                EraseLeadingSpace(
221                         String  &               io_rStr );
222 
223 /** @param o_bIsConst
224     *o_bIsConst will be set to true, if o_bIsConst != 0 and function is const.
225     If the function is not const, *o_bIsConst remains unchanged!
226 
227     @param o_bIsVirtual
228     The same as o_bIsConst.
229 */
230 void                WriteOut_LinkedFunctionText(
231                         csi::xml::Element &     o_rTitleOut,
232                         adcdisp::ParameterTable &
233                                                 o_rParameters,
234                         const ary::cpp::Function &
235                                                 i_rFunction,
236                         const OuputPage_Environment &
237                                                 i_rEnv,
238                         bool *                  o_bIsConst = 0,
239                         bool *                  o_bIsVirtual = 0 );
240 
241 
242 
243 }   // namespace dshelp
244 
245 using namespace dshelp;
246 
247 #endif
248