-
Notifications
You must be signed in to change notification settings - Fork 0
/
DocTabManager.h
81 lines (57 loc) · 2.07 KB
/
DocTabManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* DocTabWidget.h
* Copyright (c) 2013 ROBLOX Corp. All Rights Reserved.
*/
#pragma once
// Qt Headers
#include <QRubberBand>
#include <QIcon>
// Roblox Headers
#include "RBX/BaldPtr.h"
// Roblox Studio Headers
#include "IRobloxDoc.h"
class QRubberBand;
class RobloxMainWindow;
class RobloxTabWidget;
class DocTabManager : public QObject
{
Q_OBJECT
public:
DocTabManager(RobloxMainWindow& mainWindow);
virtual ~DocTabManager();
void addDoc(IRobloxDoc& doc, int index = -1);
bool removeDoc(IRobloxDoc& doc);
bool renameDoc(IRobloxDoc& doc,const QString& text,const QString& tooltip,const QIcon& icon = QIcon());
bool setCurrentDoc(IRobloxDoc& doc);
IRobloxDoc* getCurrentDoc() const;
void setDockHoverOverPos(const QPoint& globalPos);
bool attemptAttach(IRobloxDoc& doc,const QPoint& globalPos);
void restoreAsCentralWidget();
public Q_SLOTS:
void showNextTabPage();
void showPreviousTabPage();
protected:
virtual bool eventFilter(QObject* object,QEvent* event);
private Q_SLOTS:
void onCurrentChanged(int index);
bool onTabCloseRequested(int index);
void onCurrentTabCloseRequested();
void onDetachDoc();
void onFocusChanged(QWidget* oldWidget,QWidget* newWidget);
private:
void onMousePressEvent(QMouseEvent* event);
void onMouseMoveEvent(QMouseEvent* event);
void onMouseReleaseEvent(QMouseEvent* event);
bool isValidHoverOver(const QPoint& globalPos);
void setupTabPageSwitchingShortcuts();
void setCurrentTabPage(int index);
typedef QVector< RBX::BaldPtr<IRobloxDoc> > tDocList;
tDocList m_Docs;
RobloxMainWindow& m_MainWindow;
QPoint m_ClickPos;
bool m_MouseDown;
int m_DragTabIndex;
QRubberBand m_RubberBand;
RBX::BaldPtr<QWidget> m_FakeTab;
RBX::BaldPtr<RobloxTabWidget> m_TabWidget;
};