• 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 
34 class TQFont;
35 class TQFontDatabase;
36 class TQMouseEvent;
37 class TQSpinBox;
38 
49 class TDEUI_EXPORT KCharSelectTable : public TQGridView
50 {
51  TQ_OBJECT
52 
53 public:
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 
60  virtual void setFont( const TQString &_font );
61  virtual void setChar( const TQChar &_chr );
62  virtual void setTableNum( int _tableNum );
63 
64  TQString fontName() const { return vFont; }
65  virtual TQChar chr() const { return vChr; }
66  int tableNum() const { return vTableNum; }
67 
68  TQChar charAt( int row, int col ) const;
69 
70 protected:
71  virtual void paintCell( class TQPainter *p, int row, int col );
72 
73  virtual void keyPressEvent( TQKeyEvent *e );
74 
75  virtual void viewportResizeEvent( TQResizeEvent *e );
76 
77  virtual void contentsMousePressEvent( TQMouseEvent *e );
78  virtual void contentsMouseDoubleClickEvent ( TQMouseEvent *e );
79  virtual void contentsMouseReleaseEvent( TQMouseEvent *e );
80  virtual void contentsMouseMoveEvent( TQMouseEvent *e );
81 
82  void gotoLeft();
83  void gotoRight();
84  void gotoUp();
85  void gotoDown();
86 
87  TQString vFont;
88  TQChar vChr;
89  int vTableNum;
90  TQPoint vPos;
91  TQChar focusItem;
92  TQPoint focusPos;
93  int temp;
94 
95 signals:
96  void highlighted( const TQChar &c );
97  void highlighted();
98  void activated( const TQChar &c );
99  void activated();
100  void focusItemChanged();
101  void focusItemChanged( const TQChar &c );
102  void tableUp(); //< BCI: remove me
103  void tableDown(); //< BCI: remove me
104  void tableNumChanged( int tableNum );
105  void doubleClicked();
106 
107 private:
108  virtual void setFont(const TQFont &f) { TQGridView::setFont(f); }
109  void doGoto(int dx, int dy);
110 protected:
111  virtual void virtual_hook( int id, void* data );
112 private:
113  class KCharSelectTablePrivate;
114  KCharSelectTablePrivate* const d;
115 };
116 
146 class TDEUI_EXPORT KCharSelect : public TQVBox
147 {
148  TQ_OBJECT
149  TQ_PROPERTY( TQString fontFamily READ font WRITE setFont )
150  TQ_PROPERTY( int tableNum READ tableNum WRITE setTableNum )
151  TQ_PROPERTY( bool fontComboEnabled READ isFontComboEnabled WRITE enableFontCombo )
152  TQ_PROPERTY( bool tableSpinBoxEnabled READ isTableSpinBoxEnabled WRITE enableTableSpinBox )
153 
154 public:
160  KCharSelect( TQWidget *parent, const char *name,
161  const TQString &font = TQString::null, const TQChar &chr = ' ', int tableNum = 0 );
162  ~KCharSelect();
166  virtual TQSize sizeHint() const;
167 
171  virtual void setFont( const TQString &font );
172 
176  virtual void setChar( const TQChar &chr );
177 
181  virtual void setTableNum( int tableNum );
182 
186  virtual TQChar chr() const { return charTable->chr(); }
187 
191  virtual TQString font() const { return fontCombo->currentText(); }
192 
196  virtual int tableNum() const { return tableSpinBox->value(); }
197 
203  virtual void enableFontCombo( bool e ) { fontCombo->setEnabled( e ); }
204 
211  virtual void enableTableSpinBox( bool e ) { tableSpinBox->setEnabled( e ); }
212 
219  virtual bool isFontComboEnabled() const { return fontCombo->isEnabled(); }
220 
227  virtual bool isTableSpinBoxEnabled() const { return tableSpinBox->isEnabled(); }
228 
229 protected:
230  virtual void fillFontCombo();
231  virtual bool eventFilter( TQObject *, TQEvent *e );
232  static void cleanupFontDatabase();
233 
234  TQComboBox *fontCombo;
235  TQSpinBox *tableSpinBox;
236  KCharSelectTable *charTable;
237  TQStringList fontList;
238  static TQFontDatabase * fontDataBase;
239 
240 protected slots:
241  void fontSelected( const TQString &_font );
242  void tableChanged( int _value );
243  void charHighlighted( const TQChar &c ) { emit highlighted( c ); }
244  void charHighlighted() { emit highlighted(); }
245  void charActivated( const TQChar &c ) { emit activated( c ); }
246  void charActivated() { emit activated(); }
247  void charFocusItemChanged() { emit focusItemChanged(); }
248  void charFocusItemChanged( const TQChar &c ) { emit focusItemChanged( c ); }
249  void charTableUp() { if ( tableNum() < 255 ) setTableNum( tableNum() + 1 ); } //< BCI: remove me
250  void charTableDown() { if ( tableNum() > 0 ) setTableNum( tableNum() - 1 ); } //< BCI: remove me
251  void slotDoubleClicked() { emit doubleClicked(); }
252  void slotUnicodeEntered();
253  void slotUpdateUnicode( const TQChar &c );
254 signals:
255  void highlighted( const TQChar &c );
256  void highlighted();
257  void activated( const TQChar &c );
258  void activated();
259  void fontChanged( const TQString &_font );
260  void focusItemChanged();
261  void focusItemChanged( const TQChar &c );
262  void doubleClicked();
263 
264 private:
265  virtual void setFont(const TQFont &f) { TQVBox::setFont(f); }
266 protected:
267  virtual void virtual_hook( int id, void* data );
268 private:
269  class KCharSelectPrivate;
270  KCharSelectPrivate* const d;
271 };
272 
273 #endif
KCharSelectTable
Character selection table.
Definition: kcharselect.h:50
KCharSelect
Character selection widget.
Definition: kcharselect.h:147
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:203
KCharSelect::isTableSpinBoxEnabled
virtual bool isTableSpinBoxEnabled() const
Returns wether the table spinbox on the top is enabled or disabled.
Definition: kcharselect.h:227
KCharSelect::chr
virtual TQChar chr() const
Returns the currently selected character.
Definition: kcharselect.h:186
KCharSelect::isFontComboEnabled
virtual bool isFontComboEnabled() const
Returns wether the font combobox on the top is enabled or disabled.
Definition: kcharselect.h:219
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:211
KCharSelect::tableNum
virtual int tableNum() const
Returns the currently displayed table.
Definition: kcharselect.h:196
KCharSelect::font
virtual TQString font() const
Returns the currently displayed font.
Definition: kcharselect.h:191

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.1
This website is maintained by Timothy Pearson.