libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgFilterTab.h
1/*
2 Copyright (c) 2000 - 2010 Novell, Inc.
3 Copyright (c) 2021 SUSE LLC
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) version 3.0 of the License. This library
9 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details. You should have received a copy of the GNU
13 Lesser General Public License along with this library; if not, write
14 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
15 Floor, Boston, MA 02110-1301 USA
16*/
17
18
19/*
20 File: YQPkgFilterTab.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgFilterTab_h
26#define YQPkgFilterTab_h
27
28#include <yui/ImplPtr.h>
29
30#include <QWidget>
31#include <QHash>
32#include <QTabWidget>
33
35class YQPkgFilterPage;
37class QAction;
38
39
72class YQPkgFilterTab: public QTabWidget
73{
74 Q_OBJECT
75
76public:
77
81 YQPkgFilterTab( QWidget * parent, const QString & settingsName );
82
86 virtual ~YQPkgFilterTab();
87
93 void addPage( const QString & pageLabel,
94 QWidget * pageContent,
95 const QString & internalName );
96
100 QWidget * rightPane() const;
101
106
112 YQPkgFilterPage * findPage( QWidget * pageContent );
113
118 YQPkgFilterPage * findPage( const QString & internalName );
119
124 YQPkgFilterPage * findPage( int tabIndex );
125
129 int tabCount() const;
130
138 virtual bool eventFilter ( QObject * watchedObj, QEvent * event );
139
140
141signals:
142
147 void currentChanged( QWidget * newPageContent );
148
149
150public slots:
151
155 void showPage( QWidget * page );
156 void showPage( const QString & internalName );
157
161 void closeCurrentPage();
162
172 void loadSettings();
173
178 void saveSettings();
179
183 void closeAllPages();
184
185
186protected slots:
187
191 void showPage( int tabIndex );
192
196 void showPage( QAction * action );
197
202 void contextMovePageLeft();
203
209
213 void contextClosePage();
214
215
216protected:
217
221 void showPage( YQPkgFilterPage * page );
222
228 bool postTabContextMenu( const QPoint & pos );
229
233 void swapTabs( YQPkgFilterPage * page1, YQPkgFilterPage * page2 );
234
235
236private:
237
238 ImplPtr<YQPkgFilterTabPrivate> priv;
239};
240
241
242
247{
248 YQPkgFilterPage( const QString & pageLabel,
249 QWidget * content,
250 const QString & internalName )
251 : content( content )
252 , label( pageLabel )
253 , id( internalName )
254 , closeEnabled( true )
255 , tabIndex( -1 )
256 {}
257
258 QWidget * content;
259 QString label; // user visible text
260 QString id; // internal name
261 bool closeEnabled;
262 int tabIndex; // index of the corresponding tab or -1 if none
263};
264
265
266#endif // YQPkgFilterTab_h
List of disk usage of all attached partitions.
Definition YQPkgDiskUsageList.h:134
Definition YQPkgFilterTab.h:73
virtual bool eventFilter(QObject *watchedObj, QEvent *event)
Definition YQPkgFilterTab.cc:478
void swapTabs(YQPkgFilterPage *page1, YQPkgFilterPage *page2)
Definition YQPkgFilterTab.cc:594
bool postTabContextMenu(const QPoint &pos)
Definition YQPkgFilterTab.cc:496
void contextMovePageRight()
Definition YQPkgFilterTab.cc:578
void closeCurrentPage()
Definition YQPkgFilterTab.cc:391
void addPage(const QString &pageLabel, QWidget *pageContent, const QString &internalName)
Definition YQPkgFilterTab.cc:284
void contextClosePage()
Definition YQPkgFilterTab.cc:622
void contextMovePageLeft()
Definition YQPkgFilterTab.cc:562
QWidget * rightPane() const
Definition YQPkgFilterTab.cc:270
YQPkgDiskUsageList * diskUsageList() const
Definition YQPkgFilterTab.cc:277
void currentChanged(QWidget *newPageContent)
YQPkgFilterPage * findPage(QWidget *pageContent)
Definition YQPkgFilterTab.cc:423
int tabCount() const
Definition YQPkgFilterTab.cc:471
void saveSettings()
Definition YQPkgFilterTab.cc:683
void showPage(QWidget *page)
Definition YQPkgFilterTab.cc:313
void closeAllPages()
Definition YQPkgFilterTab.cc:374
virtual ~YQPkgFilterTab()
Definition YQPkgFilterTab.cc:254
void loadSettings()
Definition YQPkgFilterTab.cc:651
Definition YQPkgFilterTab.h:247
Definition YQPkgFilterTab.cc:71