Files
UnrealEngineUWP/Engine/Source/Developer/SlateFileDialogs/Private/SlateFileDialogsModule.cpp
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

69 lines
2.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "SlateFileDialogs.h"
#include "SlateFileDialogsStyles.h"
#include "SlateFileDlgWindow.h"
void FSlateFileDialogsModule::StartupModule()
{
SlateFileDialog = new FSlateFileDialogsModule();
FileDialogStyle = new FSlateFileDialogsStyle;
FileDialogStyle->Initialize();
}
void FSlateFileDialogsModule::ShutdownModule()
{
if (SlateFileDialog != NULL)
{
FileDialogStyle->Shutdown();
delete FileDialogStyle;
delete SlateFileDialog;
SlateFileDialog = NULL;
}
}
bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex)
{
FSlateFileDlgWindow dialog(FileDialogStyle);
return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames, OutFilterIndex);
}
bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{
FSlateFileDlgWindow dialog(FileDialogStyle);
return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}
bool FSlateFileDialogsModule::OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
FString& OutFoldername)
{
FSlateFileDlgWindow dialog(FileDialogStyle);
return dialog.OpenDirectoryDialog(ParentWindowHandle, DialogTitle, DefaultPath, OutFoldername);
}
bool FSlateFileDialogsModule::SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{
FSlateFileDlgWindow dialog(FileDialogStyle);
return dialog.SaveFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}
ISlateFileDialogsModule* FSlateFileDialogsModule::Get()
{
return SlateFileDialog;
}
IMPLEMENT_MODULE(FSlateFileDialogsModule, SlateFileDialogs);