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 
00469     const char* internalProgramName() const;
00473     void translateInternalProgramName() const;
00474 
00481     QImage programLogo() const;
00482 
00487     QString version() const;
00488 
00492     const char* internalVersion() const { return mVersion; }
00493 
00499     QString shortDescription() const;
00500 
00506     QString homepage() const;
00507 
00512     QString bugAddress() const;
00513     
00517     const char* internalBugAddress() const { return mBugEmailAddress; }
00518 
00523     const QValueList<KAboutPerson> authors() const;
00524 
00529     const QValueList<KAboutPerson> credits() const;
00530 
00535     const QValueList<KAboutTranslator> translators() const;
00536 
00541     static QString aboutTranslationTeam();
00542 
00547     QString otherText() const;
00548 
00556     QString license() const;
00557 
00562     QString copyrightStatement() const;
00563 
00571     QString customAuthorPlainText() const;
00572 
00580     QString customAuthorRichText() const;
00581 
00589     bool customAuthorTextEnabled() const;
00590     
00601     void setCustomAuthorText(const QString &plainText, const QString &richText);
00602     
00608     void unsetCustomAuthorText();
00609     
00610   private:
00611     const char *mAppName;
00612     const char *mProgramName;
00613     const char *mVersion;
00614     const char *mShortDescription;
00615     int mLicenseKey;
00616     const char *mCopyrightStatement;
00617     const char *mOtherText;
00618     const char *mHomepageAddress;
00619     const char *mBugEmailAddress;
00620     QValueList<KAboutPerson> mAuthorList;
00621     QValueList<KAboutPerson> mCreditList;
00622     const char *mLicenseText;
00623 
00624     KAboutDataPrivate *d;
00625 };
00626 
00627 #endif
00628 
KDE Home | KDE Accessibility Home | Description of Access Keys