From 64922e213ac731279cf3341253e67509adb2dfc8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 16 Sep 2022 21:36:12 +0200 Subject: wanda: restructure source directory --- source/include/wanda/command.hpp | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 source/include/wanda/command.hpp (limited to 'source/include/wanda/command.hpp') diff --git a/source/include/wanda/command.hpp b/source/include/wanda/command.hpp new file mode 100644 index 0000000..5ea1a08 --- /dev/null +++ b/source/include/wanda/command.hpp @@ -0,0 +1,46 @@ +#ifndef WANDA_COMMAND_HPP +#define WANDA_COMMAND_HPP + +#include + +#include +#include +#include + +namespace wanda +{ + /** + * @brief An enum to describe different command IDs + */ + enum struct command_id : char + { + change, //< Change the wallpaper + }; + + /** + * @brief A simple type to represent commands transported through the control connection + */ + struct command + { + command_id const id; + std::vector const arguments; + + /** + * @brief Convert the command to a message for transmission to a remote endpoint + */ + std::optional message() const; + }; + + /** + * @brief Extract a command from a message + */ + std::optional make_command(message message); + + /** + * @brief A simple factory to create a "Change wallpaper" command + */ + command make_change_command(); + +} // namespace wanda + +#endif \ No newline at end of file -- cgit v1.2.3