qscriptcontextinfo.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
00004 ** All rights reserved.
00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
00006 **
00007 ** This file is part of the QtScript module of the Qt Toolkit.
00008 **
00009 ** $QT_BEGIN_LICENSE:LGPL-ONLY$
00010 ** GNU Lesser General Public License Usage
00011 ** This file may be used under the terms of the GNU Lesser
00012 ** General Public License version 2.1 as published by the Free Software
00013 ** Foundation and appearing in the file LICENSE.LGPL included in the
00014 ** packaging of this file.  Please review the following information to
00015 ** ensure the GNU Lesser General Public License version 2.1 requirements
00016 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00017 **
00018 ** If you have questions regarding the use of this file, please contact
00019 ** Nokia at qt-info@nokia.com.
00020 ** $QT_END_LICENSE$
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QSCRIPTCONTEXTINFO_H
00025 #define QSCRIPTCONTEXTINFO_H
00026 
00027 #include <QtCore/qobjectdefs.h>
00028 
00029 #include <QtCore/qlist.h>
00030 #include <QtCore/qstringlist.h>
00031 #include <QtCore/qsharedpointer.h>
00032 
00033 QT_BEGIN_HEADER
00034 
00035 QT_BEGIN_NAMESPACE
00036 
00037 QT_MODULE(Script)
00038 
00039 class QScriptContext;
00040 #ifndef QT_NO_DATASTREAM
00041 class QDataStream;
00042 #endif
00043 
00044 class QScriptContextInfoPrivate;
00045 class Q_SCRIPT_EXPORT QScriptContextInfo
00046 {
00047 public:
00048 #ifndef QT_NO_DATASTREAM
00049     friend Q_SCRIPT_EXPORT QDataStream &operator<<(QDataStream &, const QScriptContextInfo &);
00050     friend Q_SCRIPT_EXPORT QDataStream &operator>>(QDataStream &, QScriptContextInfo &);
00051 #endif
00052 
00053     enum FunctionType {
00054         ScriptFunction,
00055         QtFunction,
00056         QtPropertyFunction,
00057         NativeFunction
00058     };
00059 
00060     QScriptContextInfo(const QScriptContext *context);
00061     QScriptContextInfo(const QScriptContextInfo &other);
00062     QScriptContextInfo();
00063     ~QScriptContextInfo();
00064 
00065     QScriptContextInfo &operator=(const QScriptContextInfo &other);
00066 
00067     bool isNull() const;
00068 
00069     qint64 scriptId() const;
00070     QString fileName() const;
00071     int lineNumber() const;
00072 #ifdef QT_DEPRECATED
00073     QT_DEPRECATED int columnNumber() const;
00074 #endif
00075 
00076     QString functionName() const;
00077     FunctionType functionType() const;
00078 
00079     QStringList functionParameterNames() const;
00080 
00081     int functionStartLineNumber() const;
00082     int functionEndLineNumber() const;
00083 
00084     int functionMetaIndex() const;
00085 
00086     bool operator==(const QScriptContextInfo &other) const;
00087     bool operator!=(const QScriptContextInfo &other) const;
00088 
00089 private:
00090     QExplicitlySharedDataPointer<QScriptContextInfoPrivate> d_ptr;
00091 
00092     Q_DECLARE_PRIVATE(QScriptContextInfo)
00093 };
00094 
00095 typedef QList<QScriptContextInfo> QScriptContextInfoList;
00096 
00097 #ifndef QT_NO_DATASTREAM
00098 Q_SCRIPT_EXPORT QDataStream &operator<<(QDataStream &, const QScriptContextInfo &);
00099 Q_SCRIPT_EXPORT QDataStream &operator>>(QDataStream &, QScriptContextInfo &);
00100 #endif
00101 
00102 QT_END_NAMESPACE
00103 
00104 QT_END_HEADER
00105 
00106 #endif