00001 /*************************************************************************** 00002 kqifprofileeditor.h - description 00003 ------------------- 00004 begin : Tue Dec 24 2002 00005 copyright : (C) 2002 by Thomas Baumgart 00006 email : thb@net-bembel.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef MYMONEYQIFPROFILEEDITOR_H 00019 #define MYMONEYQIFPROFILEEDITOR_H 00020 00021 // ---------------------------------------------------------------------------- 00022 // QT Includes 00023 00024 #include <qwidget.h> 00025 #include <qvalidator.h> 00026 class QListViewItem; 00027 00028 // ---------------------------------------------------------------------------- 00029 // KDE Includes 00030 00031 // ---------------------------------------------------------------------------- 00032 // Project Includes 00033 00034 #include "mymoneyqifprofileeditordecl.h" 00035 #include "../converter/mymoneyqifprofile.h" 00036 00041 class MyMoneyQifProfileNameValidator : public QValidator 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 MyMoneyQifProfileNameValidator(QObject *o, const char *name); 00047 virtual ~MyMoneyQifProfileNameValidator(); 00048 00049 QValidator::State validate(QString&, int&) const; 00050 }; 00051 00052 00053 class MyMoneyQifProfileEditor : public MyMoneyQifProfileEditorDecl 00054 { 00055 Q_OBJECT 00056 00057 public: 00058 MyMoneyQifProfileEditor(const bool edit = false, QWidget *parent=0, const char *name=0); 00059 virtual ~MyMoneyQifProfileEditor(); 00060 00064 const QString selectedProfile() const; 00065 00066 public slots: 00067 void slotOk(void); 00068 00069 protected slots: 00070 void slotLoadProfileFromConfig(const QString& name); 00071 void slotReset(void); 00072 void slotRename(void); 00073 void slotDelete(void); 00074 void slotNew(void); 00075 void slotAmountTypeSelected(QListViewItem*); 00076 void slotDecimalChanged(const QString& val); 00077 void slotThousandsChanged(const QString& val); 00078 void slotHelp(void); 00079 00080 private: 00081 void loadProfileListFromConfig(void); 00082 void loadWidgets(void); 00083 void showProfile(void); 00084 void addProfile(const QString& name); 00085 void deleteProfile(const QString& name); 00086 const QString enterName(bool& ok); 00087 00088 private: 00089 bool m_inEdit; 00090 MyMoneyQifProfile m_profile; 00091 bool m_isDirty; 00092 bool m_isAccepted; 00093 QListViewItem* m_selectedAmountType; 00094 }; 00095 00096 #endif