123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- /*******************************************************************************
- The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
- Technology released in source code form as part of the game integration package.
- The content of this file may not be used without valid licenses to the
- AUDIOKINETIC Wwise Technology.
- Note that the use of the game engine is subject to the Unreal(R) Engine End User
- License Agreement at https://www.unrealengine.com/en-US/eula/unreal
-
- License Usage
-
- Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
- this file in accordance with the end user license agreement provided with the
- software or, alternatively, in accordance with the terms contained
- in a written agreement between you and Audiokinetic Inc.
- Copyright (c) 2023 Audiokinetic Inc.
- *******************************************************************************/
- /*------------------------------------------------------------------------------------
- AkWaapiFieldNames.h
- ------------------------------------------------------------------------------------*/
- #pragma once
- /*------------------------------------------------------------------------------------
- SAkWaapiFieldNames
- ------------------------------------------------------------------------------------*/
- #include "Misc/TextFilter.h"
- #include "Widgets/Views/STableRow.h"
- #include "Widgets/Views/STreeView.h"
- #include "Kismet/BlueprintFunctionLibrary.h"
- #include "Widgets/Input/SSearchBox.h"
- #include "AkWaapiFieldNames.generated.h"
- /**
- * Structure for Field Names
- */
- USTRUCT(BlueprintType)
- struct AKAUDIO_API FAkWaapiFieldNames
- {
- GENERATED_BODY()
-
- /**
- * The Field Name
- */
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = FieldName, meta = (DisplayName = "Field Name"))
- FString FieldName;
- };
- /*------------------------------------------------------------------------------------
- USAkWaapiFieldNamesConv
- ------------------------------------------------------------------------------------*/
- UCLASS()
- class AKAUDIO_API USAkWaapiFieldNamesConv : public UBlueprintFunctionLibrary
- {
- GENERATED_BODY()
- public:
- USAkWaapiFieldNamesConv(const class FObjectInitializer& ObjectInitializer);
- /** Converts an AkWaapiFieldName value to a string */
- UFUNCTION(BlueprintPure, meta = (DisplayName = "ToString (FAkWaapiFieldNames)", CompactNodeTitle = "->", BlueprintAutocast), Category = "Utilities|String")
- static FString Conv_FAkWaapiFieldNamesToString(const FAkWaapiFieldNames& INAkWaapiFieldNames);
- /** Converts an AkWaapiFieldName value to a localizable text */
- UFUNCTION(BlueprintPure, meta = (DisplayName = "ToText (FAkWaapiFieldNames)", CompactNodeTitle = "->", BlueprintAutocast), Category = "Utilities|Text")
- static FText Conv_FAkWaapiFieldNamesToText(const FAkWaapiFieldNames& INAkWaapiFieldNames);
- };
- typedef TTextFilter< const FString& > StringFilter;
- /*------------------------------------------------------------------------------------
- SAkWaapiFieldNames
- ------------------------------------------------------------------------------------*/
- class AKAUDIO_API SAkWaapiFieldNames : public SCompoundWidget
- {
- public:
- typedef TSlateDelegates< TSharedPtr< FString > >::FOnSelectionChanged FOnSelectionChanged;
- public:
- SLATE_BEGIN_ARGS(SAkWaapiFieldNames)
- : _FocusSearchBoxWhenOpened(true)
- , _SelectionMode(ESelectionMode::Multi)
- {}
- /** Content displayed to the left of the search bar */
- SLATE_NAMED_SLOT(FArguments, SearchContent)
- /** If true, the search box will be focus the frame after construction */
- SLATE_ARGUMENT(bool, FocusSearchBoxWhenOpened)
- /** The selection mode for the list view */
- SLATE_ARGUMENT(ESelectionMode::Type, SelectionMode)
- /** Handles the drag and drop operations */
- SLATE_EVENT(FOnDragDetected, OnDragDetected)
- /** Handles the selection operation */
- SLATE_EVENT(FOnSelectionChanged, OnSelectionChanged)
- SLATE_END_ARGS()
- void Construct(const FArguments& InArgs);
- SAkWaapiFieldNames(void);
- ~SAkWaapiFieldNames();
- /** Returns all the FieldNames currently selected in the Waapi Picker view */
- const TArray<TSharedPtr<FString>> GetSelectedFieldNames() const;
- private:
- /** The tree view widget */
- TSharedPtr< SListView< TSharedPtr<FString>> > ListViewPtr;
- /** The FieldNames list search box */
- TSharedPtr< SSearchBox > SearchBoxPtr;
- /** Filter for the search box */
- TSharedPtr<StringFilter> SearchBoxFilter;
- /** Field Names list */
- TArray< TSharedPtr<FString> > FieldNamesList;
- /** Delegate to invoke when drag drop detected. */
- FOnDragDetected OnDragDetected;
- /** Delegate to invoke when a Field Name is selected. */
- FOnSelectionChanged OnSelectionChanged;
- private:
- /** One-off active timer to focus the widget post-construct */
- EActiveTimerReturnType SetFocusPostConstruct(double InCurrentTime, float InDeltaTime);
- /** Generate a row in the tree view */
- TSharedRef<ITableRow> GenerateRow(TSharedPtr<FString> in_FieldName, const TSharedRef<STableViewBase>& OwnerTable);
- /** Used by the search filter */
- void PopulateSearchStrings(const FString& in_FieldName, OUT TArray< FString >& OutSearchStrings) const;
- void FilterUpdated();
- /** Handler for list view selection changes */
- void ListSelectionChanged(TSharedPtr< FString > in_FieldName, ESelectInfo::Type SelectInfo);
- };
|