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/linguist/shared/proitems.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 Qt Linguist 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**
     
    4343#define PROITEMS_H
    4444
    45 #include <QtCore/QObject>
    4645#include <QtCore/QString>
    4746#include <QtCore/QList>
     
    6261    };
    6362
     63    enum ProItemReturn {
     64        ReturnFalse,
     65        ReturnTrue,
     66        ReturnBreak,
     67        ReturnNext,
     68        ReturnLoop,
     69        ReturnSkip,
     70        ReturnReturn
     71   };
     72
    6473    ProItem() : m_lineNumber(0) {}
    6574    virtual ~ProItem() {}
     
    7079    QString comment() const;
    7180
    72     virtual bool Accept(AbstractProItemVisitor *visitor) = 0;
     81    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor) = 0;
    7382    int lineNumber() const { return m_lineNumber; }
    7483    void setLineNumber(int lineNumber) { m_lineNumber = lineNumber; }
     
    8897        VariableKind        = 0x04,
    8998        ProFileKind         = 0x08,
    90         SingleLine          = 0x10
     99        FunctionBodyKind    = 0x10,
     100        SingleLine          = 0x80
    91101    };
    92102
     
    104114    ProBlock *parent() const;
    105115
    106     ProItem::ProItemKind kind() const;
    107 
    108     virtual bool Accept(AbstractProItemVisitor *visitor);
     116    void ref() { ++m_refCount; }
     117    void deref() { if (!--m_refCount) delete this; }
     118
     119    ProItem::ProItemKind kind() const;
     120
     121    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    109122protected:
    110123    QList<ProItem *> m_proitems;
     
    112125    ProBlock *m_parent;
    113126    int m_blockKind;
     127    int m_refCount;
    114128};
    115129
     
    133147    QString variable() const;
    134148
    135     virtual bool Accept(AbstractProItemVisitor *visitor);
     149    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    136150private:
    137151    VariableOperator m_variableKind;
     
    152166    ProItem::ProItemKind kind() const;
    153167
    154     virtual bool Accept(AbstractProItemVisitor *visitor);
     168    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    155169private:
    156170    QString m_value;
     
    168182    ProItem::ProItemKind kind() const;
    169183
    170     virtual bool Accept(AbstractProItemVisitor *visitor);
     184    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    171185private:
    172186    QString m_text;
     
    183197    ProItem::ProItemKind kind() const;
    184198
    185     virtual bool Accept(AbstractProItemVisitor *visitor);
     199    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    186200private:
    187201    QString m_text;
     
    203217    ProItem::ProItemKind kind() const;
    204218
    205     virtual bool Accept(AbstractProItemVisitor *visitor);
     219    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    206220private:
    207221    OperatorKind m_operatorKind;
    208222};
    209223
    210 class ProFile : public QObject, public ProBlock
    211 {
    212     Q_OBJECT
    213 
     224class ProFile : public ProBlock
     225{
    214226public:
    215227    explicit ProFile(const QString &fileName);
     
    223235    bool isModified() const;
    224236
    225     virtual bool Accept(AbstractProItemVisitor *visitor);
     237    virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
    226238
    227239private:
Note: See TracChangeset for help on using the changeset viewer.