summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-15 21:42:02 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-15 21:42:02 (GMT)
commit40d0a5adf74717a5244b33d416bbf1e618d72a2e (patch)
tree66e5302a0c83fc194ebe865af16f43857057a3dc
parent514191218cee42f6c2a9e9e3d00b66a2e537a323 (diff)
Add class to check url from local database
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.cpp34
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.h33
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp59
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h49
4 files changed, 175 insertions, 0 deletions
diff --git a/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.cpp b/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.cpp
new file mode 100644
index 0000000..b6ae472
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.cpp
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "checkphishingurlfromlocaldatabasejobtest.h"
+#include <QTest>
+
+CheckPhishingUrlFromLocalDataBaseJobTest::CheckPhishingUrlFromLocalDataBaseJobTest(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+CheckPhishingUrlFromLocalDataBaseJobTest::~CheckPhishingUrlFromLocalDataBaseJobTest()
+{
+
+}
+
+QTEST_MAIN(CheckPhishingUrlFromLocalDataBaseJobTest)
diff --git a/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.h b/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.h
new file mode 100644
index 0000000..cf89ec5
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/autotests/checkphishingurlfromlocaldatabasejobtest.h
@@ -0,0 +1,33 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CHECKPHISHINGURLFROMLOCALDATABASEJOB_H
+#define CHECKPHISHINGURLFROMLOCALDATABASEJOB_H
+
+#include <QObject>
+
+class CheckPhishingUrlFromLocalDataBaseJobTest : public QObject
+{
+ Q_OBJECT
+public:
+ explicit CheckPhishingUrlFromLocalDataBaseJobTest(QObject *parent = Q_NULLPTR);
+ ~CheckPhishingUrlFromLocalDataBaseJobTest();
+};
+
+#endif // CHECKPHISHINGURLFROMLOCALDATABASEJOB_H
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
new file mode 100644
index 0000000..eec7fd4
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "checkphishingurlfromlocaldatabasejob.h"
+
+using namespace WebEngineViewer;
+
+CheckPhishingUrlFromLocalDataBaseJob::CheckPhishingUrlFromLocalDataBaseJob(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+WebEngineViewer::CheckPhishingUrlFromLocalDataBaseJob::~CheckPhishingUrlFromLocalDataBaseJob()
+{
+
+}
+
+void CheckPhishingUrlFromLocalDataBaseJob::setCheckPhisingUrl(const QUrl &url)
+{
+ mUrl = url;
+}
+
+void CheckPhishingUrlFromLocalDataBaseJob::start()
+{
+ if (mUrl.isValid()) {
+ //TODO
+ deleteLater();
+ } else {
+ //TODO
+ }
+}
+
+bool CheckPhishingUrlFromLocalDataBaseJob::canStart() const
+{
+ return mUrl.isValid();
+}
+
+QString CheckPhishingUrlFromLocalDataBaseJob::createHash()
+{
+ //TODO
+ return {};
+}
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
new file mode 100644
index 0000000..f814a2c
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CHECKPHISHINGURLFROMLOCALDATABASE_H
+#define CHECKPHISHINGURLFROMLOCALDATABASE_H
+
+#include <QObject>
+#include "webengineviewer_export.h"
+#include <QUrl>
+
+namespace WebEngineViewer
+{
+class WEBENGINEVIEWER_EXPORT CheckPhishingUrlFromLocalDataBaseJob : public QObject
+{
+ Q_OBJECT
+public:
+ explicit CheckPhishingUrlFromLocalDataBaseJob(QObject *parent = Q_NULLPTR);
+ ~CheckPhishingUrlFromLocalDataBaseJob();
+ void setCheckPhisingUrl(const QUrl &url);
+
+ void start();
+ bool canStart() const;
+
+ QString createHash();
+
+Q_SIGNALS:
+ void finished();
+
+private:
+ QUrl mUrl;
+};
+}
+#endif // CHECKPHISHINGURLFROMLOCALDATABASE_H