Files
UnrealEngineUWP/Engine/Source/Runtime/Online/BackgroundHTTP/Public/BackgroundHttpNotificationObject.h
henrik karlsson 5db685f97d [Engine]
* Moved dllexport from type to methods/staticvar in all Engine runtime code. This improves compile times, memory and performance in dll builds

[CL 26082269 by henrik karlsson in ue5-main branch]
2023-06-17 18:13:06 -04:00

50 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/UnrealString.h"
#include "CoreMinimal.h"
#include "Delegates/Delegate.h"
#include "HAL/Platform.h"
#include "Internationalization/Text.h"
#include "Templates/SharedPointer.h"
class FBackgroundHttpNotificationObject
: public TSharedFromThis<FBackgroundHttpNotificationObject, ESPMode::ThreadSafe>
{
public:
BACKGROUNDHTTP_API FBackgroundHttpNotificationObject(FText InNotificationTitle, FText InNotificationBody, FText InNotificationAction, const FString& InNotificationActivationString, bool InNotifyOnlyOnFullSuccess);
BACKGROUNDHTTP_API FBackgroundHttpNotificationObject(FText InNotificationTitle, FText InNotificationBody, FText InNotificationAction, const FString& InNotificationActivationString, bool InNotifyOnlyOnFullSuccess, bool bOnlySendNotificationInBackground, int32 InIdOverride);
BACKGROUNDHTTP_API ~FBackgroundHttpNotificationObject();
BACKGROUNDHTTP_API void NotifyOfDownloadResult(bool bWasSuccess);
private:
void OnApp_EnteringBackground();
void OnApp_EnteringForeground();
private:
FText NotificationTitle;
FText NotificationAction;
FText NotificationBody;
FString NotificationActivationString;
bool bOnlySendNotificationInBackground;
bool bNotifyOnlyOnFullSuccess;
volatile bool bIsInBackground;
volatile int32 NumFailedDownloads;
int32 IdOverride;
class ILocalNotificationService* PlatformNotificationService;
FDelegateHandle OnApp_EnteringForegroundHandle;
FDelegateHandle OnApp_EnteringBackgroundHandle;
//No default constructor
FBackgroundHttpNotificationObject() {}
};
typedef TSharedPtr<FBackgroundHttpNotificationObject, ESPMode::ThreadSafe> FBackgroundHttpNotificationObjectPtr;