Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/doc.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    134134};
    135135
    136 #ifdef QDOC2DOX
    137 
    138 class DoxWriter
    139 {
    140   public:
    141     DoxWriter(const QString& source, DocPrivate* docPrivate)
    142         : commentType(OtherComment),
    143           lineLength(0),
    144           lineCount(0),
    145           priv(docPrivate),
    146           oldText(source) {}
    147     ~DoxWriter() {}
    148 
    149     void pass1();
    150     void pass2();
    151 
    152     static void setDoxPass(int pass);
    153     static bool isDoxPass(int pass);
    154     static bool isDoxPass();
    155     static void insertTitle(FakeNode* node, const QString& title);
    156     static void writeTitles();
    157     static void readTitles();
    158     static void writeMembers();
    159     static void readMembers();
    160     static void writeAnchors();
    161     static void readAnchors();
    162 
    163   private:
    164     void indentLine();
    165     void newLine();
    166     void concatenate(QString text);
    167     void wrap(QString text);
    168     bool conversionRequired() const;
    169     void convertMetaCommands();
    170     void convertText();
    171     const Atom* link(const Atom* atom);
    172     void formattingLeft(const Atom* atom, const Atom* next);
    173     void formattingRight(const Atom* atom, const Atom* prev);
    174     void tt(const Atom* atom);
    175     void formatIf(const Atom* atom);
    176     void formatEndif();
    177     void formatElse();
    178     const Atom* sectionHeading(const Atom* atom);
    179     void unhandled(const Atom* atom);
    180     void code(const Atom* atom);
    181     const Atom* codeQuoteCommand(const Atom* atom);
    182     void writeCode(QString text);
    183     void writeCommand(QCommandMap::const_iterator cmd);
    184 
    185     static void insertAnchor(const QString& text);
    186     static bool isAnchor(const QString& text);
    187 
    188     static const QString* getPageFile(const QString& title);
    189     static const QString* getFile(const QString& title);
    190     static const QString* getExamplePath(const QString& title);
    191     static const QString* getHeaderFile(const QString& title);
    192     static const QString* getGroup(const QString& title);
    193     static const QString* getModule(const QString& title);
    194     static const QString* getExternalPage(const QString& title);
    195     static const QString* getPageTitle(const QString& text);
    196     static const QString* getFileTitle(const QString& text);
    197     static const QString* getExampleTitle(const QString& text);
    198     static const QString* getHeaderFileTitle(const QString& text);
    199     static const QString* getGroupTitle(const QString& text);
    200     static const QString* getModuleTitle(const QString& text);
    201     static const QString* getExternalPageTitle(const QString& text);
    202    
    203     static bool isProperty(const QString& title, QStringList& classes);
    204     static bool isVariable(const QString& title, QStringList& classes);
    205     static bool isEnum(const QString& title, QStringList& classes);
    206 
    207  private:
    208     static void writeMap(const QStringMap& map, const QString& name);
    209     static void readMap(QStringMap& map,
    210                         QStringMap& inverseMap,
    211                         const QString& name);
    212     static void writeMultiMap(const QStringMultiMap& map, const QString& name);
    213     static void readMultiMap(QStringMultiMap& map, const QString& name);
    214 
    215  public: // VS 6, SunCC need this to be public
    216     enum StructType { BulletList, NumericList, ValueList, Table };
    217  private:
    218     struct StructDesc {
    219         StructType      structType;
    220         int             count;
    221         bool            nested;
    222         bool            inTableHeader;
    223         bool            inTableRow;
    224         bool            inTableItem;
    225         bool            odd;
    226 
    227         StructDesc()
    228             : structType(BulletList),
    229               count(0),
    230               nested(false),
    231               inTableHeader(false),
    232               inTableRow(false),
    233               inTableItem(false),
    234               odd(true) { }
    235 
    236         StructDesc(StructType t, bool n)
    237             : structType(t),
    238               count(0),
    239               nested(n),
    240               inTableHeader(false),
    241               inTableRow(false),
    242               inTableItem(false),
    243               odd(true) { }
    244     };
    245 
    246     typedef QStack<StructDesc> StructStack;
    247 
    248     enum CommentType {
    249         ClassComment,
    250         EnumComment,
    251         ExampleComment,
    252         FnComment,
    253         GroupComment,
    254         HeaderFileComment,
    255         MacroComment,
    256         ModuleComment,
    257         PageComment,
    258         PropertyComment,
    259         ServiceComment,
    260         TypedefComment,
    261         VariableComment,
    262         OtherComment
    263     };
    264 
    265   private:
    266     CommentType         commentType;
    267     int                 lineLength;
    268     int                 lineCount;
    269     DocPrivate*         priv;
    270     QString             oldText;
    271     QString             newText;
    272     StructStack         structs;
    273 
    274     QString             currentPage;
    275     QString             currentFn;
    276     QString             currentTitle;
    277     QString             currentEnum;
    278     QString             currentProperty;
    279     QString             currentVariable;
    280     QString             currentExample;
    281     QString             currentGroup;
    282     QString             currentModule;
    283     QString             currentMacro;
    284     QString             currentService;
    285     QString             currentTypedef;
    286     QString             currentHeaderFile;
    287     static QString      currentClass;
    288 
    289     static int          doxPass;
    290     static QSet<QString> anchors;
    291     static QStringMap   exampleTitles;
    292     static QStringMap   headerFileTitles;
    293     static QStringMap   fileTitles;
    294     static QStringMap   groupTitles;
    295     static QStringMap   moduleTitles;
    296     static QStringMap   pageTitles;
    297     static QStringMap   externalPageTitles;
    298     static QStringMap   exampleTitlesInverse;
    299     static QStringMap   headerFileTitlesInverse;
    300     static QStringMap   fileTitlesInverse;
    301     static QStringMap   groupTitlesInverse;
    302     static QStringMap   moduleTitlesInverse;
    303     static QStringMap   pageTitlesInverse;
    304     static QStringMap   externalPageTitlesInverse;
    305 
    306     static QStringMultiMap variables;
    307     static QStringMultiMap properties;
    308     static QStringMultiMap enums;
    309 };
    310 
    311 #endif
    312 
    313136QT_END_NAMESPACE
    314137
Note: See TracChangeset for help on using the changeset viewer.