File indexing completed on 2024-04-28 15:14:00

0001 /***************************************************************************
0002     File                 : GuiTools.h
0003     Project              : LabPlot
0004     --------------------------------------------------------------------
0005     Copyright            : (C) 2011 Alexander Semke (alexander.semke*web.de)
0006                            (replace * with @ in the email addresses)
0007     Description          :  contains several static functions which are used on frequently throughout the kde frontend.
0008 
0009  ***************************************************************************/
0010 
0011 /***************************************************************************
0012  *                                                                         *
0013  *  This program is free software; you can redistribute it and/or modify   *
0014  *  it under the terms of the GNU General Public License as published by   *
0015  *  the Free Software Foundation; either version 2 of the License, or      *
0016  *  (at your option) any later version.                                    *
0017  *                                                                         *
0018  *  This program is distributed in the hope that it will be useful,        *
0019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0021  *  GNU General Public License for more details.                           *
0022  *                                                                         *
0023  *   You should have received a copy of the GNU General Public License     *
0024  *   along with this program; if not, write to the Free Software           *
0025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0026  *   Boston, MA  02110-1301  USA                                           *
0027  *                                                                         *
0028  ***************************************************************************/
0029 
0030 #ifndef GUITOOLS_H
0031 #define GUITOOLS_H
0032 
0033 #include <QPen>
0034 
0035 class QComboBox;
0036 class QColor;
0037 class QLineEdit;
0038 class QMenu;
0039 class QActionGroup;
0040 class QAction;
0041 
0042 class GuiTools {
0043 public:
0044     static void updateBrushStyles(QComboBox*, const QColor&);
0045     static void updatePenStyles(QComboBox*, const QColor&);
0046     static void updatePenStyles(QMenu*, QActionGroup*, const QColor&);
0047     static void selectPenStyleAction(QActionGroup*, Qt::PenStyle);
0048     static Qt::PenStyle penStyleFromAction(QActionGroup*, QAction*);
0049 
0050     static void fillColorMenu(QMenu*, QActionGroup*);
0051     static void selectColorAction(QActionGroup*, const QColor&);
0052     static QColor& colorFromAction(QActionGroup*, QAction*);
0053 
0054     static void highlight(QLineEdit*, bool);
0055 };
0056 
0057 #endif // GUITOOLS_H