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

KDECore

kaboutdata.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the KDE Libraries
00003  * Copyright (C) 2000 Espen Sand (espen@kde.org)
00004  * Copyright (C) 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef KABOUTDATA_H
00024 #define KABOUTDATA_H
00025 
00026 #include <kdecore_export.h>
00027 #include <klocale.h>
00028 // Qt
00029 #include <QtCore/QString>
00030 #include <QtCore/QSharedDataPointer>
00031 
00032 template <class T> class QList;
00033 class QVariant;
00034 class KAboutData;
00035 
00067 class KDECORE_EXPORT KAboutPerson
00068 {
00069     friend class KAboutData;
00070 public:
00082     explicit KAboutPerson( const KLocalizedString &name,
00083                            const KLocalizedString &task = KLocalizedString(),
00084                            const QByteArray &emailAddress = QByteArray(),
00085                            const QByteArray &webAddress = QByteArray() );
00086 
00091     KAboutPerson(const KAboutPerson& other);
00092 
00093     ~KAboutPerson();
00094 
00099     KAboutPerson& operator=(const KAboutPerson& other);
00100 
00101 
00107     QString name() const;
00108 
00114     QString task() const;
00115 
00121     QString emailAddress() const;
00122 
00128     QString webAddress() const;
00129 
00130 private:
00134     explicit KAboutPerson( const QString &name, const QString &email );
00135 
00136     class Private;
00137     Private *const d;
00138 };
00139 
00140 class KAboutLicense;
00141 
00142 // KDE5: refactor together with KComponentData.
00143 // Like changing all property names which contain Program or App.
00144 
00165 class KDECORE_EXPORT KAboutData
00166 {
00167   public:
00171     enum LicenseKey // KDE5: move to KAboutLicense, cut License_ prefix
00172     {
00173       License_Custom = -2,
00174       License_File = -1,
00175       License_Unknown = 0,
00176       License_GPL  = 1,
00177       License_GPL_V2 = 1,
00178       License_LGPL = 2,
00179       License_LGPL_V2 = 2,
00180       License_BSD  = 3,
00181       License_Artistic = 4,
00182       License_QPL = 5,
00183       License_QPL_V1_0 = 5,
00184       License_GPL_V3 = 6,
00185       License_LGPL_V3 = 7
00186     };
00187 
00191     enum NameFormat // KDE5: move to KAboutLicense
00192     {
00193         ShortName,
00194         FullName
00195     };
00196 
00197   public:
00239     KAboutData( const QByteArray &appName,
00240                 const QByteArray &catalogName,
00241                 const KLocalizedString &programName,
00242                 const QByteArray &version,
00243                 const KLocalizedString &shortDescription = KLocalizedString(),
00244                 enum LicenseKey licenseType = License_Unknown,
00245                 const KLocalizedString &copyrightStatement = KLocalizedString(),
00246                 const KLocalizedString &text = KLocalizedString(),
00247                 const QByteArray &homePageAddress = QByteArray(),
00248                 const QByteArray &bugsEmailAddress = "submit@bugs.kde.org"
00249               );
00250 
00255      KAboutData(const KAboutData& other);
00256 
00261      KAboutData& operator=(const KAboutData& other);
00262 
00263      ~KAboutData();
00264 
00287     KAboutData &addAuthor( const KLocalizedString &name,
00288                            const KLocalizedString &task = KLocalizedString(),
00289                            const QByteArray &emailAddress = QByteArray(),
00290                            const QByteArray &webAddress = QByteArray() );
00291 
00314     KAboutData &addCredit( const KLocalizedString &name,
00315                            const KLocalizedString &task = KLocalizedString(),
00316                            const QByteArray &emailAddress = QByteArray(),
00317                            const QByteArray &webAddress = QByteArray() );
00318 
00341     KAboutData &setTranslator( const KLocalizedString& name,
00342                                const KLocalizedString& emailAddress );
00343 
00354     KAboutData &setLicenseText( const KLocalizedString &license );
00355 
00371     KAboutData &addLicenseText( const KLocalizedString &license );
00372 
00379     KAboutData &setLicenseTextFile( const QString &file );
00380 
00392     KAboutData &addLicenseTextFile( const QString &file );
00393 
00399     KAboutData &setAppName( const QByteArray &appName );
00400 
00408     KAboutData &setProgramName( const KLocalizedString &programName );
00409 
00420     KAboutData &setProgramIconName( const QString &iconName );
00421 
00434     KAboutData &setProgramLogo(const QVariant& image);
00435 
00441     KAboutData &setVersion( const QByteArray &version );
00442 
00450     KAboutData &setShortDescription( const KLocalizedString &shortDescription );
00451 
00457     KAboutData &setCatalogName( const QByteArray &catalogName );
00458 
00465     KAboutData &setLicense( LicenseKey licenseKey );
00466 
00477     KAboutData &addLicense( LicenseKey licenseKey );
00478 
00486     KAboutData &setCopyrightStatement( const KLocalizedString &copyrightStatement );
00487 
00495     KAboutData &setOtherText( const KLocalizedString &otherText );
00496 
00504     KAboutData &setHomepage( const QByteArray &homepage );
00505 
00512     KAboutData &setBugAddress( const QByteArray &bugAddress );
00513 
00531     KAboutData &setOrganizationDomain( const QByteArray &domain );
00532 
00541     KAboutData &setProductName( const QByteArray &name );
00542 
00547     QString appName() const;
00548 
00556     QString productName() const;
00557 
00562     QString programName() const;
00563 
00569     QString organizationDomain() const;
00570 
00575     const char* internalProgramName() const;
00576 
00581     void translateInternalProgramName() const;
00582 
00594     QString programIconName() const;
00595 
00605     QVariant programLogo() const;
00606 
00611     QString version() const;
00612 
00617     const char* internalVersion() const;
00618 
00624     QString shortDescription() const;
00625 
00630     QString catalogName() const;
00631 
00637     QString homepage() const;
00638 
00643     QString bugAddress() const;
00644 
00649     const char* internalBugAddress() const;
00650 
00655     QList<KAboutPerson> authors() const;
00656 
00661     QList<KAboutPerson> credits() const;
00662 
00667     QList<KAboutPerson> translators() const;
00668 
00673     static QString aboutTranslationTeam();
00674 
00679     QString otherText() const;
00680 
00690     QString license() const;
00691 
00699     QString licenseName(NameFormat formatName) const;
00700 
00707     QList<KAboutLicense> licenses() const;
00708 
00713     QString copyrightStatement() const;
00714 
00722     QString customAuthorPlainText() const;
00723 
00731     QString customAuthorRichText() const;
00732 
00740     bool customAuthorTextEnabled() const;
00741 
00753     KAboutData &setCustomAuthorText(const KLocalizedString &plainText,
00754                                     const KLocalizedString &richText);
00755 
00761     KAboutData &unsetCustomAuthorText();
00762 
00763   private:
00764 
00765     class Private;
00766     Private *const d;
00767 };
00768 
00769 
00785 class KDECORE_EXPORT KAboutLicense
00786 {
00787     friend class KAboutData;
00788 public:
00793     KAboutLicense(const KAboutLicense& other);
00794 
00795     ~KAboutLicense();
00796 
00801     KAboutLicense& operator=(const KAboutLicense& other);
00802 
00803 
00811     QString text() const;
00812 
00818     QString name(KAboutData::NameFormat formatName) const;
00819 
00826     KAboutData::LicenseKey key() const;
00827 
00850     static KAboutLicense byKeyword(const QString &keyword);
00851 
00852 private:
00856     explicit KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
00860     explicit KAboutLicense( const QString &pathToFile, const KAboutData *aboutData );
00864     explicit KAboutLicense( const KLocalizedString &licenseText, const KAboutData *aboutData );
00865 
00866     class Private;
00867     QSharedDataPointer<Private> d;
00868 };
00869 
00870 #endif
00871 

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal