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
26 #include <QStackedLayout>
34 class CodeEditorBox
: public QWidget
39 typedef QList
< ScCodeEditor
* > History
;
41 CodeEditorBox(QWidget
*parent
= 0);
43 void setDocument(Document
*, int pos
= -1, int selectionLength
= 0);
45 ScCodeEditor
*currentEditor();
46 Document
*currentDocument();
48 const History
& history() { return mHistory
; }
54 CodeEditorBox
*lastActiveBox
= gActiveBox
;
58 lastActiveBox
->update();
65 bool isActive() { return gActiveBox
== this; }
67 QSize
minimumSizeHint() const { return QSize(100, 100); }
68 QSize
sizeHint() const { return QSize(100, 100); }
71 void currentChanged(ScCodeEditor
*);
72 void activated( CodeEditorBox
*me
);
75 void onDocumentClosed(Document
*);
78 int historyIndexOf(Document
*);
79 ScCodeEditor
*editorForDocument(Document
*);
80 bool eventFilter( QObject
*, QEvent
* );
81 void focusInEvent( QFocusEvent
* );
82 void paintEvent( QPaintEvent
* );
84 QStackedLayout
*mLayout
;
86 static QPointer
<CodeEditorBox
> gActiveBox
;
91 #endif // SCIDE_WIDGET_CODE_EDITOR_EDITOR_BOX_HPP