1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef ADC_DISPLAY_HDIMPL_HXX 25 #define ADC_DISPLAY_HDIMPL_HXX 26 27 // BASE CLASSES 28 #include <udm/html/htmlitem.hxx> 29 // USED SERVICES 30 #include "easywri.hxx" 31 #include <cosv/bstream.hxx> 32 #include <ary/ary_disp.hxx> 33 #include <ary/cpp/c_namesp.hxx> 34 #include <ary/cpp/c_ce.hxx> 35 #include "aryattrs.hxx" // For compatibility with earlier times, when those funtions were in this header. 36 37 38 namespace ary 39 { 40 namespace cpp 41 { 42 class CodeEntity; 43 class Class; 44 class DisplayGate; 45 class Function; 46 class DefineEntity; 47 class OperationSignature; 48 } 49 50 class QualifiedName; 51 } 52 namespace csi 53 { 54 namespace xml 55 { 56 class Element; 57 } 58 namespace html 59 { 60 class Table; 61 } 62 } 63 64 namespace adcdisp 65 { 66 class ParameterTable; 67 } 68 69 class OuputPage_Environment; 70 class Docu_Display; 71 72 class HtmlDisplay_Impl 73 { 74 public: 75 ~HtmlDisplay_Impl(); 76 77 const OuputPage_Environment & 78 Env() const { return *pEnv; } 79 80 // ACCESS 81 OuputPage_Environment & 82 Env() { return *pEnv; } 83 EasyWriter & Easy() { return aWriteHelper; } 84 csi::xml::Element & CurOut() { return aWriteHelper.Out(); } 85 86 protected: 87 HtmlDisplay_Impl( 88 OuputPage_Environment & 89 io_rEnv ); 90 private: 91 // DATA 92 OuputPage_Environment * 93 pEnv; 94 EasyWriter aWriteHelper; 95 }; 96 97 98 namespace dshelp 99 { 100 101 void DisplaySlot( 102 ary::Display & o_rDisplay, 103 const ary::AryGroup & 104 i_rGroup, 105 ary::SlotAccessId i_nSlot ); 106 107 108 const char * PathUp( 109 uintt i_nLevels ); 110 const char * PathPerLevelsUp( 111 uintt i_nLevels, 112 const char * i_nPathBelowDestinationLevel ); 113 114 const char * PathPerRoot( 115 const OuputPage_Environment & 116 i_rEnv, 117 const char * i_sPathFromRootDir ); 118 const char * PathPerNamespace( 119 const OuputPage_Environment & 120 i_rEnv, 121 const char * i_sPathFromNamespaceDir ); 122 123 void Create_ChildListLabel( 124 csi::xml::Element & o_rParentElement, 125 const char * i_sLabel ); 126 DYN csi::html::Table & 127 Create_ChildListTable( 128 const char * i_sTitle ); 129 130 const char * HtmlFileName( 131 const char * i_sPrefix, 132 const char * i_sEntityName ); 133 134 inline const char * 135 ClassFileName( const char * i_sClassLocalName ) 136 { return HtmlFileName( "c-", i_sClassLocalName); } 137 inline const char * 138 EnumFileName( const char * i_sEnumLocalName ) 139 { return HtmlFileName( "e-", i_sEnumLocalName); } 140 inline const char * 141 TypedefFileName( const char * i_sTypedefLocalName ) 142 { return HtmlFileName( "t-", i_sTypedefLocalName); } 143 inline const char * 144 FileFileName( const char * i_sFileLocalName ) 145 { return HtmlFileName( "f-", i_sFileLocalName); } 146 147 const char * Path2Class( 148 uintt i_nLevelsUp, 149 const char * i_sClassLocalName ); 150 151 const char * Path2Child( 152 const char * i_sFileName, 153 const char * i_sSubDir = 0 ); 154 155 const char * Path2ChildNamespace( 156 const char * i_sLocalName ); 157 158 String OperationLink( 159 const ary::cpp::Gate & i_gate, 160 const String & i_sOpName, 161 ary::cpp::Ce_id i_nOpId, 162 const char * i_sPrePath = "" ); 163 const char * DataLink( 164 const String & i_sLocalName, 165 const char * i_sPrePath = "" ); 166 167 inline String 168 OperationLabel( const String & i_sOpName, 169 ary::cpp::Ce_id i_nOpId, 170 const ary::cpp::Gate & i_gate ) 171 { return String(OperationLink(i_gate, i_sOpName, i_nOpId) + 1); } // Skip '#' in front. 172 inline const char * 173 DataLabel( const String & i_sLocalName ) 174 { return DataLink(i_sLocalName) + 1; } // Skip '#' in front. 175 176 177 void Get_LinkedTypeText( 178 csi::xml::Element & o_rOut, 179 const OuputPage_Environment & 180 i_rEnv, 181 ary::cpp::Type_id i_nId, 182 bool i_bWithAbsolutifier = true ); 183 184 185 const char * Link2Ce( 186 const OuputPage_Environment & 187 i_rEnv, 188 const ary::cpp::CodeEntity & 189 i_rCe ); 190 191 const char * Link2CppDefinition( 192 const OuputPage_Environment & 193 i_rEnv, 194 const ary::cpp::DefineEntity & 195 i_rDef ); 196 197 const ary::cpp::CodeEntity * 198 FindUnambiguousCe( 199 const OuputPage_Environment & 200 i_rEnv, 201 const ary::QualifiedName & 202 i_rQuName, 203 const ary::cpp::Class * i_pJustDocumentedClass ); 204 205 void ShowDocu_On( 206 csi::xml::Element & o_rOut, 207 Docu_Display & io_rDisplay, 208 const ary::cpp::CppEntity & 209 i_rRE ); 210 211 void WriteOut_TokenList( 212 csi::xml::Element & o_rOut, 213 const StringVector & i_rTokens, 214 const char * i_sSeparator ); 215 216 void EraseLeadingSpace( 217 String & io_rStr ); 218 219 /** @param o_bIsConst 220 *o_bIsConst will be set to true, if o_bIsConst != 0 and function is const. 221 If the function is not const, *o_bIsConst remains unchanged! 222 223 @param o_bIsVirtual 224 The same as o_bIsConst. 225 */ 226 void WriteOut_LinkedFunctionText( 227 csi::xml::Element & o_rTitleOut, 228 adcdisp::ParameterTable & 229 o_rParameters, 230 const ary::cpp::Function & 231 i_rFunction, 232 const OuputPage_Environment & 233 i_rEnv, 234 bool * o_bIsConst = 0, 235 bool * o_bIsVirtual = 0 ); 236 237 238 239 } // namespace dshelp 240 241 using namespace dshelp; 242 243 #endif 244