Commit b555a793 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_REQUIRED_RESULT

parent 6bfb8d1d
......@@ -45,7 +45,7 @@ public:
/**
* @return The current text mode
*/
Mode textMode() const;
Q_REQUIRED_RESULT Mode textMode() const;
/**
* Enables word wrap. Words will be wrapped at the specified column.
......@@ -65,12 +65,12 @@ public:
* @return the line number where the cursor is. This takes word-wrapping
* into account. Line numbers start at 0.
*/
int linePosition() const;
Q_REQUIRED_RESULT int linePosition() const;
/**
* @return the column numbe where the cursor is.
*/
int columnNumber() const;
Q_REQUIRED_RESULT int columnNumber() const;
void forcePlainTextMarkup(bool force);
......@@ -78,24 +78,24 @@ public:
void switchToPlainText();
void setTextOrHtml(const QString &text);
QString textOrHtml() const;
Q_REQUIRED_RESULT QString textOrHtml() const;
virtual void setHighlighterColors(KPIMTextEdit::RichTextComposerEmailQuoteHighlighter *highlighter);
void setUseExternalEditor(bool use);
void setExternalEditorPath(const QString &path);
bool checkExternalEditorFinished();
Q_REQUIRED_RESULT bool checkExternalEditorFinished();
void killExternalEditor();
//Redefine it for each apps
virtual QString smartQuote(const QString &msg); //need by kmail
void setQuotePrefixName(const QString &quotePrefix);
QString quotePrefixName() const;
Q_REQUIRED_RESULT QString quotePrefixName() const;
void setCursorPositionFromStart(unsigned int pos);
int quoteLength(const QString &line, bool oneQuote = false) const;
bool isLineQuoted(const QString &line) const;
Q_REQUIRED_RESULT int quoteLength(const QString &line, bool oneQuote = false) const;
Q_REQUIRED_RESULT bool isLineQuoted(const QString &line) const;
const QString defaultQuoteSign() const;
void createActions(KActionCollection *ac);
......
......@@ -36,9 +36,9 @@ public:
~RichTextComposerActions();
void createActions(KActionCollection *ac);
int numberOfActions() const;
Q_REQUIRED_RESULT int numberOfActions() const;
QList<QAction *> richTextActionList() const;
Q_REQUIRED_RESULT QList<QAction *> richTextActionList() const;
void uncheckActionFormatPainter();
void updateActionStates();
......
......@@ -34,34 +34,34 @@ public:
explicit RichTextComposerControler(RichTextComposer *richtextComposer, QObject *parent = nullptr);
~RichTextComposerControler();
RichTextComposer *richTextComposer() const;
Q_REQUIRED_RESULT RichTextComposer *richTextComposer() const;
QString currentLinkUrl() const;
Q_REQUIRED_RESULT QString currentLinkUrl() const;
QString currentLinkText() const;
Q_REQUIRED_RESULT QString currentLinkText() const;
void selectLinkText() const;
QString toCleanHtml() const;
Q_REQUIRED_RESULT QString toCleanHtml() const;
bool canIndentList() const;
bool canDedentList() const;
Q_REQUIRED_RESULT bool canIndentList() const;
Q_REQUIRED_RESULT bool canDedentList() const;
NestedListHelper *nestedListHelper() const;
Q_REQUIRED_RESULT NestedListHelper *nestedListHelper() const;
void insertShareLink(const QString &url);
void insertLink(const QString &url);
void setCursorPositionFromStart(unsigned int pos);
void ensureCursorVisible();
RichTextComposerImages *composerImages() const;
bool painterActive() const;
Q_REQUIRED_RESULT bool painterActive() const;
void disablePainter();
bool isFormattingUsed() const;
void setFontForWholeText(const QFont &font);
void textModeChanged(KPIMTextEdit::RichTextComposer::Mode mode);
void updateLink(const QString &linkUrl, const QString &linkText);
QString toWrappedPlainText(QTextDocument *doc) const;
QString toWrappedPlainText() const;
QString toCleanPlainText(const QString &plainText = QString()) const;
Q_REQUIRED_RESULT QString toWrappedPlainText(QTextDocument *doc) const;
Q_REQUIRED_RESULT QString toWrappedPlainText() const;
Q_REQUIRED_RESULT QString toCleanPlainText(const QString &plainText = QString()) const;
public Q_SLOTS:
void insertHorizontalRule();
void alignLeft();
......
......@@ -86,9 +86,9 @@ public:
void loadImage(const QImage &image, const QString &matchName, const QString &resourceName);
void addImageHelper(const QString &imageName, const QImage &image, int width = -1, int height = -1);
ImageWithNameList imagesWithName() const;
QList<QSharedPointer<EmbeddedImage> > embeddedImages() const;
QList<QTextImageFormat> embeddedImageFormats() const;
Q_REQUIRED_RESULT ImageWithNameList imagesWithName() const;
Q_REQUIRED_RESULT QList<QSharedPointer<EmbeddedImage> > embeddedImages() const;
Q_REQUIRED_RESULT QList<QTextImageFormat> embeddedImageFormats() const;
void addImageHelper(const QUrl &url, int width = -1, int height = -1);
void insertImage(const QImage &image, const QFileInfo &fileInfo);
......
......@@ -36,7 +36,7 @@ public:
explicit RichTextComposerWidget(QWidget *parent = nullptr);
~RichTextComposerWidget();
KPIMTextEdit::RichTextComposer *richTextComposer() const;
Q_REQUIRED_RESULT KPIMTextEdit::RichTextComposer *richTextComposer() const;
private:
RichTextComposerWidgetPrivate *const d;
};
......
......@@ -33,17 +33,17 @@ public:
explicit RichTextExternalComposer(RichTextComposer *composer, QObject *parent = nullptr);
~RichTextExternalComposer();
bool useExternalEditor() const;
Q_REQUIRED_RESULT bool useExternalEditor() const;
void setUseExternalEditor(bool value);
void startExternalEditor();
void setExternalEditorPath(const QString &path);
QString externalEditorPath() const;
bool checkExternalEditorFinished();
Q_REQUIRED_RESULT QString externalEditorPath() const;
Q_REQUIRED_RESULT bool checkExternalEditorFinished();
void killExternalEditor();
bool isInProgress() const;
Q_REQUIRED_RESULT bool isInProgress() const;
Q_SIGNALS:
void externalEditorClosed();
......
......@@ -32,18 +32,18 @@ class InsertTableWidget : public QWidget
public:
explicit InsertTableWidget(QWidget *parent = nullptr);
~InsertTableWidget();
int columns() const;
int rows() const;
int border() const;
Q_REQUIRED_RESULT int columns() const;
Q_REQUIRED_RESULT int rows() const;
Q_REQUIRED_RESULT int border() const;
void setColumns(int col);
void setRows(int rows);
void setBorder(int border);
QTextLength::Type typeOfLength() const;
Q_REQUIRED_RESULT QTextLength::Type typeOfLength() const;
void setTypeOfLength(QTextLength::Type type);
int length() const;
Q_REQUIRED_RESULT int length() const;
void setLength(int);
private:
......
......@@ -35,7 +35,7 @@ public:
~SelectSpecialCharDialog();
void setCurrentChar(QChar c);
QChar currentChar() const;
Q_REQUIRED_RESULT QChar currentChar() const;
void setOkButtonText(const QString &text);
......
......@@ -54,7 +54,7 @@ public:
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
int slideHeight() const;
Q_REQUIRED_RESULT int slideHeight() const;
Q_INVOKABLE void setSlideHeight(int height);
......
......@@ -37,7 +37,7 @@ public:
* @brief tableCellBackgroundColor
* @return background color of cell.
*/
QColor tableCellBackgroundColor() const;
Q_REQUIRED_RESULT QColor tableCellBackgroundColor() const;
/**
* @brief setTableCellBackgroundColor
......@@ -49,7 +49,7 @@ public:
* @brief verticalAlignment
* @return vertical alignment for current cell.
*/
QTextCharFormat::VerticalAlignment verticalAlignment() const;
Q_REQUIRED_RESULT QTextCharFormat::VerticalAlignment verticalAlignment() const;
/**
* @brief setVerticalAlignment
......@@ -61,7 +61,7 @@ public:
* @brief useBackgroundColor
* @return true if we define background color. Otherwise false and allows to clear it.
*/
bool useBackgroundColor() const;
Q_REQUIRED_RESULT bool useBackgroundColor() const;
private:
class TableCellFormatDialogPrivate;
......
......@@ -33,33 +33,33 @@ public:
explicit TableFormatDialog(QWidget *parent);
~TableFormatDialog();
int columns() const;
int rows() const;
int border() const;
Q_REQUIRED_RESULT int columns() const;
Q_REQUIRED_RESULT int rows() const;
Q_REQUIRED_RESULT int border() const;
void setColumns(int);
void setRows(int);
void setBorder(int);
int padding() const;
Q_REQUIRED_RESULT int padding() const;
void setPadding(int);
int spacing() const;
Q_REQUIRED_RESULT int spacing() const;
void setSpacing(int);
void setAlignment(Qt::Alignment alignment);
Qt::Alignment alignment() const;
Q_REQUIRED_RESULT Qt::Alignment alignment() const;
QTextLength::Type typeOfLength() const;
Q_REQUIRED_RESULT QTextLength::Type typeOfLength() const;
void setTypeOfLength(QTextLength::Type type);
int length() const;
Q_REQUIRED_RESULT int length() const;
void setLength(int);
QColor tableBackgroundColor() const;
Q_REQUIRED_RESULT QColor tableBackgroundColor() const;
void setTableBackgroundColor(const QColor &col);
bool useBackgroundColor() const;
Q_REQUIRED_RESULT bool useBackgroundColor() const;
private:
class TableFormatDialogPrivate;
......
......@@ -35,7 +35,7 @@ public:
explicit TextEditFindBarBase(QWidget *parent = nullptr);
~TextEditFindBarBase() override;
QString text() const;
Q_REQUIRED_RESULT QString text() const;
void setText(const QString &text);
void focusAndSetCursor();
......
......@@ -34,7 +34,7 @@ public:
explicit TextFindWidget(QWidget *parent = nullptr);
~TextFindWidget();
QTextDocument::FindFlags searchOptions() const;
Q_REQUIRED_RESULT QTextDocument::FindFlags searchOptions() const;
QLineEdit *searchLineEdit() const;
......@@ -42,9 +42,9 @@ public:
bool isRegularExpression() const;
QRegExp searchRegExp() const;
Q_REQUIRED_RESULT QRegExp searchRegExp() const;
QString searchText() const;
Q_REQUIRED_RESULT QString searchText() const;
private Q_SLOTS:
void slotAutoSearch(const QString &str);
......
......@@ -50,29 +50,29 @@ public:
Q_DECLARE_FLAGS(SupportFeatures, SupportFeature)
void setSearchSupport(bool b);
bool searchSupport() const;
Q_REQUIRED_RESULT bool searchSupport() const;
bool spellCheckingSupport() const;
Q_REQUIRED_RESULT bool spellCheckingSupport() const;
void setSpellCheckingSupport(bool check);
virtual void setReadOnly(bool readOnly);
void setTextToSpeechSupport(bool b);
bool textToSpeechSupport() const;
Q_REQUIRED_RESULT bool textToSpeechSupport() const;
void setWebShortcutSupport(bool b);
bool webShortcutSupport() const;
Q_REQUIRED_RESULT bool webShortcutSupport() const;
virtual void createHighlighter();
void addIgnoreWords(const QStringList &lst);
bool activateLanguageMenu() const;
Q_REQUIRED_RESULT bool activateLanguageMenu() const;
void setActivateLanguageMenu(bool activate);
Sonnet::Highlighter *highlighter() const;
Q_REQUIRED_RESULT Sonnet::Highlighter *highlighter() const;
bool checkSpellingEnabled() const;
void setCheckSpellingEnabled(bool check);
void setSpellCheckingConfigFileName(const QString &_fileName);
QString spellCheckingConfigFileName() const;
Q_REQUIRED_RESULT QString spellCheckingConfigFileName() const;
const QString &spellCheckingLanguage() const;
void setSpellCheckingLanguage(const QString &_language);
public Q_SLOTS:
......
......@@ -35,18 +35,18 @@ public:
explicit PlainTextEditorWidget(PlainTextEditor *customEditor, QWidget *parent = nullptr);
~PlainTextEditorWidget();
PlainTextEditor *editor() const;
Q_REQUIRED_RESULT PlainTextEditor *editor() const;
void setReadOnly(bool readOnly);
bool isReadOnly() const;
Q_REQUIRED_RESULT bool isReadOnly() const;
void setPlainText(const QString &text);
QString toPlainText() const;
Q_REQUIRED_RESULT QString toPlainText() const;
void clear();
void setSpellCheckingConfigFileName(const QString &_fileName);
bool isEmpty() const;
Q_REQUIRED_RESULT bool isEmpty() const;
private Q_SLOTS:
void slotFind();
void slotReplace();
......
......@@ -53,9 +53,9 @@ public:
Q_DECLARE_FLAGS(SupportFeatures, SupportFeature)
void setSearchSupport(bool b);
bool searchSupport() const;
Q_REQUIRED_RESULT bool searchSupport() const;
bool spellCheckingSupport() const;
Q_REQUIRED_RESULT bool spellCheckingSupport() const;
void setSpellCheckingSupport(bool check);
void setSpellCheckingConfigFileName(const QString &_fileName);
......@@ -69,24 +69,24 @@ public:
virtual void setReadOnly(bool readOnly);
virtual void createHighlighter();
bool textToSpeechSupport() const;
Q_REQUIRED_RESULT bool textToSpeechSupport() const;
void setTextToSpeechSupport(bool b);
Sonnet::Highlighter *highlighter() const;
Q_REQUIRED_RESULT Sonnet::Highlighter *highlighter() const;
bool activateLanguageMenu() const;
Q_REQUIRED_RESULT bool activateLanguageMenu() const;
void setActivateLanguageMenu(bool activate);
void setAllowTabSupport(bool b);
bool allowTabSupport() const;
Q_REQUIRED_RESULT bool allowTabSupport() const;
void setShowAutoCorrectButton(bool b);
bool showAutoCorrectButton() const;
Q_REQUIRED_RESULT bool showAutoCorrectButton() const;
void forceSpellChecking();
QString spellCheckingConfigFileName() const;
Q_REQUIRED_RESULT QString spellCheckingConfigFileName() const;
void setWebShortcutSupport(bool b);
bool webShortcutSupport() const;
Q_REQUIRED_RESULT bool webShortcutSupport() const;
void addIgnoreWords(const QStringList &lst);
......
......@@ -38,23 +38,23 @@ public:
void clear();
RichTextEditor *editor() const;
Q_REQUIRED_RESULT RichTextEditor *editor() const;
void setReadOnly(bool readOnly);
bool isReadOnly() const;
void setHtml(const QString &html);
QString toHtml() const;
Q_REQUIRED_RESULT QString toHtml() const;
void setPlainText(const QString &text);
QString toPlainText() const;
Q_REQUIRED_RESULT QString toPlainText() const;
void setAcceptRichText(bool b);
bool acceptRichText() const;
void setSpellCheckingConfigFileName(const QString &_fileName);
bool isEmpty() const;
Q_REQUIRED_RESULT bool isEmpty() const;
public Q_SLOTS:
void slotFindNext();
void slotFind();
......
......@@ -38,7 +38,7 @@ public:
void setCompleterStringList(const QStringList &list);
QCompleter *completer() const;
Q_REQUIRED_RESULT QCompleter *completer() const;
void completeText();
......
......@@ -36,7 +36,7 @@ public:
bool isReady() const override;
void say(const QString &text) override;
int volume() const override;
Q_REQUIRED_RESULT int volume() const override;
void setVolume(int value) override;
void reloadSettings() override;
......
......@@ -40,12 +40,12 @@ public:
};
Q_ENUMS(State)
State state() const;
Q_REQUIRED_RESULT State state() const;
void setState(KPIMTextEdit::TextToSpeechWidget::State state);
void setTextToSpeechInterface(AbstractTextToSpeechInterface *interface);
bool isReady() const;
Q_REQUIRED_RESULT bool isReady() const;
public Q_SLOTS:
void say(const QString &text);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment