1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef OUTPUTPANEMANAGER_H
35 #define OUTPUTPANEMANAGER_H
37 #include <QtCore/QMap>
38 #include <QtGui/QPushButton>
54 class OutputPaneManager;
60 class OutputPaneManager : public QWidget
66 static OutputPaneManager *instance();
67 void setCloseable(bool b);
69 QWidget *buttonsWidget();
70 void updateStatusButtons(bool visible);
72 bool isMaximized()const;
78 void shortcutTriggered();
82 void focusInEvent(QFocusEvent *e);
86 void showPage(bool focus);
87 void togglePage(bool focus);
89 void buttonTriggered();
90 void updateNavigateState();
93 // the only class that is allowed to create and destroy
94 friend class MainWindow;
97 static void destroy();
99 explicit OutputPaneManager(QWidget *parent = 0);
100 ~OutputPaneManager();
102 void showPage(int idx, bool focus);
103 void ensurePageVisible(int idx);
104 int findIndexForPage(IOutputPane *out);
105 QComboBox *m_widgetComboBox;
106 QToolButton *m_clearButton;
107 QToolButton *m_closeButton;
109 QAction *m_minMaxAction;
110 QToolButton *m_minMaxButton;
112 QAction *m_nextAction;
113 QAction *m_prevAction;
114 QToolButton *m_prevToolButton;
115 QToolButton *m_nextToolButton;
118 QMap<int, Core::IOutputPane*> m_pageMap;
121 QStackedWidget *m_outputWidgetPane;
122 QStackedWidget *m_opToolBarWidgets;
123 QWidget *m_buttonsWidget;
124 QMap<int, QPushButton *> m_buttons;
125 QMap<QAction *, int> m_actions;
126 QPixmap m_minimizeIcon;
127 QPixmap m_maximizeIcon;
131 class OutputPaneToggleButton : public QPushButton
135 OutputPaneToggleButton(int number, const QString &text, QAction *action,
136 QWidget *parent = 0);
137 QSize sizeHint() const;
138 void paintEvent(QPaintEvent *event);
141 void updateToolTip();
149 } // namespace Internal
152 #endif // OUTPUTPANEMANAGER_H