KDECore
kaboutdata.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KABOUTDATA_H
00024 #define KABOUTDATA_H
00025
00026 #include <kdecore_export.h>
00027 #include <klocale.h>
00028
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
00143
00144
00165 class KDECORE_EXPORT KAboutData
00166 {
00167 public:
00171 enum LicenseKey
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
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 ©rightStatement = 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 ©rightStatement );
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