LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
icoretabwidget.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#ifndef INTERFACES_CORE_ICORETABWIDGET_H
10#define INTERFACES_CORE_ICORETABWIDGET_H
11
12#include <QTabBar>
13#include <QVariant>
14
15class QObject;
16class QWidget;
17class QIcon;
18class QMenu;
19
24class Q_DECL_EXPORT ICoreTabWidget
25{
26public:
27 virtual ~ICoreTabWidget () {}
28
36 virtual QObject* GetQObject () = 0;
37
42 virtual int WidgetCount () const = 0;
43
50 virtual QWidget* Widget (int index) const = 0;
51
57 virtual int IndexOf (QWidget *page) const = 0;
58
67 virtual QMenu* GetTabMenu (int index) = 0;
68
75
82 virtual QString TabText (int index) const = 0;
83
90 virtual void SetTabText (int index, const QString& text) = 0;
91
98 virtual QIcon TabIcon (int index) const = 0;
99
107 virtual QWidget* TabButton (int index, QTabBar::ButtonPosition position) const = 0;
108
113 virtual QTabBar::ButtonPosition GetCloseButtonPosition () const = 0;
114
121 virtual void SetTabClosable (int index, bool closable, QWidget *closeButton = 0) = 0;
122
127 virtual int CurrentIndex () const = 0;
128
134 virtual void MoveTab (int from, int to) = 0;
135
140 virtual void setCurrentTab (int index) = 0;
141
146 virtual void setCurrentWidget (QWidget *widget) = 0;
147
152 virtual QWidget* GetPreviousWidget () const = 0;
153protected:
160 virtual void tabInserted (int index) = 0;
161
169 virtual void currentChanged (int index) = 0;
170
178 virtual void tabWasMoved (int from, int to) = 0;
179};
180
181Q_DECLARE_INTERFACE (ICoreTabWidget, "org.Deviant.LeechCraft.ICoreTabWidget/1.0")
182
183#endif
This interface is used to represent LeechCraft's core tab widget.
virtual void MoveTab(int from, int to)=0
Moves the item at index position from to index position to.
virtual QList< QAction * > GetPermanentActions() const =0
Returns the list of actions witch always shows in context menu. of the tab.
virtual void tabWasMoved(int from, int to)=0
This signal is emitted when tab at from moves to position to.
virtual QObject * GetQObject()=0
Returns the pointer to tab widget as a QObject.
virtual QWidget * GetPreviousWidget() const =0
Returns the previous active widget if it exists.
virtual ~ICoreTabWidget()
virtual QWidget * TabButton(int index, QTabBar::ButtonPosition position) const =0
Returns the widget set a tab index and position or 0 if one is not set.
virtual void tabInserted(int index)=0
This signal is emitted after new tab was inserted.
virtual QTabBar::ButtonPosition GetCloseButtonPosition() const =0
Returns the position of close button.
virtual int IndexOf(QWidget *page) const =0
Returns the index of the given page.
virtual void currentChanged(int index)=0
This signal is emitted when the tab widget's current tab changes. The new current has the given index...
virtual int WidgetCount() const =0
Returns the number of widgets associated with tabs.
virtual QString TabText(int index) const =0
Returns the text of the tab at position index, or an empty string if index is out of range.
virtual QIcon TabIcon(int index) const =0
Returns the icon of the tab at position index, or a null icon if index is out of range.
virtual QMenu * GetTabMenu(int index)=0
Returns the tab menu for the given tab index.
virtual void SetTabClosable(int index, bool closable, QWidget *closeButton=0)=0
Sets tab closable.
virtual QWidget * Widget(int index) const =0
Returns the tab page at index position index or 0. if the index is out of range.
virtual int CurrentIndex() const =0
Returns the index of the tab bar's visible tab.
virtual void SetTabText(int index, const QString &text)=0
Sets the text of the tab at position index to text. of the tabs.
virtual void setCurrentTab(int index)=0
Sets the current tab index to specified index.
virtual void setCurrentWidget(QWidget *widget)=0
Sets the current tab index to specified associated widget.