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

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • kernel
kaboutdata.h
Go to the documentation of this file.
1 /*
2  * This file is part of the KDE Libraries
3  * Copyright (C) 2000 Espen Sand (espen@kde.org)
4  * Copyright (C) 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
5  * Copyright (C) 2010 Teo Mrnjavac <teo@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #ifndef KABOUTDATA_H
25 #define KABOUTDATA_H
26 
27 #include <kdecore_export.h>
28 #include <klocale.h>
29 // Qt
30 #include <QtCore/QString>
31 #include <QtCore/QSharedDataPointer>
32 
33 template <class T> class QList;
34 class QVariant;
35 class KAboutData;
36 
68 class KDECORE_EXPORT KAboutPerson
69 {
70  friend class KAboutData;
71 public:
83  explicit KAboutPerson( const KLocalizedString &name,
84  const KLocalizedString &task = KLocalizedString(),
85  const QByteArray &emailAddress = QByteArray(),
86  const QByteArray &webAddress = QByteArray() );
87 
101  explicit KAboutPerson( const KLocalizedString &name,
102  const KLocalizedString &task,
103  const QByteArray &emailAddress,
104  const QByteArray &webAddress,
105  const QByteArray &ocsUsername ); //KDE5: merge into main ctor
106 
111  KAboutPerson(const KAboutPerson& other);
112 
113  ~KAboutPerson();
114 
119  KAboutPerson& operator=(const KAboutPerson& other);
120 
121 
127  QString name() const;
128 
134  QString task() const;
135 
141  QString emailAddress() const;
142 
148  QString webAddress() const;
149 
155  QString ocsUsername() const;
156 
157 private:
161  explicit KAboutPerson( const QString &name, const QString &email );
162 
163  class Private;
164  Private *const d;
165 };
166 
167 class KAboutLicense;
168 
169 // KDE5: refactor together with KComponentData.
170 // Like changing all property names which contain Program or App.
171 
192 class KDECORE_EXPORT KAboutData
193 {
194  public:
198  enum LicenseKey // KDE5: move to KAboutLicense, cut License_ prefix
199  {
200  License_Custom = -2,
201  License_File = -1,
202  License_Unknown = 0,
203  License_GPL = 1,
204  License_GPL_V2 = 1,
205  License_LGPL = 2,
206  License_LGPL_V2 = 2,
207  License_BSD = 3,
208  License_Artistic = 4,
209  License_QPL = 5,
210  License_QPL_V1_0 = 5,
211  License_GPL_V3 = 6,
212  License_LGPL_V3 = 7
213  };
214 
218  enum NameFormat // KDE5: move to KAboutLicense
219  {
220  ShortName,
221  FullName
222  };
223 
224  public:
266  KAboutData( const QByteArray &appName,
267  const QByteArray &catalogName,
268  const KLocalizedString &programName,
269  const QByteArray &version,
270  const KLocalizedString &shortDescription = KLocalizedString(),
271  enum LicenseKey licenseType = License_Unknown,
272  const KLocalizedString &copyrightStatement = KLocalizedString(),
273  const KLocalizedString &otherText = KLocalizedString(),
274  const QByteArray &homePageAddress = QByteArray(),
275  const QByteArray &bugsEmailAddress = "submit@bugs.kde.org"
276  );
277 
282  KAboutData(const KAboutData& other);
283 
288  KAboutData& operator=(const KAboutData& other);
289 
290  ~KAboutData();
291 
314  KAboutData &addAuthor( const KLocalizedString &name,
315  const KLocalizedString &task = KLocalizedString(),
316  const QByteArray &emailAddress = QByteArray(),
317  const QByteArray &webAddress = QByteArray() );
318 
344  KAboutData &addAuthor( const KLocalizedString &name,
345  const KLocalizedString &task,
346  const QByteArray &emailAddress,
347  const QByteArray &webAddress,
348  const QByteArray &ocsUsername ); //KDE5: merge with addAuthor
349 
372  KAboutData &addCredit( const KLocalizedString &name,
373  const KLocalizedString &task = KLocalizedString(),
374  const QByteArray &emailAddress = QByteArray(),
375  const QByteArray &webAddress = QByteArray() );
376 
402  KAboutData &addCredit( const KLocalizedString &name,
403  const KLocalizedString &task,
404  const QByteArray &emailAddress,
405  const QByteArray &webAddress,
406  const QByteArray &ocsUsername ); //KDE5: merge with addCredit
407 
430  KAboutData &setTranslator( const KLocalizedString& name,
431  const KLocalizedString& emailAddress );
432 
443  KAboutData &setLicenseText( const KLocalizedString &license );
444 
460  KAboutData &addLicenseText( const KLocalizedString &license );
461 
468  KAboutData &setLicenseTextFile( const QString &file );
469 
481  KAboutData &addLicenseTextFile( const QString &file );
482 
488  KAboutData &setAppName( const QByteArray &appName );
489 
497  KAboutData &setProgramName( const KLocalizedString &programName );
498 
509  KAboutData &setProgramIconName( const QString &iconName );
510 
523  KAboutData &setProgramLogo(const QVariant& image);
524 
537  KAboutData &setOcsProvider( const QByteArray &providerUrl );
538 
544  KAboutData &setVersion( const QByteArray &version );
545 
553  KAboutData &setShortDescription( const KLocalizedString &shortDescription );
554 
560  KAboutData &setCatalogName( const QByteArray &catalogName );
561 
568  KAboutData &setLicense( LicenseKey licenseKey );
569 
580  KAboutData &addLicense( LicenseKey licenseKey );
581 
589  KAboutData &setCopyrightStatement( const KLocalizedString &copyrightStatement );
590 
598  KAboutData &setOtherText( const KLocalizedString &otherText );
599 
607  KAboutData &setHomepage( const QByteArray &homepage );
608 
615  KAboutData &setBugAddress( const QByteArray &bugAddress );
616 
634  KAboutData &setOrganizationDomain( const QByteArray &domain );
635 
644  KAboutData &setProductName( const QByteArray &name );
645 
650  QString appName() const;
651 
659  QString productName() const;
660 
665  QString programName() const;
666 
672  QString organizationDomain() const;
673 
678  const char* internalProgramName() const;
679 
684  void translateInternalProgramName() const;
685 
697  QString programIconName() const;
698 
708  QVariant programLogo() const;
709 
714  QString ocsProviderUrl() const;
715 
720  QString version() const;
721 
726  const char* internalVersion() const;
727 
733  QString shortDescription() const;
734 
739  QString catalogName() const;
740 
746  QString homepage() const;
747 
752  QString bugAddress() const;
753 
758  const char* internalBugAddress() const;
759 
764  QList<KAboutPerson> authors() const;
765 
770  QList<KAboutPerson> credits() const;
771 
776  QList<KAboutPerson> translators() const;
777 
782  static QString aboutTranslationTeam();
783 
788  QString otherText() const;
789 
799  QString license() const;
800 
808  QString licenseName(NameFormat formatName) const;
809 
816  QList<KAboutLicense> licenses() const;
817 
822  QString copyrightStatement() const;
823 
831  QString customAuthorPlainText() const;
832 
840  QString customAuthorRichText() const;
841 
849  bool customAuthorTextEnabled() const;
850 
862  KAboutData &setCustomAuthorText(const KLocalizedString &plainText,
863  const KLocalizedString &richText);
864 
870  KAboutData &unsetCustomAuthorText();
871 
872  private:
873 
874  class Private;
875  Private *const d;
876 };
877 
878 
894 class KDECORE_EXPORT KAboutLicense
895 {
896  friend class KAboutData;
897 public:
902  KAboutLicense(const KAboutLicense& other);
903 
904  ~KAboutLicense();
905 
910  KAboutLicense& operator=(const KAboutLicense& other);
911 
912 
920  QString text() const;
921 
927  QString name(KAboutData::NameFormat formatName) const;
928 
935  KAboutData::LicenseKey key() const;
936 
959  static KAboutLicense byKeyword(const QString &keyword);
960 
961 private:
965  explicit KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
969  explicit KAboutLicense( const QString &pathToFile, const KAboutData *aboutData );
973  explicit KAboutLicense( const KLocalizedString &licenseText, const KAboutData *aboutData );
974 
975  class Private;
976  QSharedDataPointer<Private> d;
977 };
978 
979 #endif
980 
KAboutLicense
This class is used to store information about a license.
Definition: kaboutdata.h:894
kdecore_export.h
QByteArray
KAboutData::NameFormat
NameFormat
Format of the license name.
Definition: kaboutdata.h:218
KAboutData::ShortName
Definition: kaboutdata.h:220
klocale.h
KAboutData
This class is used to store information about a program.
Definition: kaboutdata.h:192
QString
QList
Definition: kaboutdata.h:33
KAboutPerson
This class is used to store information about a person or developer.
Definition: kaboutdata.h:68
KDE::version
unsigned int version()
Returns the encoded number of KDE's version, see the KDE_VERSION macro.
Definition: kdeversion.cpp:24
KAboutData::operator=
KAboutData & operator=(const KAboutData &other)
Assignment operator.
Definition: kaboutdata.cpp:491
KAboutData::LicenseKey
LicenseKey
Describes the license of the software.
Definition: kaboutdata.h:198
KLocalizedString
Class for producing and handling localized messages.
Definition: klocalizedstring.h:299
QSharedDataPointer< Private >
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs 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

Search



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