KTextEditor::ModificationInterface
#include <KTextEditor/ModificationInterface>

Public Types | |
enum | ModifiedOnDiskReason { OnDiskUnmodified = 0, OnDiskModified = 1, OnDiskCreated = 2, OnDiskDeleted = 3 } |
Public Member Functions | |
virtual | ~ModificationInterface () |
virtual void | modifiedOnDisk (KTextEditor::Document *document, bool isModified, KTextEditor::ModificationInterface::ModifiedOnDiskReason reason)=0 |
virtual void | setModifiedOnDisk (ModifiedOnDiskReason reason)=0 |
virtual void | setModifiedOnDiskWarning (bool on)=0 |
Detailed Description
External modification extension interface for the Document.
Introduction
The class ModificationInterface provides methods to handle modifications of all opened files caused by external programs. Whenever the modified-on-disk state changes the signal modifiedOnDisk() is emitted along with a ModifiedOnDiskReason. Set the state by calling setModifiedOnDisk(). Whether the Editor should show warning dialogs to inform the user about external modified files can be controlled with setModifiedOnDiskWarning(). The slot modifiedOnDisk() is called to ask the user what to do whenever a file was modified.
Accessing the ModificationInterface
The ModificationInterface is supposed to be an extension interface for a Document, i.e. the Document inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:
- See also
- KTextEditor::Document
Definition at line 61 of file modificationinterface.h.
Member Enumeration Documentation
◆ ModifiedOnDiskReason
Reasons why a document is modified on disk.
Enumerator | |
---|---|
OnDiskUnmodified | Not modified. |
OnDiskModified | The file was modified on disk. |
OnDiskCreated | The file was created on disk. |
OnDiskDeleted | The file was deleted on disk. |
Definition at line 75 of file modificationinterface.h.
Constructor & Destructor Documentation
◆ ~ModificationInterface()
|
virtualdefault |
Virtual destructor.
Member Function Documentation
◆ modifiedOnDisk()
|
pure virtual |
This signal is emitted whenever the document
changed its modified-on-disk state.
- Parameters
-
document the Document object that represents the file on disk isModified if true, the file was modified rather than created or deleted reason the reason why the signal was emitted
- See also
- setModifiedOnDisk()
◆ setModifiedOnDisk()
|
pure virtual |
Set the document's modified-on-disk state to reason
.
KTextEditor implementations should emit the signal modifiedOnDisk() along with the reason. When the document is in a clean state again the reason should be ModifiedOnDiskReason::OnDiskUnmodified.
- Parameters
-
reason the modified-on-disk reason.
- See also
- ModifiedOnDiskReason, modifiedOnDisk()
Implemented in KTextEditor.
◆ setModifiedOnDiskWarning()
|
pure virtual |
Control, whether the editor should show a warning dialog whenever a file was modified on disk.
If on
is true the editor will show warning dialogs.
- Parameters
-
on controls, whether the editor should show a warning dialog for files modified on disk
Implemented in KTextEditor.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 03:55:38 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.