sc ide: MultiSplitter - reimplement findChild() to respect split order
[supercollider.git] / editors / sc-ide / widgets / editor_box.hpp
blob1b3d9a591fc67c3681effc46c139877d7bc00c34
1 /*
2 SuperCollider Qt IDE
3 Copyright (c) 2012 Jakob Leben & Tim Blechmann
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef SCIDE_WIDGET_CODE_EDITOR_EDITOR_BOX_HPP
23 #define SCIDE_WIDGET_CODE_EDITOR_EDITOR_BOX_HPP
25 #include <QWidget>
26 #include <QStackedLayout>
28 namespace ScIDE {
30 class Document;
31 class CodeEditor;
33 class CodeEditorBox : public QWidget
35 Q_OBJECT
37 public:
38 typedef QList< CodeEditor * > History;
40 CodeEditorBox(QWidget *parent = 0);
42 void setDocument(Document *, int pos = -1);
44 CodeEditor *currentEditor();
45 Document *currentDocument();
47 const History & history() { return mHistory; }
49 signals:
50 void currentChanged(CodeEditor*);
51 void editorFocusChanged( CodeEditor *, bool focused );
53 private slots:
54 void onDocumentClosed(Document*);
56 private:
57 int historyIndexOf(Document*);
58 CodeEditor *editorForDocument(Document*);
59 bool eventFilter( QObject *, QEvent * );
61 QStackedLayout *mLayout;
62 History mHistory;
65 } // namespace ScIDE
67 #endif // SCIDE_WIDGET_CODE_EDITOR_EDITOR_BOX_HPP