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> 26 #include <quentier/utility/Macros.h> 29 #include <QStringList> 33 QT_FORWARD_DECLARE_CLASS(QUndoStack)
37 QT_FORWARD_DECLARE_CLASS(Account)
38 QT_FORWARD_DECLARE_CLASS(INoteEditorBackend)
39 QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsync)
40 QT_FORWARD_DECLARE_CLASS(SpellChecker)
50 explicit NoteEditor(QWidget * parent =
nullptr, Qt::WindowFlags flags = 0);
74 QThread * pBackgroundJobsThread =
nullptr);
91 void setAccount(
const Account & account);
96 const QUndoStack * undoStack()
const;
101 void setUndoStack(QUndoStack * pUndoStack);
106 void setInitialPageHtml(
const QString & html);
112 void setNoteNotFoundPageHtml(
const QString & html);
119 void setNoteDeletedPageHtml(
const QString & html);
125 void setNoteLoadingPageHtml(
const QString & html);
130 QString currentNoteLocalUid()
const;
139 void setCurrentNoteLocalUid(
const QString & noteLocalUid);
150 bool isModified()
const;
156 bool isEditorPageModified()
const;
162 bool isNoteLoaded()
const;
169 qint64 idleTime()
const;
176 QString selectedText()
const;
177 bool hasSelection()
const;
179 bool spellCheckEnabled()
const;
181 bool print(QPrinter & printer,
ErrorString & errorDescription);
184 const QString & absoluteFilePath,
ErrorString & errorDescription);
187 const QStringList & tagNames, QString & enex,
197 QPalette defaultPalette()
const;
203 const QFont * defaultFont()
const;
210 void contentChanged();
217 void noteAndNotebookFoundInLocalStorage(
Note note,
Notebook notebook);
223 void noteNotFound(QString noteLocalUid);
230 void noteDeleted(QString noteLocalUid);
249 void inAppNoteLinkClicked(QString userId, QString shardId, QString noteGuid);
262 void inAppNoteLinkPasteRequested(
263 QString url, QString userId, QString shardId, QString noteGuid);
265 void convertedToNote(
Note note);
268 void noteEditorHtmlUpdated(QString html);
270 void currentNoteChanged(
Note note);
272 void spellCheckerNotReady();
273 void spellCheckerReady();
283 void noteSavedToLocalStorage(QString noteLocalUid);
289 void failedToSaveNoteToLocalStorage(
290 ErrorString errorDescription, QString noteLocalUid);
294 void textBoldState(
bool state);
295 void textItalicState(
bool state);
296 void textUnderlineState(
bool state);
297 void textStrikethroughState(
bool state);
298 void textAlignLeftState(
bool state);
299 void textAlignCenterState(
bool state);
300 void textAlignRightState(
bool state);
301 void textAlignFullState(
bool state);
302 void textInsideOrderedListState(
bool state);
303 void textInsideUnorderedListState(
bool state);
304 void textInsideTableState(
bool state);
306 void textFontFamilyChanged(QString fontFamily);
307 void textFontSizeChanged(
int fontSize);
309 void insertTableDialogRequested();
317 void convertToNote();
327 void saveNoteToLocalStorage();
338 void setNoteTitle(
const QString & noteTitle);
352 const QStringList & tagLocalUids,
const QStringList & tagGuids);
359 void pasteUnformatted();
362 void formatSelectionAsSourceCode();
367 void textUnderline();
368 void textStrikethrough();
369 void textHighlight();
376 void findNext(
const QString & text,
const bool matchCase)
const;
377 void findPrevious(
const QString & text,
const bool matchCase)
const;
380 const QString & textToReplace,
const QString & replacementText,
381 const bool matchCase);
384 const QString & textToReplace,
const QString & replacementText,
385 const bool matchCase);
387 void insertToDoCheckbox();
389 void insertInAppNoteLink(
390 const QString & userId,
const QString & shardId,
391 const QString & noteGuid,
const QString & linkText);
393 void setSpellcheck(
const bool enabled);
395 void setFont(
const QFont & font);
396 void setFontHeight(
const int height);
397 void setFontColor(
const QColor & color);
398 void setBackgroundColor(
const QColor & color);
415 void setDefaultPalette(
const QPalette & pal);
422 void setDefaultFont(
const QFont & font);
424 void insertHorizontalLine();
426 void increaseFontSize();
427 void decreaseFontSize();
429 void increaseIndentation();
430 void decreaseIndentation();
432 void insertBulletedList();
433 void insertNumberedList();
435 void insertTableDialog();
437 void insertFixedWidthTable(
438 const int rows,
const int columns,
const int widthInPixels);
440 void insertRelativeWidthTable(
441 const int rows,
const int columns,
const double relativeWidth);
443 void insertTableRow();
444 void insertTableColumn();
445 void removeTableRow();
446 void removeTableColumn();
448 void addAttachmentDialog();
449 void saveAttachmentDialog(
const QByteArray & resourceHash);
450 void saveAttachmentUnderCursor();
451 void openAttachment(
const QByteArray & resourceHash);
452 void openAttachmentUnderCursor();
453 void copyAttachment(
const QByteArray & resourceHash);
454 void copyAttachmentUnderCursor();
456 void encryptSelectedText();
457 void decryptEncryptedTextUnderCursor();
459 void editHyperlinkDialog();
460 void copyHyperlink();
461 void removeHyperlink();
463 void onNoteLoadCancelled();
466 virtual void dragMoveEvent(QDragMoveEvent * pEvent)
override;
467 virtual void dropEvent(QDropEvent * pEvent)
override;
475 #endif // LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H Definition: INoteEditorBackend.h:42
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
Definition: LocalStorageManagerAsync.h:44
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:39
Definition: Notebook.h:34
Definition: SpellChecker.h:36
The NoteEditor class is a widget encapsulating all the functionality necessary for showing and editin...
Definition: NoteEditor.h:46