19#ifndef LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H
20#define LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H
22#include <quentier/types/ErrorString.h>
23#include <quentier/types/Note.h>
24#include <quentier/types/Notebook.h>
25#include <quentier/utility/Linkage.h>
32QT_FORWARD_DECLARE_CLASS(QUndoStack)
36QT_FORWARD_DECLARE_CLASS(Account)
37QT_FORWARD_DECLARE_CLASS(INoteEditorBackend)
38QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsync)
39QT_FORWARD_DECLARE_CLASS(SpellChecker)
50 QWidget * parent =
nullptr,
51#
if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
52 Qt::WindowFlags flags = {});
54 Qt::WindowFlags flags = 0);
80 QThread * pBackgroundJobsThread =
nullptr);
182 QString selectedText()
const;
183 bool hasSelection()
const;
185 bool spellCheckEnabled()
const;
187 bool print(QPrinter & printer,
ErrorString & errorDescription);
190 const QString & absoluteFilePath,
ErrorString & errorDescription);
193 const QStringList & tagNames, QString & enex,
256 QString userId, QString shardId, QString noteGuid);
270 QString url, QString userId, QString shardId, QString noteGuid);
272 void convertedToNote(
Note note);
275 void noteEditorHtmlUpdated(QString html);
277 void currentNoteChanged(
Note note);
279 void spellCheckerNotReady();
280 void spellCheckerReady();
297 ErrorString errorDescription, QString noteLocalUid);
301 void textBoldState(
bool state);
302 void textItalicState(
bool state);
303 void textUnderlineState(
bool state);
304 void textStrikethroughState(
bool state);
305 void textAlignLeftState(
bool state);
306 void textAlignCenterState(
bool state);
307 void textAlignRightState(
bool state);
308 void textAlignFullState(
bool state);
309 void textInsideOrderedListState(
bool state);
310 void textInsideUnorderedListState(
bool state);
311 void textInsideTableState(
bool state);
313 void textFontFamilyChanged(QString fontFamily);
314 void textFontSizeChanged(
int fontSize);
316 void insertTableDialogRequested();
359 const QStringList & tagLocalUids,
const QStringList & tagGuids);
366 void pasteUnformatted();
369 void formatSelectionAsSourceCode();
374 void textUnderline();
375 void textStrikethrough();
376 void textHighlight();
383 void findNext(
const QString & text,
const bool matchCase)
const;
384 void findPrevious(
const QString & text,
const bool matchCase)
const;
387 const QString & textToReplace,
const QString & replacementText,
388 const bool matchCase);
391 const QString & textToReplace,
const QString & replacementText,
392 const bool matchCase);
394 void insertToDoCheckbox();
396 void insertInAppNoteLink(
397 const QString & userId,
const QString & shardId,
398 const QString & noteGuid,
const QString & linkText);
400 void setSpellcheck(
const bool enabled);
402 void setFont(
const QFont & font);
403 void setFontHeight(
const int height);
404 void setFontColor(
const QColor & color);
405 void setBackgroundColor(
const QColor & color);
431 void insertHorizontalLine();
433 void increaseFontSize();
434 void decreaseFontSize();
436 void increaseIndentation();
437 void decreaseIndentation();
439 void insertBulletedList();
440 void insertNumberedList();
442 void insertTableDialog();
444 void insertFixedWidthTable(
445 const int rows,
const int columns,
const int widthInPixels);
447 void insertRelativeWidthTable(
448 const int rows,
const int columns,
const double relativeWidth);
450 void insertTableRow();
451 void insertTableColumn();
452 void removeTableRow();
453 void removeTableColumn();
455 void addAttachmentDialog();
456 void saveAttachmentDialog(
const QByteArray & resourceHash);
457 void saveAttachmentUnderCursor();
458 void openAttachment(
const QByteArray & resourceHash);
459 void openAttachmentUnderCursor();
460 void copyAttachment(
const QByteArray & resourceHash);
461 void copyAttachmentUnderCursor();
463 void encryptSelectedText();
464 void decryptEncryptedTextUnderCursor();
466 void editHyperlinkDialog();
467 void copyHyperlink();
468 void removeHyperlink();
470 void onNoteLoadCancelled();
473 virtual void dragMoveEvent(QDragMoveEvent * pEvent)
override;
474 virtual void dropEvent(QDropEvent * pEvent)
override;
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition Account.h:39
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:44
Definition INoteEditorBackend.h:42
Definition LocalStorageManagerAsync.h:44
The NoteEditor class is a widget encapsulating all the functionality necessary for showing and editin...
Definition NoteEditor.h:46
void setNoteLoadingPageHtml(const QString &html)
void noteNotFound(QString noteLocalUid)
noteNotFound signal is emitted when the note could not be found within the local storage by the provi...
bool isNoteLoaded() const
void setAccount(const Account &account)
void setBackend(INoteEditorBackend *backend)
void notifyError(ErrorString error)
notifyError signal is emitted when NoteEditor encounters some problem worth letting the user to know ...
QPalette defaultPalette() const
void setUndoStack(QUndoStack *pUndoStack)
void setNoteNotFoundPageHtml(const QString &html)
void setInitialPageHtml(const QString &html)
void setDefaultFont(const QFont &font)
void inAppNoteLinkClicked(QString userId, QString shardId, QString noteGuid)
inAppNoteLinkClicked signal is emitted when the in-app note link is clicked within the note editor
INoteEditorBackend * backend()
void noteModified()
noteModified signal is emitted when the note's content within the editor gets modified via some way -...
void failedToSaveNoteToLocalStorage(ErrorString errorDescription, QString noteLocalUid)
failedToSaveNoteToLocalStorage signal is emitted in case of failure to save the note to local storage
void saveNoteToLocalStorage()
void initialize(LocalStorageManagerAsync &localStorageManager, SpellChecker &spellChecker, const Account &account, QThread *pBackgroundJobsThread=nullptr)
void noteDeleted(QString noteLocalUid)
noteDeleted signal is emitted when the note displayed within the note editor is deleted....
void noteAndNotebookFoundInLocalStorage(Note note, Notebook notebook)
noteAndNotebookFoundInLocalStorage signal is emitted when note and its corresponding notebook were fo...
void setNoteDeletedPageHtml(const QString &html)
void noteSavedToLocalStorage(QString noteLocalUid)
noteSavedToLocalStorage signal is emitted when the note has been saved within the local storage....
void inAppNoteLinkPasteRequested(QString url, QString userId, QString shardId, QString noteGuid)
void setNoteTitle(const QString ¬eTitle)
void contentChanged()
contentChanged signal is emitted when the note's content (text) gets modified via manual editing (i....
void setDefaultPalette(const QPalette &pal)
QString currentNoteLocalUid() const
void setTagIds(const QStringList &tagLocalUids, const QStringList &tagGuids)
bool isEditorPageModified() const
const QUndoStack * undoStack() const
const QFont * defaultFont() const
void setCurrentNoteLocalUid(const QString ¬eLocalUid)
Definition SpellChecker.h:36