LCOV - code coverage report
Current view: top level - unodevtools/source/skeletonmaker - cpptypemaker.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 487 0.0 %
Date: 2012-08-25 Functions: 0 12 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : 
      20                 :            : #include "codemaker/commoncpp.hxx"
      21                 :            : 
      22                 :            : #include "ostringostreaminserter.hxx"
      23                 :            : #include "skeletoncommon.hxx"
      24                 :            : #include "skeletoncpp.hxx"
      25                 :            : 
      26                 :            : using namespace ::rtl;
      27                 :            : using namespace ::codemaker::cpp;
      28                 :            : 
      29                 :            : namespace skeletonmaker { namespace cpp {
      30                 :            : 
      31                 :          0 : void printType(std::ostream & o,
      32                 :            :     ProgramOptions const & options, TypeManager const & manager,
      33                 :            :     codemaker::UnoType::Sort sort, RTTypeClass typeClass,
      34                 :            :     OString const & name, sal_Int32 rank,
      35                 :            :     std::vector< OString > const & arguments, short referenceType,
      36                 :            :     bool defaultvalue)
      37                 :            : {
      38                 :          0 :     if (defaultvalue && rank == 0 && sort <= codemaker::UnoType::SORT_CHAR) {
      39                 :          0 :         switch (sort)
      40                 :            :         {
      41                 :            :         case codemaker::UnoType::SORT_BOOLEAN:
      42                 :          0 :             o << "sal_False";
      43                 :          0 :             return;
      44                 :            :         case codemaker::UnoType::SORT_CHAR:
      45                 :            :         case codemaker::UnoType::SORT_BYTE:
      46                 :            :         case codemaker::UnoType::SORT_SHORT:
      47                 :            :         case codemaker::UnoType::SORT_UNSIGNED_SHORT:
      48                 :            :         case codemaker::UnoType::SORT_LONG:
      49                 :            :         case codemaker::UnoType::SORT_UNSIGNED_LONG:
      50                 :            :         case codemaker::UnoType::SORT_HYPER:
      51                 :            :         case codemaker::UnoType::SORT_UNSIGNED_HYPER:
      52                 :            :         case codemaker::UnoType::SORT_FLOAT:
      53                 :            :         case codemaker::UnoType::SORT_DOUBLE:
      54                 :          0 :             o << "0";
      55                 :          0 :             return;
      56                 :            :         case codemaker::UnoType::SORT_VOID:
      57                 :            :         case codemaker::UnoType::SORT_STRING:
      58                 :            :         case codemaker::UnoType::SORT_TYPE:
      59                 :            :         case codemaker::UnoType::SORT_ANY:
      60                 :            :         case codemaker::UnoType::SORT_COMPLEX:
      61                 :          0 :             break;
      62                 :            :         }
      63                 :            :     }
      64                 :            : 
      65                 :          0 :     if (defaultvalue && referenceType == 16) {
      66                 :          0 :         if (typeClass == RT_TYPE_ENUM) {
      67                 :          0 :             typereg::Reader reader(manager.getTypeReader(name));
      68                 :          0 :             o << name.copy(name.lastIndexOf('/'))
      69                 :          0 :               << "_"
      70                 :          0 :               << codemaker::convertString(reader.getFieldName(0));
      71                 :            :         }
      72                 :          0 :         return;
      73                 :            :     }
      74                 :          0 :     bool bReference = false;
      75                 :          0 :     if (((sort > codemaker::UnoType::SORT_CHAR ||
      76                 :            :           rank > 0) && referenceType != 8 &&
      77                 :          0 :          !(typeClass == RT_TYPE_ENUM && referenceType == 4 && rank == 0)) ||
      78                 :            :         (sort <= codemaker::UnoType::SORT_CHAR && referenceType == 2))
      79                 :            :     {
      80                 :          0 :         bReference = true;
      81                 :            :     }
      82                 :            : 
      83                 :          0 :     if (bReference && referenceType == 4)
      84                 :          0 :         o << "const ";
      85                 :            : 
      86                 :          0 :     for (sal_Int32 i = 0; i < rank; ++i) {
      87                 :            :         o << ((options.shortnames) ? "css::uno::Sequence< " :
      88                 :          0 :               "::com::sun::star::uno::Sequence< ");
      89                 :            :     }
      90                 :          0 :     if (typeClass == RT_TYPE_INTERFACE && referenceType > 0) {
      91                 :            :         o << ((options.shortnames) ? "css::uno::Reference< " :
      92                 :          0 :               "::com::sun::star::uno::Reference< ");
      93                 :            :     }
      94                 :            : 
      95                 :            :     o << scopedCppName(codemaker::cpp::translateUnoToCppType(
      96                 :            :                            sort, typeClass, name, false),
      97                 :          0 :                        false, options.shortnames && referenceType > 0);
      98                 :            : 
      99                 :          0 :     if (typeClass == RT_TYPE_INTERFACE && referenceType > 0)
     100                 :          0 :         o << " >";
     101                 :            : 
     102                 :          0 :     if (!arguments.empty()) {
     103                 :          0 :         o << "< ";
     104                 :          0 :         for (std::vector< OString >::const_iterator i(arguments.begin());
     105                 :          0 :              i != arguments.end(); ++i)
     106                 :            :         {
     107                 :          0 :             if (i != arguments.begin())
     108                 :          0 :                 o << ", ";
     109                 :            : 
     110                 :          0 :             printType(o, options, manager, *i, 1, false);
     111                 :            :         }
     112                 :          0 :         o << " >";
     113                 :            :     }
     114                 :            : 
     115                 :          0 :     for (sal_Int32 i = 0; i < rank; ++i)
     116                 :          0 :         o << " >";
     117                 :            : 
     118                 :          0 :     if (bReference && referenceType > 1)
     119                 :          0 :         o << " &";
     120                 :            : 
     121                 :          0 :     if (referenceType == 8 && (sort > codemaker::UnoType::SORT_CHAR || rank > 0))
     122                 :          0 :         o << "()";
     123                 :            : }
     124                 :            : 
     125                 :          0 : void printType(std::ostream & o,
     126                 :            :     ProgramOptions const & options, TypeManager const & manager,
     127                 :            :     OString const & type, short referenceType, bool defaultvalue)
     128                 :            : {
     129                 :            :     RTTypeClass typeClass;
     130                 :          0 :     OString name;
     131                 :            :     sal_Int32 rank;
     132                 :          0 :     std::vector< OString > arguments;
     133                 :            :     codemaker::UnoType::Sort sort = codemaker::decomposeAndResolve(
     134                 :          0 :         manager, type, true, true, true, &typeClass, &name, &rank, &arguments);
     135                 :            :     printType(o,
     136                 :            :         options, manager, sort, typeClass, name, rank, arguments,
     137                 :          0 :         referenceType, defaultvalue);
     138                 :          0 : }
     139                 :            : 
     140                 :          0 : bool printConstructorParameters(std::ostream & o,
     141                 :            :     ProgramOptions const & options, TypeManager const & manager,
     142                 :            :     typereg::Reader const & reader, typereg::Reader const & outerReader,
     143                 :            :     std::vector< OString > const & arguments)
     144                 :            : {
     145                 :          0 :     bool previous = false;
     146                 :          0 :     if (reader.getSuperTypeCount() != 0) {
     147                 :            :         OString super(
     148                 :          0 :             codemaker::convertString(reader.getSuperTypeName(0)));
     149                 :          0 :         typereg::Reader superReader(manager.getTypeReader(super));
     150                 :          0 :         if (!superReader.isValid())
     151                 :          0 :             throw CannotDumpException("Bad type library entity " + super);
     152                 :            : 
     153                 :            :         previous = printConstructorParameters(o,
     154                 :          0 :             options, manager, superReader, outerReader, arguments);
     155                 :            :     }
     156                 :          0 :     for (sal_uInt16 i = 0; i < reader.getFieldCount(); ++i) {
     157                 :          0 :         if (previous)
     158                 :          0 :             o << ", ";
     159                 :            :         else
     160                 :          0 :             previous = true;
     161                 :            : 
     162                 :          0 :         if ((reader.getFieldFlags(i) & RT_ACCESS_PARAMETERIZED_TYPE) == 0) {
     163                 :            :             printType(o, options, manager,
     164                 :          0 :                       codemaker::convertString(reader.getFieldTypeName(i)), 4);
     165                 :          0 :         } else if (arguments.empty()) {
     166                 :            :             // ToDo !
     167                 :            :             // o << "com::sun::star::uno::Any";
     168                 :            :         } else {
     169                 :          0 :             sal_uInt16 tparam = 0;
     170                 :          0 :             while (outerReader.getReferenceTypeName(tparam)
     171                 :          0 :                    != reader.getFieldTypeName(i))
     172                 :            :             {
     173                 :          0 :                 ++tparam;
     174                 :            :                 OSL_ASSERT(tparam < outerReader.getReferenceCount());
     175                 :            :             }
     176                 :            :             // assume std::vector< OString >::size_type is at least as
     177                 :            :             // large as sal_uInt16:
     178                 :          0 :             printType(o, options, manager, arguments[tparam], 4);
     179                 :            :         }
     180                 :          0 :         o << ' '
     181                 :            :           << (codemaker::cpp::translateUnoToCppIdentifier(
     182                 :            :                   codemaker::convertString(reader.getFieldName(i)),
     183                 :            :                   "param").
     184                 :          0 :               getStr());
     185                 :            :     }
     186                 :          0 :     return previous;
     187                 :            : }
     188                 :            : 
     189                 :          0 : void printConstructor(std::ostream & o,
     190                 :            :     ProgramOptions const & options, TypeManager const & manager,
     191                 :            :     typereg::Reader const & reader,
     192                 :            :     std::vector< OString > const & arguments)
     193                 :            : {
     194                 :          0 :     OString type(codemaker::convertString(reader.getTypeName()));
     195                 :          0 :     o << "public ";
     196                 :          0 :     o << type.copy(type.lastIndexOf('/') + 1) << '(';
     197                 :            :     printConstructorParameters(o, options, manager, reader, reader,
     198                 :          0 :                                arguments);
     199                 :          0 :     o << ");\n";
     200                 :          0 : }
     201                 :            : 
     202                 :          0 : void printMethodParameters(std::ostream & o,
     203                 :            :     ProgramOptions const & options, TypeManager const & manager,
     204                 :            :     typereg::Reader const & reader, sal_uInt16 method, bool previous,
     205                 :            :     bool withtype)
     206                 :            : {
     207                 :          0 :     short referenceType = 4;
     208                 :          0 :     for (sal_uInt16 i = 0; i < reader.getMethodParameterCount(method); ++i) {
     209                 :          0 :         if (previous)
     210                 :          0 :             o << ", ";
     211                 :            : 
     212                 :          0 :         previous = true;
     213                 :            : 
     214                 :          0 :         if (reader.getMethodParameterFlags(method, i) == RT_PARAM_OUT
     215                 :          0 :             || reader.getMethodParameterFlags(method, i) == RT_PARAM_INOUT)
     216                 :            :         {
     217                 :          0 :             referenceType = 2;
     218                 :            :         } else {
     219                 :          0 :             referenceType = 4;
     220                 :            :         }
     221                 :            : 
     222                 :          0 :         if (withtype) {
     223                 :            :             printType(o, options, manager,
     224                 :            :                 codemaker::convertString(
     225                 :            :                     reader.getMethodParameterTypeName(method, i)),
     226                 :          0 :                          referenceType);
     227                 :          0 :             o << ' ';
     228                 :            :         }
     229                 :            : 
     230                 :            :         o << (codemaker::cpp::translateUnoToCppIdentifier(
     231                 :            :                   codemaker::convertString(
     232                 :            :                       reader.getMethodParameterName(method, i)),
     233                 :            :                   "param").
     234                 :          0 :               getStr());
     235                 :            :     }
     236                 :          0 : }
     237                 :            : 
     238                 :          0 : void printExceptionSpecification(std::ostream & o,
     239                 :            :     ProgramOptions const & options, TypeManager const & manager,
     240                 :            :     typereg::Reader const & reader, sal_uInt16 method)
     241                 :            : {
     242                 :            :     o << ((options.shortnames) ? " throw (css::uno::RuntimeException" :
     243                 :          0 :           " throw (::com::sun::star::uno::RuntimeException");
     244                 :          0 :     if (reader.getMethodExceptionCount(method) > 0) {
     245                 :          0 :         for (sal_uInt16 i = 0; i < reader.getMethodExceptionCount(method); ++i) {
     246                 :          0 :             o << ", ";
     247                 :            :             printType(o, options, manager,
     248                 :            :                 codemaker::convertString(
     249                 :          0 :                     reader.getMethodExceptionTypeName(method, i)), 1);
     250                 :            :         }
     251                 :            :     }
     252                 :          0 :     o << ")";
     253                 :          0 : }
     254                 :            : 
     255                 :          0 : void printSetPropertyMixinBody(std::ostream & o,
     256                 :            :                                typereg::Reader const & reader,
     257                 :            :                                sal_uInt16 field,
     258                 :            :                                sal_uInt16 method)
     259                 :            : {
     260                 :          0 :     RTFieldAccess propFlags = checkAdditionalPropertyFlags(reader, field, method);
     261                 :          0 :     OString fieldname = codemaker::convertString(reader.getFieldName(field));
     262                 :          0 :     bool bound = (reader.getFieldFlags(field) & RT_ACCESS_BOUND ? true : false);
     263                 :            : 
     264                 :          0 :     o << "\n{\n";
     265                 :            : 
     266                 :          0 :     if (bound)
     267                 :          0 :         o << "    BoundListeners l;\n";
     268                 :            : 
     269                 :          0 :     if (propFlags & RT_ACCESS_CONSTRAINED) {
     270                 :            :         OString fieldtype = codemaker::convertString(
     271                 :          0 :                                 reader.getFieldTypeName(field));
     272                 :            : 
     273                 :          0 :         sal_Int32 index = fieldtype.lastIndexOf('<');
     274                 :          0 :         sal_Int32 nPos=0;
     275                 :          0 :         bool single = true;
     276                 :          0 :         bool optional = false;
     277                 :          0 :         OStringBuffer buffer1(64);
     278                 :          0 :         OStringBuffer buffer2(64);
     279                 :          0 :         do
     280                 :            :         {
     281                 :          0 :             OString s(fieldtype.getToken(0, '<', nPos));
     282                 :          0 :             OString t = s.copy(s.lastIndexOf('/')+1);
     283                 :            : 
     284                 :          0 :             if (t.equals("Optional")) {
     285                 :          0 :                 optional=true;
     286                 :          0 :                 if (single) {
     287                 :          0 :                     single=false;
     288                 :          0 :                     buffer1.append("the_value.IsPresent");
     289                 :          0 :                     buffer2.append("the_value.Value");
     290                 :            :                 } else {
     291                 :          0 :                     buffer1.insert(0, t);
     292                 :          0 :                     buffer1.append(".IsPresent");
     293                 :          0 :                     buffer2.insert(0, t);
     294                 :          0 :                     buffer2.append(".Value");
     295                 :            :                 }
     296                 :            :             } else {
     297                 :          0 :                 if (single) {
     298                 :          0 :                     single=false;
     299                 :          0 :                     if (!optional)
     300                 :          0 :                         buffer1.append("the_value.Value");
     301                 :            : 
     302                 :          0 :                     buffer2.append("the_value.Value");
     303                 :            :                 } else {
     304                 :          0 :                     if (!optional) {
     305                 :          0 :                         buffer1.insert(0, t);
     306                 :          0 :                         buffer1.append(".Value");
     307                 :            :                     }
     308                 :          0 :                     buffer2.insert(0, t);
     309                 :          0 :                     buffer2.append(".Value");
     310                 :            :                 }
     311                 :          0 :             }
     312                 :            :         } while( nPos <= index );
     313                 :            : 
     314                 :          0 :         o << "    css::uno::Any v;\n";
     315                 :          0 :         if (optional) {
     316                 :          0 :             o << "    if(" << buffer1.makeStringAndClear() << ")\n    {\n"
     317                 :          0 :               << "        v <<= " << buffer2.makeStringAndClear() << ";\n    }\n";
     318                 :            :         } else {
     319                 :          0 :             o << "    v <<= " << buffer2.makeStringAndClear() << ";\n\n";
     320                 :            :         }
     321                 :            : 
     322                 :          0 :         o << "    prepareSet(\n        rtl::OUString(\""
     323                 :          0 :           << fieldname << "\"),\n        css::uno::Any(), v, ";
     324                 :            :     } else {
     325                 :          0 :         o << "    prepareSet(\n        rtl::OUString(\""
     326                 :          0 :           << fieldname << "\"),\n        css::uno::Any(), css::uno::Any(), ";
     327                 :            :     }
     328                 :            : 
     329                 :          0 :     if (bound)
     330                 :          0 :         o << "&l);\n";
     331                 :            :     else
     332                 :          0 :         o << "0);\n";
     333                 :            : 
     334                 :          0 :     o << "    {\n        osl::MutexGuard g(m_aMutex);\n        m_"
     335                 :          0 :       << fieldname << " = the_value;\n    }\n";
     336                 :            : 
     337                 :          0 :     if (bound)
     338                 :          0 :         o << "    l.notify();\n";
     339                 :            : 
     340                 :          0 :     o  << "}\n\n";
     341                 :          0 : }
     342                 :            : 
     343                 :            : void generateXPropertySetBodies(std::ostream& o,
     344                 :            :                                 const OString & classname,
     345                 :            :                                 const OString & interfaceName);
     346                 :            : void generateXFastPropertySetBodies(std::ostream& o,
     347                 :            :                                     const OString & classname,
     348                 :            :                                     const OString & interfaceName);
     349                 :            : void generateXPropertyAccessBodies(std::ostream& o,
     350                 :            :                                    const OString & classname,
     351                 :            :                                    const OString & interfaceName);
     352                 :            : 
     353                 :            : void generateXAddInBodies(std::ostream& o, const OString & classname);
     354                 :            : 
     355                 :            : void generateXLocalizable(std::ostream& o, const OString & classname);
     356                 :            : 
     357                 :            : void generateXCompatibilityNamesBodies(std::ostream& o, const OString & classname);
     358                 :            : 
     359                 :            : void generateXInitialization(std::ostream& o, const OString & classname);
     360                 :            : 
     361                 :            : void generateXDispatch(std::ostream& o,
     362                 :            :                        const OString & classname,
     363                 :            :                        const ProtocolCmdMap & protocolCmdMap);
     364                 :            : 
     365                 :            : void generateXDispatchProvider(std::ostream& o,
     366                 :            :                                const OString & classname,
     367                 :            :                                const ProtocolCmdMap & protocolCmdMap);
     368                 :            : 
     369                 :            : 
     370                 :          0 : void printMethods(std::ostream & o,
     371                 :            :     ProgramOptions const & options, TypeManager const & manager,
     372                 :            :     typereg::Reader const & reader, codemaker::GeneratedTypeSet & generated,
     373                 :            :     OString const & delegate, OString const & classname,
     374                 :            :     OString const & indentation, bool defaultvalue,
     375                 :            :     OString const & propertyhelper)
     376                 :            : {
     377                 :          0 :     OString type(codemaker::convertString(reader.getTypeName()));
     378                 :          0 :     if (generated.contains(type) || type.equals("com/sun/star/uno/XInterface") ||
     379                 :            :         (defaultvalue &&
     380                 :          0 :          ( type.equals("com/sun/star/lang/XComponent") ||
     381                 :          0 :            type.equals("com/sun/star/lang/XTypeProvider") ||
     382                 :          0 :            type.equals("com/sun/star/uno/XWeak")) ) )
     383                 :            :     {
     384                 :            :         return;
     385                 :            :     }
     386                 :            : 
     387                 :          0 :     static OString sd(RTL_CONSTASCII_STRINGPARAM("_"));
     388                 :          0 :     bool body = !delegate.isEmpty();
     389                 :          0 :     bool defaultbody = ((delegate.equals(sd)) ? true : false);
     390                 :            : 
     391                 :          0 :     if (body && propertyhelper.getLength() > 1) {
     392                 :          0 :         if ( type.equals("com/sun/star/beans/XPropertySet")) {
     393                 :          0 :             generated.add(type);
     394                 :            :             generateXPropertySetBodies(
     395                 :          0 :                 o, classname, scopedCppName(propertyhelper, false, true));
     396                 :            :             return;
     397                 :          0 :         } else if ( type.equals("com/sun/star/beans/XFastPropertySet")) {
     398                 :          0 :             generated.add(type);
     399                 :            :             generateXFastPropertySetBodies(
     400                 :          0 :                 o, classname, scopedCppName(propertyhelper, false, true));
     401                 :            :             return;
     402                 :          0 :         } else if ( type.equals("com/sun/star/beans/XPropertyAccess")) {
     403                 :          0 :             generated.add(type);
     404                 :            :             generateXPropertyAccessBodies(
     405                 :          0 :                 o, classname, scopedCppName(propertyhelper, false, true));
     406                 :            :             return;
     407                 :            :         }
     408                 :            :     }
     409                 :            : 
     410                 :          0 :     if (body && options.componenttype == 2) {
     411                 :          0 :         if (type.equals("com/sun/star/lang/XServiceName")) {
     412                 :            :             o << "// ::com::sun::star::lang::XServiceName:\n"
     413                 :          0 :                 "::rtl::OUString SAL_CALL " << classname << "getServiceName() "
     414                 :            :                 "throw (css::uno::RuntimeException)\n{\n    "
     415                 :            :                 "return ::rtl::OUString("
     416                 :          0 :                 "sADDIN_SERVICENAME);\n}\n";
     417                 :          0 :             generated.add(type);
     418                 :            :             return;
     419                 :          0 :         } else if (type.equals("com/sun/star/sheet/XAddIn")) {
     420                 :          0 :             generateXAddInBodies(o, classname);
     421                 :          0 :             generated.add(type);
     422                 :            : 
     423                 :            :             // special handling of XLocalizable -> parent of XAddIn
     424                 :          0 :             if (!generated.contains("com/sun/star/lang/XLocalizable")) {
     425                 :          0 :                 generateXLocalizable(o, classname);
     426                 :          0 :                 generated.add("com/sun/star/lang/XLocalizable");
     427                 :            :             }
     428                 :            :             return;
     429                 :          0 :         } else if (type.equals("com/sun/star/lang/XLocalizable")) {
     430                 :          0 :             generateXLocalizable(o, classname);
     431                 :          0 :             generated.add(type);
     432                 :            :             return;
     433                 :          0 :         } else if (type.equals("com/sun/star/sheet/XCompatibilityNames")) {
     434                 :          0 :             generateXCompatibilityNamesBodies(o, classname);
     435                 :          0 :             generated.add(type);
     436                 :            :             return;
     437                 :            :         }
     438                 :            :     }
     439                 :            : 
     440                 :          0 :     if (body && options.componenttype == 3) {
     441                 :          0 :         if (type.equals("com/sun/star/lang/XInitialization")) {
     442                 :          0 :             generateXInitialization(o, classname);
     443                 :          0 :             generated.add(type);
     444                 :            :             return;
     445                 :          0 :         } else if (type.equals("com/sun/star/frame/XDispatch")) {
     446                 :          0 :             generateXDispatch(o, classname, options.protocolCmdMap);
     447                 :          0 :             generated.add(type);
     448                 :            :             return;
     449                 :          0 :         } else if (type.equals("com/sun/star/frame/XDispatchProvider")) {
     450                 :          0 :             generateXDispatchProvider(o, classname, options.protocolCmdMap);
     451                 :          0 :             generated.add(type);
     452                 :            :             return;
     453                 :            :         }
     454                 :            :     }
     455                 :            : 
     456                 :          0 :     generated.add(type);
     457                 :          0 :     if (options.all || defaultvalue) {
     458                 :          0 :         for (sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i) {
     459                 :            :             typereg::Reader super(
     460                 :            :                 manager.getTypeReader(
     461                 :            :                     codemaker::convertString(
     462                 :          0 :                         reader.getSuperTypeName(i))));
     463                 :          0 :             if (!super.isValid()) {
     464                 :            :                 throw CannotDumpException(
     465                 :            :                     "Bad type library entity "
     466                 :            :                     + codemaker::convertString(
     467                 :          0 :                         reader.getSuperTypeName(i)));
     468                 :            :             }
     469                 :            : 
     470                 :          0 :             OString stype(codemaker::convertString(super.getTypeName()));
     471                 :            :             printMethods(o, options, manager, super, generated, delegate,
     472                 :          0 :                             classname, indentation, defaultvalue, propertyhelper);
     473                 :          0 :         }
     474                 :            : 
     475                 :          0 :         if (reader.getFieldCount() > 0 || reader.getMethodCount() > 0) {
     476                 :          0 :             o << indentation << "// ";
     477                 :          0 :             printType(o, options, manager, type, 0);
     478                 :          0 :             o << ":\n";
     479                 :            :         }
     480                 :            :     }
     481                 :          0 :     sal_uInt16 method = 0;
     482                 :          0 :     for (sal_uInt16 i = 0; i < reader.getFieldCount(); ++i) {
     483                 :          0 :         o << indentation;
     484                 :          0 :         if (!body)
     485                 :          0 :             o << "virtual ";
     486                 :            : 
     487                 :            :         printType(o, options, manager,
     488                 :          0 :                   codemaker::convertString(reader.getFieldTypeName(i)), 1);
     489                 :          0 :         o << " SAL_CALL ";
     490                 :          0 :         if (!classname.isEmpty())
     491                 :          0 :             o << classname;
     492                 :            : 
     493                 :          0 :         o << "get"
     494                 :          0 :           << codemaker::convertString(reader.getFieldName(i)).getStr()
     495                 :          0 :           << "()";
     496                 :          0 :         if (method < reader.getMethodCount()
     497                 :          0 :             && reader.getMethodFlags(method) == RT_MODE_ATTRIBUTE_GET
     498                 :          0 :             && reader.getMethodName(method) == reader.getFieldName(i))
     499                 :            :         {
     500                 :          0 :             printExceptionSpecification(o, options, manager, reader, method++);
     501                 :            :         } else {
     502                 :            :             o << ((options.shortnames) ? " throw (css::uno::RuntimeException)" :
     503                 :          0 :                   " throw (::com::sun::star::uno::RuntimeException)");
     504                 :            :         }
     505                 :          0 :         if (body) {
     506                 :          0 :             if (defaultbody) {
     507                 :          0 :                 if (!propertyhelper.isEmpty()) {
     508                 :          0 :                     o << "\n{\n    osl::MutexGuard g(m_aMutex);\n    return m_"
     509                 :          0 :                       << codemaker::convertString(reader.getFieldName(i)).getStr()
     510                 :          0 :                       << ";\n}\n\n";
     511                 :            :                 } else {
     512                 :          0 :                     o << "\n{\n    return ";
     513                 :          0 :                     if (options.componenttype == 1) {
     514                 :          0 :                         o << "m_"
     515                 :            :                           << codemaker::convertString(
     516                 :          0 :                               reader.getFieldName(i)).getStr();
     517                 :            :                     } else {
     518                 :            :                         printType(o, options, manager,
     519                 :            :                                   codemaker::convertString(
     520                 :            :                                       reader.getFieldTypeName(i)),
     521                 :          0 :                                   8, true);
     522                 :            :                     }
     523                 :          0 :                     o << ";\n}\n\n";
     524                 :            :                 }
     525                 :            :             } else {
     526                 :          0 :                 o << "\n" << indentation << "{\n" << indentation << "    return "
     527                 :          0 :                   << delegate.getStr() << "get"
     528                 :          0 :                   << codemaker::convertString(reader.getFieldName(i)).getStr()
     529                 :          0 :                   << "();\n" << indentation << "}\n\n";
     530                 :            :             }
     531                 :            :         } else {
     532                 :          0 :             o << ";\n";
     533                 :            :         }
     534                 :            : 
     535                 :          0 :         if ((reader.getFieldFlags(i) & RT_ACCESS_READONLY) == 0) {
     536                 :          0 :             o << indentation;
     537                 :          0 :             if (!body)
     538                 :          0 :                 o << "virtual ";
     539                 :            : 
     540                 :          0 :             o << "void SAL_CALL ";
     541                 :          0 :             if (!classname.isEmpty())
     542                 :          0 :                 o << classname;
     543                 :            : 
     544                 :          0 :             o << "set"
     545                 :          0 :               << (codemaker::convertString(reader.getFieldName(i)).getStr())
     546                 :          0 :               << '(';
     547                 :            :             printType(o, options, manager,
     548                 :          0 :                       codemaker::convertString(reader.getFieldTypeName(i)), 4);
     549                 :          0 :             o << " the_value)";
     550                 :          0 :             if (method < reader.getMethodCount()
     551                 :          0 :                 && reader.getMethodFlags(method) == RT_MODE_ATTRIBUTE_SET
     552                 :          0 :                 && reader.getMethodName(method) == reader.getFieldName(i))
     553                 :            :             {
     554                 :          0 :                 printExceptionSpecification(o, options, manager, reader, method++);
     555                 :            :             } else {
     556                 :            :                 o << ((options.shortnames) ? " throw (css::uno::RuntimeException)" :
     557                 :          0 :                       " throw (::com::sun::star::uno::RuntimeException)");
     558                 :            :             }
     559                 :          0 :             if (body) {
     560                 :          0 :                 if (defaultbody) {
     561                 :          0 :                     if (!propertyhelper.isEmpty()) {
     562                 :          0 :                         printSetPropertyMixinBody(o, reader, i, method);
     563                 :            :                     } else {
     564                 :          0 :                         if (options.componenttype == 1) {
     565                 :          0 :                             o << "\n{\n    m_"
     566                 :            :                               << codemaker::convertString(
     567                 :          0 :                                   reader.getFieldName(i)).getStr()
     568                 :          0 :                               << " = the_value;\n}\n\n";
     569                 :            :                         } else {
     570                 :          0 :                             o << "\n{\n\n}\n\n";
     571                 :            :                         }
     572                 :            :                     }
     573                 :            :                 } else {
     574                 :          0 :                     o << "\n" << indentation << "{\n" << indentation << "    "
     575                 :          0 :                       << delegate.getStr() << "set"
     576                 :          0 :                       << codemaker::convertString(reader.getFieldName(i)).getStr()
     577                 :          0 :                       << "(the_value);\n" << indentation << "}\n\n";
     578                 :            :                 }
     579                 :            :             } else {
     580                 :          0 :                 o << ";\n";
     581                 :            :             }
     582                 :            :         }
     583                 :            :     }
     584                 :          0 :     for (; method < reader.getMethodCount(); ++method) {
     585                 :          0 :         o << indentation;
     586                 :          0 :         if (!body)
     587                 :          0 :             o << "virtual ";
     588                 :            : 
     589                 :            :         printType(o, options, manager,
     590                 :            :                   codemaker::convertString(
     591                 :          0 :                       reader.getMethodReturnTypeName(method)), 1);
     592                 :          0 :         o << " SAL_CALL ";
     593                 :          0 :         if (!classname.isEmpty())
     594                 :          0 :             o << classname;
     595                 :            : 
     596                 :          0 :         const OString methodName(codemaker::convertString(reader.getMethodName(method)));
     597                 :            : 
     598                 :          0 :         o << methodName << '(';
     599                 :          0 :         printMethodParameters(o, options, manager, reader, method, false, true);
     600                 :          0 :         o << ')';
     601                 :          0 :         printExceptionSpecification(o, options, manager, reader, method);
     602                 :          0 :         if (body) {
     603                 :          0 :             static OUString s("void");
     604                 :          0 :             if (defaultbody) {
     605                 :          0 :                 o << "\n{\n";
     606                 :          0 :                 if (!reader.getMethodReturnTypeName(method).equals(s)) {
     607                 :          0 :                     o << "    // TODO: Exchange the default return implementation for \""
     608                 :          0 :                       << methodName << "\" !!!\n";
     609                 :            :                     o << "    // Exchange the default return implementation.\n"
     610                 :            :                         "    // NOTE: Default initialized polymorphic structs "
     611                 :            :                         "can cause problems because of\n    // missing default "
     612                 :            :                         "initialization of primitive types of some C++ compilers or"
     613                 :            :                         "\n    // different Any initialization in Java and C++ "
     614                 :          0 :                         "polymorphic structs.\n    return ";
     615                 :            :                     printType(o, options, manager,
     616                 :            :                         codemaker::convertString(
     617                 :          0 :                             reader.getMethodReturnTypeName(method)), 8, true);
     618                 :          0 :                     o << ";";
     619                 :            :                 } else {
     620                 :          0 :                     o << "    // TODO: Insert your implementation for \""
     621                 :          0 :                       << methodName << "\" here.";
     622                 :            :                 }
     623                 :          0 :                 o << "\n}\n\n";
     624                 :            :             } else {
     625                 :          0 :                 o << "\n" << indentation << "{\n" << indentation << "    ";
     626                 :          0 :                 if (!reader.getMethodReturnTypeName(method).equals(s))
     627                 :          0 :                     o << "return ";
     628                 :            : 
     629                 :          0 :                 o << delegate.getStr()
     630                 :            :                   << (codemaker::convertString(
     631                 :          0 :                           reader.getMethodName(method)).getStr())
     632                 :          0 :                   << '(';
     633                 :            :                 printMethodParameters(o, options, manager, reader, method,
     634                 :          0 :                                       false, false);
     635                 :          0 :                 o << ");\n" << indentation << "}\n\n";
     636                 :            :             }
     637                 :            :         } else {
     638                 :          0 :             o << ";\n";
     639                 :            :         }
     640                 :          0 :     }
     641                 :            : 
     642                 :          0 :     if (method > 0 && !body)
     643                 :          0 :         o << "\n";
     644                 :            : }
     645                 :            : 
     646                 :          0 : void printConstructionMethods(std::ostream & o,
     647                 :            :     ProgramOptions const & options, TypeManager const & manager,
     648                 :            :     typereg::Reader const & reader)
     649                 :            : {
     650                 :          0 :     for (sal_uInt16 i = 0; i < reader.getMethodCount(); ++i) {
     651                 :          0 :         o << "static ";
     652                 :            :         printType(o,
     653                 :            :             options, manager,
     654                 :          0 :             codemaker::convertString(reader.getSuperTypeName(0)), 1);
     655                 :          0 :         o << ' ';
     656                 :          0 :         if (reader.getMethodName(i).isEmpty()) {
     657                 :          0 :             o << "create";
     658                 :            :         } else {
     659                 :            :             o << (codemaker::cpp::translateUnoToCppIdentifier(
     660                 :            :                       codemaker::convertString(reader.getMethodName(i)),
     661                 :            :                       "method").
     662                 :          0 :                   getStr());
     663                 :            :         }
     664                 :            :         o << ((options.shortnames) ? "(css::uno::Reference< css" :
     665                 :          0 :               "(::com::sun::star::uno::Reference< ::com::sun::star")
     666                 :          0 :           << "::uno::XComponentContext > const & the_context";
     667                 :            :         printMethodParameters(o, options, manager, reader, i,
     668                 :          0 :                               true, true);
     669                 :          0 :         o << ')';
     670                 :          0 :         printExceptionSpecification(o, options, manager, reader, i);
     671                 :          0 :         o << ";\n";
     672                 :            :     }
     673                 :          0 : }
     674                 :            : 
     675                 :          0 : void printServiceMembers(std::ostream & o,
     676                 :            :     ProgramOptions const & options, TypeManager const & manager,
     677                 :            :     typereg::Reader const & reader, OString const & type,
     678                 :            :     OString const & delegate)
     679                 :            : {
     680                 :          0 :     for (sal_uInt16 i = 0; i < reader.getReferenceCount(); ++i) {
     681                 :            :         OString referenceType(
     682                 :            :             codemaker::convertString(
     683                 :          0 :                 reader.getReferenceTypeName(i)).replace('/', '.'));
     684                 :            : 
     685                 :          0 :         if ( reader.getReferenceSort(i) == RT_REF_SUPPORTS ) {
     686                 :          0 :             o << "\n// supported interface " << referenceType.getStr() << "\n";
     687                 :          0 :             generateDocumentation(o, options, manager, referenceType, delegate);
     688                 :          0 :         } else if ( reader.getReferenceSort(i) == RT_REF_EXPORTS ) {
     689                 :          0 :             o << "\n// exported service " << referenceType.getStr() << "\n";
     690                 :          0 :             generateDocumentation(o, options, manager, referenceType, delegate);
     691                 :          0 :             o << "\n// end of exported service " << referenceType.getStr() << "\n";
     692                 :            :         }
     693                 :          0 :     }
     694                 :            : 
     695                 :          0 :     if (delegate.isEmpty()) {
     696                 :          0 :         o << "\n// properties of service \""<< type.getStr() << "\"\n";
     697                 :          0 :         for (sal_uInt16 i = 0; i < reader.getFieldCount(); ++i) {
     698                 :            :             OString fieldName(
     699                 :          0 :                 codemaker::convertString(reader.getFieldName(i)));
     700                 :            :             OString fieldType(
     701                 :          0 :                 codemaker::convertString(reader.getFieldTypeName(i)));
     702                 :            : 
     703                 :          0 :             o << "// private ";
     704                 :          0 :             printType(o, options, manager, fieldType, 1);
     705                 :          0 :             o << " "
     706                 :            :               << codemaker::cpp::translateUnoToCppIdentifier(
     707                 :          0 :                   fieldName, "property").getStr()
     708                 :          0 :               << ";\n";
     709                 :          0 :         }
     710                 :            :     }
     711                 :          0 : }
     712                 :            : 
     713                 :          0 : void printMapsToCppType(std::ostream & o,
     714                 :            :     ProgramOptions const & options, TypeManager const & manager,
     715                 :            :     codemaker::UnoType::Sort sort, RTTypeClass typeClass,
     716                 :            :     OString const & name, sal_Int32 rank,
     717                 :            :     std::vector< OString > const & arguments, const char * cppTypeSort)
     718                 :            : {
     719                 :          0 :     o << "maps to C++ ";
     720                 :          0 :     if (cppTypeSort != 0)
     721                 :          0 :         o << cppTypeSort << ' ';
     722                 :            : 
     723                 :          0 :     o << "type \"";
     724                 :          0 :     if (rank == 0 && name == "com/sun/star/uno/XInterface") {
     725                 :          0 :         o << "Reference< com::sun::star::uno::XInterface >";
     726                 :            :     } else {
     727                 :          0 :         printType(o, options, manager, sort, typeClass, name, rank, arguments, 0);
     728                 :            :     }
     729                 :          0 :     o << '"';
     730                 :          0 : }
     731                 :            : 
     732                 :          0 : void generateDocumentation(std::ostream & o,
     733                 :            :     ProgramOptions const & options, TypeManager const & manager,
     734                 :            :     OString const & type, OString const & delegate)
     735                 :            : {
     736                 :          0 :     if (type.indexOf('/') >= 0)
     737                 :          0 :         throw CannotDumpException("Illegal type name " + type);
     738                 :            : 
     739                 :          0 :     OString binType(type.replace('.', '/'));
     740                 :            :     RTTypeClass typeClass;
     741                 :          0 :     OString name;
     742                 :            :     sal_Int32 rank;
     743                 :          0 :     std::vector< OString > arguments;
     744                 :            :     codemaker::UnoType::Sort sort = decomposeResolveAndCheck(
     745                 :            :         manager, binType, false, true, true, &typeClass, &name, &rank,
     746                 :          0 :         &arguments);
     747                 :            : 
     748                 :          0 :     bool comment=true;
     749                 :          0 :     if (!delegate.isEmpty()) {
     750                 :          0 :         if (typeClass != RT_TYPE_INTERFACE &&
     751                 :            :             typeClass != RT_TYPE_SERVICE )
     752                 :            :         {
     753                 :          0 :             return;
     754                 :            :         }
     755                 :          0 :         comment=false;
     756                 :            :     }
     757                 :            : 
     758                 :          0 :     if (comment) {
     759                 :          0 :         o << "\n// UNO";
     760                 :          0 :         if (rank > 0) {
     761                 :          0 :             o << " sequence type";
     762                 :          0 :         } else if (sort != codemaker::UnoType::SORT_COMPLEX) {
     763                 :          0 :             o << " simple type";
     764                 :            :         } else {
     765                 :          0 :             typereg::Reader reader(manager.getTypeReader(name));
     766                 :          0 :             if (!reader.isValid())
     767                 :          0 :                 throw CannotDumpException("Bad type library entity " + name);
     768                 :            : 
     769                 :          0 :             switch (typeClass)
     770                 :            :             {
     771                 :            :             case RT_TYPE_INTERFACE:
     772                 :          0 :                 o << " interface type";
     773                 :          0 :                 break;
     774                 :            : 
     775                 :            :             case RT_TYPE_MODULE:
     776                 :          0 :                 o << "IDL module";
     777                 :          0 :                 break;
     778                 :            : 
     779                 :            :             case RT_TYPE_STRUCT:
     780                 :          0 :                 if (reader.getReferenceCount() == 0)
     781                 :          0 :                     o << " simple struct type";
     782                 :          0 :                 else if (arguments.empty())
     783                 :          0 :                     o << " polymorphic struct type template";
     784                 :            :                 else
     785                 :          0 :                     o << " instantiated polymorphic struct type";
     786                 :          0 :                 break;
     787                 :            : 
     788                 :            :             case RT_TYPE_ENUM:
     789                 :          0 :                 o << " enum type";
     790                 :          0 :                 break;
     791                 :            : 
     792                 :            :             case RT_TYPE_EXCEPTION:
     793                 :          0 :                 o << " exception type";
     794                 :          0 :                 break;
     795                 :            : 
     796                 :            :             case RT_TYPE_TYPEDEF:
     797                 :          0 :                 o << "IDL typedef";
     798                 :          0 :                 break;
     799                 :            : 
     800                 :            :             case RT_TYPE_SERVICE:
     801                 :          0 :                 if (reader.getSuperTypeCount() > 0)
     802                 :          0 :                     o << " single-inheritance--based service";
     803                 :            :                 else
     804                 :          0 :                     o << "IDL accumulation-based service";
     805                 :          0 :                 break;
     806                 :            : 
     807                 :            :             case RT_TYPE_SINGLETON:
     808                 :          0 :                 if ((manager.getTypeReader(
     809                 :            :                          codemaker::convertString(
     810                 :          0 :                              reader.getSuperTypeName(0))).getTypeClass())
     811                 :            :                     == RT_TYPE_INTERFACE)
     812                 :          0 :                     o << " inheritance-based singleton";
     813                 :            :                 else
     814                 :          0 :                     o << "IDL service-based singleton";
     815                 :          0 :                 break;
     816                 :            : 
     817                 :            :             case RT_TYPE_CONSTANTS:
     818                 :          0 :                 o << "IDL constant group";
     819                 :          0 :                 break;
     820                 :            : 
     821                 :            :             default:
     822                 :            :                 OSL_ASSERT(false);
     823                 :          0 :                 break;
     824                 :          0 :             }
     825                 :            :         }
     826                 :          0 :         o << " \"" << type.getStr() << "\" ";
     827                 :            :     }
     828                 :            :     sort = codemaker::decomposeAndResolve(
     829                 :            :         manager, binType, true, true, true, &typeClass, &name, &rank,
     830                 :          0 :         &arguments);
     831                 :          0 :     if (rank > 0) {
     832                 :          0 :         if (comment) {
     833                 :            :             printMapsToCppType(o,
     834                 :          0 :                 options, manager, sort, typeClass, name, rank, arguments, "array");
     835                 :          0 :             o << '\n';
     836                 :            :         }
     837                 :          0 :     } else if (sort != codemaker::UnoType::SORT_COMPLEX) {
     838                 :          0 :         if (comment) {
     839                 :            :             printMapsToCppType(o,
     840                 :          0 :                 options, manager, sort, typeClass, name, rank, arguments, 0);
     841                 :          0 :             o << '\n';
     842                 :            :         }
     843                 :            :     } else {
     844                 :          0 :         typereg::Reader reader(manager.getTypeReader(name));
     845                 :          0 :         if (!reader.isValid())
     846                 :          0 :             throw CannotDumpException("Bad type library entity " + name);
     847                 :            : 
     848                 :          0 :         switch (typeClass)
     849                 :            :         {
     850                 :            :         case RT_TYPE_INTERFACE:
     851                 :          0 :             if (comment)
     852                 :            :                 printMapsToCppType(o,
     853                 :            :                     options, manager, sort, typeClass, name, rank, arguments,
     854                 :          0 :                     "interface");
     855                 :          0 :             if (name == "com/sun/star/uno/XInterface") {
     856                 :          0 :                 if (comment)
     857                 :          0 :                     o << '\n';
     858                 :            :             } else {
     859                 :          0 :                 if (comment)
     860                 :          0 :                     o << "; " << (options.all ? "all" : "direct") << " methods:\n";
     861                 :            : 
     862                 :          0 :                 codemaker::GeneratedTypeSet generated;
     863                 :            :                 printMethods(o, options, manager, reader, generated,
     864                 :          0 :                              delegate, options.implname, "");
     865                 :            :             }
     866                 :          0 :             break;
     867                 :            : 
     868                 :            :         case RT_TYPE_MODULE:
     869                 :            :             printMapsToCppType(o,
     870                 :            :                 options, manager, sort, typeClass, name, rank, arguments,
     871                 :          0 :                 "namespace");
     872                 :          0 :             o << '\n';
     873                 :          0 :             break;
     874                 :            : 
     875                 :            :         case RT_TYPE_STRUCT:
     876                 :          0 :             if (reader.getReferenceCount() == 0) {
     877                 :            :                 printMapsToCppType(o,
     878                 :            :                     options, manager, sort, typeClass, name, rank, arguments,
     879                 :          0 :                     "class");
     880                 :          0 :             } else if (arguments.empty()) {
     881                 :            :                 printMapsToCppType(o,
     882                 :            :                     options, manager, sort, typeClass, name, rank, arguments,
     883                 :          0 :                     options.java5 ? "generic class" : "class");
     884                 :            :             } else {
     885                 :            :                 printMapsToCppType(o,
     886                 :            :                     options, manager, sort, typeClass, name, rank, arguments,
     887                 :          0 :                     options.java5 ? "generic class instantiation" : "class");
     888                 :            :             }
     889                 :          0 :             o << "; full constructor:\n";
     890                 :          0 :             printConstructor(o, options, manager, reader, arguments);
     891                 :          0 :             break;
     892                 :            : 
     893                 :            :         case RT_TYPE_ENUM:
     894                 :            :             printMapsToCppType(o,
     895                 :            :                 options, manager, sort, typeClass, name, rank, arguments,
     896                 :          0 :                 "enum");
     897                 :          0 :             o << '\n';
     898                 :          0 :             break;
     899                 :            : 
     900                 :            :         case RT_TYPE_CONSTANTS:
     901                 :            :             printMapsToCppType(o,
     902                 :            :                 options, manager, sort, typeClass, name, rank, arguments,
     903                 :          0 :                 "namespace");
     904                 :          0 :             o << '\n';
     905                 :          0 :             break;
     906                 :            : 
     907                 :            :         case RT_TYPE_EXCEPTION:
     908                 :            :             printMapsToCppType(o,
     909                 :            :                 options, manager, sort, typeClass, name, rank, arguments,
     910                 :          0 :                 "exception class");
     911                 :          0 :             o << "; full constructor:\n";
     912                 :          0 :             printConstructor(o, options, manager, reader, arguments);
     913                 :          0 :             break;
     914                 :            : 
     915                 :            :         case RT_TYPE_SERVICE:
     916                 :          0 :             if (reader.getSuperTypeCount() > 0) {
     917                 :          0 :                 if (comment) {
     918                 :            :                     printMapsToCppType(o, options, manager, sort, typeClass,
     919                 :          0 :                                        name, rank, arguments, "class");
     920                 :          0 :                     o << "; construction methods:\n";
     921                 :          0 :                     printConstructionMethods(o, options, manager, reader);
     922                 :            :                 }
     923                 :            : 
     924                 :            :                 OString super(
     925                 :            :                     codemaker::convertString(
     926                 :          0 :                         reader.getSuperTypeName(0)).replace('/', '.'));
     927                 :          0 :                 generateDocumentation(o, options, manager, super, delegate);
     928                 :            :             } else {
     929                 :          0 :                 if (comment)
     930                 :            :                     o << ("does not map to C++\n"
     931                 :          0 :                           "// the service members are generated instead\n");
     932                 :          0 :                 printServiceMembers(o, options, manager, reader, type, delegate);
     933                 :            :             }
     934                 :          0 :             break;
     935                 :            : 
     936                 :            :         case RT_TYPE_SINGLETON:
     937                 :          0 :             if (reader.getSuperTypeCount() > 0 &&
     938                 :            :                 ((manager.getTypeReader(
     939                 :            :                      codemaker::convertString(
     940                 :          0 :                          reader.getSuperTypeName(0))).
     941                 :          0 :                     getTypeClass()) == RT_TYPE_INTERFACE) )
     942                 :            :             {
     943                 :            :                 printMapsToCppType(o, options, manager, sort, typeClass,
     944                 :            :                                    name, rank, arguments,
     945                 :          0 :                     "class");
     946                 :          0 :                 o << "; get method:\nstatic ";
     947                 :            :                 printType(o, options, manager,
     948                 :          0 :                           codemaker::convertString(reader.getSuperTypeName(0)), 1);
     949                 :          0 :                 o << " get(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);\n";
     950                 :            :             } else {
     951                 :          0 :                 o << "does not map to C++\n";
     952                 :            :             }
     953                 :          0 :             break;
     954                 :            : 
     955                 :            :         default:
     956                 :            :             OSL_ASSERT(false);
     957                 :          0 :             break;
     958                 :          0 :         }
     959                 :          0 :     }
     960                 :            : }
     961                 :            : 
     962                 :            : } }
     963                 :            : 
     964                 :            : 
     965                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10