2014-07-17 17:04:02 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-07-17 17:04:02 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2014-07-17 17:04:02 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2014-07-17 17:04:02 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-07-17 17:04:02 +02:00
|
|
|
|
|
|
|
|
#include "icontext.h"
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QAction;
|
2014-08-25 17:28:25 +02:00
|
|
|
class QMenu;
|
2014-07-17 17:04:02 +02:00
|
|
|
class QWidget;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-11-21 10:01:11 +02:00
|
|
|
class WindowList
|
2014-08-25 17:28:25 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static void addWindow(QWidget *window);
|
|
|
|
|
static void removeWindow(QWidget *window);
|
|
|
|
|
static void setActiveWindow(QWidget *window);
|
2015-01-05 11:12:39 +01:00
|
|
|
static void setWindowVisible(QWidget *window, bool visible);
|
2014-08-25 17:28:25 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static void activateWindow(QAction *action);
|
|
|
|
|
static void updateTitle(QWidget *window);
|
|
|
|
|
|
|
|
|
|
static QMenu *m_dockMenu;
|
|
|
|
|
static QList<QWidget *> m_windows;
|
|
|
|
|
static QList<QAction *> m_windowActions;
|
|
|
|
|
static QList<Id> m_windowActionIds;
|
|
|
|
|
};
|
|
|
|
|
|
2014-07-17 17:04:02 +02:00
|
|
|
class WindowSupport : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
WindowSupport(QWidget *window, const Context &context);
|
|
|
|
|
~WindowSupport();
|
|
|
|
|
|
2014-07-18 10:35:17 +02:00
|
|
|
void setCloseActionEnabled(bool enabled);
|
|
|
|
|
|
2014-07-17 17:04:02 +02:00
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
|
2016-02-02 09:10:54 +02:00
|
|
|
private:
|
2014-07-17 17:04:02 +02:00
|
|
|
void toggleFullScreen();
|
|
|
|
|
void updateFullScreenAction();
|
|
|
|
|
|
|
|
|
|
QWidget *m_window;
|
|
|
|
|
IContext *m_contextObject;
|
|
|
|
|
QAction *m_minimizeAction;
|
|
|
|
|
QAction *m_zoomAction;
|
2014-07-18 10:35:17 +02:00
|
|
|
QAction *m_closeAction;
|
2014-07-17 17:04:02 +02:00
|
|
|
QAction *m_toggleFullScreenAction;
|
2015-06-04 16:36:45 +02:00
|
|
|
bool m_shutdown = false;
|
2014-07-17 17:04:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Internal
|
|
|
|
|
} // Core
|