55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|||
|
|
|
|||
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include "CoreMinimal.h"
|
|||
|
|
#include "SWebBrowser.h"
|
|||
|
|
#include "Widgets/SCompoundWidget.h"
|
|||
|
|
|
|||
|
|
class IHttpResponse;
|
|||
|
|
class IHttpRequest;
|
|||
|
|
/**
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
class DTFLUXRACERESULT_API SDTFluxRaceResultWidget : public SCompoundWidget
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
SLATE_BEGIN_ARGS(SDTFluxRaceResultWidget)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SLATE_END_ARGS()
|
|||
|
|
|
|||
|
|
/** Constructs this widget with InArgs */
|
|||
|
|
void Construct(const FArguments& InArgs);
|
|||
|
|
void OnCookieSet(bool bSuccess);
|
|||
|
|
void LoadSpecificURL(const FString& Url);
|
|||
|
|
void LoadContentViaHTTP();
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
TSharedPtr<SWebBrowser> WebBrowser;
|
|||
|
|
TSharedPtr<IWebBrowserWindow> Browser;
|
|||
|
|
TSharedPtr<IWebBrowserAdapter> BrowserAdapter;
|
|||
|
|
FCreateBrowserWindowSettings WindowSettings;
|
|||
|
|
|
|||
|
|
void OnUrlChanged(const FText& NewUrl);
|
|||
|
|
FString ProcessHTMLContent(const FString& Content, const FString& BaseUrl);
|
|||
|
|
FString ExtractDomain(const FString& Url);
|
|||
|
|
void OnHTTPContentLoaded(TSharedPtr<IHttpRequest> Request, TSharedPtr<IHttpResponse> HttpResponse, bool bWasSuccessful);
|
|||
|
|
bool OnBeforeNavigation(const FString& Url, const FWebNavigationRequest& Request);
|
|||
|
|
void OnLoadCompleted();
|
|||
|
|
void OnLoadStarted();
|
|||
|
|
void OnLoadError();
|
|||
|
|
|
|||
|
|
void OnLoadOverride();
|
|||
|
|
|
|||
|
|
void OnBeforeResourceLoad(FString Url, FString ResourceType, FContextRequestHeaders& AdditionalHeaders, const bool AllowUserCredentials);
|
|||
|
|
|
|||
|
|
FString RaceResultUrl = "https://raceresult.tds-france.com";
|
|||
|
|
FString Username = "sporkrono";
|
|||
|
|
FString Password = "Notre 3ème décennie d'action pour le climat";
|
|||
|
|
|
|||
|
|
|
|||
|
|
void SetupBasicAuth();
|
|||
|
|
};
|