2
* tabmanager.h - Controller for tab dialogs.
3
* Copyright (C) 2007 Kevin Smith
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef _TABMANAGER_H_
21
#define _TABMANAGER_H_
31
class TabManager : public QObject
35
TabManager(PsiCon *psiCon, QObject *parent = 0);
38
PsiCon* psiCon() const;
41
* Get the default tabset for this widget (created if needed).
43
TabDlg* getTabs(QWidget *widget);
46
* Return a new tabset (for this widget).
48
TabDlg* newTabs(QWidget *widget=0);
51
* Checks if a tabset manages this widget.
53
bool isChatTabbed(const TabbableWidget*) const;
56
* Returns the tab dialog that owns the supplied widget.
58
TabDlg* getManagingTabs(const TabbableWidget*) const;
61
* Returns all active tabsets (could be empty).
63
const QList<TabDlg*>& tabSets();
66
* Checks if a given widget should be in a tabset
67
* (depends on set options and widget type).
69
bool shouldBeTabbed(QWidget *widget);
72
* removes and deletes all tabsets
78
* Returns the Kind of the given widget.
80
QChar tabKind(QWidget *widget);
83
* return the preferred tabset for a given kind of tabs(0 for none).
85
TabDlg *preferredTabsForKind(QChar kind);
88
* set the preferred tabset for a given kind of tabs
90
void setPreferredTabsForKind(QChar kind, TabDlg *tabs);
93
* set the delegate to be used for all created TabDlgs
95
void setTabDlgDelegate(TabDlgDelegate *delegate);
98
* enable/disable user dragging/detach/assignment of tabs
100
* the default is enabled
102
void setUserManagementEnabled(bool enabled);
105
* enable/disable display of PsiTabBar when there is only one tab
107
* the default is enabled
109
void setTabBarShownForSingles(bool enabled);
112
* enable/disable simplified caption mode
114
* the default is disabled
116
void setSimplifiedCaptionEnabled(bool enabled);
119
void tabDestroyed(QObject*);
120
void tabResized(QSize);
123
QMap<QChar, TabDlg*> preferedTabsetForKind_;
124
QMap<TabDlg*, QString> tabsetToKinds_;
125
QList<TabDlg*> tabs_;
126
QList<TabbableWidget*> tabControlledChats_;
128
TabDlgDelegate *tabDlgDelegate_;
129
bool userManagement_;
131
bool simplifiedCaption_;
134
#endif /* _TABMANAGER_H_ */