File indexing completed on 2022-09-27 12:25:39

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 RADSELECT_H
0009 #define RADSELECT_H
0010 
0011 #include "dictquery.h"
0012 
0013 #include <KXmlGuiWindow>
0014 
0015 class QDBusInterface;
0016 class RadSelectView;
0017 
0018 /**
0019  * This class serves as the main window for radselect.
0020  * It handles the menus, toolbars, and status bars.
0021  *
0022  * @short Main window class
0023  * @author Joseph Kerian <jkerian@gmail.com>
0024  * @version 0.1
0025  */
0026 class RadSelect : public KXmlGuiWindow
0027 {
0028   Q_OBJECT
0029 
0030   public:
0031     RadSelect();
0032     ~RadSelect() override;
0033 
0034    /**
0035     * This loads a string for a given query into the UI
0036     */
0037     void loadSearchString( const QString &searchString );
0038 
0039   protected:
0040     // Overridden virtuals for Qt drag 'n drop (XDND)
0041     void dragEnterEvent( QDragEnterEvent *event ) override;
0042     void dropEvent( QDropEvent *event ) override;
0043 
0044   protected:
0045     /**
0046      * This function is called when it is time for the app to save its
0047      * properties for session management purposes.
0048      */
0049     void saveProperties( KConfigGroup &config ) override;
0050 
0051     /**
0052      * This function is called when this app is restored. The KConfig
0053      * object points to the session management config file that was saved
0054      * with @ref saveProperties
0055      */
0056     void readProperties( const KConfigGroup &config ) override;
0057 
0058 
0059   private Q_SLOTS:
0060     void optionsPreferences();
0061 
0062     void changeStatusbar( const QString &text );
0063 
0064     void sendSearch( const QStringList &kanji );
0065 
0066   private:
0067     QDBusInterface *m_dbusInterface;
0068     RadSelectView  *m_view;
0069     DictQuery       m_currentQuery;
0070 };
0071 
0072 #endif