QCodeEdit
2.2
|
00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr> 00004 ** 00005 ** This file is part of the Edyuk project <http://edyuk.org> 00006 ** 00007 ** This file may be used under the terms of the GNU General Public License 00008 ** version 3 as published by the Free Software Foundation and appearing in the 00009 ** file GPL.txt included in the packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ****************************************************************************/ 00015 00016 #ifndef _QFORMAT_CONFIG_H_ 00017 #define _QFORMAT_CONFIG_H_ 00018 00019 #include "qce-config.h" 00020 00028 #include <QWidget> 00029 00030 #include "ui_formatconfig.h" 00031 00032 class QFormatScheme; 00033 00034 class QCE_EXPORT QFormatConfig : public QWidget, private Ui::FormatConfig 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 QFormatConfig(QWidget *w = 0); 00040 00041 bool isAutonomous() const; 00042 00043 bool hasUnsavedChanges() const; 00044 00045 QList<QFormatScheme*> schemes() const; 00046 00047 public slots: 00048 void retranslate(); 00049 00050 void apply(); 00051 void cancel(); 00052 void restore(); 00053 00054 void setAutonomous(bool y); 00055 00056 void addScheme(const QString& name, QFormatScheme *scheme); 00057 void removeScheme(QFormatScheme *scheme); 00058 00059 void setCurrentScheme(QFormatScheme *scheme); 00060 00061 protected: 00062 virtual void hideEvent(QHideEvent *e); 00063 00064 private slots: 00065 void on_m_selector_currentIndexChanged(int idx); 00066 00067 private: 00068 QList<int> modifiedFormats() const; 00069 00070 bool m_autonomous; 00071 QFormatScheme *m_currentScheme; 00072 QList<QFormatScheme*> m_schemes; 00073 }; 00074 00075 #endif // _QFORMAT_CONFIG_H_