KDEUI
kcharselect.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 00003 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef kcharselect_h 00022 #define kcharselect_h 00023 00024 #include <QtCore/QString> 00025 #include <QtCore/QStringList> 00026 #include <QtGui/QWidget> 00027 #include <kglobal.h> 00028 #include <kdeui_export.h> 00029 00030 class KActionCollection; 00031 00032 class QFont; 00033 class QUrl; 00034 00061 class KDEUI_EXPORT KCharSelect : public QWidget 00062 { 00063 Q_OBJECT 00064 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont) 00065 Q_PROPERTY(QChar currentChar READ currentChar WRITE setCurrentChar) 00066 Q_PROPERTY(QList<QChar> displayedChars READ displayedChars) 00067 00068 public: 00072 enum Control { 00076 SearchLine = 0x01, 00080 FontCombo = 0x02, 00084 FontSize = 0x04, 00088 BlockCombos = 0x08, 00092 CharacterTable = 0x10, 00096 DetailBrowser = 0x20, 00100 HistoryButtons = 0x40, 00104 AllGuiElements = 65535 00105 }; 00106 Q_DECLARE_FLAGS(Controls, 00107 Control) 00108 00109 00110 #ifndef KDE_NO_DEPRECATED 00111 KDE_CONSTRUCTOR_DEPRECATED explicit KCharSelect( 00112 QWidget *parent, 00113 const Controls controls = AllGuiElements); 00114 #endif 00115 00134 explicit KCharSelect( 00135 QWidget *parent, 00136 KActionCollection *collection, 00137 const Controls controls = AllGuiElements); 00138 00139 ~KCharSelect(); 00140 00144 virtual QSize sizeHint() const; 00145 00149 QChar currentChar() const; 00150 00154 QFont currentFont() const; 00155 00159 QList<QChar> displayedChars() const; 00160 00161 public Q_SLOTS: 00167 void setCurrentChar(const QChar &c); 00168 00174 void setCurrentFont(const QFont &font); 00175 00176 Q_SIGNALS: 00182 void currentFontChanged(const QFont &font); 00188 void currentCharChanged(const QChar &c); 00192 void displayedCharsChanged(); 00198 void charSelected(const QChar &c); 00199 00200 private: 00201 Q_PRIVATE_SLOT(d, void _k_activateSearchLine()) 00202 Q_PRIVATE_SLOT(d, void _k_back()) 00203 Q_PRIVATE_SLOT(d, void _k_forward()) 00204 Q_PRIVATE_SLOT(d, void _k_fontSelected()) 00205 Q_PRIVATE_SLOT(d, void _k_updateCurrentChar(const QChar &c)) 00206 Q_PRIVATE_SLOT(d, void _k_slotUpdateUnicode(const QChar &c)) 00207 Q_PRIVATE_SLOT(d, void _k_sectionSelected(int index)) 00208 Q_PRIVATE_SLOT(d, void _k_blockSelected(int index)) 00209 Q_PRIVATE_SLOT(d, void _k_searchEditChanged()) 00210 Q_PRIVATE_SLOT(d, void _k_search()) 00211 Q_PRIVATE_SLOT(d, void _k_linkClicked(QUrl)) 00212 00213 class KCharSelectPrivate; 00214 KCharSelectPrivate* const d; 00215 00216 void init(const Controls, KActionCollection *); 00217 }; 00218 00219 Q_DECLARE_OPERATORS_FOR_FLAGS(KCharSelect::Controls) 00220 00221 #endif
KDE 4.6 API Reference