• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • kde3support
  • kdeui
k3aboutdialog.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE Libraries
3 * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and
4 * Espen Sand (espen@kde.org)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23/*
24 * This file declares a class for creating "About ..." dialogs
25 * in a general way. It provides geometry management and some
26 * options to connect for, like emailing the author or maintainer.
27 */
28
29
30#ifndef K3ABOUTDIALOG_H
31#define K3ABOUTDIALOG_H
32
33#include <kde3support_export.h>
34
35#include <QtGui/QFrame>
36#include <kdialog.h>
37
38class QLabel;
39class QLabel;
40class K3AboutContainer;
41class K3AboutContainerBase;
42
46class KDE3SUPPORT_EXPORT K3AboutContainer : public QFrame
47{
48 Q_OBJECT
49
50 public:
51 K3AboutContainer( QWidget *parent = 0,
52 int margin = 0, int spacing = 0,
53 Qt::Alignment childAlignment = Qt::AlignCenter,
54 Qt::Alignment innerAlignment = Qt::AlignCenter );
55
56 ~K3AboutContainer();
57
58 void addWidget( QWidget *widget );
59
60 void addPerson( const QString &name, const QString &email,
61 const QString &url, const QString &task,
62 bool showHeader = false, bool showframe = false,
63 bool showBold = false );
64
65 void addTitle( const QString &title, Qt::Alignment alignment = Qt::AlignLeft,
66 bool showframe = false, bool showBold = false );
67
68 void addImage( const QString &fileName, Qt::Alignment alignment = Qt::AlignLeft );
69
70 virtual QSize sizeHint() const;
71 virtual QSize minimumSizeHint() const;
72
73 private:
74 class Private;
75 Private* const d;
76};
77
82class KDE3SUPPORT_EXPORT K3AboutContributor : public QFrame
83{
84 Q_OBJECT
85
86 public:
87 K3AboutContributor( QWidget *parent = 0,
88 const QString &username = QString(),
89 const QString &email = QString(),
90 const QString &url = QString(),
91 const QString &work = QString(),
92 bool showHeader = false, bool showFrame = true,
93 bool showBold = false );
94
95 ~K3AboutContributor();
96
97 void setName( const QString &text, const QString &header = QString(),
98 bool update = true );
99
100 void setEmail( const QString &text, const QString &header = QString(),
101 bool update = true );
102
103 void setUrl( const QString &text, const QString &header = QString(),
104 bool update = true );
105
106 void setWork( const QString &text, const QString &header = QString(),
107 bool update = true );
108
109 QString name() const;
110 QString email() const;
111 QString url() const;
112 QString work() const;
113
114 virtual QSize sizeHint() const;
115
116 protected:
117 virtual void fontChange( const QFont &oldFont );
118
119 private:
120 class Private;
121 Private* const d;
122
123 virtual void setName(const char *_name) { QObject::setObjectName(QLatin1String(_name)); }
124};
125
131class KDE3SUPPORT_EXPORT K3AboutWidget : public QWidget
132{
133 Q_OBJECT
134
135 public:
136
140 K3AboutWidget( QWidget* parent=0 );
141
146 void adjust();
147
153 void setLogo( const QPixmap &logo );
154
158 void setAuthor( const QString& name, const QString& email,
159 const QString& url, const QString& work );
160
164 void setMaintainer( const QString& name, const QString& email,
165 const QString& url, const QString& work );
166
170 void addContributor( const QString& name, const QString& email,
171 const QString& url, const QString& work );
172
176 void setVersion( const QString& name );
177
178 protected:
182 void resizeEvent(QResizeEvent*);
183
187 QLabel *version;
188
192 QLabel *cont;
193
197 QLabel *logo;
198
202 K3AboutContributor *author;
203
207 K3AboutContributor *maintainer;
208
212 bool showMaintainer;
213
217 QList<K3AboutContributor *> contributors;
218
219 private:
220 class Private;
221 Private* const d;
222};
223
255class KDE3SUPPORT_EXPORT K3AboutDialog : public KDialog
256{
257 Q_OBJECT
258
259 public:
260
264 enum LayoutType
265 {
266 Plain = 0x0001,
267 Tabbed = 0x0002,
268 Title = 0x0004,
269 ImageLeft = 0x0008,
270 ImageRight = 0x0010,
271 ImageOnly = 0x0020,
272 Product = 0x0040,
273 KDEStandard = Tabbed | Title | ImageLeft,
274 AppStandard = Tabbed | Title | Product,
275 ImageAndTitle = Plain | Title | ImageOnly
276 };
277
278 public:
287 K3AboutDialog( QWidget *parent=0 );
288
302 K3AboutDialog( int dialogLayout, const QString &caption, QWidget *parent=0 );
303
311 void adjust();
312
320 virtual void show();
321
330 virtual void show( QWidget *centerParent );
331
338 void setTitle( const QString &title );
339
347 void setImage( const QString &fileName );
348
352 void setProgramLogo( const QString &fileName );
353
363 void setProgramLogo( const QPixmap &pixmap );
364
373 void setImageBackgroundColor( const QColor &color );
374
382 void setImageFrame( bool state );
383
395 void setProduct( const QString &appName, const QString &version,
396 const QString &author, const QString &year );
397
410 QFrame *addTextPage( const QString &title, const QString &text,
411 bool richText=false, int numLines=10 );
412
423 QFrame *addLicensePage( const QString &title, const QString &text,
424 int numLines=10 );
425
438 K3AboutContainer *addContainerPage( const QString &title,
439 Qt::Alignment childAlignment = Qt::AlignCenter,
440 Qt::Alignment innerAlignment = Qt::AlignCenter );
441
454 K3AboutContainer *addScrolledContainerPage( const QString &title,
455 Qt::Alignment childAlignment = Qt::AlignCenter,
456 Qt::Alignment innerAlignment = Qt::AlignCenter );
457
468 K3AboutContainer *addContainer( Qt::Alignment childAlignment, Qt::Alignment innerAlignment );
469
477 QFrame *addPage( const QString &title );
478
483 void setLogo( const QPixmap &logo );
484
489 void setAuthor( const QString& name, const QString& email,
490 const QString& url, const QString& work );
491
496 void setMaintainer( const QString& name, const QString& email,
497 const QString& url, const QString& work );
498
503 void addContributor( const QString& name, const QString& email,
504 const QString& url, const QString& work );
505
510 void setVersion( const QString& name );
511
516 static void imageUrl( QWidget *parent, const QString &caption,
517 const QString &path, const QColor &imageColor,
518 const QString &url );
519
520 protected:
524 K3AboutWidget *mAbout;
525
529 K3AboutContainerBase *mContainerBase;
530
531 private:
532 class Private;
533 Private* const d;
534};
535
536#endif // defined K3ABOUTDIALOG_H
K3AboutContainerBase
Used internally by K3AboutDialog.
Definition: k3aboutdialog_p.h:40
K3AboutContainer
K3AboutContainer can be used to make a application specific AboutDialog.
Definition: k3aboutdialog.h:47
K3AboutContributor
Used internally by K3AboutWidget.
Definition: k3aboutdialog.h:83
K3AboutDialog
A KDialog with predefined main widget.
Definition: k3aboutdialog.h:256
K3AboutDialog::mContainerBase
K3AboutContainerBase * mContainerBase
The main widget (Constructor II)
Definition: k3aboutdialog.h:529
K3AboutDialog::mAbout
K3AboutWidget * mAbout
The main widget (Constructor I)
Definition: k3aboutdialog.h:524
K3AboutDialog::LayoutType
LayoutType
Layout formats.
Definition: k3aboutdialog.h:265
K3AboutWidget
K3AboutWidget is the main widget for K3AboutDialog.
Definition: k3aboutdialog.h:132
K3AboutWidget::author
K3AboutContributor * author
The application developer.
Definition: k3aboutdialog.h:202
K3AboutWidget::contributors
QList< K3AboutContributor * > contributors
A set of people who contributed to the application.
Definition: k3aboutdialog.h:217
K3AboutWidget::maintainer
K3AboutContributor * maintainer
The application maintainer.
Definition: k3aboutdialog.h:207
K3AboutWidget::cont
QLabel * cont
The label showing the text "Other contributors:".
Definition: k3aboutdialog.h:192
K3AboutWidget::version
QLabel * version
The label showing the program version.
Definition: k3aboutdialog.h:187
K3AboutWidget::logo
QLabel * logo
The frame showing the logo.
Definition: k3aboutdialog.h:197
K3AboutWidget::showMaintainer
bool showMaintainer
Show the maintainer?
Definition: k3aboutdialog.h:212
KDialog
QFrame
QLabel
QList
QWidget
header
const char header[]
kde3support_export.h
kdialog.h
name
const char * name(StandardAction id)
Plain
Plain
Title
Title
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal