libquentier
0.5.0
The library for rich desktop clients of Evernote service
|
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);
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,
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();
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();
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);
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
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:40
const QFont * defaultFont() const
void initialize(LocalStorageManagerAsync &localStorageManager, SpellChecker &spellChecker, const Account &account, QThread *pBackgroundJobsThread=nullptr)
void noteModified()
noteModified signal is emitted when the note's content within the editor gets modified via some way -...
Definition: INoteEditorBackend.h:43
void inAppNoteLinkPasteRequested(QString url, QString userId, QString shardId, QString noteGuid)
INoteEditorBackend * backend()
void setBackend(INoteEditorBackend *backend)
void setInitialPageHtml(const QString &html)
void contentChanged()
contentChanged signal is emitted when the note's content (text) gets modified via manual editing (i....
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:44
void setNoteLoadingPageHtml(const QString &html)
QPalette defaultPalette() const
void noteAndNotebookFoundInLocalStorage(Note note, Notebook notebook)
noteAndNotebookFoundInLocalStorage signal is emitted when note and its corresponding notebook were fo...
Definition: SpellChecker.h:37
void setCurrentNoteLocalUid(const QString ¬eLocalUid)
Definition: Notebook.h:35
void setNoteTitle(const QString ¬eTitle)
void failedToSaveNoteToLocalStorage(ErrorString errorDescription, QString noteLocalUid)
failedToSaveNoteToLocalStorage signal is emitted in case of failure to save the note to local storage
void notifyError(ErrorString error)
notifyError signal is emitted when NoteEditor encounters some problem worth letting the user to know ...
void setDefaultFont(const QFont &font)
void noteDeleted(QString noteLocalUid)
noteDeleted signal is emitted when the note displayed within the note editor is deleted....
void setNoteNotFoundPageHtml(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...
The NoteEditor class is a widget encapsulating all the functionality necessary for showing and editin...
Definition: NoteEditor.h:47
bool isNoteLoaded() const
void setDefaultPalette(const QPalette &pal)
bool isEditorPageModified() const
void setAccount(const Account &account)
void setNoteDeletedPageHtml(const QString &html)
QString currentNoteLocalUid() const
void setUndoStack(QUndoStack *pUndoStack)
const QUndoStack * undoStack() const
void setTagIds(const QStringList &tagLocalUids, const QStringList &tagGuids)
void saveNoteToLocalStorage()
void noteSavedToLocalStorage(QString noteLocalUid)
noteSavedToLocalStorage signal is emitted when the note has been saved within the local storage....
Definition: LocalStorageManagerAsync.h:45
void inAppNoteLinkClicked(QString userId, QString shardId, QString noteGuid)
inAppNoteLinkClicked signal is emitted when the in-app note link is clicked within the note editor