LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
irootwindowsmanager.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 <QObject>
12
13class ITabWidget;
14class QMainWindow;
15class ICoreTabWidget;
16class IMWProxy;
17
45class Q_DECL_EXPORT IRootWindowsManager
46{
47public:
49
57 virtual QObject* GetQObject () = 0;
58
65 virtual int GetWindowsCount () const = 0;
66
73 virtual int GetPreferredWindowIndex () const = 0;
74
89 virtual int GetPreferredWindowIndex (const QByteArray& tabclass) const = 0;
90
100 virtual QMainWindow* GetPreferredWindow () const
101 {
102 return GetMainWindow (GetPreferredWindowIndex ());
103 }
104
112 virtual int GetWindowForTab (ITabWidget *tab) const = 0;
113
120 virtual IMWProxy* GetMWProxy (int winIdx) const = 0;
121
129 virtual QMainWindow* GetMainWindow (int idx) const = 0;
130
138 virtual int GetWindowIndex (QMainWindow *window) const = 0;
139
149 virtual ICoreTabWidget* GetTabWidget (int idx) const = 0;
150
158 virtual int GetTabWidgetIndex (ICoreTabWidget *ictw) const
159 {
160 for (int i = 0; i < GetWindowsCount (); ++i)
161 if (GetTabWidget (i) == ictw)
162 return i;
163
164 return -1;
165 }
166protected:
174 virtual void windowAdded (int index) = 0;
175
187 virtual void windowRemoved (int index) = 0;
188
196 virtual void currentWindowChanged (int to, int from) = 0;
197
206 virtual void tabAdded (int windowIdx, int tabIdx) = 0;
207
217 virtual void tabIsRemoving (int windowIdx, int tabIdx) = 0;
218
230 virtual void tabIsMoving (int fromWin, int toWin, int tabIdx) = 0;
231
243 virtual void tabMoved (int fromWin, int toWin, int tabIdx) = 0;
244};
245
246Q_DECLARE_INTERFACE (IRootWindowsManager, "org.LeechCraft.IRootWindowsManager/1.0")
This interface is used to represent LeechCraft's core tab widget.
This interface is used for manipulating the main window.
Definition: imwproxy.h:26
Interface to the core windows manager.
virtual int GetTabWidgetIndex(ICoreTabWidget *ictw) const
Returns the index of the window containing the tab widget.
virtual QObject * GetQObject()=0
Returns this object as a QObject.
virtual int GetPreferredWindowIndex(const QByteArray &tabclass) const =0
Returns the preferred window for the given tabclass.
virtual ICoreTabWidget * GetTabWidget(int idx) const =0
Returns the tab widget of the window identified by idx.
virtual void tabAdded(int windowIdx, int tabIdx)=0
Emitted after a new tab is added to the given window.
virtual void windowRemoved(int index)=0
Emitted before a window at the given index is removed.
virtual int GetWindowForTab(ITabWidget *tab) const =0
Returns the window index containing the given tab.
virtual void windowAdded(int index)=0
Emitted after a new window is added.
virtual void tabMoved(int fromWin, int toWin, int tabIdx)=0
Emitted after a tab is moved from a window to another one.
virtual void tabIsRemoving(int windowIdx, int tabIdx)=0
Emitted before a tab is removed from the given window.
virtual int GetWindowIndex(QMainWindow *window) const =0
Returns the index of the given window.
virtual IMWProxy * GetMWProxy(int winIdx) const =0
Returns the window proxy for the given window index.
virtual int GetPreferredWindowIndex() const =0
Returns the index of the currently preferred window.
virtual QMainWindow * GetPreferredWindow() const
Returns the currently preferred window.
virtual void tabIsMoving(int fromWin, int toWin, int tabIdx)=0
Emitted before a tab is moved from a window to another one.
virtual QMainWindow * GetMainWindow(int idx) const =0
Returns the window for the given index.
virtual void currentWindowChanged(int to, int from)=0
Emitted when current LeechCraft window changes.
virtual int GetWindowsCount() const =0
Returns the current window count.
This interface defines methods that should be implemented in widgets added to the main tab widget.
Definition: ihavetabs.h:150