A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SFindInDialogues.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "Widgets/DeclarativeSyntaxSupport.h"
5#include "Widgets/SCompoundWidget.h"
6#include "Widgets/Views/STreeView.h"
7#include "Framework/Commands/UICommandList.h"
8
10
11class FDialogueEditor;
12class SSearchBox;
13class SDockTab;
14
17{
18private:
20
21public:
23 : _bIsSearchWindow(true)
24 , _bHideSearchBar(false)
25 , _ContainingTab()
26 {}
27 SLATE_ARGUMENT(bool, bIsSearchWindow)
28 SLATE_ARGUMENT(bool, bHideSearchBar)
29 SLATE_ARGUMENT(TSharedPtr<SDockTab>, ContainingTab)
30 SLATE_END_ARGS()
31
32 void Construct(const FArguments& InArgs, const TSharedPtr<FDialogueEditor>& InDialogueEditor = nullptr);
34
36 void FocusForUse(bool bSetFindWithinDialogue, const FDialogueSearchFilter& SearchFilter = FDialogueSearchFilter(), bool bSelectFirstResult = false);
37
44 void MakeSearchQuery(const FDialogueSearchFilter& SearchFilter, bool bInIsFindWithinDialogue);
45
47 FName GetHostTabId() const;
48
50 void CloseHostTab();
51
52private:
54 void HandleHostTabClosed(TSharedRef<SDockTab> DockTab);
55
57 void HandleSearchTextChanged(const FText& Text);
58
60 void HandleSearchTextCommitted(const FText& Text, ETextCommit::Type CommitType);
61
64
66 void HandleFindModeChanged(ECheckBoxState CheckState)
67 {
68 bIsInFindWithinDialogueMode = CheckState == ECheckBoxState::Checked;
69 }
70
72 ECheckBoxState HandleGetFindModeChecked() const
73 {
74 return bIsInFindWithinDialogueMode ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
75 }
76
77 /* Get the children of a row */
78 void HandleGetChildren(TSharedPtr<FDialogueSearchResult> InItem, TArray<TSharedPtr<FDialogueSearchResult>>& OutChildren);
79
80 /* Called when user double clicks on a new result */
81 void HandleTreeSelectionDoubleClicked(TSharedPtr<FDialogueSearchResult> Item);
82
83 /* Called when a new row is being generated */
84 TSharedRef<ITableRow> HandleGenerateRow(TSharedPtr<FDialogueSearchResult> InItem, const TSharedRef<STableViewBase>& OwnerTable);
85
87 TSharedPtr<SWidget> HandleContextMenuOpening();
88
90 TSharedRef<SWidget> FillFilterEntries();
91
92private:
94 TWeakPtr<FDialogueEditor> DialogueEditorPtr;
95
96 /* The tree view displays the results */
97 TSharedPtr<STreeView<TSharedPtr<FDialogueSearchResult>>> TreeView;
98
100 TSharedPtr<SSearchBox> SearchTextBoxWidget;
101
103 TWeakPtr<SVerticalBox> MainVerticalBoxWidget;
104
106 TSharedPtr<FDialogueSearchResult> RootSearchResult;
107
108 /* This buffer stores the currently displayed results */
109 TArray<TSharedPtr<FDialogueSearchResult>> ItemsFound;
110
111 /* The string to highlight in the results */
113
116
119
121 TWeakPtr<SDockTab> HostTab;
122
124 TSharedPtr<FUICommandList> CommandList;
125};
TSharedRef< SWidget > FillFilterEntries()
void HandleGetChildren(TSharedPtr< FDialogueSearchResult > InItem, TArray< TSharedPtr< FDialogueSearchResult > > &OutChildren)
FName GetHostTabId() const
void FocusForUse(bool bSetFindWithinDialogue, const FDialogueSearchFilter &SearchFilter=FDialogueSearchFilter(), bool bSelectFirstResult=false)
TSharedPtr< SWidget > HandleContextMenuOpening()
void HandleTreeSelectionDoubleClicked(TSharedPtr< FDialogueSearchResult > Item)
TSharedRef< ITableRow > HandleGenerateRow(TSharedPtr< FDialogueSearchResult > InItem, const TSharedRef< STableViewBase > &OwnerTable)
void HandleHostTabClosed(TSharedRef< SDockTab > DockTab)
TWeakPtr< SDockTab > HostTab
TSharedPtr< SSearchBox > SearchTextBoxWidget
SFindInDialogues Self
TSharedPtr< STreeView< TSharedPtr< FDialogueSearchResult > > > TreeView
TSharedPtr< FUICommandList > CommandList
void HandleFindModeChanged(ECheckBoxState CheckState)
FReply HandleOpenGlobalFindResults()
TWeakPtr< FDialogueEditor > DialogueEditorPtr
void HandleSearchTextCommitted(const FText &Text, ETextCommit::Type CommitType)
TWeakPtr< SVerticalBox > MainVerticalBoxWidget
void HandleSearchTextChanged(const FText &Text)
void MakeSearchQuery(const FDialogueSearchFilter &SearchFilter, bool bInIsFindWithinDialogue)
FDialogueSearchFilter CurrentFilter
TArray< TSharedPtr< FDialogueSearchResult > > ItemsFound
ECheckBoxState HandleGetFindModeChecked() const
TSharedPtr< FDialogueSearchResult > RootSearchResult
void Construct(const FArguments &InArgs, const TSharedPtr< FDialogueEditor > &InDialogueEditor=nullptr)