2015-03-05 00:08:26 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-03-05 06:15:45 -05:00
|
|
|
#include "IDetailCustomization.h"
|
2015-05-26 07:13:31 -04:00
|
|
|
#include "ILocalizationServiceProvider.h"
|
2015-03-05 06:15:45 -05:00
|
|
|
|
|
|
|
|
class ULocalizationTarget;
|
|
|
|
|
class IPropertyHandle;
|
|
|
|
|
class ULocalizationTargetSet;
|
2015-05-26 07:13:31 -04:00
|
|
|
class IDetailCategoryBuilder;
|
2015-03-05 06:15:45 -05:00
|
|
|
|
2015-05-26 07:13:31 -04:00
|
|
|
struct FLocalizationServiceProviderWrapper
|
|
|
|
|
{
|
|
|
|
|
FLocalizationServiceProviderWrapper() : Provider(nullptr) {}
|
|
|
|
|
FLocalizationServiceProviderWrapper(ILocalizationServiceProvider* const InProvider) : Provider(InProvider) {}
|
2015-03-05 00:08:26 -05:00
|
|
|
|
2015-05-26 07:13:31 -04:00
|
|
|
ILocalizationServiceProvider* Provider;
|
|
|
|
|
};
|
2015-03-05 00:08:26 -05:00
|
|
|
|
|
|
|
|
class FLocalizationTargetSetDetailCustomization : public IDetailCustomization
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FLocalizationTargetSetDetailCustomization();
|
|
|
|
|
void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void BuildTargetsList();
|
|
|
|
|
void RebuildTargetsList();
|
|
|
|
|
|
2015-05-26 07:13:31 -04:00
|
|
|
FText GetCurrentServiceProviderDisplayName() const;
|
|
|
|
|
TSharedRef<SWidget> ServiceProviderComboBox_OnGenerateWidget(TSharedPtr<FLocalizationServiceProviderWrapper> LSPWrapper) const;
|
|
|
|
|
void ServiceProviderComboBox_OnSelectionChanged(TSharedPtr<FLocalizationServiceProviderWrapper> LSPWrapper, ESelectInfo::Type SelectInfo);
|
2015-03-05 00:08:26 -05:00
|
|
|
|
2015-05-21 22:15:36 -04:00
|
|
|
bool CanGatherAllTargets() const;
|
2015-03-05 00:08:26 -05:00
|
|
|
void GatherAllTargets();
|
2015-05-21 22:15:36 -04:00
|
|
|
bool CanImportAllTargets() const;
|
2015-03-05 00:08:26 -05:00
|
|
|
void ImportAllTargets();
|
2015-05-21 22:15:36 -04:00
|
|
|
bool CanExportAllTargets() const;
|
2015-03-05 00:08:26 -05:00
|
|
|
void ExportAllTargets();
|
2015-05-21 22:15:36 -04:00
|
|
|
bool CanCountWordsForAllTargets() const;
|
|
|
|
|
void CountWordsForAllTargets();
|
|
|
|
|
bool CanCompileAllTargets() const;
|
2015-03-05 00:08:26 -05:00
|
|
|
void CompileAllTargets();
|
2015-05-21 22:15:36 -04:00
|
|
|
void UpdateTargetFromReports(ULocalizationTarget* const LocalizationTarget);
|
2015-03-05 00:08:26 -05:00
|
|
|
|
|
|
|
|
TSharedRef<ITableRow> OnGenerateRow(TSharedPtr<IPropertyHandle> TargetObjectPropertyHandle, const TSharedRef<STableViewBase>& Table);
|
|
|
|
|
FReply OnNewTargetButtonClicked();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
IDetailLayoutBuilder* DetailLayoutBuilder;
|
|
|
|
|
|
|
|
|
|
TWeakObjectPtr<ULocalizationTargetSet> TargetSet;
|
|
|
|
|
|
2015-05-26 07:13:31 -04:00
|
|
|
IDetailCategoryBuilder* ServiceProviderCategoryBuilder;
|
|
|
|
|
TArray< TSharedPtr<FLocalizationServiceProviderWrapper> > Providers;
|
2015-03-05 00:08:26 -05:00
|
|
|
|
|
|
|
|
TSharedPtr<IPropertyHandle> TargetObjectsPropertyHandle;
|
|
|
|
|
FSimpleDelegate TargetsArrayPropertyHandle_OnNumElementsChanged;
|
|
|
|
|
TArray< TSharedPtr<IPropertyHandle> > TargetsList;
|
|
|
|
|
TSharedPtr< SListView< TSharedPtr<IPropertyHandle> > > TargetsListView;
|
|
|
|
|
|
|
|
|
|
/* If set, the entry at the index specified needs to be initialized as soon as possible. */
|
|
|
|
|
int32 NewEntryIndexToBeInitialized;
|
|
|
|
|
};
|