summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-21 07:21:59 +0200
committerMontel Laurent <[email protected]>2017-05-21 07:21:59 +0200
commit3bddf9b3ddb936d072d1f777402311efe2651422 (patch)
tree3c398dcb21141b9585da95f76a32fc5ac6ff176c
parent7e3dc77a17ca46c670fe41035e3767fc74d5ca1e (diff)
Look for using KF5::SyntaxHighlighting
-rw-r--r--plugins/messageviewer/bodypartformatter/xdiff/CMakeLists.txt7
-rw-r--r--plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.cpp35
-rw-r--r--plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.h35
3 files changed, 75 insertions, 2 deletions
diff --git a/plugins/messageviewer/bodypartformatter/xdiff/CMakeLists.txt b/plugins/messageviewer/bodypartformatter/xdiff/CMakeLists.txt
index 9ff3d64..7b63d74 100644
--- a/plugins/messageviewer/bodypartformatter/xdiff/CMakeLists.txt
+++ b/plugins/messageviewer/bodypartformatter/xdiff/CMakeLists.txt
@@ -1,8 +1,11 @@
add_definitions(-DTRANSLATION_DOMAIN=\"messageviewer_text_xdiff_plugin\")
-set(messageviewer_bodypartformatter_text_xdiff_PART_SRCS text_xdiff.cpp)
+set(messageviewer_bodypartformatter_text_xdiff_PART_SRCS text_xdiff.cpp diffhighlighter.cpp)
+
add_library(messageviewer_bodypartformatter_text_xdiff MODULE ${messageviewer_bodypartformatter_text_xdiff_PART_SRCS})
-target_link_libraries(messageviewer_bodypartformatter_text_xdiff Qt5::Core KF5::I18n KF5::CoreAddons KF5::IconThemes KF5::WidgetsAddons KF5::MessageViewer)
+
+target_link_libraries(messageviewer_bodypartformatter_text_xdiff Qt5::Core KF5::I18n KF5::CoreAddons KF5::IconThemes KF5::WidgetsAddons KF5::MessageViewer KF5::SyntaxHighlighting)
+
install(TARGETS messageviewer_bodypartformatter_text_xdiff DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES text_xdiff.desktop DESTINATION ${KDE_INSTALL_DATADIR}/messageviewer/plugins/bodypartformatter)
diff --git a/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.cpp b/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.cpp
new file mode 100644
index 0000000..d1b1374
--- /dev/null
+++ b/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.cpp
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "diffhighlighter.h"
+
+DiffHighlighter::DiffHighlighter()
+{
+
+}
+
+DiffHighlighter::~DiffHighlighter()
+{
+
+}
+
+void DiffHighlighter::applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format)
+{
+ //TODO
+}
diff --git a/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.h b/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.h
new file mode 100644
index 0000000..6f8030e
--- /dev/null
+++ b/plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef DIFFHIGHLIGHTER_H
+#define DIFFHIGHLIGHTER_H
+
+#include <KSyntaxHighlighting/AbstractHighlighter>
+
+class DiffHighlighter : public KSyntaxHighlighting::AbstractHighlighter
+{
+public:
+ DiffHighlighter();
+ ~DiffHighlighter();
+
+protected:
+ void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format) Q_DECL_OVERRIDE;
+};
+
+#endif // DIFFHIGHLIGHTER_H