![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Interface to the core windows manager. More...
#include "irootwindowsmanager.h"
Public Member Functions | |
virtual | ~IRootWindowsManager () |
virtual QObject * | GetQObject ()=0 |
Returns this object as a QObject. More... | |
virtual int | GetWindowsCount () const =0 |
Returns the current window count. More... | |
virtual int | GetPreferredWindowIndex () const =0 |
Returns the index of the currently preferred window. More... | |
virtual int | GetPreferredWindowIndex (const QByteArray &tabclass) const =0 |
Returns the preferred window for the given tabclass. More... | |
virtual QMainWindow * | GetPreferredWindow () const |
Returns the currently preferred window. More... | |
virtual int | GetWindowForTab (ITabWidget *tab) const =0 |
Returns the window index containing the given tab. More... | |
virtual IMWProxy * | GetMWProxy (int winIdx) const =0 |
Returns the window proxy for the given window index. More... | |
virtual QMainWindow * | GetMainWindow (int idx) const =0 |
Returns the window for the given index. More... | |
virtual int | GetWindowIndex (QMainWindow *window) const =0 |
Returns the index of the given window. More... | |
virtual ICoreTabWidget * | GetTabWidget (int idx) const =0 |
Returns the tab widget of the window identified by idx. More... | |
virtual int | GetTabWidgetIndex (ICoreTabWidget *ictw) const |
Returns the index of the window containing the tab widget. More... | |
Protected Member Functions | |
virtual void | windowAdded (int index)=0 |
Emitted after a new window is added. More... | |
virtual void | windowRemoved (int index)=0 |
Emitted before a window at the given index is removed. More... | |
virtual void | currentWindowChanged (int to, int from)=0 |
Emitted when current LeechCraft window changes. More... | |
virtual void | tabAdded (int windowIdx, int tabIdx)=0 |
Emitted after a new tab is added to the given window. More... | |
virtual void | tabIsRemoving (int windowIdx, int tabIdx)=0 |
Emitted before a tab is removed from the given window. More... | |
virtual void | tabIsMoving (int fromWin, int toWin, int tabIdx)=0 |
Emitted before a tab is moved from a window to another one. More... | |
virtual void | tabMoved (int fromWin, int toWin, int tabIdx)=0 |
Emitted after a tab is moved from a window to another one. More... | |
Interface to the core windows manager.
The implementation of this interface is the core manager of root windows (or main windows). It is used to support various multiwindow features.
Since the implementation is guaranteed to have signals (see the protected functions below), it also has a GetQObject() method that returns a QObject that can be used to expose these signals.
There is always at least one window (that is, with the index 0). It is the window initially created during LeechCraft startup, and currently it cannot be destroyed at all (though this may change some time in the future).
There is a concept of preferred window. It's the window best used to be a parent of a message box, or used to determine the preferred screen on a multiscreen system, etc. Typically, it is the window that currently has focus. The functions GetPreferredWindowIndex() and GetPreferredWindow() are used to get the currently preferred window.
Window indices are simply indices in some internal data structure. That's why if a window gets removed all indices following it get invalidated (in fact, decremented by one).
Definition at line 45 of file irootwindowsmanager.h.
|
inlinevirtual |
Definition at line 48 of file irootwindowsmanager.h.
|
protectedpure virtual |
Emitted when current LeechCraft window changes.
[out] | to | The new active window index. |
[out] | from | The previous active window index. |
|
pure virtual |
Returns the window for the given index.
[in] | idx | The index of the window. |
|
pure virtual |
Returns the window proxy for the given window index.
[in] | winIdx | The window index for which the proxy is requested. |
|
inlinevirtual |
Returns the currently preferred window.
It is a helper function returning the window with the index of GetPreferredWindowIndex().
Definition at line 100 of file irootwindowsmanager.h.
|
pure virtual |
Returns the index of the currently preferred window.
|
pure virtual |
Returns the preferred window for the given tabclass.
This function returns the window that would be used to host a new tab of the given tabclass if the tab is opened right after this call.
Please note that preferred windows algorithm can be dynamic, so the result of this function may become irrelevant after a few other tabs are opened, closed or moved.
[in] | tabclass | The tab class to check. |
|
pure virtual |
Returns this object as a QObject.
The returned QObject can be used to connect its signals, which are declared as protected functions here.
|
pure virtual |
Returns the tab widget of the window identified by idx.
[in] | idx | The index of the window for which to return the tab widget. |
|
inlinevirtual |
Returns the index of the window containing the tab widget.
[in] | ictw | The tab widget to search for. |
Definition at line 158 of file irootwindowsmanager.h.
|
pure virtual |
Returns the window index containing the given tab.
If no window contains the tab, returns -1.
[in] | tab | The tab to search for. |
|
pure virtual |
Returns the index of the given window.
[in] | window | The window to search for. |
|
pure virtual |
Returns the current window count.
Please note that there is always at least one window.
|
protectedpure virtual |
Emitted after a new tab is added to the given window.
[out] | windowIdx | The index of the window tab is added to. |
[out] | tabIdx | The index of the tab. |
|
protectedpure virtual |
Emitted before a tab is moved from a window to another one.
The tab index is given in the window from which the tab is moved.
[out] | fromWin | The window from which the tab is being removed. |
[out] | toWin | The window to which the tab is being added. |
[out] | tabIdx | The index of the tab being moved in the window it is moved from. |
|
protectedpure virtual |
Emitted before a tab is removed from the given window.
[out] | windowIdx | The index of the window tab is being removed from. |
[out] | tabIdx | The index of the tab. |
|
protectedpure virtual |
Emitted after a tab is moved from a window to another one.
The tab index is given in the window to which the tab is moved.
[out] | fromWin | The window from which the tab is removed. |
[out] | toWin | The window to which the tab is added. |
[out] | tabIdx | The index of the tab being moved in the window it is moved to. |
|
protectedpure virtual |
Emitted after a new window is added.
[out] | index | The index of the newly added window. |
|
protectedpure virtual |
Emitted before a window at the given index is removed.
Since the signal is emitted before the window is removed, the window still can be obtained via GetMainWindow() (as well as its helper classes via GetMWProxy() and GetTabWidget()).
[out] | index | The index of the window being removed. |