# kdecore Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KAboutData Class Reference

This class is used to store information about a program. Holds information needed by the "About" box and other classes. More...

`#include <kaboutdata.h>`

Collaboration diagram for KAboutData:

[legend]
List of all members.

## Public Types

enum | LicenseKey { License_Custom = -2, License_File = -1, License_Unknown = 0, License_GPL = 1, License_GPL_V2 = 1, License_LGPL = 2, License_LGPL_V2 = 2, License_BSD = 3, License_Artistic = 4, License_QPL = 5, License_QPL_V1_0 = 5 }

## Public Member Functions

| KAboutData (const char *appName, const char *programName, const char *version, const char *shortDescription=0, int licenseType=License_Unknown, const char *copyrightStatement=0, const char *text=0, const char *homePageAddress=0, const char *bugsEmailAddress="submit@bugs.kde.org")
void | addAuthor (const char *name, const char *task=0, const char *emailAddress=0, const char *webAddress=0)
void | addCredit (const char *name, const char *task=0, const char *emailAddress=0, const char *webAddress=0)
void | setTranslator (const char *name, const char *emailAddress)
void | setLicenseText (const char *license)
void | setLicenseTextFile (const QString &file)
void | setAppName (const char *appName)
void | setProgramName (const char *programName)
void | setProgramLogo (const QImage &image)
void | setVersion (const char *version)
void | setShortDescription (const char *shortDescription)
void | setLicense (LicenseKey licenseKey)
void | setCopyrightStatement (const char *copyrightStatement)
void | setOtherText (const char *otherText)
void | setHomepage (const char *homepage)
void | setBugAddress (const char *bugAddress)
void | setProductName (const char *name)
const char * | appName () const
const char * | productName () const
QString | programName () const
QImage | programLogo () const
QString | version () const
QString | shortDescription () const
QString | homepage () const
QString | bugAddress () const
const QValueList< KAboutPerson > | authors () const
const QValueList< KAboutPerson > | credits () const
const QValueList< KAboutTranslator > | translators () const
QString | otherText () const
QString | license () const
QString | copyrightStatement () const

## Static Public Member Functions

static QString | aboutTranslationTeam ()

## Detailed Description

This class is used to store information about a program. Holds information needed by the "About" box and other classes.

It can store such values as version number, program name, home page, email address for bug reporting, multiple authors and contributors (using KAboutPerson), license and copyright information.

Currently, the values set here are shown by the "About" box (see KAboutDialog), used by the bug report dialog (see KBugReport), and by the help shown on command line (see KCmdLineArgs).

Author:
  Espen Sand (espen@kde.org), David Faure (faure@kde.org)

Definition at line 180 of file kaboutdata.h.

## Member Enumeration Documentation

enum KAboutData::LicenseKey

| Descibes the license of the software. Definition at line 186 of file kaboutdata.h.

## Constructor & Destructor Documentation

KAboutData::KAboutData | ( | const char * | appName,
|  | const char * | programName,
|  | const char * | version,
|  | const char * | shortDescription = `0`,
|  | int | licenseType = `License_Unknown`,
|  | const char * | copyrightStatement = `0`,
|  | const char * | text = `0`,
|  | const char * | homePageAddress = `0`,
|  | const char * | bugsEmailAddress = `"submit@bugs.kde.org"`
| ) |

Constructor.

Parameters:

  | appName | The program name used internally. Example: "kedit"
  | programName | A displayable program name string. This string should be marked for translation. Example: I18N_NOOP("KEdit")
  | version | The program version string.
  | shortDescription | A short description of what the program does. This string should be marked for translation. Example: I18N_NOOP("A simple text editor.")
  | licenseType | The license identifier. Use setLicenseText if you use a license not predefined here.
  | copyrightStatement | A copyright statement, that can look like this: "(c) 1999-2000, Name". The string specified here is not modified in any manner. The author information from addAuthor is not used.
  | text | Some free form text, that can contain any kind of information. The text can contain newlines. This string should be marked for translation.
  | homePageAddress | The program homepage string. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not.
  | bugsEmailAddress | The bug report email address string. This defaults to the kde.org bug system.

Definition at line 95 of file kaboutdata.cpp.

References appName().

## Member Function Documentation

void KAboutData::addAuthor | ( | const char * | name,
|  | const char * | task = `0`,
|  | const char * | emailAddress = `0`,
|  | const char * | webAddress = `0`
| ) |

Defines an author.

You can call this function as many times you need. Each entry is appended to a list. The person in the first entry is assumed to be the leader of the project.

Parameters:

  | name | The developer's name in UTF-8 encoding.
  | task | What the person is responsible for. This text can contain newlines. It should be marked for translation like this: I18N_NOOP("Task description..."). Can be 0.
  | emailAddress | An Email address where the person can be reached. Can be 0.
  | webAddress | The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be 0.

