.. _program_listing_file_include_miral_miral_configuration_option.h: Program Listing for File configuration_option.h =============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/miral/miral/configuration_option.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright © Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 or 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef MIRAL_CONFIGURATION_OPTION_H #define MIRAL_CONFIGURATION_OPTION_H #include #include #include #include #include namespace mir { class Server; } namespace miral { class ConfigurationOption { public: ConfigurationOption( std::function callback, std::string const& option, std::string const& description, int default_value); ConfigurationOption( std::function callback, std::string const& option, std::string const& description, double default_value); ConfigurationOption( std::function callback, std::string const& option, std::string const& description, std::string const& default_value); ConfigurationOption( std::function callback, std::string const& option, std::string const& description, char const* default_value); ConfigurationOption( std::function callback, std::string const& option, std::string const& description, bool default_value); ConfigurationOption( std::function const& value)> callback, std::string const& option, std::string const& description); ConfigurationOption( std::function const& value)> callback, std::string const& option, std::string const& description); ConfigurationOption( std::function const& value)> callback, std::string const& option, std::string const& description); ConfigurationOption( std::function callback, std::string const& option, std::string const& description); // \remark Since MirAL 3.6 ConfigurationOption( std::function const& values)> callback, std::string const& option, std::string const& description); template ConfigurationOption( Lambda&& callback, std::string const& option, std::string const& description) : ConfigurationOption(lambda_as_function(std::forward(callback)), option, description) {} void operator()(mir::Server& server) const; // Call the callback *before* Mir initialization starts friend auto pre_init(ConfigurationOption const& clo) -> ConfigurationOption; ~ConfigurationOption(); ConfigurationOption(ConfigurationOption const&); auto operator=(ConfigurationOption const&) -> ConfigurationOption&; private: struct Self; std::shared_ptr self; }; auto pre_init(ConfigurationOption const& clo) -> ConfigurationOption; } #endif //MIRAL_CONFIGURATION_OPTION_H