LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ihavetabs.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#ifndef INTERFACES_IHAVETABS_H
10#define INTERFACES_IHAVETABS_H
11#include <QMetaType>
12#include <QList>
13#include <QMap>
14#include <QByteArray>
15#include <QIcon>
16#include <QtPlugin>
17
18namespace LC
19{
23 {
26 TFEmpty = 0x0,
27
40
54 TFSingle = 1 << 1,
55
63 TFByDefault = 1 << 2,
64
75
82 };
83
85
89 {
95 QByteArray TabClass_;
96
103
110
116 QIcon Icon_;
117
123 quint16 Priority_;
124
129 TabFeatures Features_;
130 };
131
133};
134
135class QToolBar;
136class QAction;
137
150class Q_DECL_EXPORT ITabWidget
151{
152public:
153 virtual ~ITabWidget () {}
154
164 virtual LC::TabClassInfo GetTabClassInfo () const = 0;
165
174 virtual QObject* ParentMultiTabs () = 0;
175
186 virtual void Remove () = 0;
187
198 virtual QToolBar* GetToolBar () const = 0;
199
212 {
213 return {};
214 }
215
235 {
236 return {};
237 }
238
243 virtual void TabMadeCurrent ()
244 {
245 }
246
252 virtual void TabLostCurrent ()
253 {
254 }
255
261 virtual void removeTab () = 0;
262
273 virtual void changeTabName (const QString& name)
274 {
275 Q_UNUSED (name)
276 }
277
288 virtual void changeTabIcon (const QIcon& icon)
289 {
290 Q_UNUSED (icon)
291 }
292
297 virtual void raiseTab ()
298 {
299 }
300};
301
342class Q_DECL_EXPORT IHaveTabs
343{
344public:
345 virtual ~IHaveTabs () {}
346
362 virtual LC::TabClasses_t GetTabClasses () const = 0;
363
378 virtual void TabOpenRequested (const QByteArray& tabClass) = 0;
379};
380
381Q_DECLARE_OPERATORS_FOR_FLAGS (LC::TabFeatures)
382
383Q_DECLARE_INTERFACE (ITabWidget, "org.Deviant.LeechCraft.ITabWidget/1.0")
384Q_DECLARE_INTERFACE (IHaveTabs, "org.Deviant.LeechCraft.IHaveTabs/1.0")
385
386#endif
Interface for plugins that have one or more tabs.
Definition ihavetabs.h:343
virtual ~IHaveTabs()
Definition ihavetabs.h:345
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.
This interface defines methods that should be implemented in widgets added to the main tab widget.
Definition ihavetabs.h:151
virtual void TabMadeCurrent()
This method is called when this tab becomes active.
Definition ihavetabs.h:243
virtual QObject * ParentMultiTabs()=0
Returns the pointer to the plugin this tab belongs to.
virtual void changeTabIcon(const QIcon &icon)
This signal is emitted by a tab to change its icon.
Definition ihavetabs.h:288
virtual void raiseTab()
This signal is emitted by a tab to bring itself to the front.
Definition ihavetabs.h:297
virtual QMap< QString, QList< QAction * > > GetWindowMenus() const
Returns the list of QActions to be inserted into global menu.
Definition ihavetabs.h:234
virtual void removeTab()=0
This signal is emitted by a tab when it wants to remove itself.
virtual void Remove()=0
Requests to remove the tab.
virtual void changeTabName(const QString &name)
This signal is emitted by a tab to change its name.
Definition ihavetabs.h:273
virtual ~ITabWidget()
Definition ihavetabs.h:153
virtual void TabLostCurrent()
This method is called when another tab becomes active.
Definition ihavetabs.h:252
virtual QList< QAction * > GetTabBarContextMenuActions() const
Returns the list of QActions for the context menu of the tabbar.
Definition ihavetabs.h:211
virtual QToolBar * GetToolBar() const =0
Requests tab's toolbar.
virtual LC::TabClassInfo GetTabClassInfo() const =0
Returns the description of the tab class of this tab.
Definition anutil.h:15
Definition constants.h:15
TabFeature
Defines different behavior features of tab classes.
Definition ihavetabs.h:23
@ TFSuggestOpening
The tab is to be suggested in a quick launch area.
Definition ihavetabs.h:74
@ TFSingle
There could be only one instance of this tab.
Definition ihavetabs.h:54
@ TFOpenableByRequest
This tab could be opened by user request.
Definition ihavetabs.h:39
@ TFEmpty
No special features.
Definition ihavetabs.h:26
@ TFOverridesTabClose
The tab uses the standard tab close shortcut (Ctrl+W).
Definition ihavetabs.h:81
@ TFByDefault
The tab should be opened by default.
Definition ihavetabs.h:63
Q_DECLARE_FLAGS(TabFeatures, LC::TabFeature)
QList< TabClassInfo > TabClasses_t
Definition ihavetabs.h:132
The structure describing a single tab class.
Definition ihavetabs.h:89
QString VisibleName_
Visible name for the given tab class.
Definition ihavetabs.h:102
TabFeatures Features_
The features of this tab class.
Definition ihavetabs.h:129
QByteArray TabClass_
The tab class ID, which should be globally unique.
Definition ihavetabs.h:95
QString Description_
The description of the given tab class.
Definition ihavetabs.h:109
QIcon Icon_
The icon for the given tab class.
Definition ihavetabs.h:116
quint16 Priority_
The priority of this tab class.
Definition ihavetabs.h:123