File indexing completed on 2024-12-15 04:51:47
0001 /* 0002 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include <QWidget> 0009 0010 #include "noteshared_export.h" 0011 0012 class KJob; 0013 0014 namespace NoteShared 0015 { 0016 class CreateNewNoteJobPrivate; 0017 class NOTESHARED_EXPORT CreateNewNoteJob : public QObject 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit CreateNewNoteJob(QObject *parent = nullptr, QWidget *widget = nullptr); 0022 ~CreateNewNoteJob() override; 0023 0024 void setNote(const QString &name, const QString &text); 0025 0026 void start(); 0027 0028 void setRichText(bool richText); 0029 0030 Q_SIGNALS: 0031 void selectNewCollection(); 0032 0033 private: 0034 void slotNoteCreationFinished(KJob *); 0035 0036 void slotFetchCollection(KJob *job); 0037 void slotCollectionModifyFinished(KJob *job); 0038 void slotSelectNewCollection(); 0039 void createFetchCollectionJob(bool useSettings); 0040 QString mTitle; 0041 QString mText; 0042 bool mRichText = false; 0043 QWidget *const mWidget; 0044 }; 0045 }