KParts

readwritepart.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: 1999 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef _KPARTS_READWRITEPART_H
10 #define _KPARTS_READWRITEPART_H
11 
12 #include <kparts/readonlypart.h>
13 
14 
15 namespace KParts
16 {
17 
18 class ReadWritePartPrivate;
19 
37 class KPARTS_EXPORT ReadWritePart : public ReadOnlyPart
38 {
39  Q_OBJECT
40 
41  KPARTS_DECLARE_PRIVATE(ReadWritePart)
42 
43 public:
48  explicit ReadWritePart(QObject *parent = nullptr);
57  ~ReadWritePart() override;
58 
62  bool isReadWrite() const;
63 
68  virtual void setReadWrite(bool readwrite = true);
69 
73  bool isModified() const;
74 
83  virtual bool queryClose();
84 
96  bool closeUrl() override;
97 
106  virtual bool closeUrl(bool promptToSave);
107 
113  virtual bool saveAs(const QUrl &url);
114 
118  virtual void setModified(bool modified);
119 
120 Q_SIGNALS:
126  void sigQueryClose(bool *handled, bool *abortClosing);
127 
128 public Q_SLOTS:
134  void setModified();
135 
141  virtual bool save();
142 
147  bool waitSaveComplete();
148 
149 protected:
161  virtual bool saveFile() = 0;
162 
171  virtual bool saveToUrl();
172 
173 private:
174  Q_PRIVATE_SLOT(d_func(), void _k_slotUploadFinished(KJob *job))
175 
176  Q_DISABLE_COPY(ReadWritePart)
177 };
178 
179 } // namespace
180 
181 #endif
Base class for an "editor" part.
Definition: readwritepart.h:37
The KParts namespace,.
Base class for any "viewer" part.
Definition: readonlypart.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:55:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.