kword

KWEditPersonnalExpression.h

00001 /* This file is part of the KDE project
00002    Copyright (C)  2001 Montel Laurent <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __KWEditPersonnalExpression__
00021 #define __KWEditPersonnalExpression__
00022 
00023 #include <kdialogbase.h>
00024 #include <qmap.h>
00025 
00026 class QPushButton;
00027 class QComboBox;
00028 class QListBox;
00029 class QLineEdit;
00030 
00031 class KWEditPersonnalExpression : public KDialogBase
00032 {
00033     Q_OBJECT
00034 public:
00035     KWEditPersonnalExpression( QWidget *parent, const char *name = 0 );
00036 
00037 protected:
00038     void init(const QString& filename );
00039     void loadFile();
00040     void initGroupList();
00041     void saveFile();
00042     void updateWidget();
00043     void updateExpression();
00044 
00045 protected slots:
00046     void slotGroupSelected();
00047     void slotExpressionSelected();
00048     void slotUpdateGroupName(const QString &newGroupName);
00049     void slotUpdateExpression(const QString &newExpression);
00050     void slotRemoveExpression();
00051     void slotAddExpression();
00052     void slotRemoveGroup();
00053     void slotAddGroup();
00054     virtual void slotOk();
00055 
00056  private:
00057     typedef QMap<QString,QStringList> list;
00058     list listExpression;
00059     QListBox *m_groupList;
00060     QListBox *m_ExpressionsList;
00061     QPushButton *m_addGroup;
00062     QPushButton *m_delGroup;
00063     QPushButton *m_addExpression;
00064     QPushButton *m_delExpression;
00065     QLineEdit *m_groupLineEdit;
00066     QLineEdit *m_expressionLineEdit;
00067     bool m_bChanged;
00068 };
00069 
00070 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys