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> 28 #include <QStringList> 32 QT_FORWARD_DECLARE_CLASS(QUndoStack)
36 QT_FORWARD_DECLARE_CLASS(Account)
37 QT_FORWARD_DECLARE_CLASS(INoteEditorBackend)
38 QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsync)
39 QT_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);
97 void setAccount(
const Account & account);
102 const QUndoStack * undoStack()
const;
107 void setUndoStack(QUndoStack * pUndoStack);
112 void setInitialPageHtml(
const QString & html);
118 void setNoteNotFoundPageHtml(
const QString & html);
125 void setNoteDeletedPageHtml(
const QString & html);
131 void setNoteLoadingPageHtml(
const QString & html);
136 QString currentNoteLocalUid()
const;
145 void setCurrentNoteLocalUid(
const QString & noteLocalUid);
156 bool isModified()
const;
162 bool isEditorPageModified()
const;
168 bool isNoteLoaded()
const;
175 qint64 idleTime()
const;
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,
203 QPalette defaultPalette()
const;
209 const QFont * defaultFont()
const;
216 void contentChanged();
223 void noteAndNotebookFoundInLocalStorage(
Note note,
Notebook notebook);
229 void noteNotFound(QString noteLocalUid);
236 void noteDeleted(QString noteLocalUid);
255 void inAppNoteLinkClicked(
256 QString userId, QString shardId, QString noteGuid);
269 void inAppNoteLinkPasteRequested(
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();
290 void noteSavedToLocalStorage(QString noteLocalUid);
296 void failedToSaveNoteToLocalStorage(
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();
324 void convertToNote();
334 void saveNoteToLocalStorage();
345 void setNoteTitle(
const QString & noteTitle);
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);
422 void setDefaultPalette(
const QPalette & pal);
429 void setDefaultFont(
const QFont & font);
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;
482 #endif // LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H Definition: INoteEditorBackend.h:41
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
Definition: LocalStorageManagerAsync.h:43
Definition: DecryptedTextManager.h:26
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:38
Definition: Notebook.h:34
Definition: SpellChecker.h:35
The NoteEditor class is a widget encapsulating all the functionality necessary for showing and editin...
Definition: NoteEditor.h:45