kword

KWEditPersonnalExpression.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Montel Laurent <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __KWEditPersonnalExpression__
21#define __KWEditPersonnalExpression__
22
23#include <kdialogbase.h>
24#include <tqmap.h>
25
26class TQPushButton;
27class TQComboBox;
28class TQListBox;
29class TQLineEdit;
30
31class KWEditPersonnalExpression : public KDialogBase
32{
33 TQ_OBJECT
34
35public:
36 KWEditPersonnalExpression( TQWidget *parent, const char *name = 0 );
37
38protected:
39 void init(const TQString& filename );
40 void loadFile();
41 void initGroupList();
42 void saveFile();
43 void updateWidget();
44 void updateExpression();
45
46protected slots:
47 void slotGroupSelected();
48 void slotExpressionSelected();
49 void slotUpdateGroupName(const TQString &newGroupName);
50 void slotUpdateExpression(const TQString &newExpression);
51 void slotRemoveExpression();
52 void slotAddExpression();
53 void slotRemoveGroup();
54 void slotAddGroup();
55 virtual void slotOk();
56
57 private:
58 typedef TQMap<TQString,TQStringList> list;
59 list listExpression;
60 TQListBox *m_groupList;
61 TQListBox *m_ExpressionsList;
62 TQPushButton *m_addGroup;
63 TQPushButton *m_delGroup;
64 TQPushButton *m_addExpression;
65 TQPushButton *m_delExpression;
66 TQLineEdit *m_groupLineEdit;
67 TQLineEdit *m_expressionLineEdit;
68 bool m_bChanged;
69};
70
71#endif