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 00364 void setProgramName( const char* programName ); 00365 00375 void setProgramLogo(const QImage& image); 00376 00382 void setVersion( const char* version ); 00383 00391 void setShortDescription( const char *shortDescription ); 00392 00398 void setLicense( LicenseKey licenseKey); 00399 00408 void setCopyrightStatement( const char *copyrightStatement ); 00409 00417 void setOtherText( const char *otherText ); 00418 00426 void setHomepage( const char *homepage ); 00427 00434 void setBugAddress( const char *bugAddress ); 00435 00444 void setProductName( const char *name ); 00445 00450 const char *appName() const; 00451 00459 const char *productName() const; 00460 00465 QString programName() const; 00466 00470 const char* internalProgramName() const; 00474 void translateInternalProgramName() const; 00475 00482 QImage programLogo() const; 00483 00488 QString version() const; 00489 00493 const char* internalVersion() const { return mVersion; } 00494 00500 QString shortDescription() const; 00501 00507 QString homepage() const; 00508 00513 QString bugAddress() const; 00514 00518 const char* internalBugAddress() const { return mBugEmailAddress; } 00519 00524 const QValueList<KAboutPerson> authors() const; 00525 00530 const QValueList<KAboutPerson> credits() const; 00531 00536 const QValueList<KAboutTranslator> translators() const; 00537 00542 static QString aboutTranslationTeam(); 00543 00548 QString otherText() const; 00549 00557 QString license() const; 00558 00563 QString copyrightStatement() const; 00564 00572 QString customAuthorPlainText() const; 00573 00581 QString customAuthorRichText() const; 00582 00590 bool customAuthorTextEnabled() const; 00591 00602 void setCustomAuthorText(const QString &plainText, const QString &richText); 00603 00609 void unsetCustomAuthorText(); 00610 00611 private: 00612 const char *mAppName; 00613 const char *mProgramName; 00614 const char *mVersion; 00615 const char *mShortDescription; 00616 int mLicenseKey; 00617 const char *mCopyrightStatement; 00618 const char *mOtherText; 00619 const char *mHomepageAddress; 00620 const char *mBugEmailAddress; 00621 QValueList<KAboutPerson> mAuthorList; 00622 QValueList<KAboutPerson> mCreditList; 00623 const char *mLicenseText; 00624 00625 KAboutDataPrivate *d; 00626 }; 00627 00628 #endif 00629