Source Code (Use browser search to find items of interest.)

Class Index

kdelibs'KAboutData (./kdelibs/kdecore/kaboutdata.h:111)

class KAboutData
{
  public:
    enum LicenseKey
    {
      License_GPL  = 1,
      License_LGPL = 2,
      License_BSD  = 3,
      License_Artistic = 4
    };

  public:
    /**
     * Constructor.
     *
     * @param appName The program name used internally. Example: "kedit"
     *
     * @param programName A displayable program name string. This string
     *        should be marked for translation. Example: I18N_NOOP("KEdit")
     *
     * @param version The program version string.
     *
     * @param shortDescription A short description of what the program does.
     *        This string should be marked for translation.
     *        Example: I18N_NOOP("A simple text editor.")
     *
     * @param licenseType The license identifier. Use @ref setLicenseText if
     *        you use a license not predefined here.
     *
     * @param 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 @ref addAuthor is not
     *        used.
     *
     * @param webAddress The program homepage string.
     *        Start the address with "http://". "http://some.domain" is
     *        is correct, "some.domain" is not.
     *
     * @param text Some free form text, that can contain any kind of
     *        information. The text can contain newlines. This string
     *        should be marked for translation.
     *
     * @param bugsEmailAddress The bug report email address string.
     *
     */
    KAboutData( const char *appName,
                const char *programName,
		const char *version,
		const char *shortDescription = 0,
		int licenseType = 0,
		const char *copyrightStatement = 0,
		const char *text = 0,
		const char *homePageAddress = 0,
		const char *bugsEmailAddress = "submit@bugs.kde.org"
		);

