kaboutdata.h

00001 /*
00002  * This file is part of the KDE Libraries
00003  * Copyright (C) 2000 Espen Sand (espen@kde.org)
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  *
00020  */
00021 
00022 #include <qvaluelist.h>
00023 #include <qstring.h>
00024 #include <qimage.h>
00025 #include <klocale.h>
00026 
00027 #ifndef _KABOUTDATA_H_
00028 #define _KABOUTDATA_H_
00029 
00030 class KAboutPersonPrivate;
00031 class KAboutDataPrivate;
00032 
00054 class KDECORE_EXPORT KAboutPerson
00055 {
00056 public:
00070     KAboutPerson( const char *name, const char *task,
00071                   const char *emailAddress, const char *webAddress )
00072     {
00073       mName = name;
00074       mTask = task;
00075       mEmailAddress = emailAddress;
00076       mWebAddress = webAddress;
00077     }
00082     KAboutPerson() {}
00083 
00089     QString name() const;
00090 
00096     QString task() const;
00097 
00103     QString emailAddress() const;
00104 
00110     QString webAddress() const;
00111 
00112 private:
00113     const char *mName;
00114     const char *mTask;
00115     const char *mEmailAddress;
00116     const char *mWebAddress;
00117 
00118     KAboutPersonPrivate *d;
00119 };
00120 
00121 class KAboutTranslatorPrivate;
00134 class KDECORE_EXPORT KAboutTranslator
00135 {
00136 public:
00144     KAboutTranslator(const QString & name=QString::null,
00145                      const QString & emailAddress=QString::null);
00146 
00152     QString name() const;
00153 
00159     QString emailAddress() const;
00160 
00161 private:
00162     QString mName;
00163     QString mEmail;
00164     KAboutTranslatorPrivate* d;
00165 };
00166 
00167 
00182 class KDECORE_EXPORT KAboutData
00183 {
00184   public:
00188     enum LicenseKey
00189     {
00190       License_Custom = -2,
00191       License_File = -1,
00192       License_Unknown = 0,
00193       License_GPL  = 1,
00194       License_GPL_V2 = 1,
00195       License_LGPL = 2,
00196       License_LGPL_V2 = 2,
00197       License_BSD  = 3,
00198       License_Artistic = 4,
00199       License_QPL = 5,
00200       License_QPL_V1_0 = 5
00201     };
00202 
00203   public:
00238     KAboutData( const char *appName,
00239                 const char *programName,
00240         const char *version,
00241         const char *shortDescription = 0,
00242         int licenseType = License_Unknown,
00243         const char *copyrightStatement = 0,
00244         const char *text = 0,
00245         const char *homePageAddress = 0,
00246         const char *bugsEmailAddress = "submit@bugs.kde.org"
00247         );
00248 
00249      ~KAboutData();
00250 
00270     void addAuthor( const char *name,
00271             const char *task=0,
00272             const char *emailAddress=0,
00273             const char *webAddress=0 );
00274 
00294     void addCredit( const char *name,
00295                     const char *task=0,
00296             const char *emailAddress=0,
00297             const char *webAddress=0 );
00298 
00323     void setTranslator(const char* name, const char* emailAddress);
00324 
00340     void setLicenseText( const char *license );
00341 
00347     void setLicenseTextFile( const QString &file );
00348 
00354     void setAppName( const char *appName );
00355     
00363     void setProgramName( const char* programName );
00364 
00374     void setProgramLogo(const QImage& image);
00375 
00381     void setVersion( const char* version );
00382     
00390     void setShortDescription( const char *shortDescription );
00391     
00397     void setLicense( LicenseKey licenseKey);
00398     
00407     void setCopyrightStatement( const char *copyrightStatement );
00408     
00416     void setOtherText( const char *otherText );
00417     
00425     void setHomepage( const char *homepage );
00426     
00433     void setBugAddress( const char *bugAddress );
00434     
00443     void setProductName( const char *name );
00444 
00449     const char *appName() const;
00450 
00458     const char *productName() const;
00459 
00464     QString programName() const;
00465 
00472     QImage programLogo() const;
00473 
00478     QString version() const;
00479 
00485     QString shortDescription() const;
00486 
00492     QString homepage() const;
00493 
00498     QString bugAddress() const;
00499 
00504     const QValueList<KAboutPerson> authors() const;
00505 
00510     const QValueList<KAboutPerson> credits() const;
00511 
00516     const QValueList<KAboutTranslator> translators() const;
00517 
00522     static QString aboutTranslationTeam();
00523 
00528     QString otherText() const;
00529 
00537     QString license() const;
00538 
00543     QString copyrightStatement() const;
00544 
00552     QString customAuthorPlainText() const;
00553 
00561     QString customAuthorRichText() const;
00562 
00570     bool customAuthorTextEnabled() const;
00571     
00582     void setCustomAuthorText(const QString &plainText, const QString &richText);
00583     
00589     void unsetCustomAuthorText();
00590     
00591   private:
00592     const char *mAppName;
00593     const char *mProgramName;
00594     const char *mVersion;
00595     const char *mShortDescription;
00596     int mLicenseKey;
00597     const char *mCopyrightStatement;
00598     const char *mOtherText;
00599     const char *mHomepageAddress;
00600     const char *mBugEmailAddress;
00601     QValueList<KAboutPerson> mAuthorList;
00602     QValueList<KAboutPerson> mCreditList;
00603     const char *mLicenseText;
00604 
00605     KAboutDataPrivate *d;
00606 };
00607 
00608 #endif
00609 
KDE Home | KDE Accessibility Home | Description of Access Keys