17 #include "addon/manager.hpp" 23 #include <boost/dynamic_bitset.hpp> 33 struct builder_addon_list;
41 using addon_sort_func = std::function<bool(const addon_info&, const addon_info&)>;
46 static const int DEFAULT_ACTION_RETVAL = 200;
48 const std::string display_title_full_shift(
const addon_info& addon)
const;
63 std::string get_remote_addon_id();
66 void select_addon(
const std::string&
id);
80 install_function_ =
function;
86 uninstall_function_ =
function;
92 update_function_ =
function;
98 publish_function_ =
function;
104 delete_function_ =
function;
110 get_listbox().set_row_shown(shown);
119 static std::string colorize_addon_state_string(
const std::string& str,
ADDON_STATUS state,
bool verbose =
false);
124 install_status_visibility_ = visibility;
130 install_buttons_visibility_ = visibility;
134 void add_list_to_keyboard_chain();
138 get_listbox().set_callback_order_change(callback);
177 void finalize_setup();
181 void select_first_addon();
184 static const std::string&
type();
188 virtual const std::string& get_control_type()
const override;
Base class of a resolution, contains the common keys for a resolution.
visibility install_status_visibility_
std::function< bool(const addon_info &, const addon_info &)> addon_sort_func
preferences::SORT_ORDER SORT_ORDER
ADDON_STATUS
Defines various add-on installation statuses.
void set_addon_shown(boost::dynamic_bitset<> &shown)
Filters which add-ons are visible.
addon_op_func_t delete_function_
widget::visibility install_status_visibility_
void set_install_status_visibility(visibility visibility)
Determines if install status of each widget is shown.
void set_callback_order_change(std::function< void(unsigned, preferences::SORT_ORDER)> callback)
Sets up a callback that will be called when the player changes the sorting order. ...
virtual unsigned get_state() const override
See styled_widget::get_state.
virtual void set_active(const bool) override
See styled_widget::set_active.
visibility install_buttons_visibility_
void set_delete_function(addon_op_func_t function)
Sets the function to install an addon from the addons server.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
std::vector< const addon_info * > addon_vector_
virtual bool get_active() const override
See styled_widget::get_active.
widget::visibility install_buttons_visibility_
void set_self_active(const bool) override
See container_base::set_self_active.
addon_op_func_t uninstall_function_
void set_publish_function(addon_op_func_t function)
Sets the function to upload an addon to the addons server.
void set_update_function(addon_op_func_t function)
Sets the function to call when the player clicks the update button.
A generic container base class.
addon_op_func_t publish_function_
void set_uninstall_function(addon_op_func_t function)
Sets the function to call when the player clicks the uninstall button.
addon_op_func_t install_function_
void set_install_buttons_visibility(visibility visibility)
Determines if install/uninstall buttons are shown for each widget.
void set_install_function(addon_op_func_t function)
Sets the function to call when the player clicks the install button.
std::unique_ptr< window > build(const builder_window::window_resolution &definition)
Builds a window.
Stores additional status information about add-ons.
std::function< void(const addon_info &)> addon_op_func_t
A config object defines a single node in a WML file, with access to child nodes.
std::map< std::string, addon_info > addons_list
std::shared_ptr< builder_grid > builder_grid_ptr
void set_modified_signal_handler(const std::function< void()> &callback)
Sets up a callback that will be called when the player selects an add-on.
Contains the implementation details for lexical_cast and shouldn't be used directly.
addon_op_func_t update_function_