2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup CorePlugin Core Plugin
11 * @brief The Core GCS plugin
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "core_global.h"
34 #include <QtCore/QMap>
50 class OutputPaneManager
;
55 class CORE_EXPORT OutputPanePlaceHolder
: public QWidget
{
56 friend class Core::Internal::OutputPaneManager
; // needs to set m_visible and thus access m_current
59 OutputPanePlaceHolder(Core::IMode
*mode
, QWidget
*parent
= 0);
60 ~OutputPanePlaceHolder();
61 void setCloseable(bool b
);
63 static OutputPanePlaceHolder
*getCurrent()
69 void currentModeChanged(Core::IMode
*);
73 static OutputPanePlaceHolder
*m_current
;
77 class OutputPaneManager
: public QWidget
{
82 static OutputPaneManager
*instance();
83 void setCloseable(bool b
);
85 QWidget
*buttonsWidget();
86 void updateStatusButtons(bool visible
);
92 void shortcutTriggered();
95 void focusInEvent(QFocusEvent
*e
);
99 void showPage(bool focus
);
100 void togglePage(bool focus
);
102 void updateToolTip();
103 void buttonTriggered();
104 void updateNavigateState();
107 // the only class that is allowed to create and destroy
108 friend class MainWindow
;
110 static void create();
111 static void destroy();
113 OutputPaneManager(QWidget
*parent
= 0);
114 ~OutputPaneManager();
116 void showPage(int idx
, bool focus
);
117 void ensurePageVisible(int idx
);
118 int findIndexForPage(IOutputPane
*out
);
119 QComboBox
*m_widgetComboBox
;
120 QToolButton
*m_clearButton
;
121 QToolButton
*m_closeButton
;
123 QAction
*m_nextAction
;
124 QAction
*m_prevAction
;
125 QToolButton
*m_prevToolButton
;
126 QToolButton
*m_nextToolButton
;
129 QMap
<int, Core::IOutputPane
*> m_pageMap
;
132 QStackedWidget
*m_outputWidgetPane
;
133 QStackedWidget
*m_opToolBarWidgets
;
134 QWidget
*m_buttonsWidget
;
135 QMap
<int, QPushButton
*> m_buttons
;
136 QMap
<QAction
*, int> m_actions
;
138 } // namespace Internal
141 #endif // OUTPUTPANE_H