Eneboo - Documentación para desarrolladores
src/qsa/src/qsa/qsscript.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qsscript.h  1.1.5   edited 2006-02-23T15:39:57$
00003 **
00004 ** Copyright (C) 2001-2006 Trolltech AS.  All rights reserved.
00005 **
00006 ** This file is part of the Qt Script for Applications framework (QSA).
00007 **
00008 ** This file may be distributed and/or modified under the terms of the
00009 ** GNU General Public License version 2 as published by the Free Software
00010 ** Foundation and appearing in the file LICENSE.GPL included in the
00011 ** packaging of this file.
00012 **
00013 ** Licensees holding a valid Qt Script for Applications license may use
00014 ** this file in accordance with the Qt Script for Applications License
00015 ** Agreement provided with the Software.
00016 **
00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00019 **
00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00021 **   information about QSA Commercial License Agreements.
00022 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00023 **
00024 ** Contact info@trolltech.com if any conditions of this licensing are
00025 ** not clear to you.
00026 **
00027 *****************************************************************************/
00028 
00029 #ifndef QSSCRIPT_H
00030 #define QSSCRIPT_H
00031 
00032 #include <qobject.h>
00033 #include <qstring.h>
00034 #include <qsaglobal.h>
00035 
00036 class QSProject;
00037 class QSScriptPrivate;
00038 
00039 class QSA_EXPORT QSScript : public QObject
00040 {
00041   friend class QSProject;
00042   Q_OBJECT
00043 public:
00044   virtual ~QSScript();
00045 
00046   QString name() const;
00047   QString code() const;
00048   // ### AbanQ
00049   QObject *context() const {
00050     return context_;
00051   }
00052 
00053   void setCode(const QString &code);
00054   void addCode(const QString &code);
00055   bool addFunction(const QString &funcName, const QString &funcBody = QString::null);
00056   QSProject *project() const;
00057 
00058   // ### AbanQ
00059   QString fileName() const;
00060   void setFileName(const QString &name);
00061   QString baseFileName() const;
00062   void setBaseFileName(const QString &name);
00063   // ### AbanQ
00064 
00065 protected slots:
00066   virtual void objectDestroyed();
00067 
00068 private:
00069   QSScript(QSProject *project,
00070            const QString &name,
00071            const QString &code,
00072            QObject *context = 0);
00073   QSScript(const QSScript &sc);
00074   QSScript &operator=(const QSScript &sc);
00075 
00076   void setContext(QObject *context);
00077 
00078 signals:
00079   void codeChanged();
00080 
00081 private:
00082   QSScriptPrivate *d;
00083 
00084   // ### AbanQ
00085   QObject *context_;
00086 };
00087 
00088 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'