LeechCraft 0.6.70-16373-g319c272718
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
17namespace LC
18{
22 {
25 TFEmpty = 0x0,
26
39
53 TFSingle = 1 << 1,
54
62 TFByDefault = 1 << 2,
63
74
81 };
82
84
88 {
94 QByteArray TabClass_;
95
102
109
115 QIcon Icon_;
116
122 quint16 Priority_;
123
128 TabFeatures Features_;
129 };
130
132};
133
134class QToolBar;
135class QAction;
136
149class Q_DECL_EXPORT ITabWidget
150{
151public:
152 virtual ~ITabWidget () {}
153
163 virtual LC::TabClassInfo GetTabClassInfo () const = 0;
164
173 virtual QObject* ParentMultiTabs () = 0;
174
185 virtual void Remove () = 0;
186
197 virtual QToolBar* GetToolBar () const = 0;
198
211 {
212 return {};
213 }
214
234 {
235 return {};
236 }
237
242 virtual void TabMadeCurrent ()
243 {
244 }
245
251 virtual void TabLostCurrent ()
252 {
253 }
254
260 virtual void removeTab () = 0;
261
272 virtual void changeTabName (const QString& name)
273 {
274 Q_UNUSED (name)
275 }
276
287 virtual void changeTabIcon (const QIcon& icon)
288 {
289 Q_UNUSED (icon)
290 }
291
296 virtual void raiseTab ()
297 {
298 }
299};
300
341class Q_DECL_EXPORT IHaveTabs
342{
343public:
344 virtual ~IHaveTabs () {}
345
361 virtual LC::TabClasses_t GetTabClasses () const = 0;
362
377 virtual void TabOpenRequested (const QByteArray& tabClass) = 0;
378};
379
380Q_DECLARE_OPERATORS_FOR_FLAGS (LC::TabFeatures)
381
382Q_DECLARE_INTERFACE (ITabWidget, "org.Deviant.LeechCraft.ITabWidget/1.0")
383Q_DECLARE_INTERFACE (IHaveTabs, "org.Deviant.LeechCraft.IHaveTabs/1.0")
384
385#endif
Interface for plugins that have one or more tabs.
Definition ihavetabs.h:342
virtual ~IHaveTabs()
Definition ihavetabs.h:344
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:150
virtual void TabMadeCurrent()
This method is called when this tab becomes active.
Definition ihavetabs.h:242
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:287
virtual void raiseTab()
This signal is emitted by a tab to bring itself to the front.
Definition ihavetabs.h:296
virtual QMap< QString, QList< QAction * > > GetWindowMenus() const
Returns the list of QActions to be inserted into global menu.
Definition ihavetabs.h:233
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:272
virtual ~ITabWidget()
Definition ihavetabs.h:152
virtual void TabLostCurrent()
This method is called when another tab becomes active.
Definition ihavetabs.h:251
virtual QList< QAction * > GetTabBarContextMenuActions() const
Returns the list of QActions for the context menu of the tabbar.
Definition ihavetabs.h:210
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:17
Definition constants.h:15
TabFeature
Defines different behavior features of tab classes.
Definition ihavetabs.h:22
@ TFSuggestOpening
The tab is to be suggested in a quick launch area.
Definition ihavetabs.h:73
@ TFSingle
There could be only one instance of this tab.
Definition ihavetabs.h:53
@ TFOpenableByRequest
This tab could be opened by user request.
Definition ihavetabs.h:38
@ TFEmpty
No special features.
Definition ihavetabs.h:25
@ TFOverridesTabClose
The tab uses the standard tab close shortcut (Ctrl+W).
Definition ihavetabs.h:80
@ TFByDefault
The tab should be opened by default.
Definition ihavetabs.h:62
Q_DECLARE_FLAGS(TabFeatures, LC::TabFeature)
QList< TabClassInfo > TabClasses_t
Definition ihavetabs.h:131
The structure describing a single tab class.
Definition ihavetabs.h:88
QString VisibleName_
Visible name for the given tab class.
Definition ihavetabs.h:101
TabFeatures Features_
The features of this tab class.
Definition ihavetabs.h:128
QByteArray TabClass_
The tab class ID, which should be globally unique.
Definition ihavetabs.h:94
QString Description_
The description of the given tab class.
Definition ihavetabs.h:108
QIcon Icon_
The icon for the given tab class.
Definition ihavetabs.h:115
quint16 Priority_
The priority of this tab class.
Definition ihavetabs.h:122