• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kcharselect.h
1/* This file is part of the KDE libraries
2
3 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef kcharselect_h
22#define kcharselect_h
23
24#include <tqgridview.h>
25#include <tqvbox.h>
26#include <tqcombobox.h>
27#include <tqspinbox.h>
28#include <tqstring.h>
29#include <tqpoint.h>
30#include <tqstringlist.h>
31
32#include <tdelibs_export.h>
33
34class TQFont;
35class TQFontDatabase;
36class TQMouseEvent;
37class TQSpinBox;
38
49class TDEUI_EXPORT KCharSelectTable : public TQGridView
50{
51 TQ_OBJECT
52
53public:
54 KCharSelectTable( TQWidget *parent, const char *name, const TQString &_font,
55 const TQChar &_chr, int _tableNum );
56 ~KCharSelectTable();
57
58 virtual TQSize sizeHint() const;
59 virtual void resizeEvent( TQResizeEvent * ); //< BCI: remove me
60
61 virtual void setFont( const TQString &_font );
62 virtual void setChar( const TQChar &_chr );
63 virtual void setTableNum( int _tableNum );
64
65 TQString font() const { return vFont; }
66 // BCI: add const
67 virtual TQChar chr() { return vChr; }
68 int tableNum() const { return vTableNum; }
69
70 TQChar charAt( int row, int col ) const;
71
72protected:
73 virtual void paintCell( class TQPainter *p, int row, int col );
74
75 // BCI: remove non-"contents*" mouse*Event handlers
76 virtual void mousePressEvent( TQMouseEvent *e ) { TQGridView::mousePressEvent(e); }
77 virtual void mouseDoubleClickEvent ( TQMouseEvent *e ){ TQGridView::mouseDoubleClickEvent(e); }
78 virtual void mouseReleaseEvent( TQMouseEvent *e ) { TQGridView::mouseReleaseEvent(e); }
79 virtual void mouseMoveEvent( TQMouseEvent *e );
80
81 virtual void keyPressEvent( TQKeyEvent *e );
82
83 virtual void viewportResizeEvent( TQResizeEvent *e );
84
85 virtual void contentsMousePressEvent( TQMouseEvent *e );
86 virtual void contentsMouseDoubleClickEvent ( TQMouseEvent *e );
87 virtual void contentsMouseReleaseEvent( TQMouseEvent *e );
88 virtual void contentsMouseMoveEvent( TQMouseEvent *e );
89
90
91 void gotoLeft();
92 void gotoRight();
93 void gotoUp();
94 void gotoDown();
95
96 TQString vFont;
97 TQChar vChr;
98 int vTableNum;
99 TQPoint vPos;
100 TQChar focusItem;
101 TQPoint focusPos;
102 int temp;
103
104signals:
105 void highlighted( const TQChar &c );
106 void highlighted();
107 void activated( const TQChar &c );
108 void activated();
109 void focusItemChanged();
110 void focusItemChanged( const TQChar &c );
111 void tableUp(); //< BCI: remove me
112 void tableDown(); //< BCI: remove me
113 void tableNumChanged( int tableNum );
114 void doubleClicked();
115
116private:
117 virtual void setFont(const TQFont &f) { TQGridView::setFont(f); }
118 void doGoto(int dx, int dy);
119protected:
120 virtual void virtual_hook( int id, void* data );
121private:
122 class KCharSelectTablePrivate;
123 KCharSelectTablePrivate* const d;
124};
125
155class TDEUI_EXPORT KCharSelect : public TQVBox
156{
157 TQ_OBJECT
158 TQ_PROPERTY( TQString fontFamily READ font WRITE setFont )
159 TQ_PROPERTY( int tableNum READ tableNum WRITE setTableNum )
160 TQ_PROPERTY( bool fontComboEnabled READ isFontComboEnabled WRITE enableFontCombo )
161 TQ_PROPERTY( bool tableSpinBoxEnabled READ isTableSpinBoxEnabled WRITE enableTableSpinBox )
162
163public:
169 KCharSelect( TQWidget *parent, const char *name,
170 const TQString &font = TQString::null, const TQChar &chr = ' ', int tableNum = 0 );
171 ~KCharSelect();
175 virtual TQSize sizeHint() const;
176
180 virtual void setFont( const TQString &font );
181
185 virtual void setChar( const TQChar &chr );
186
190 virtual void setTableNum( int tableNum );
191
195 virtual TQChar chr() const { return charTable->chr(); }
196
200 virtual TQString font() const { return fontCombo->currentText(); }
201
205 virtual int tableNum() const { return tableSpinBox->value(); }
206
212 virtual void enableFontCombo( bool e ) { fontCombo->setEnabled( e ); }
213
220 virtual void enableTableSpinBox( bool e ) { tableSpinBox->setEnabled( e ); }
221
228 virtual bool isFontComboEnabled() const { return fontCombo->isEnabled(); }
229
236 virtual bool isTableSpinBoxEnabled() const { return tableSpinBox->isEnabled(); }
237
238protected:
239 virtual void fillFontCombo();
240 virtual bool eventFilter( TQObject *, TQEvent *e );
241 static void cleanupFontDatabase();
242
243 TQComboBox *fontCombo;
244 TQSpinBox *tableSpinBox;
245 KCharSelectTable *charTable;
246 TQStringList fontList;
247 static TQFontDatabase * fontDataBase;
248
249protected slots:
250 void fontSelected( const TQString &_font );
251 void tableChanged( int _value );
252 void charHighlighted( const TQChar &c ) { emit highlighted( c ); }
253 void charHighlighted() { emit highlighted(); }
254 void charActivated( const TQChar &c ) { emit activated( c ); }
255 void charActivated() { emit activated(); }
256 void charFocusItemChanged() { emit focusItemChanged(); }
257 void charFocusItemChanged( const TQChar &c ) { emit focusItemChanged( c ); }
258 void charTableUp() { if ( tableNum() < 255 ) setTableNum( tableNum() + 1 ); } //< BCI: remove me
259 void charTableDown() { if ( tableNum() > 0 ) setTableNum( tableNum() - 1 ); } //< BCI: remove me
260 void slotDoubleClicked() { emit doubleClicked(); }
261 void slotUnicodeEntered();
262 void slotUpdateUnicode( const TQChar &c );
263signals:
264 void highlighted( const TQChar &c );
265 void highlighted();
266 void activated( const TQChar &c );
267 void activated();
268 void fontChanged( const TQString &_font );
269 void focusItemChanged();
270 void focusItemChanged( const TQChar &c );
271 void doubleClicked();
272
273private:
274 virtual void setFont(const TQFont &f) { TQVBox::setFont(f); }
275protected:
276 virtual void virtual_hook( int id, void* data );
277private:
278 class KCharSelectPrivate;
279 KCharSelectPrivate* const d;
280};
281
282#endif
KCharSelectTable
Character selection table.
Definition kcharselect.h:50
KCharSelect
Character selection widget.
Definition kcharselect.h:156
KCharSelect::enableFontCombo
virtual void enableFontCombo(bool e)
If e is set to true, the combobox which allows the user to select the font which should be displayed ...
Definition kcharselect.h:212
KCharSelect::isTableSpinBoxEnabled
virtual bool isTableSpinBoxEnabled() const
Returns wether the table spinbox on the top is enabled or disabled.
Definition kcharselect.h:236
KCharSelect::chr
virtual TQChar chr() const
Returns the currently selected character.
Definition kcharselect.h:195
KCharSelect::isFontComboEnabled
virtual bool isFontComboEnabled() const
Returns wether the font combobox on the top is enabled or disabled.
Definition kcharselect.h:228
KCharSelect::enableTableSpinBox
virtual void enableTableSpinBox(bool e)
If e is set to true, the spinbox which allows the user to specify which characters of the font should...
Definition kcharselect.h:220
KCharSelect::tableNum
virtual int tableNum() const
Returns the currently displayed table.
Definition kcharselect.h:205
KCharSelect::font
virtual TQString font() const
Returns the currently displayed font.
Definition kcharselect.h:200

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.8
This website is maintained by Timothy Pearson.