@@ -28,20 +28,20 @@ namespace workrave
2828 {
2929 public:
3030 // ! The stage of a break warning (prelude)
31- enum PreludeStage
31+ enum class PreludeStage
3232 {
33- STAGE_INITIAL = 0 ,
34- STAGE_MOVE_OUT ,
35- STAGE_WARN ,
36- STAGE_ALERT
33+ Initial = 0 ,
34+ MoveOut ,
35+ Warn ,
36+ Alert
3737 };
3838
3939 // ! Text that the GUI show must in the prelude window.
40- enum PreludeProgressText
40+ enum class PreludeProgressText
4141 {
42- PROGRESS_TEXT_BREAK_IN ,
43- PROGRESS_TEXT_DISAPPEARS_IN ,
44- PROGRESS_TEXT_SILENT_IN
42+ BreakIn ,
43+ DisappearsIn ,
44+ SilentIn
4545 };
4646
4747 virtual ~IApp () = default ;
@@ -70,6 +70,26 @@ namespace workrave
7070 // ! Set the progress text of the prelude window.
7171 virtual void set_prelude_progress_text (PreludeProgressText text) = 0;
7272 };
73+
74+ template <>
75+ struct workrave ::utils::enum_traits<IApp::PreludeStage>
76+ {
77+ static constexpr std::array<std::pair<std::string_view, IApp::PreludeStage>, 4 > names{
78+ {{" initial" , IApp::PreludeStage::Initial},
79+ {" move_out" , IApp::PreludeStage::MoveOut},
80+ {" warn" , IApp::PreludeStage::Warn},
81+ {" alert" , IApp::PreludeStage::Alert}}};
82+ };
83+
84+ template <>
85+ struct workrave ::utils::enum_traits<IApp::PreludeProgressText>
86+ {
87+ static constexpr std::array<std::pair<std::string_view, IApp::PreludeProgressText>, 3 > names{
88+ {{" break_in" , IApp::PreludeProgressText::BreakIn},
89+ {" disappears_in" , IApp::PreludeProgressText::DisappearsIn},
90+ {" silent_in" , IApp::PreludeProgressText::SilentIn}}};
91+ };
92+
7393} // namespace workrave
7494
7595#endif // WORKRAVE_BACKEND_IAPP_HH
0 commit comments