source: trunk/tools/designer/plugins/cppeditor/yyreg.h

Last change on this file was 197, checked in by rudi, 14 years ago

Added QtDesigner

File size: 2.8 KB
Line 
1/**********************************************************************
2**
3** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved.
4**
5** This file is part of Qt Designer.
6**
7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file.
11**
12** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
13** licenses may use this file in accordance with the Qt Commercial License
14** Agreement provided with the Software.
15**
16** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18**
19** See http://www.trolltech.com/gpl/ for GPL licensing information.
20** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
21** information about Qt Commercial License Agreements.
22**
23** Contact info@trolltech.com if any conditions of this licensing are
24** not clear to you.
25**
26**********************************************************************/
27
28#ifndef YYREG_H
29#define YYREG_H
30
31#include <qstringlist.h>
32#include <qvaluelist.h>
33
34class CppFunction
35{
36public:
37 CppFunction() : cnst( FALSE ), lineno1( 0 ), lineno2( 0 ) { }
38
39 void setReturnType( const QString& r ) { ret = r; }
40 void setScopedName( const QString& n ) { nam = n; }
41 void setParameterList( const QStringList& p ) { params = p; }
42 void setConst( bool c ) { cnst = c; }
43 void setBody( const QString& b ) { bod = b; }
44 void setDocumentation( const QString& d ) { doc = d; }
45 void setLineNums( int functionStart, int openingBrace, int closingBrace ) {
46 lineno0 = functionStart;
47 lineno1 = openingBrace;
48 lineno2 = closingBrace;
49 }
50
51 const QString& returnType() const { return ret; }
52 const QString& scopedName() const { return nam; }
53 const QStringList& parameterList() const { return params; }
54 bool isConst() const { return cnst; }
55 QString prototype() const;
56 const QString& body() const { return bod; }
57 const QString& documentation() const { return doc; }
58 int functionStartLineNum() const { return lineno0; }
59 int openingBraceLineNum() const { return lineno1; }
60 int closingBraceLineNum() const { return lineno2; }
61
62#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
63 bool operator==( const CppFunction& ) const { return FALSE; }
64#endif
65
66private:
67 QString ret;
68 QString nam;
69 QStringList params;
70 bool cnst;
71 QString bod;
72 QString doc;
73 int lineno0;
74 int lineno1;
75 int lineno2;
76};
77
78void extractCppFunctions( const QString& code, QValueList<CppFunction> *flist );
79QString canonicalCppProto( const QString& proto );
80
81#endif
Note: See TracBrowser for help on using the repository browser.