![]() |
LeechCraft 0.6.70-17609-g3dde4097dd
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. | |
virtual void | TabOpenRequested (const QByteArray &tabClass)=0 |
Opens the new tab from the given tabClass. | |
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 342 of file ihavetabs.h.
|
inlinevirtual |
Definition at line 345 of file ihavetabs.h.
|
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 |
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. |