api started

This commit is contained in:
Tim Blume 2021-01-02 00:19:42 +01:00
parent 4d5f0fd233
commit efa3677d69
4 changed files with 52 additions and 5 deletions

View file

@ -36,6 +36,8 @@ add_executable(littlesnitch
editandresend.h
addonhandler.h
include/api.h
include/httpsender.h
include/httpreceiver.h
mainwindow.ui
editandresend.ui
)

View file

@ -78,12 +78,12 @@
<rect>
<x>10</x>
<y>120</y>
<width>781</width>
<height>404</height>
<width>881</width>
<height>441</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Expanding">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
@ -110,14 +110,20 @@
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item row="0" column="0">
<item row="0" column="0" colspan="2">
<widget class="QSplitter" name="splitter_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>

18
include/httpreceiver.h Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include <include/api.h>
#include <QObject>
namespace http {
#define HTTPReceiverInterfaceIID "bigsnitch.api.HTTPReceiverInterface/100"
class ReceiverInterface {
public:
virtual ~ReceiverInterface() = default;
};
}
Q_DECLARE_INTERFACE(http::ReceiverInterface, HTTPReceiverInterfaceIID)

21
include/httpsender.h Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <include/api.h>
#include <QObject>
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<http::Response> receive(int id);
};
}
Q_DECLARE_INTERFACE(http::SenderInterface, HTTPSenderInterfaceIID)