diff options
Diffstat (limited to 'src/greeter.h')
-rw-r--r-- | src/greeter.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/greeter.h b/src/greeter.h index e084d25..f3012f6 100644 --- a/src/greeter.h +++ b/src/greeter.h @@ -29,7 +29,13 @@ class Greeter public: Greeter(); virtual ~Greeter(); - virtual core::Property<bool>& is_active() =0; + + enum class State { UNAVAILABLE, INACTIVE, ACTIVE }; +static inline const char* state_str(const State& state) { + static constexpr char const * state_str[] = { "Unavailable", "Inactive", "Active" }; + return state_str[int(state)]; +} + virtual core::Property<State>& state() =0; }; @@ -38,7 +44,7 @@ class UnityGreeter: public Greeter public: UnityGreeter(); virtual ~UnityGreeter(); - core::Property<bool>& is_active() override; + core::Property<State>& state() override; protected: class Impl; |