libyui-qt-pkg
 
Loading...
Searching...
No Matches
YQPkgGenericDetailsView.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: YQPkgGenericDetailsView.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgGenericDetailsView_h
26#define YQPkgGenericDetailsView_h
27
28#include <QTextBrowser>
29#include <zypp/Date.h>
30#include "YQZypp.h"
31
32
33class QTabWidget;
34using std::string;
35
36
42class YQPkgGenericDetailsView : public QTextBrowser
43{
44 Q_OBJECT
45
46protected:
47
51 YQPkgGenericDetailsView( QWidget * parent );
52
57
58
59public:
60
65 virtual QSize minimumSizeHint() const;
66
70 static QString htmlStart();
71 static QString htmlEnd();
72
78 static QString htmlHeading( ZyppSel selectable, bool showVersion = false );
79
88 static QString htmlEscape( const QString & plainText );
89
93 static QString table( const QString & contents );
94
98 static QString row( const QString & contents );
99
103 static QString cell( QString contents );
104 static QString cell( int contents );
105 static QString cell( const string & contents );
106 static QString cell( const zypp::Date & date );
107
112 static QString hcell( QString contents );
113
114
115public slots:
116
122 void showDetailsIfVisible( ZyppSel selectable );
123
124 // slot clear() inherited from QTextEdit
125
130 virtual void showDetails( ZyppSel selectable ) = 0;
131
132
133
134protected slots:
135
139 void reloadTab( int newCurrent );
140 virtual void reload() { QTextBrowser::reload(); }
141
142
143protected:
144
145 // Data members
146
147 QTabWidget * _parentTab;
148 ZyppSel _selectable;
149};
150
151
152#endif // ifndef YQPkgGenericDetailsView_h
virtual ~YQPkgGenericDetailsView()
Definition YQPkgGenericDetailsView.cc:89
static QString htmlHeading(ZyppSel selectable, bool showVersion=false)
Definition YQPkgGenericDetailsView.cc:147
static QString hcell(QString contents)
Definition YQPkgGenericDetailsView.cc:245
virtual QSize minimumSizeHint() const
Definition YQPkgGenericDetailsView.cc:125
virtual void showDetails(ZyppSel selectable)=0
void showDetailsIfVisible(ZyppSel selectable)
Definition YQPkgGenericDetailsView.cc:106
YQPkgGenericDetailsView(QWidget *parent)
Definition YQPkgGenericDetailsView.cc:43
void reloadTab(int newCurrent)
Definition YQPkgGenericDetailsView.cc:96
static QString htmlStart()
Definition YQPkgGenericDetailsView.cc:132
static QString row(const QString &contents)
Definition YQPkgGenericDetailsView.cc:209
static QString cell(QString contents)
Definition YQPkgGenericDetailsView.cc:216
static QString htmlEscape(const QString &plainText)
Definition YQPkgGenericDetailsView.cc:182
static QString table(const QString &contents)
Definition YQPkgGenericDetailsView.cc:196