From efa3677d69dc6011a73a0b796648fb6266053fee Mon Sep 17 00:00:00 2001 From: Tim Blume Date: Sat, 2 Jan 2021 00:19:42 +0100 Subject: [PATCH] api started --- CMakeLists.txt | 2 ++ editandresend.ui | 16 +++++++++++----- include/httpreceiver.h | 18 ++++++++++++++++++ include/httpsender.h | 21 +++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 include/httpreceiver.h create mode 100644 include/httpsender.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 319624f..8886500 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ add_executable(littlesnitch editandresend.h addonhandler.h include/api.h + include/httpsender.h + include/httpreceiver.h mainwindow.ui editandresend.ui ) diff --git a/editandresend.ui b/editandresend.ui index 207a77a..14498e8 100644 --- a/editandresend.ui +++ b/editandresend.ui @@ -78,12 +78,12 @@ 10 120 - 781 - 404 + 881 + 441 - + 1 1 @@ -110,14 +110,20 @@ QLayout::SetMaximumSize - + - + 1 1 + + + 200 + 200 + + 1 diff --git a/include/httpreceiver.h b/include/httpreceiver.h new file mode 100644 index 0000000..4775304 --- /dev/null +++ b/include/httpreceiver.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +namespace http { + +#define HTTPReceiverInterfaceIID "bigsnitch.api.HTTPReceiverInterface/100" + +class ReceiverInterface { + +public: + virtual ~ReceiverInterface() = default; +}; + +} + +Q_DECLARE_INTERFACE(http::ReceiverInterface, HTTPReceiverInterfaceIID) diff --git a/include/httpsender.h b/include/httpsender.h new file mode 100644 index 0000000..a4906b1 --- /dev/null +++ b/include/httpsender.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace http { + +#define HTTPSenderInterfaceIID "bigsnitch.api.HTTPSenderInterface/100" + +class SenderInterface { + +public: + virtual ~SenderInterface() = default; + virtual int send(http::Request request); + virtual bool received(int id); + virtual std::optional receive(int id); +}; + +} + +Q_DECLARE_INTERFACE(http::SenderInterface, HTTPSenderInterfaceIID)