1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr> 4 ** 5 ** This file is part of the Edyuk project <http://edyuk.org> 6 ** 7 ** This file may be used under the terms of the GNU General Public License 8 ** version 3 as published by the Free Software Foundation and appearing in the 9 ** file GPL.txt included in the packaging of this file. 10 ** 11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13 ** 14 ****************************************************************************/ 15 16 #ifndef _QFORMAT_CONFIG_H_ 17 #define _QFORMAT_CONFIG_H_ 18 19 #include "qce-config.h" 20 21 /*! 22 \file qformatconfig.h 23 \brief Definition of the QFormatConfig widget 24 25 \see QFormatConfig 26 */ 27 28 #include <QWidget> 29 30 #include "ui_formatconfig.h" 31 32 class QFormatScheme; 33 34 class QCE_EXPORT QFormatConfig : public QWidget, private Ui::FormatConfig 35 { 36 Q_OBJECT 37 38 public: 39 QFormatConfig(QWidget *w = 0); 40 41 bool isAutonomous() const; 42 43 bool hasUnsavedChanges() const; 44 45 QList<QFormatScheme*> schemes() const; 46 47 public slots: 48 void retranslate(); 49 50 void apply(); 51 void cancel(); 52 void restore(); 53 54 void setAutonomous(bool y); 55 56 void addScheme(const QString& name, QFormatScheme *scheme); 57 void removeScheme(QFormatScheme *scheme); 58 59 void setCurrentScheme(QFormatScheme *scheme); 60 61 protected: 62 virtual void hideEvent(QHideEvent *e); 63 64 private slots: 65 void on_m_selector_currentIndexChanged(int idx); 66 67 private: 68 QList<int> modifiedFormats() const; 69 70 bool m_autonomous; 71 QFormatScheme *m_currentScheme; 72 QList<QFormatScheme*> m_schemes; 73 }; 74 75 #endif // _QFORMAT_CONFIG_H_ 76