Definition at line 135 of file kaboutdata.cpp.

References QValueList::append().

void KAboutData::addCredit | ( | const char * | name,
|  | const char * | task = `0`,
|  | const char * | emailAddress = `0`,
|  | const char * | webAddress = `0`
| ) |

Defines a person that deserves credit.

You can call this function as many times you need. Each entry is appended to a list.

Parameters:

  | name | The person's name in UTF-8 encoding.
  | task | What the person has done to deserve the honor. The text can contain newlines. It should be marked for translation like this: I18N_NOOP("Task description...") Can be 0.
  | emailAddress | An Email address when the person can be reached. Can be 0.
  | webAddress | The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not. Can be 0.

Definition at line 142 of file kaboutdata.cpp.

References QValueList::append().

void KAboutData::setTranslator | ( | const char * | name,
|  | const char * | emailAddress
| ) |

Sets the name of the translator of the gui.

Since this depends on the language, just use a dummy text marked for translation.

For example:

     setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names")
     ,I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails"));

The translator can then translate this dummy text with his name or with a list of names separated with ",". If there is no translation or the application is used with the default language, this function call is ignored.

Note: If you are using the default KDE automake environment, there is no need to use this function, because the two default strings above are added to the applications po file automatically.

Parameters:

  | name | the name of the translator
  | emailAddress | the email address of the translator

See also:
  KAboutTranslator

Definition at line 149 of file kaboutdata.cpp.

void KAboutData::setLicenseText | ( | const char * | license | ) |

Defines a license text.

The text will be translated if it got marked for translations with the I18N_NOOP() macro.

Example:

     setLicenseText( I18N_NOOP("This is my license"));

NOTE: No copy of the text is made.

Parameters:

  | license | The license text in utf8 encoding.

Definition at line 156 of file kaboutdata.cpp.

void KAboutData::setLicenseTextFile | ( | const QString & | file | ) |

Defines a license text.

Parameters:

  | file | File containing the license text.

Definition at line 163 of file kaboutdata.cpp.

void KAboutData::setAppName | ( | const char * | appName | ) |

Defines the program name used internally.

Parameters:

  | appName | The application name. Example: "kate".

Definition at line 170 of file kaboutdata.cpp.

References appName().

void KAboutData::setProgramName | ( | const char * | programName | ) |

Defines the displayable program name string.

Parameters:

  | programName | The program name. This string should be marked for translation. Example: I18N_NOOP("Advanced Text Editor").

Definition at line 176 of file kaboutdata.cpp.

References programName().

void KAboutData::setProgramLogo | ( | const QImage & | image | ) |

Defines the program logo.

Use this if you need to have application logo in AboutData other than application icon.

Parameters:

  | image | logo image.

See also:
  programLogo()

Since:
  3.4

Definition at line 260 of file kaboutdata.cpp.

void KAboutData::setVersion | ( | const char * | version | ) |

Defines the program version string.

Parameters:

  | version | The program version.

Definition at line 182 of file kaboutdata.cpp.

References version().

void KAboutData::setShortDescription | ( | const char * | shortDescription | ) |

Defines a short description of what the program does.

Parameters:

  | shortDescription | The program description This string should be marked for translation. Example: I18N_NOOP("An advanced text editor with syntax highlithing support.").

Definition at line 188 of file kaboutdata.cpp.

References shortDescription().

void KAboutData::setLicense | ( | LicenseKey | licenseKey | ) |

Defines the license identifier.

Parameters:

  | licenseKey | The license identifier.

Definition at line 194 of file kaboutdata.cpp.

void KAboutData::setCopyrightStatement | ( | const char * | copyrightStatement | ) |

Defines the copyright statement to show when displaying the license.

Parameters:

  | copyrightStatement | A copyright statement, that can look like this: "(c) 1999-2000, Name". The string specified here is not modified in any manner. The author information from addAuthor is not used.

Definition at line 200 of file kaboutdata.cpp.

References copyrightStatement().

void KAboutData::setOtherText | ( | const char * | otherText | ) |

Defines the additional text to show in the about dialog.

Parameters:

  | otherText | Some free form text, that can contain any kind of information. The text can contain newlines. This string should be marked for translation.

Definition at line 206 of file kaboutdata.cpp.

References otherText().

void KAboutData::setHomepage | ( | const char * | homepage | ) |

Defines the program homepage.

Parameters:

  | homepage | The program homepage string. Start the address with "http://". "http://kate.kde.org" is is correct, "kde.kde.org" is not.

Definition at line 212 of file kaboutdata.cpp.

References homepage().

void KAboutData::setBugAddress | ( | const char * | bugAddress | ) |

