File indexing completed on 2024-04-28 07:29:13

0001 // SPDX-FileCopyrightText: 2007-2010 Pino Toscano <pino@kde.org>
0002 // SPDX-FileCopyCopyright: 2010 Adam Rakowski <foo-script@o2.pl>
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 #ifndef KHMTHEME_H
0006 #define KHMTHEME_H
0007 
0008 #include <QPalette>
0009 
0010 class KHMTheme
0011 {
0012   private:
0013     QString KHMname, KHMuiName, KHMsvgFileName, KHMauthor, KHMthemeVersion;
0014     QRect KHMwordRect, KHMhintRect, KHMkRect;
0015     QColor KHMletterColor, KHMguessButtonTextColor, KHMguessButtonColor, KHMguessButtonHoverColor, KHMletterInputTextColor;
0016     QPoint KHMgoodWordPos;
0017 
0018   public:
0019     KHMTheme(   const QString &name, const QString &uiName, const QString &svgFileName, const QString &author, const QString &themeVersion,
0020                 QRect wordRect, QRect hintRect, QRect kRect,
0021                 QColor letterColor, QColor guessButtonTextColor, QColor guessButtonColor, QColor guessButtonHoverColor, QColor letterInputTextColor,
0022                 QPoint goodWordPos);
0023 
0024     ///The name of theme as in the folder
0025     QString name() const { return KHMname; }
0026     ///The name of the theme in the menu
0027     QString uiName() const;
0028     ///Get the svg n22 the theme
0029     QString svgFileName() const { return KHMsvgFileName; }
0030     ///Set the position and size for drawing the word to guess
0031     QRect wordRect(const QSize& windowsize) const;
0032 
0033     QRect hintRect(const QSize& windowsize) const;
0034 
0035     ///Set the position and size for drawing the hanged K
0036     QRect kRect(const QSize& windowsize) const;
0037     ///Set the color for the word and the missed letters
0038     QColor letterColor() const { return KHMletterColor; }
0039     ///Set the color of the Guess word
0040     QColor guessButtonTextColor() const { return KHMguessButtonTextColor; }
0041     ///Set the color of the Guess button background
0042     QColor guessButtonColor() const { return KHMguessButtonColor; }
0043     ///Set the color of the Guess button background when the mouse is over it
0044     QColor guessButtonHoverColor() const { return KHMguessButtonHoverColor; }
0045     ///Set the color of the input text in the input widget
0046     QColor letterInputTextColor() const { return KHMletterInputTextColor; }
0047     ///Set the already guessed popup position
0048     QPoint goodWordPos(const QSize& windowsize, const QPoint& popupPos) const;
0049     //Find out who's the author
0050     QString getAuthor() const { return KHMauthor; }
0051     //Version is equal to a KHMTheme format version declared in XML file
0052     QString getThemeVersion() const { return KHMthemeVersion; }
0053 };
0054 
0055 #endif
0056 
0057 // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
0058 // vim: set et sw=4 ts=4 cino=l1,cs,U1:
0059