KVIrc 5.2.6
Developer APIs
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

◆ Location

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()

KviThemeInfo::~KviThemeInfo ( )
default

Member Function Documentation

◆ application()

const QString & KviThemeInfo::application ( )
inline

◆ author()

◆ date()

const QString & KviThemeInfo::date ( )
inline

◆ description()

◆ directory()

const QString & KviThemeInfo::directory ( ) const
inline

◆ isBuiltin()

◆ largeScreenshot()

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().

◆ lastError()

const QString & KviThemeInfo::lastError ( )
inline

◆ load()

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()

Location KviThemeInfo::location ( ) const
inline

◆ mediumScreenshot()

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().

◆ name()

◆ save()

bool KviThemeInfo::save ( const QString & szThemeFileName)

◆ setApplication()

void KviThemeInfo::setApplication ( const QString & szApplication)
inline

◆ setAuthor()

void KviThemeInfo::setAuthor ( const QString & szAuthor)
inline

◆ setDate()

void KviThemeInfo::setDate ( const QString & szDate)
inline

◆ setDescription()

void KviThemeInfo::setDescription ( const QString & szDescription)
inline

◆ setDirectoryAndLocation()

◆ setLastError()

void KviThemeInfo::setLastError ( const QString & szLastError)
inline

◆ setName()

void KviThemeInfo::setName ( const QString & szName)
inline

◆ setThemeEngineVersion()

void KviThemeInfo::setThemeEngineVersion ( const QString & szThemeEngineVersion)
inline

◆ setVersion()

void KviThemeInfo::setVersion ( const QString & szVersion)
inline

◆ smallScreenshot()

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().

◆ smallScreenshotPath()

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().

◆ subdirectory()

const QString & KviThemeInfo::subdirectory ( ) const
inline

◆ themeEngineVersion()

const QString & KviThemeInfo::themeEngineVersion ( )
inline

◆ version()

Member Data Documentation

◆ m_eLocation

Location KviThemeInfo::m_eLocation
protected

Referenced by setDirectoryAndLocation().

◆ m_pixScreenshotLarge

QPixmap KviThemeInfo::m_pixScreenshotLarge
protected

Referenced by largeScreenshot().

◆ m_pixScreenshotMedium

QPixmap KviThemeInfo::m_pixScreenshotMedium
protected

Referenced by mediumScreenshot().

◆ m_pixScreenshotSmall

QPixmap KviThemeInfo::m_pixScreenshotSmall
protected

Referenced by smallScreenshot().

◆ m_szApplication

QString KviThemeInfo::m_szApplication
protected

Referenced by load().

◆ m_szAuthor

QString KviThemeInfo::m_szAuthor
protected

Referenced by load(), and save().

◆ m_szDate

QString KviThemeInfo::m_szDate
protected

Referenced by load(), and save().

◆ m_szDescription

QString KviThemeInfo::m_szDescription
protected

Referenced by load(), and save().

◆ m_szDirectory

QString KviThemeInfo::m_szDirectory
protected

◆ m_szLastError

QString KviThemeInfo::m_szLastError
protected

Referenced by load().

◆ m_szName

QString KviThemeInfo::m_szName
protected

Referenced by load(), and save().

◆ m_szSubdirectory

QString KviThemeInfo::m_szSubdirectory
protected

Referenced by setDirectoryAndLocation().

◆ m_szThemeEngineVersion

QString KviThemeInfo::m_szThemeEngineVersion
protected

Referenced by load().

◆ m_szVersion

QString KviThemeInfo::m_szVersion
protected

Referenced by load(), and save().


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