KVIrc  4.9.2
DeveloperAPIs
Public Types | Public Member Functions | Protected Attributes | List of all members
KviThemeInfo Class Reference

A set of information about a KVIrc theme. More...

#include <KviTheme.h>

+ Inheritance diagram for KviThemeInfo:

Public Types

enum  Location { Builtin = 0, User = 1, External = 3, Auto = 4 }
 

Public Member Functions

const QString & application ()
 
const QString & author ()
 
const QString & date ()
 
const QString & description ()
 
const QString & directory () const
 
bool isBuiltin ()
 
 KviThemeInfo ()
 
const QPixmap & largeScreenshot ()
 
const QString & lastError ()
 
bool load (const QString &szDirectory, Location eLocation)
 
Location location () const
 
const QPixmap & mediumScreenshot ()
 
const QString & name ()
 
bool save (const QString &szThemeFileName)
 
void setApplication (const QString &szApplication)
 
void setAuthor (const QString &szAuthor)
 
void setDate (const QString &szDate)
 
void setDescription (const QString &szDescription)
 
void setDirectoryAndLocation (const QString &szDirectory, Location eLocation)
 
void setLastError (const QString &szLastError)
 
void setName (const QString &szName)
 
void setThemeEngineVersion (const QString &szThemeEngineVersion)
 
void setVersion (const QString &szVersion)
 
const QPixmap & smallScreenshot ()
 
QString smallScreenshotPath ()
 
const QString & subdirectory () const
 
const QString & themeEngineVersion ()
 
const QString & version ()
 
 ~KviThemeInfo ()
 

Protected Attributes

Location m_eLocation
 
QPixmap m_pixScreenshotLarge
 
QPixmap m_pixScreenshotMedium
 
QPixmap m_pixScreenshotSmall
 
QString m_szApplication
 
QString m_szAuthor
 
QString m_szDate
 
QString m_szDescription
 
QString m_szDirectory
 
QString m_szLastError
 
QString m_szName
 
QString m_szSubdirectory
 
QString m_szThemeEngineVersion
 
QString m_szVersion
 

Detailed Description

A set of information about a KVIrc theme.

This object contains a set of information about a theme that can be read and stored to a standard KVIrc configuration file (which is usually named themeinfo.kvc but this is not strictly necessary).

Member Enumeration Documentation

Enumerator
Builtin 

Theme is a builtin theme. The subdirectory is inside the kvirc global theme directory.

User 

Theme is a user theme. The subdirectory is inside the kvirc local theme directory.

External 

Theme is an external theme. The subdirectory is somewhere on the filesystem.

Auto 

Automatically determine location

Constructor & Destructor Documentation

KviThemeInfo::KviThemeInfo ( )
KviThemeInfo::~KviThemeInfo ( )
default

Member Function Documentation

const QString& KviThemeInfo::application ( )
inline
const QString& KviThemeInfo::author ( )
inline
const QString& KviThemeInfo::date ( )
inline
const QString& KviThemeInfo::description ( )
inline
const QString& KviThemeInfo::directory ( ) const
inline
bool KviThemeInfo::isBuiltin ( )
inline
const QPixmap & KviThemeInfo::largeScreenshot ( )

Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.

References KVI_THEME_LARGE_SCREENSHOT_NAME, m_pixScreenshotLarge, and m_szDirectory.

Referenced by mediumScreenshot().

const QString& KviThemeInfo::lastError ( )
inline
bool KviThemeInfo::load ( const QString &  szDirectory,
Location  eLocation 
)

Load theme data from the specified location. If eLocation is Builtin then szThemeDirectory is assumed to be a subdirectory of the kvirc global theme directory. If eLocation is User then szThemeDirectory is assumed to be a subdirectory of the kvirc local theme directory. If eLocation is External the szThemeDirectory is assumed to be a full path to a theme directory.

