2
* UGENE - Integrated Bioinformatics Tools.
3
* Copyright (C) 2008-2011 UniPro <ugene@unipro.ru>
4
* http://ugene.unipro.ru
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (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,
22
#ifndef _U2_MDI_MANAGER_IMPL_H_
23
#define _U2_MDI_MANAGER_IMPL_H_
25
#include "MainWindowImpl.h"
27
#include <QtCore/QSignalMapper>
28
#include <QtCore/QEvent>
30
#include <QtGui/QMdiArea>
31
#include <QtGui/QMdiSubWindow>
35
class MDIItem : QWidget {
38
MDIItem(MWMDIWindow* _w, QMdiSubWindow* _qw) : w(_w), qw(_qw){this->setObjectName(_w->objectName()+"_MDIItem");qw->setObjectName(_w->objectName()+"_SubWindow");}
44
typedef QList<MDIItem*> MDIItems;
46
class MWMDIManagerImpl : public MWMDIManager {
49
MWMDIManagerImpl(MainWindow* _mw, FixedMdiArea* _mdiArea)
50
: MWMDIManager(_mw), mw(_mw), mdiArea(_mdiArea){ prepareGUI();}
54
virtual void addMDIWindow(MWMDIWindow* w);
56
virtual bool closeMDIWindow(MWMDIWindow* w);
58
virtual QList<MWMDIWindow*> getWindows() const;
60
virtual MWMDIWindow* getWindowById(int id) const;
62
virtual void activateWindow(MWMDIWindow* w);
64
virtual MWMDIWindow* getActiveWindow() const;
67
bool eventFilter(QObject *obj, QEvent *event);
70
void sl_setActiveSubWindow(QWidget *);
71
void sl_updateWindowMenu();
72
void sl_onSubWindowActivated(QMdiSubWindow *);
73
void sl_updateWindowLayout();
76
MDIItem* getMDIItem(int id) const;
77
MDIItem* getMDIItem(MWMDIWindow* w) const;
78
MDIItem* getMDIItem(QMdiSubWindow* qw) const;
80
void clearMDIContent(bool addCloseAction);
86
MDIItem* getCurrentMDIItem() const ;
90
FixedMdiArea* mdiArea;
100
QAction* separatorAct;
102
QSignalMapper* windowMapper;
103
bool defaultIsMaximized;
104
MDIItem* mdiContentOwner;