Debian Codegraph @

include/ui/ianimationchooser.h

raw
1 #pragma once
2
3 #include <string>
4
5 namespace ui
6 {
7
8 class IAnimationChooser
9 {
10 public:
11 virtual ~IAnimationChooser() {}
12
13 struct Result
14 {
15 // The selected model
16 std::string model;
17
18 // The selected animation
19 std::string anim;
20
21 bool cancelled()
22 {
23 return model.empty() && anim.empty();
24 }
25 };
26
27 // Run the dialog and return the selected model/anim combination.
28 // The dialog will enter a new event loop and block the UI until it's closed again.
29 // The returned Result will be empty if the user clicks cancel.
30 virtual Result runDialog(const std::string& preselectModel = std::string(),
31 const std::string& preselectAnim = std::string()) = 0;
32
33 // Destroys the window. Don't rely on the destructor, it won't call Destroy() for you.
34 virtual void destroyDialog() = 0;
35 };
36
37 }