moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kiten / widgets.h
blob74062c702ecce4470da2bfc7106745d22025006d
1 /**
2 This file is part of Kiten, a KDE Japanese Reference Tool...
3 Copyright (C) 2001 Jason Katz-Brown <jason@katzbrown.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 USA
19 **/
21 #ifndef KITEN_WIDGETS_H
22 #define KITEN_WIDGETS_H
24 #include <qguardedptr.h>
26 #include <kaction.h>
27 #include <klineedit.h>
28 #include <kmainwindow.h>
29 #include <ktextbrowser.h>
31 class KListView;
32 class KStatusBar;
34 #include "dict.h"
35 #include "rad.h"
37 class KDE_EXPORT ResultView : public KTextBrowser
39 Q_OBJECT
41 public:
42 ResultView(bool showLinks, QWidget *parent = 0, const char *name = 0);
44 void addResult(Dict::Entry result, bool common = false);
45 void addKanjiResult(Dict::Entry, bool common = false, Radical = Radical());
47 void addHeader(const QString &, unsigned int degree = 3);
49 public slots:
50 void print(QString = QString::null);
51 void append(const QString &);
52 void flush();
53 void clear();
54 void setBasicMode(bool yes) { basicMode = yes; }
56 void updateFont();
58 private:
59 QString putchars(const QString &);
60 QString printText;
62 bool links;
63 bool basicMode;
66 class KDE_EXPORT eEdit : public KMainWindow
68 Q_OBJECT
70 public:
71 eEdit(const QString &, QWidget *parent = 0, const char *name = 0);
72 ~eEdit();
74 private slots:
75 void add();
76 void save();
77 void del();
78 void disable();
79 void openFile(const QString &);
81 private:
82 KListView *List;
83 QString filename;
84 KStatusBar *StatusBar;
85 KAction *addAct;
86 KAction *removeAct;
87 KAction *saveAct;
88 bool isMod;
91 class KDE_EXPORT EditAction : public KAction
93 Q_OBJECT
94 public:
95 EditAction( const QString& text, int accel, const QObject *receiver, const char *member, QObject* parent, const char* name );
96 virtual ~EditAction();
98 virtual int plug( QWidget *w, int index = -1 );
100 virtual void unplug( QWidget *w );
102 QString text() { return m_combo->text(); }
103 void setText(const QString &text);
105 QGuardedPtr<KLineEdit> editor();
107 public slots:
108 void insert(const QString &);
110 // also sets focus to the lineedit widget
111 void clear();
113 signals:
114 void plugged();
116 private:
117 QGuardedPtr<KLineEdit> m_combo;
118 const QObject *m_receiver;
119 const char *m_member;
122 #endif