1 /***************************************************************************
2 * Copyright (C) 2008 by Simon Andreas Eugster (simon.eu@gmail.com) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef UNICODEDIALOG_H
11 #define UNICODEDIALOG_H
13 #include "ui_unicodedialog_ui.h"
15 class UnicodeDialog : public QDialog, public Ui::UnicodeDialog_UI
20 /** \brief The input method for the dialog. Atm only InputHex supported. */
21 enum InputMethod { InputHex, InputDec };
23 UnicodeDialog(InputMethod inputMeth);
26 /** \brief Returns infos about an unicode number. Extendable/improvable ;) */
27 QString unicodeInfo(QString unicode_number);
30 Ui::UnicodeDialog_UI m_view;
32 /** Selected input method */
33 InputMethod inputMethod;
34 /** \brief Validates text and removes all invalid characters (non-hex e.g.) */
35 QString validateText(QString text);
38 QString lastUnicodeNumber;
41 /** \brief Contains the selected unicode character; emitted when Enter is pressed. */
42 void charSelected(const QString&);
45 void slotTextChanged(QString text);
46 void slotReturnPressed();