itom 1.0.14
D:/git-itom/sources/itom/Qitom/ui/widgetPropEditorStyles.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef WIDGETPROPEDITORSTYLES_H
00024 #define WIDGETPROPEDITORSTYLES_H
00025 
00026 #include "abstractPropertyPageWidget.h"
00027 
00028 #include <QtGui>
00029 #include <qvector.h>
00030 #include <qstring.h>
00031 #include <qfont.h>
00032 #include <qcolor.h>
00033 
00034 // Under Windows, define QSCINTILLA_MAKE_DLL to create a Scintilla DLL, or
00035 // define QSCINTILLA_DLL to link against a Scintilla DLL, or define neither
00036 // to either build or link against a static Scintilla library.
00038 #define QSCINTILLA_DLL  //http://www.riverbankcomputing.com/pipermail/qscintilla/2007-March/000034.html
00039 
00040 #include <Qsci/qsciscintilla.h>
00041 #include <Qsci/qscilexerpython.h>
00042 
00043 #include "ui_widgetPropEditorStyles.h"
00044 
00045 class WidgetPropEditorStyles : public AbstractPropertyPageWidget
00046 {
00047     Q_OBJECT
00048 
00049 public:
00050 
00051     struct StyleNode
00052     {
00053         StyleNode(int index, QString name, QFont font, bool fillToEOL, QColor foregroundColor, QColor backgroundColor) : m_index(index), m_name(name), m_font(font), m_fillToEOL(fillToEOL), m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor) {};
00054         StyleNode() {};
00055         StyleNode(int index, QString name) : m_index(index), m_name(name) {};
00056         int m_index;
00057         QString m_name;
00058         QFont m_font;
00059         bool m_fillToEOL;
00060         QColor m_foregroundColor;
00061         QColor m_backgroundColor;
00062     };
00063 
00064     WidgetPropEditorStyles(QWidget *parent = NULL);
00065     ~WidgetPropEditorStyles();
00066 
00067     void readSettings();
00068     void writeSettings();
00069 
00070 protected:
00071 
00072 private:
00073     Ui::WidgetPropEditorStyles ui;
00074 
00075     QVector<StyleNode> m_styles;
00076 
00077     QsciLexerPython* qSciLex;
00078     
00079 
00080 signals:
00081 
00082 public slots:
00083 
00084 private slots:
00085     void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
00086     void on_btnBackgroundColor_clicked();
00087     void on_btnFont_clicked();
00088     void on_btnForegroundColor_clicked();
00089     void on_checkFillEOL_stateChanged(int state);
00090 
00091 };
00092 
00093 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends