| 1 | /**********************************************************************
|
|---|
| 2 | ** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
|
|---|
| 3 | **
|
|---|
| 4 | ** This file is part of Qt Designer.
|
|---|
| 5 | **
|
|---|
| 6 | ** This file may be distributed and/or modified under the terms of the
|
|---|
| 7 | ** GNU General Public License version 2 as published by the Free Software
|
|---|
| 8 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 9 | ** packaging of this file.
|
|---|
| 10 | **
|
|---|
| 11 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
|---|
| 12 | ** licenses may use this file in accordance with the Qt Commercial License
|
|---|
| 13 | ** Agreement provided with the Software.
|
|---|
| 14 | **
|
|---|
| 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|---|
| 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 17 | **
|
|---|
| 18 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
|---|
| 19 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
|---|
| 20 | ** information about Qt Commercial License Agreements.
|
|---|
| 21 | **
|
|---|
| 22 | ** Contact info@trolltech.com if any conditions of this licensing are
|
|---|
| 23 | ** not clear to you.
|
|---|
| 24 | **
|
|---|
| 25 | **********************************************************************/
|
|---|
| 26 |
|
|---|
| 27 | #ifndef LANGUAGEINTERFACE_H
|
|---|
| 28 | #define LANGUAGEINTERFACE_H
|
|---|
| 29 |
|
|---|
| 30 | //
|
|---|
| 31 | // W A R N I N G -- PRIVATE INTERFACES
|
|---|
| 32 | // --------------------------------------
|
|---|
| 33 | //
|
|---|
| 34 | // This file and the interfaces declared in the file are not
|
|---|
| 35 | // public. It exists for internal purpose. This header file and
|
|---|
| 36 | // interfaces may change from version to version (even binary
|
|---|
| 37 | // incompatible) without notice, or even be removed.
|
|---|
| 38 | //
|
|---|
| 39 | // We mean it.
|
|---|
| 40 | //
|
|---|
| 41 | //
|
|---|
| 42 |
|
|---|
| 43 | #include <private/qcom_p.h>
|
|---|
| 44 | #include <qvaluelist.h>
|
|---|
| 45 | #include <qstringlist.h>
|
|---|
| 46 | #include <qmap.h>
|
|---|
| 47 | #include <qstrlist.h>
|
|---|
| 48 |
|
|---|
| 49 | // {f208499a-6f69-4883-9219-6e936e55a330}
|
|---|
| 50 | #ifndef IID_Language
|
|---|
| 51 | #define IID_Language QUuid( 0xf208499a, 0x6f69, 0x4883, 0x92, 0x19, 0x6e, 0x93, 0x6e, 0x55, 0xa3, 0x30 )
|
|---|
| 52 | #endif
|
|---|
| 53 |
|
|---|
| 54 | struct LanguageInterface : public QUnknownInterface
|
|---|
| 55 | {
|
|---|
| 56 | struct Function
|
|---|
| 57 | {
|
|---|
| 58 | QString name;
|
|---|
| 59 | QString body;
|
|---|
| 60 | QString returnType;
|
|---|
| 61 | QString comments;
|
|---|
| 62 | int start;
|
|---|
| 63 | int end;
|
|---|
| 64 | QString access;
|
|---|
| 65 | bool operator==( const Function &f ) const {
|
|---|
| 66 | return ( name == f.name &&
|
|---|
| 67 | body == f.body &&
|
|---|
| 68 | returnType == f.returnType &&
|
|---|
| 69 | comments == f.comments );
|
|---|
| 70 | }
|
|---|
| 71 | };
|
|---|
| 72 |
|
|---|
| 73 | struct Connection
|
|---|
| 74 | {
|
|---|
| 75 | QString sender;
|
|---|
| 76 | QString signal;
|
|---|
| 77 | QString slot;
|
|---|
| 78 | bool operator==( const Connection &c ) const {
|
|---|
| 79 | return ( sender == c.sender &&
|
|---|
| 80 | signal == c.signal &&
|
|---|
| 81 | slot == c.slot );
|
|---|
| 82 | }
|
|---|
| 83 | };
|
|---|
| 84 |
|
|---|
| 85 | enum Support
|
|---|
| 86 | {
|
|---|
| 87 | ReturnType,
|
|---|
| 88 | ConnectionsToCustomSlots,
|
|---|
| 89 | CompressProject
|
|---|
| 90 | };
|
|---|
| 91 |
|
|---|
| 92 | virtual void functions( const QString &code, QValueList<Function> *funcs ) const = 0;
|
|---|
| 93 | virtual void connections( const QString &code, QValueList<Connection> *connections ) const = 0;
|
|---|
| 94 | virtual QString createFunctionStart( const QString &className, const QString &func,
|
|---|
| 95 | const QString &returnType, const QString &access ) = 0;
|
|---|
| 96 | virtual QString createArguments( const QString &cpp_signature ) = 0;
|
|---|
| 97 | virtual QString createEmptyFunction() = 0;
|
|---|
| 98 | virtual QStringList definitions() const = 0;
|
|---|
| 99 | virtual QStringList definitionEntries( const QString &definition, QUnknownInterface *designerIface ) const = 0;
|
|---|
| 100 | virtual void setDefinitionEntries( const QString &definition, const QStringList &entries, QUnknownInterface *designerIface ) = 0;
|
|---|
| 101 | virtual bool supports( Support s ) const = 0;
|
|---|
| 102 | virtual QStringList fileFilterList() const = 0;
|
|---|
| 103 | virtual QStringList fileExtensionList() const = 0;
|
|---|
| 104 | virtual void preferedExtensions( QMap<QString, QString> &extensionMap ) const = 0;
|
|---|
| 105 | virtual QString projectKeyForExtension( const QString &extension ) const = 0;
|
|---|
| 106 | virtual void sourceProjectKeys( QStringList &keys ) const = 0;
|
|---|
| 107 | virtual QString cleanSignature( const QString &sig ) = 0;
|
|---|
| 108 | virtual void loadFormCode( const QString &form, const QString &filename,
|
|---|
| 109 | QValueList<Function> &functions,
|
|---|
| 110 | QStringList &vars,
|
|---|
| 111 | QValueList<Connection> &connections ) = 0;
|
|---|
| 112 | virtual QString formCodeExtension() const = 0;
|
|---|
| 113 |
|
|---|
| 114 | virtual bool canConnect( const QString &signal, const QString &slot ) = 0;
|
|---|
| 115 |
|
|---|
| 116 | virtual void compressProject( const QString &projectFile, const QString &compressedFile,
|
|---|
| 117 | bool withWarning ) = 0;
|
|---|
| 118 | virtual QString uncompressProject( const QString &projectFile, const QString &destDir ) = 0;
|
|---|
| 119 | virtual QString aboutText() const = 0;
|
|---|
| 120 |
|
|---|
| 121 | virtual void addConnection( const QString &sender, const QString &signal,
|
|---|
| 122 | const QString &receiver, const QString &slot,
|
|---|
| 123 | QString *code ) = 0;
|
|---|
| 124 | virtual void removeConnection( const QString &sender, const QString &signal,
|
|---|
| 125 | const QString &receiver, const QString &slot,
|
|---|
| 126 | QString *code ) = 0;
|
|---|
| 127 | virtual QStrList signalNames( QObject *obj ) const = 0;
|
|---|
| 128 |
|
|---|
| 129 | };
|
|---|
| 130 |
|
|---|
| 131 | #endif
|
|---|