/usr/include/sonnet/dialog.h is in kdelibs5-dev 4:4.14.2-5+deb8u2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
/*
* dialog.h
*
* Copyright (C) 2003 Zack Rusin <zack@kde.org>
* Copyright (C) 2009-2010 Michel Ludwig <michel.ludwig@kdemail.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef SONNET_DIALOG_H
#define SONNET_DIALOG_H
#include <kdialog.h>
class QListWidgetItem;
class QModelIndex;
namespace Sonnet
{
class BackgroundChecker;
/**
* @short Spellcheck dialog
*
* \code
* Sonnet::Dialog dlg = new Sonnet::Dialog(
* new Sonnet::BackgroundChecker(this), this);
* //connect signals
* ...
* dlg->setBuffer( someText );
* dlg->show();
* \endcode
*
* You can change buffer inside a slot connected to done() signal
* and spellcheck will continue with new data automatically.
*/
class KDEUI_EXPORT Dialog : public KDialog
{
Q_OBJECT
public:
Dialog(BackgroundChecker *checker,
QWidget *parent);
~Dialog();
QString originalBuffer() const;
QString buffer() const;
void show();
void activeAutoCorrect(bool _active);
// Hide warning about done(), which is a slot in QDialog and a signal here.
using KDialog::done;
/**
* Controls whether an (indefinite) progress dialog is shown when the spell
* checking takes longer than the given time to complete. By default no
* progress dialog is shown. If the progress dialog is set to be shown, no
* time consuming operation (for example, showing a notification message) should
* be performed in a slot connected to the 'done' signal as this might trigger
* the progress dialog unnecessarily.
*
* @param timeout time after which the progress dialog should appear; a negative
* value can be used to hide it
* @since 4.4
*/
void showProgressDialog(int timeout = 500);
/**
* Controls whether a message box indicating the completion of the spell checking
* is shown or not. By default it is not shown.
*
* @since 4.4
*/
void showSpellCheckCompletionMessage( bool b = true );
/**
* Controls whether the spell checking is continued after the replacement of a
* misspelled word has been performed. By default it is continued.
*
* @since 4.4
*/
void setSpellCheckContinuedAfterReplacement( bool b );
public Q_SLOTS:
void setBuffer(const QString &);
Q_SIGNALS:
/**
* The dialog won't be closed if you setBuffer() in slot connected to this signal
*
* Also emitted after stop() signal
*/
void done( const QString& newBuffer );
void misspelling( const QString& word, int start );
void replace( const QString& oldWord, int start,
const QString& newWord );
void stop();
void cancel();
void autoCorrect( const QString & currentWord, const QString & replaceWord );
/**
* Signal sends when spell checking is finished/stopped/completed
* @since 4.1
*/
void spellCheckStatus(const QString &);
/**
* Emitted when the user changes the language used for spellchecking,
* which is shown in a combobox of this dialog.
*
* @param dictionary the new language the user selected
* @since 4.1
*/
void languageChanged( const QString &language );
private Q_SLOTS:
void slotMisspelling(const QString& word, int start );
void slotDone();
void slotFinished();
void slotCancel();
void slotAddWord();
void slotReplaceWord();
void slotReplaceAll();
void slotSkip();
void slotSkipAll();
void slotSuggest();
void slotChangeLanguage( const QString& );
void slotSelectionChanged(const QModelIndex &);
void slotAutocorrect();
void setGuiEnabled(bool b);
void setProgressDialogVisible(bool b);
private:
void updateDialog( const QString& word );
void fillDictionaryComboBox();
void updateDictionaryComboBox();
void fillSuggestions( const QStringList& suggs );
void initConnections();
void initGui();
void continueChecking();
private:
class Private;
Private* const d;
Q_DISABLE_COPY( Dialog )
};
}
#endif
|