Feel++ 0.91.0
Public Types | Public Member Functions
Feel::AboutData Class Reference

Holds information needed by the "About" box and other classes. More...

#include <about.hpp>

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

 AboutData (const char *appName, const char *programName, const char *version, const char *shortDescription="", int licenseType=License_Unknown, const char *copyrightStatement="", const char *text="", const char *homePageAddress="", const char *bugsEmailAddress="feel-dev@webmail.polimi.it")
 AboutData (AboutData const &ad)
void addAuthor (std::string const &name, std::string const &task=0, std::string const &emailAddress=0, std::string const &webAddress=0)
void addCredit (std::string const &name, std::string const &task=0, std::string const &emailAddress=0, std::string const &webAddress=0)
void setLicenseText (std::string const &license)
void setAppName (std::string const &appName)
void setProgramName (const char *programName)
void setVersion (const char *version)
void setShortDescription (std::string const &shortDescription)
void setLicense (LicenseKey licenseKey)
void setCopyrightStatement (std::string const &copyrightStatement)
void setOtherText (std::string const &otherText)
void setHomepage (std::string const &homepage)
void setBugAddress (std::string const &bugAddress)
void setProductName (std::string const &name)
std::string appName () const
std::string productName () const
std::string programName () const
std::string version () const
std::string shortDescription () const
std::string homepage () const
std::string bugAddress () const
const std::vector< AboutPerson > & authors () const
const std::vector< AboutPerson > & credits () const
std::string otherText () const
std::string license () const
std::string copyrightStatement () const

Detailed Description

Holds information needed by the "About" box and other classes.

This class is used to store information about a program. It can store such values as version number, program name, home page, email address for bug reporting, multiple authors and contributors (using AboutPerson), license and copyright information.

Author:
Christophe Prud'homme <christophe.prudhomme@ujf-grenoble.fr>

Member Enumeration Documentation

Descibes the license of the software.


Constructor & Destructor Documentation

Feel::AboutData::AboutData ( const char *  appName,
const char *  programName,
const char *  version,
const char *  shortDescription = "",
int  licenseType = License_Unknown,
const char *  copyrightStatement = "",
const char *  text = "",
const char *  homePageAddress = "",
const char *  bugsEmailAddress = "feel-dev@webmail.polimi.it" 
)

Constructor.

Parameters:
appNameThe program name used internally. Example: "kedit"
programNameA displayable program name string. This string should be marked for translation. Example: I18N_NOOP("KEdit")
versionThe program version string.
shortDescriptionA short description of what the program does. This string should be marked for translation. Example: I18N_NOOP("A simple text editor.")
licenseTypeThe license identifier. Use setLicenseText if you use a license not predefined here.
copyrightStatementA 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.
textSome free form text, that can contain any kind of information. The text can contain newlines. This string should be marked for translation.
homePageAddressThe program homepage string. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not.
bugsEmailAddressThe bug report email address string. This defaults to the feel-dev@webmail.polimi.it mailing list.

References appName().


Member Function Documentation

void Feel::AboutData::addAuthor ( std::string const &  name,
std::string const &  task = 0,
std::string const &  emailAddress = 0,
std::string const &  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:
nameThe developer's name in UTF-8 encoding.
taskWhat 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.
emailAddressAn Email address where the person can be reached. Can be 0.
webAddressThe 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.

Referenced by makeAbout().

void Feel::AboutData::addCredit ( std::string const &  name,
std::string const &  task = 0,
std::string const &  emailAddress = 0,
std::string const &  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:
nameThe person's name in UTF-8 encoding.
taskWhat 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.
emailAddressAn Email address when the person can be reached. Can be 0.
webAddressThe 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.
std::string Feel::AboutData::appName ( ) const

Returns the application's internal name.

Returns:
the internal program name.

Referenced by AboutData(), Feel::Application::doOptions(), Feel::Application::processGenericOptions(), productName(), and setAppName().

const std::vector< AboutPerson > & Feel::AboutData::authors ( ) const

Returns a list of authors.

Returns:
author information (list of persons).

Referenced by Feel::Application::processGenericOptions().

std::string Feel::AboutData::bugAddress ( ) const

Returns the email address for bugs.

Returns:
the email address where to report bugs.

Referenced by setBugAddress().

std::string Feel::AboutData::copyrightStatement ( ) const

Returns the copyright statement.

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

Referenced by license(), Feel::Application::processGenericOptions(), and setCopyrightStatement().

const std::vector< AboutPerson > & Feel::AboutData::credits ( ) const

Returns a list of persons who contributed.

Returns:
credit information (list of persons).
std::string Feel::AboutData::homepage ( ) const

Returns the application homepage.

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

Referenced by setHomepage().

std::string Feel::AboutData::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.

References copyrightStatement().

Referenced by Feel::Application::processGenericOptions().

std::string Feel::AboutData::otherText ( ) const

Returns a translated, free form text.

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

Referenced by setOtherText().

std::string Feel::AboutData::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.

References appName().

Referenced by setProductName().

std::string Feel::AboutData::programName ( ) const

Returns the translated program name.

Returns:
the program name (translated).

Referenced by setProgramName().

void Feel::AboutData::setAppName ( std::string const &  appName)

Defines the program name used internally.

Parameters:
appNameThe application name. Example: "kate".

References appName().

void Feel::AboutData::setBugAddress ( std::string const &  bugAddress)

Defines the address where bug reports should be sent.

Parameters:
bugAddressThe bug report email address string. This defaults to the feel-dev@ mailing list.

References bugAddress().

void Feel::AboutData::setCopyrightStatement ( std::string const &  copyrightStatement)

Defines the copyright statement to show when displaying the license.

Parameters:
copyrightStatementA 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.

References copyrightStatement().

void Feel::AboutData::setHomepage ( std::string const &  homepage)

Defines the program homepage.

Parameters:
homepageThe program homepage string. Start the address with "http://". "http://www.feel.org" is is correct, "www.feel.org" is not.

References homepage().

void Feel::AboutData::setLicense ( LicenseKey  licenseKey)

Defines the license identifier.

Parameters:
licenseKeyThe license identifier.
void Feel::AboutData::setLicenseText ( std::string const &  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:
licenseThe license text in utf8 encoding.
void Feel::AboutData::setOtherText ( std::string const &  otherText)

Defines the additional text to show in the about dialog.

Parameters:
otherTextSome free form text, that can contain any kind of information. The text can contain newlines. This string should be marked for translation.

References otherText().

void Feel::AboutData::setProductName ( std::string const &  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:
nameThe name of product

References productName().

void Feel::AboutData::setProgramName ( const char *  programName)

Defines the displayable program name string.

Parameters:
programNameThe program name. This string should be marked for translation. Example: I18N_NOOP("Advanced Text Editor").

References programName().

void Feel::AboutData::setShortDescription ( std::string const &  shortDescription)

Defines a short description of what the program does.

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

References shortDescription().

void Feel::AboutData::setVersion ( const char *  version)

Defines the program version string.

Parameters:
versionThe program version.

References version().

std::string Feel::AboutData::shortDescription ( ) const

Returns a short, translated description.

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

Referenced by Feel::Application::processGenericOptions(), and setShortDescription().

std::string Feel::AboutData::version ( ) const

Returns the program's version.

Returns:
the version string.

Referenced by Feel::Application::processGenericOptions(), and setVersion().