scide: refactoring - move LineIndicator to separate source file
[supercollider.git] / editors / sc-ide / widgets / cmd_line.hpp
blobf18d22cd715283c76f12c53e0f296a986e37335e
1 /*
2 SuperCollider Qt IDE
3 Copyright (c) 2010-2012 Jakob Leben
4 Copyright (c) 2012 Tim Blechmann
5 http://www.audiosynth.com
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef SCIDE_WIDGETS_CMD_LINE_HPP_INCLUDED
23 #define SCIDE_WIDGETS_CMD_LINE_HPP_INCLUDED
25 #include <QLineEdit>
26 #include <QString>
27 #include <QWidget>
29 namespace ScIDE {
31 namespace Settings { class Manager; }
33 class CmdLineEdit : public QLineEdit
35 Q_OBJECT
37 public:
38 explicit CmdLineEdit(QWidget * parent = NULL) :
39 QLineEdit(parent)
42 public Q_SLOTS:
43 bool openDocumentation();
44 void openDefinition();
45 void lookupReferences();
47 private:
48 QString symbolUnderCursor();
51 class CmdLine : public QWidget
53 Q_OBJECT
55 public:
56 CmdLine( const QString &text, int maxHistory = 30 );
57 void applySettings( Settings::Manager * );
59 signals:
60 void invoked( const QString &, bool silent );
62 private:
63 bool eventFilter( QObject *, QEvent * );
65 CmdLineEdit *expr;
66 QStringList history;
67 int curHistory;
68 int maxHistory;
71 } // namespace ScIDE
73 #endif // SCIDE_WIDGETS_CMD_LINE_HPP_INCLUDED