File indexing completed on 2024-04-28 05:42:49
0001 /* 0002 SPDX-FileCopyrightText: 2002-2003 Otto Bruggeman <otto.bruggeman@home.nl> 0003 0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef _KOMPARE_INTERFACE_H 0008 #define _KOMPARE_INTERFACE_H 0009 0010 #include <QString> 0011 #include <QStringList> 0012 #include <QtPlugin> 0013 0014 #include "kompareinterface_export.h" 0015 0016 class KConfig; 0017 class QUrl; 0018 0019 class KompareInterfacePrivate; 0020 0021 class KOMPAREINTERFACE_EXPORT KompareInterface 0022 { 0023 public: 0024 KompareInterface(); 0025 virtual ~KompareInterface(); 0026 0027 protected: 0028 KompareInterface(const KompareInterface&); 0029 KompareInterface& operator=(const KompareInterface&); 0030 0031 public: 0032 /** 0033 * Open and parse the diff file at url. 0034 */ 0035 virtual bool openDiff(const QUrl& diffUrl) = 0; 0036 0037 /** 0038 * Open and parse the supplied diff output 0039 */ 0040 virtual bool openDiff(const QString& diffOutput) = 0; 0041 0042 /** 0043 * Open and parse the diff3 file at url. 0044 */ 0045 virtual bool openDiff3(const QUrl& diff3Url) = 0; 0046 0047 /** 0048 * Open and parse the supplied diff3 output 0049 */ 0050 virtual bool openDiff3(const QString& diff3Output) = 0; 0051 0052 /** 0053 * Compare, with diff, source with destination, can also be used if you do not 0054 * know what source and destination are. The part will try to figure out what 0055 * they are (directory, file, diff output file) and call the 0056 * appropriate method(s) 0057 */ 0058 virtual void compare(const QUrl& sourceFile, const QUrl& destinationFile) = 0; 0059 0060 /** 0061 * Compare a Source file to a custom Destination string 0062 */ 0063 virtual void compareFileString(const QUrl& sourceFile, const QString& destination) = 0; 0064 0065 /** 0066 * Compare a custom Source string to a Destination file 0067 */ 0068 virtual void compareStringFile(const QString& source, const QUrl& destinationFile) = 0; 0069 0070 /** 0071 * Compare, with diff, source with destination files 0072 */ 0073 virtual void compareFiles(const QUrl& sourceFile, const QUrl& destinationFile) = 0; 0074 0075 /** 0076 * Compare, with diff, source with destination directories 0077 */ 0078 virtual void compareDirs(const QUrl& sourceDir, const QUrl& destinationDir) = 0; 0079 0080 /** 0081 * Compare, with diff3, originalFile with changedFile1 and changedFile2 0082 */ 0083 virtual void compare3Files(const QUrl& originalFile, const QUrl& changedFile1, const QUrl& changedFile2) = 0; 0084 0085 /** 0086 * This will show the file and the file with the diff applied 0087 */ 0088 virtual void openFileAndDiff(const QUrl& file, const QUrl& diffFile) = 0; 0089 0090 /** 0091 * This will show the directory and the directory with the diff applied 0092 */ 0093 virtual void openDirAndDiff(const QUrl& dir, const QUrl& diffFile) = 0; 0094 0095 /** 0096 * This will set the encoding to use for all files that are read or for the diffoutput 0097 */ 0098 virtual void setEncoding(const QString& encoding); 0099 0100 public: 0101 /** 0102 * Warning this should be in class Part in KDE 4.0, not here ! 0103 * Around that time the methods will disappear here 0104 */ 0105 virtual int readProperties(KConfig* config) = 0; 0106 virtual int saveProperties(KConfig* config) = 0; 0107 0108 /** 0109 * Warning this should be in class ReadWritePart in KDE 4.0, not here ! 0110 * Around that time the method will disappear here 0111 */ 0112 virtual bool queryClose() = 0; 0113 0114 protected: 0115 // Add all variables to the KompareInterfacePrivate class and access them through the kip pointer 0116 KompareInterfacePrivate* kip; 0117 QString m_encoding; 0118 }; 0119 0120 Q_DECLARE_INTERFACE(KompareInterface, "com.kde.Kompare.KompareInterface/4.0") 0121 0122 #endif /* _KOMPARE_INTERFACE_H */