LeechCraft 0.6.70-17335-ge406ffdcaf
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#pragma once
10
11#include <QTabBar>
12#include <QVariant>
13
14class QObject;
15class QWidget;
16class QIcon;
17class QMenu;
18
23class Q_DECL_EXPORT ICoreTabWidget
24{
25public:
26 virtual ~ICoreTabWidget () = default;
27
35 virtual QObject* GetQObject () = 0;
36
41 virtual int WidgetCount () const = 0;
42
49 virtual QWidget* Widget (int index) const = 0;
50
56 virtual int IndexOf (QWidget *page) const = 0;
57
66 virtual QMenu* GetTabMenu (int index) = 0;
67
74
81 virtual QString TabText (int index) const = 0;
82
89 virtual void SetTabText (int index, const QString& text) = 0;
90
97 virtual QIcon TabIcon (int index) const = 0;
98
106 virtual QWidget* TabButton (int index, QTabBar::ButtonPosition position) const = 0;
107
112 virtual QTabBar::ButtonPosition GetCloseButtonPosition () const = 0;
113
120 virtual void SetTabClosable (int index, bool closable, QWidget *closeButton = 0) = 0;
121
126 virtual int CurrentIndex () const = 0;
127
133 virtual void MoveTab (int from, int to) = 0;
134
139 virtual void setCurrentTab (int index) = 0;
140
145 virtual void setCurrentWidget (QWidget *widget) = 0;
146
151 virtual QWidget* GetPreviousWidget () const = 0;
152protected:
159 virtual void tabInserted (int index) = 0;
160
168 virtual void currentChanged (int index) = 0;
169
177 virtual void tabWasMoved (int from, int to) = 0;
178};
179
180Q_DECLARE_INTERFACE (ICoreTabWidget, "org.Deviant.LeechCraft.ICoreTabWidget/1.0")
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 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 ~ICoreTabWidget()=default
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.