19 #ifndef LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H 20 #define LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H 22 #include <quentier/types/Note.h> 23 #include <quentier/utility/Macros.h> 24 #include <quentier/utility/Linkage.h> 25 #include <quentier/types/ErrorString.h> 28 #include <QStringList> 30 QT_FORWARD_DECLARE_CLASS(QUndoStack)
34 QT_FORWARD_DECLARE_CLASS(Account)
35 QT_FORWARD_DECLARE_CLASS(Notebook)
36 QT_FORWARD_DECLARE_CLASS(INoteEditorBackend)
37 QT_FORWARD_DECLARE_CLASS(FileIOProcessorAsync)
38 QT_FORWARD_DECLARE_CLASS(SpellChecker)
47 explicit NoteEditor(QWidget * parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
67 void setAccount(
const Account & account);
72 const QUndoStack * undoStack()
const;
77 void setUndoStack(QUndoStack * pUndoStack);
82 void setBlankPageHtml(
const QString & html);
87 QString currentNoteLocalUid()
const;
92 void setNoteAndNotebook(
const Note & note,
const Notebook & notebook);
102 bool isModified()
const;
108 bool isNoteLoaded()
const;
115 QString selectedText()
const;
116 bool hasSelection()
const;
118 bool spellCheckEnabled()
const;
120 bool print(QPrinter & printer,
ErrorString & errorDescription);
121 bool exportToPdf(
const QString & absoluteFilePath,
ErrorString & errorDescription);
122 bool exportToEnex(
const QStringList & tagNames,
130 void contentChanged();
146 void inAppNoteLinkClicked(QString userId, QString shardId, QString noteGuid);
156 void inAppNoteLinkPasteRequested(QString url, QString userId, QString shardId, QString noteGuid);
158 void convertedToNote(
Note note);
161 void noteEditorHtmlUpdated(QString html);
163 void currentNoteChanged(
Note note);
165 void spellCheckerNotReady();
166 void spellCheckerReady();
171 void textBoldState(
bool state);
172 void textItalicState(
bool state);
173 void textUnderlineState(
bool state);
174 void textStrikethroughState(
bool state);
175 void textAlignLeftState(
bool state);
176 void textAlignCenterState(
bool state);
177 void textAlignRightState(
bool state);
178 void textAlignFullState(
bool state);
179 void textInsideOrderedListState(
bool state);
180 void textInsideUnorderedListState(
bool state);
181 void textInsideTableState(
bool state);
183 void textFontFamilyChanged(QString fontFamily);
184 void textFontSizeChanged(
int fontSize);
186 void insertTableDialogRequested();
193 void convertToNote();
200 void pasteUnformatted();
203 void formatSelectionAsSourceCode();
208 void textUnderline();
209 void textStrikethrough();
210 void textHighlight();
217 void findNext(
const QString & text,
const bool matchCase)
const;
218 void findPrevious(
const QString & text,
const bool matchCase)
const;
219 void replace(
const QString & textToReplace,
const QString & replacementText,
const bool matchCase);
220 void replaceAll(
const QString & textToReplace,
const QString & replacementText,
const bool matchCase);
222 void insertToDoCheckbox();
224 void insertInAppNoteLink(
const QString & userId,
const QString & shardId,
const QString & noteGuid,
const QString & linkText);
226 void setSpellcheck(
const bool enabled);
228 void setFont(
const QFont & font);
229 void setFontHeight(
const int height);
230 void setFontColor(
const QColor & color);
231 void setBackgroundColor(
const QColor & color);
233 void insertHorizontalLine();
235 void increaseFontSize();
236 void decreaseFontSize();
238 void increaseIndentation();
239 void decreaseIndentation();
241 void insertBulletedList();
242 void insertNumberedList();
244 void insertTableDialog();
245 void insertFixedWidthTable(
const int rows,
const int columns,
const int widthInPixels);
246 void insertRelativeWidthTable(
const int rows,
const int columns,
const double relativeWidth);
247 void insertTableRow();
248 void insertTableColumn();
249 void removeTableRow();
250 void removeTableColumn();
252 void addAttachmentDialog();
253 void saveAttachmentDialog(
const QByteArray & resourceHash);
254 void saveAttachmentUnderCursor();
255 void openAttachment(
const QByteArray & resourceHash);
256 void openAttachmentUnderCursor();
257 void copyAttachment(
const QByteArray & resourceHash);
258 void copyAttachmentUnderCursor();
260 void encryptSelectedText();
261 void decryptEncryptedTextUnderCursor();
263 void editHyperlinkDialog();
264 void copyHyperlink();
265 void removeHyperlink();
267 void onNoteLoadCancelled();
270 virtual void dragMoveEvent(QDragMoveEvent * pEvent) Q_DECL_OVERRIDE;
271 virtual void dropEvent(QDropEvent * pEvent) Q_DECL_OVERRIDE;
279 #endif // LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H Definition: INoteEditorBackend.h:40
The FileIOProcessorAsync class is a wrapper under simple file IO operations, it is meant to be used f...
Definition: FileIOProcessorAsync.h:39
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:38
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:24
Definition: Notebook.h:38
Definition: SpellChecker.h:34
The NoteEditor class is a widget encapsulating all the functionality necessary for showing and editin...
Definition: NoteEditor.h:43