    /**
     * 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.
     *
     * @param name The developer's name.
     *
     * @param task What the person is resposible for. This text can contain
     *             newlines. It should be marked for translation like this:
     *             I18N_NOOP("Task description...")
     *
     * @param emailAddress An Email address when the person can be reached.
     *
     * @param webAddress The person's homepage or a relevant link.
     *        Start the address with "http://". "http://some.domain" is
     *        is correct, "some.domain" is not.
     *
     */
    void addAuthor( 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.
     *
     * @param name The person's name.
     *
     * @param task What the person has done to deserve the hounor. The
     *        text can contain newlines. It should be marked for 
     *        translation like this: I18N_NOOP("Task description...")
     *
     * @param emailAddress An Email address when the person can be reached.
     *
     * @param webAddress The person's homepage or a relevant link.
     *        Start the address with "http://". "http://some.domain" is
     *        is correct, "some.domain" is not.
     *
     */
    void addCredit( const char *name,
                    const char *task=0,
		    const char *emailAddress=0,
		    const char *webAddress=0 );

    /**
     * Defines a licence text. Normally you should set a
     * value in the constructor which provides a set of standard licenses.
     * If you do so, any text defined with this function is ignored.
     *
     * @param license The license text.
     */
    void setLicenseText( const char *license );

    /**
     * @return the internal program name.
     */
    const char *appName() const;

    /**
     * @return the program name (translated).
     */
    QString programName() const;

    /**
     * @return the version string.
     */
    QString version() const;

    /**
     * @return the short description (translated).
     */
    QString shortDescription() const;

    /**
     * @return the application homepage URL.
     */
    QString homepage() const;

    /**
     * @return the email address where to report bugs.
     */
    QString bugAddress() const;

    /**
     * @return author information (list of persons).
     */
    const QValueList<KAboutPerson> authors() const;

    /**
     * @return credit information (list of persons).
     */
    const QValueList<KAboutPerson> credits() const;

    /**
     * @return the free form text (translated). 
     */
    QString otherText() const;

    /**
     * Returns the license. If @ref setLicenseType has been
     * used, any text defined by @ref setLicenseText is ignored,
     * and the standard text for the chosen license will be returned.
     *
     * @return The license text.
     */
    QString license() const;

    /**
     * @return the copyright statement.
     */
    QString copyrightStatement() const { return( QString::fromLatin1(mCopyrightStatement )); }

  private:
    const char *mAppName;
    const char *mProgramName;
    const char *mVersion;
    const char *mShortDescription;
    int mLicenseKey;
    const char *mCopyrightStatement;
    const char *mOtherText;
    const char *mHomepageAddress;
    const char *mBugEmailAddress;
    QValueList<KAboutPerson> mAuthorList;
    QValueList<KAboutPerson> mCreditList;
    const char *mLicenseText;

    KAboutDataPrivate *d;
};


kdelibs'KAboutData::KAboutData() (./kdelibs/kdecore/kaboutdata.cpp:52)

KAboutData::KAboutData( const char *appName,
                        const char *programName,
			const char *version,
                        const char *shortDescription,
			int licenseType,
			const char *copyrightStatement,
			const char *text,
			const char *homePageAddress,
			const char *bugsEmailAddress
			) :
  mProgramName( programName ),
  mVersion( version ),
  mShortDescription( shortDescription ),
  mLicenseKey( licenseType ),
  mCopyrightStatement( copyrightStatement ),
  mOtherText( text ),
  mHomepageAddress( homePageAddress ),
  mBugEmailAddress( bugsEmailAddress )
{
   if( appName ) {
     const char *p = strrchr(appName, '/');
     if( p )
	 mAppName = p+1;
     else
	 mAppName = appName;
   } else
     mAppName = 0;
}

void

kdelibs'KAboutData::addAuthor() (./kdelibs/kdecore/kaboutdata.cpp:82)

KAboutData::addAuthor( const char *name, const char *task,
		    const char *emailAddress, const char *webAddress )
{
  mAuthorList.append(KAboutPerson(name,task,emailAddress,webAddress));
}

void

kdelibs'KAboutData::addCredit() (./kdelibs/kdecore/kaboutdata.cpp:89)

KAboutData::addCredit( const char *name, const char *task,
		    const char *emailAddress, const char *webAddress )
{
  mCreditList.append(KAboutPerson(name,task,emailAddress,webAddress));
}

void

kdelibs'KAboutData::setLicenseText() (./kdelibs/kdecore/kaboutdata.cpp:96)

KAboutData::setLicenseText( const char *licenseText )
{
  mLicenseText = licenseText;
}

const char *

kdelibs'KAboutData::appName() (./kdelibs/kdecore/kaboutdata.cpp:102)

KAboutData::appName() const
{
   return mAppName;
}

QString

kdelibs'KAboutData::programName() (./kdelibs/kdecore/kaboutdata.cpp:108)

KAboutData::programName() const
{
   return i18n(mProgramName);
}

QString

kdelibs'KAboutData::version() (./kdelibs/kdecore/kaboutdata.cpp:114)

KAboutData::version() const
{
   return QString::fromLatin1(mVersion);
}

QString

kdelibs'KAboutData::shortDescription() (./kdelibs/kdecore/kaboutdata.cpp:120)

KAboutData::shortDescription() const
{
   return i18n(mShortDescription);
}

QString

kdelibs'KAboutData::homepage() (./kdelibs/kdecore/kaboutdata.cpp:126)

KAboutData::homepage() const
{
   return QString::fromLatin1(mHomepageAddress);
}

QString

kdelibs'KAboutData::bugAddress() (./kdelibs/kdecore/kaboutdata.cpp:132)

KAboutData::bugAddress() const
{
   return QString::fromLatin1(mBugEmailAddress);
}

const QValueList<KAboutPerson>

kdelibs'KAboutData::authors() (./kdelibs/kdecore/kaboutdata.cpp:138)

KAboutData::authors() const
{
   return mAuthorList;
}

const QValueList<KAboutPerson>

kdelibs'KAboutData::credits() (./kdelibs/kdecore/kaboutdata.cpp:144)

KAboutData::credits() const
{
   return mCreditList;
}

QString

kdelibs'KAboutData::otherText() (./kdelibs/kdecore/kaboutdata.cpp:150)

KAboutData::otherText() const
{
   return i18n(mOtherText);
}


QString

kdelibs'KAboutData::license() (./kdelibs/kdecore/kaboutdata.cpp:157)

KAboutData::license() const
{
  if( mLicenseKey != 0 )
  {
    // TODO put standard license texts in some files under $KDEDIR
    return( QString("Key based license text not yet implemented." ) );
  }
  else
  {
    return( QString::fromLatin1(mLicenseText) );
  }
}