File indexing completed on 2022-11-29 18:12:55

0001 /*
0002     This file is part of Kiten, a KDE Japanese Reference Tool
0003     SPDX-FileCopyrightText: 2006 Joseph Kerian <jkerian@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef RADSELECTVIEW_H
0009 #define RADSELECTVIEW_H
0010 
0011 //generated from the uic from radical_selector.ui (defines Ui::radical_selector)
0012 #include "ui_radical_selector.h"
0013 
0014 #include <QList>
0015 #include <QWidget>
0016 
0017 class ButtonGrid;
0018 class QListWidgetItem;
0019 class QString;
0020 class QStringList;
0021 
0022 #include "radicalfile.h"    //For Kanji/radicalFile definitions
0023 
0024 class RadSelectView : public QWidget, public Ui::radical_selector
0025 {
0026   Q_OBJECT
0027 
0028   public:
0029     explicit RadSelectView( QWidget *parent );
0030     ~RadSelectView() override;
0031 
0032     //Load pre-determined search parameters
0033     void loadRadicals( const QString &radicals, int strokeMin, int strokeMax );
0034     void loadKanji( QString &kanji );
0035 
0036   Q_SIGNALS:
0037     void signalChangeStatusbar( const QString &text );
0038     //Listen for this if you want to detect each minor change
0039     void searchModified();
0040     //This is when they've actually pressed a kanji
0041     void kanjiSelected( const QStringList &kanjiList );
0042 
0043   private Q_SLOTS:
0044     void loadSettings();
0045     //Handles either of the stroke limiters moving
0046     void strokeLimitChanged( int newvalue );
0047     //Connected to any changes in searches, emits searchModified
0048     void changedSearch();
0049     //Clear everything
0050     void clearSearch();
0051     //Result is clicked
0052     void kanjiClicked( QListWidgetItem *item );
0053     //Result is double-clicked
0054     void kanjiDoubleClicked( QListWidgetItem *item );
0055     //Sets the list of visible Kanji
0056     void listPossibleKanji( const QList<Kanji> &list );
0057     //Copy text from lineedit to clipboard
0058     void toClipboard();
0059 
0060   private:
0061     RadicalFile  *m_radicalInfo;
0062     ButtonGrid   *m_buttongrid;
0063     QList<Kanji>  m_possibleKanji;
0064 };
0065 
0066 #endif