Defines the address where bug reports should be sent.

Parameters:

  | bugAddress | The bug report email address string. This defaults to the kde.org bug system.

Definition at line 218 of file kaboutdata.cpp.

References bugAddress().

void KAboutData::setProductName | ( | const char * | name | ) |

Defines the product name wich will be used in the KBugReport dialog.

By default it's the appName, but you can overwrite it here to provide support for special components e.g. 'product/component' like 'kontact/summary'.

Parameters:

  | name | The name of product

Definition at line 224 of file kaboutdata.cpp.

References productName().

const char * KAboutData::appName | ( |  | ) | const

Returns the application's internal name.

Returns:
  the internal program name.

Definition at line 230 of file kaboutdata.cpp.

Referenced by KCmdLineArgs::init(), KAboutData(), productName(), setAppName(), and KUniqueApplication::start().

const char * KAboutData::productName | ( |  | ) | const

Returns the application's product name, which will be used in KBugReport dialog.

By default it returns appName(), otherwise the one which is set with setProductName()

Returns:
  the product name.

Definition at line 236 of file kaboutdata.cpp.

References appName().

Referenced by setProductName().

QString KAboutData::programName | ( |  | ) | const

Returns the translated program name.

Returns:
  the program name (translated).

Definition at line 245 of file kaboutdata.cpp.

Referenced by KApplication::caption(), KCrash::defaultCrashHandler(), and setProgramName().

QImage KAboutData::programLogo | ( |  | ) | const

Returns the program logo image.

Returns:
  the program logo data or null image if there is no custom application logo defined.

Since:
  3.4

Definition at line 254 of file kaboutdata.cpp.

QString KAboutData::version | ( |  | ) | const

Returns the program's version.

Returns:
  the version string.

Definition at line 269 of file kaboutdata.cpp.

References QString::fromLatin1().

Referenced by KCrash::defaultCrashHandler(), and setVersion().

QString KAboutData::shortDescription | ( |  | ) | const

Returns a short, translated description.

Returns:
  the short description (translated). Can be QString::null if not set.

Definition at line 275 of file kaboutdata.cpp.

Referenced by setShortDescription(), and KCmdLineArgs::usage().

QString KAboutData::homepage | ( |  | ) | const

Returns the application homepage.

Returns:
  the application homepage URL. Can be QString::null if not set.

Definition at line 284 of file kaboutdata.cpp.

References QString::fromLatin1().

Referenced by setHomepage().

QString KAboutData::bugAddress | ( |  | ) | const

Returns the email address for bugs.

Returns:
  the email address where to report bugs.

Definition at line 290 of file kaboutdata.cpp.

References QString::fromLatin1().

Referenced by KCrash::defaultCrashHandler(), and setBugAddress().

const QValueList< KAboutPerson > KAboutData::authors | ( |  | ) | const

Returns a list of authors.

Returns:
  author information (list of persons).

Definition at line 296 of file kaboutdata.cpp.

const QValueList< KAboutPerson > KAboutData::credits | ( |  | ) | const

Returns a list of persons who contributed.

Returns:
  credit information (list of persons).

Definition at line 302 of file kaboutdata.cpp.

const QValueList< KAboutTranslator > KAboutData::translators | ( |  | ) | const

Returns a list of translators.

Returns:
  translators information (list of persons)

Definition at line 308 of file kaboutdata.cpp.

References QValueList::append(), QString::fromUtf8(), QStringList::split(), and QString::stripWhiteSpace().

QString KAboutData::aboutTranslationTeam | ( |  | ) | `[static]`

Returns a message about the translation team.

Returns:
  a message about the translation team

Definition at line 357 of file kaboutdata.cpp.

QString KAboutData::otherText | ( |  | ) | const

Returns a translated, free form text.

Returns:
  the free form text (translated). Can be QString::null if not set.

Definition at line 367 of file kaboutdata.cpp.

Referenced by setOtherText().

QString KAboutData::license | ( |  | ) | const

Returns the license.

If the licenseType argument of the constructor has been used, any text defined by setLicenseText is ignored, and the standard text for the chosen license will be returned.

Returns:
  The license text.

Definition at line 377 of file kaboutdata.cpp.

References QString::arg(), copyrightStatement(), QFile::decodeName(), QString::isEmpty(), QFile::open(), and QTextStream::read().

QString KAboutData::copyrightStatement | ( |  | ) | const

Returns the copyright statement.

Returns:
  the copyright statement. Can be QString::null if not set.

Definition at line 440 of file kaboutdata.cpp.

Referenced by license(), and setCopyrightStatement().

The documentation for this class was generated from the following files:

- kaboutdata.h
- kaboutdata.cpp

This file is part of the documentation for kdecore Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:18:15 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003