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,
132 QPalette defaultPalette()
const;
139 void contentChanged();
155 void inAppNoteLinkClicked(QString userId, QString shardId, QString noteGuid);
165 void inAppNoteLinkPasteRequested(QString url, QString userId, QString shardId, QString noteGuid);
167 void convertedToNote(
Note note);
170 void noteEditorHtmlUpdated(QString html);
172 void currentNoteChanged(
Note note);
174 void spellCheckerNotReady();
175 void spellCheckerReady();
180 void textBoldState(
bool state);
181 void textItalicState(
bool state);
182 void textUnderlineState(
bool state);
183 void textStrikethroughState(
bool state);
184 void textAlignLeftState(
bool state);
185 void textAlignCenterState(
bool state);
186 void textAlignRightState(
bool state);
187 void textAlignFullState(
bool state);
188 void textInsideOrderedListState(
bool state);
189 void textInsideUnorderedListState(
bool state);
190 void textInsideTableState(
bool state);
192 void textFontFamilyChanged(QString fontFamily);
193 void textFontSizeChanged(
int fontSize);
195 void insertTableDialogRequested();
202 void convertToNote();
209 void pasteUnformatted();
212 void formatSelectionAsSourceCode();
217 void textUnderline();
218 void textStrikethrough();
219 void textHighlight();
226 void findNext(
const QString & text,
const bool matchCase)
const;
227 void findPrevious(
const QString & text,
const bool matchCase)
const;
228 void replace(
const QString & textToReplace,
const QString & replacementText,
const bool matchCase);
229 void replaceAll(
const QString & textToReplace,
const QString & replacementText,
const bool matchCase);
231 void insertToDoCheckbox();
233 void insertInAppNoteLink(
const QString & userId,
const QString & shardId,
const QString & noteGuid,
const QString & linkText);
235 void setSpellcheck(
const bool enabled);
237 void setFont(
const QFont & font);
238 void setFontHeight(
const int height);
239 void setFontColor(
const QColor & color);
240 void setBackgroundColor(
const QColor & color);
257 void setDefaultPalette(
const QPalette & pal);
259 void insertHorizontalLine();
261 void increaseFontSize();
262 void decreaseFontSize();
264 void increaseIndentation();
265 void decreaseIndentation();
267 void insertBulletedList();
268 void insertNumberedList();
270 void insertTableDialog();
271 void insertFixedWidthTable(
const int rows,
const int columns,
const int widthInPixels);
272 void insertRelativeWidthTable(
const int rows,
const int columns,
const double relativeWidth);
273 void insertTableRow();
274 void insertTableColumn();
275 void removeTableRow();
276 void removeTableColumn();
278 void addAttachmentDialog();
279 void saveAttachmentDialog(
const QByteArray & resourceHash);
280 void saveAttachmentUnderCursor();
281 void openAttachment(
const QByteArray & resourceHash);
282 void openAttachmentUnderCursor();
283 void copyAttachment(
const QByteArray & resourceHash);
284 void copyAttachmentUnderCursor();
286 void encryptSelectedText();
287 void decryptEncryptedTextUnderCursor();
289 void editHyperlinkDialog();
290 void copyHyperlink();
291 void removeHyperlink();
293 void onNoteLoadCancelled();
296 virtual void dragMoveEvent(QDragMoveEvent * pEvent) Q_DECL_OVERRIDE;
297 virtual void dropEvent(QDropEvent * pEvent) Q_DECL_OVERRIDE;
305 #endif // LIB_QUENTIER_NOTE_EDITOR_NOTE_EDITOR_H Definition: INoteEditorBackend.h:41
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