References __tr2qs, KviMiscUtils::compareVersions(), KviFileUtils::fileExists(), KVI_CURRENT_THEME_ENGINE_VERSION, KVI_THEMEDATA_FILE_NAME, KVI_THEMEINFO_CONFIG_GROUP, KVI_THEMEINFO_FILE_NAME, m_szApplication, m_szAuthor, m_szDate, m_szDescription, m_szDirectory, m_szLastError, m_szName, m_szThemeEngineVersion, m_szVersion, KviConfigurationFile::Read, KviConfigurationFile::readEntry(), setDirectoryAndLocation(), and KviConfigurationFile::setGroup().

Referenced by KviTheme::apply(), ThemeManagementDialog::fillThemeBox(), SaveThemeDialog::SaveThemeDialog(), theme_kvs_cmd_pack(), and theme_kvs_fnc_info().

Location KviThemeInfo::location ( ) const
inline
const QPixmap & KviThemeInfo::mediumScreenshot ( )

Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.

References KVI_THEME_MEDIUM_SCREENSHOT_NAME, largeScreenshot(), m_pixScreenshotMedium, m_szDirectory, and QIMAGE_SCALE_MIN.

Referenced by smallScreenshot().

const QString& KviThemeInfo::name ( )
inline
bool KviThemeInfo::save ( const QString &  szThemeFileName)
void KviThemeInfo::setApplication ( const QString &  szApplication)
inline
void KviThemeInfo::setAuthor ( const QString &  szAuthor)
inline
void KviThemeInfo::setDate ( const QString &  szDate)
inline
void KviThemeInfo::setDescription ( const QString &  szDescription)
inline
void KviThemeInfo::setDirectoryAndLocation ( const QString &  szDirectory,
Location  eLocation 
)
void KviThemeInfo::setLastError ( const QString &  szLastError)
inline
void KviThemeInfo::setName ( const QString &  szName)
inline
void KviThemeInfo::setThemeEngineVersion ( const QString &  szThemeEngineVersion)
inline
void KviThemeInfo::setVersion ( const QString &  szVersion)
inline
const QPixmap & KviThemeInfo::smallScreenshot ( )

Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.

References KVI_THEME_SMALL_SCREENSHOT_NAME, m_pixScreenshotSmall, m_szDirectory, mediumScreenshot(), and QIMAGE_SCALE_MIN.

Referenced by ThemeManagementDialog::fillThemeBox(), and PackThemeDataWidget::parseThemes().

QString KviThemeInfo::smallScreenshotPath ( )

Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.

References KVI_THEME_SMALL_SCREENSHOT_NAME, and m_szDirectory.

Referenced by PackThemeDataWidget::parseThemes().

const QString& KviThemeInfo::subdirectory ( ) const
inline
const QString& KviThemeInfo::themeEngineVersion ( )
inline
const QString& KviThemeInfo::version ( )
inline

Member Data Documentation

Location KviThemeInfo::m_eLocation
protected

Referenced by setDirectoryAndLocation().

QPixmap KviThemeInfo::m_pixScreenshotLarge
protected

Referenced by largeScreenshot().

QPixmap KviThemeInfo::m_pixScreenshotMedium
protected

Referenced by mediumScreenshot().

QPixmap KviThemeInfo::m_pixScreenshotSmall
protected

Referenced by smallScreenshot().

QString KviThemeInfo::m_szApplication
protected

Referenced by load().

QString KviThemeInfo::m_szAuthor
protected

Referenced by load(), and save().

QString KviThemeInfo::m_szDate
protected

Referenced by load(), and save().

QString KviThemeInfo::m_szDescription
protected

Referenced by load(), and save().

QString KviThemeInfo::m_szDirectory
protected
QString KviThemeInfo::m_szLastError
protected

Referenced by load().

QString KviThemeInfo::m_szName
protected

Referenced by load(), and save().

QString KviThemeInfo::m_szSubdirectory
protected

Referenced by setDirectoryAndLocation().

QString KviThemeInfo::m_szThemeEngineVersion
protected

Referenced by load().

QString KviThemeInfo::m_szVersion
protected

Referenced by load(), and save().


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