MirAL
command_line_option.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_COMMAND_LINE_OPTION_H
20 #define MIRAL_COMMAND_LINE_OPTION_H
21 
22 #include <mir/optional_value.h>
23 
24 #include <functional>
25 #include <memory>
26 #include <string>
27 
28 namespace mir { class Server; }
29 
30 namespace miral
31 {
36 {
37 public:
39  std::function<void(int value)> callback,
40  std::string const& option,
41  std::string const& description,
42  int default_value);
43 
45  std::function<void(double value)> callback,
46  std::string const& option,
47  std::string const& description,
48  double default_value);
49 
51  std::function<void(std::string const& value)> callback,
52  std::string const& option,
53  std::string const& description,
54  std::string const& default_value);
55 
57  std::function<void(std::string const& value)> callback,
58  std::string const& option,
59  std::string const& description,
60  char const* default_value);
61 
63  std::function<void(bool value)> callback,
64  std::string const& option,
65  std::string const& description,
66  bool default_value);
67 
69  std::function<void(mir::optional_value<int> const& value)> callback,
70  std::string const& option,
71  std::string const& description);
72 
74  std::function<void(mir::optional_value<std::string> const& value)> callback,
75  std::string const& option,
76  std::string const& description);
77 
79  std::function<void(mir::optional_value<bool> const& value)> callback,
80  std::string const& option,
81  std::string const& description);
82 
84  std::function<void(bool is_set)> callback,
85  std::string const& option,
86  std::string const& description);
87 
88  void operator()(mir::Server& server) const;
89 
92  auto operator=(CommandLineOption const&) -> CommandLineOption&;
93 
94 private:
95  struct Self;
96  std::shared_ptr<Self> self;
97 };
98 }
99 
100 #endif //MIRAL_COMMAND_LINE_OPTION_H
Definition: active_outputs.h:25
Add a user configuration option to Mir&#39;s option handling. The callback will be invoked during initial...
Definition: command_line_option.h:35
Mir Abstraction Layer.
Definition: active_outputs.h:27

Copyright © 2016 Canonical Ltd.
Generated on Tue Dec 20 16:03:55 UTC 2016