![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Interface for plugins that have one or more tabs. More...
#include "ihavetabs.h"
Public Member Functions | |
virtual | ~IHaveTabs () |
virtual LC::TabClasses_t | GetTabClasses () const =0 |
Returns the list of tab classes provided by this plugin. More... | |
virtual void | TabOpenRequested (const QByteArray &tabClass)=0 |
Opens the new tab from the given tabClass. More... | |
virtual void | addNewTab (const QString &name, QWidget *tabContents)=0 |
This signal is emitted by plugin to add a new tab. More... | |
virtual void | removeTab (QWidget *tabContents)=0 |
This signal is emitted by plugin when it wants to remove a tab. More... | |
virtual void | changeTabName (QWidget *tabContents, const QString &name)=0 |
This signal is emitted by plugin to change the name of the tab with the given tabContents. More... | |
virtual void | changeTabIcon (QWidget *tabContents, const QIcon &icon)=0 |
This signal is emitted by plugin to change the icon of the tab with the given tabContents. More... | |
virtual void | statusBarChanged (QWidget *tabContents, const QString &text)=0 |
This signal is emitted by plugin to change the status bar text for the tab with the given tabContents. More... | |
virtual void | raiseTab (QWidget *tabContents)=0 |
This signal is emitted by plugin to bring the tab with the given tabContents to the front. More... | |
Interface for plugins that have one or more tabs.
Each plugin that may have tabs in LeechCraft should implement this interface.
Plugins implementing this interface may have one or more tabs of different semantics, like chat tabs and service discovery tabs in an IM or download tab and hub browse tab in a DirectConnect plugin.
Different tabs with different semantics are said to belong to different tab classes. Different tab classes may have different behavior, but tabs of the same tab class are considered to be semantically equivalent. For example, there may be only one opened tab with the list of active downloads at a time, but there may be many simultaneously opened tabs for hub browsing. Tab behavior is defined by the LC::TabFeature enum.
Different tab classes may have different priorities. The priorities system is used to try to guess the most-currently-wanted tab by the user. When user requests a new tab, but doesn't specify its type (for example, just hits Ctrl+T), priorities of two tab classes are compared: the priority of the class of the current tab and the highest priority among all the tabs. If current priority plus some delta is higher than maximum one, a new instance of current tab class is opened, otherwise the tab with the highest priority is opened. For example, if web browser tab has priority of 80, text editor — 70 and search plugin — 60, and delta is 15, then if current tab is web browser or search plugin, the new tab will be a web browser tab (since 60 + 15 < 80), but if the current tab is text editor's one, then the new tab will also be a text editor (70 + 15 > 80).
In future implementations user may be allowed to adjust the delta and priorities of different classes to his liking.
Definition at line 296 of file ihavetabs.h.
|
inlinevirtual |
Definition at line 299 of file ihavetabs.h.
|
pure virtual |
This signal is emitted by plugin to add a new tab.
tabContents must implement the ITabWidget interface to be successfully added to the tab widget.
For the tab to have an icon, emit the changeTabIcon() signal after emitting this one.
[out] | name | The initial name of the tab. |
[out] | tabContents | The widget to be added, must implement ITabWidget. |
|
pure virtual |
This signal is emitted by plugin to change the icon of the tab with the given tabContents.
The tab is identified by tabContents, which should be the widget previously added by emitting the addNewTab() signal by this same plugin.
Null icon object may be used to clear the icon.
[out] | tabContents | The widget with the contents of the tab which icon should be changed, added previously with addNewTab(). |
[out] | icon | The new icon of the tab with tabContents. |
|
pure virtual |
This signal is emitted by plugin to change the name of the tab with the given tabContents.
The name of the tab is shown in the tab bar of the tab widget. It also may be shown in other places and contexts, like in the LeechCraft title bar when the corresponding tab is active.
The tab is identified by tabContents, which should be the widget previously added by emitting the addNewTab() signal by this same plugin.
[out] | tabContents | The widget with the contents of the tab which name should be changed, added previously with addNewTab(). |
[out] | name | The new name of the tab with tabContents. |
|
pure virtual |
Returns the list of tab classes provided by this plugin.
This list must not change between different calls to this function.
|
pure virtual |
This signal is emitted by plugin to bring the tab with the given tabContents to the front.
The tab is identified by tabContents, which should be the widget previously added by emitting the addNewTab() signal by this same plugin.
[out] | tabContents | The widget with the contents of the tab that should be brought to the front. |
|
pure virtual |
This signal is emitted by plugin when it wants to remove a tab.
tabContents must be a widget previously added by emitting the addNewTab() signal by this same plugin.
[out] | tabContents | The widget to remove from the tab widget, must be previously added with addNewTab(). |
|
pure virtual |
This signal is emitted by plugin to change the status bar text for the tab with the given tabContents.
The text set by this signal would be shown when the corresponding tab is active. To clear the status bar, this signal should be emitted with empty text.
The tab is identified by tabContents, which should be the widget previously added by emitting the addNewTab() signal by this same plugin.
[out] | tabContents | The widget with the contents of the tab which statusbar text should be changed, added previously with addNewTab(). |
[out] | text | The new statusbar text of the tab with tabContents. |
|
pure virtual |
Opens the new tab from the given tabClass.
This method is called to notify the plugin that a tab of the given tabClass is requested by the user.
[in] | tabClass | The class of the requested tab, from the returned from GetTabClasses() list. |