preferences.hpp

Go to the documentation of this file.
00001 /* $Id: preferences.hpp 53010 2012-02-14 18:17:09Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2003 - 2012 by David White <dave@whitevine.net>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 /** @file */
00017 
00018 #ifndef PREFERENCES_HPP_INCLUDED
00019 #define PREFERENCES_HPP_INCLUDED
00020 
00021 class config;
00022 class display;
00023 
00024 #include "game_config.hpp"
00025 #include "terrain_translation.hpp"
00026 
00027 #include <utility>
00028 
00029 namespace preferences {
00030 
00031     struct base_manager
00032     {
00033         base_manager();
00034         ~base_manager();
00035     };
00036 
00037     void write_preferences();
00038 
00039     void set(const std::string& key, const std::string &value);
00040     void set(const std::string& key, char const *value);
00041     void set(const std::string &key, bool value);
00042     void set(const std::string &key, int value);
00043     void clear(const std::string& key);
00044     void set_child(const std::string& key, const config& val);
00045     const config &get_child(const std::string &key);
00046     std::string get(const std::string& key);
00047     bool get(const std::string &key, bool def);
00048     void erase(const std::string& key);
00049     bool have_setting(const std::string& key);
00050 
00051     void disable_preferences_save();
00052 
00053     config* get_prefs();
00054 
00055     bool fullscreen();
00056     void _set_fullscreen(bool ison);
00057 
00058     bool scroll_to_action();
00059     void _set_scroll_to_action(bool ison);
00060 
00061     int min_allowed_width();
00062     int min_allowed_height();
00063 
00064     std::pair<int,int> resolution();
00065     void _set_resolution(const std::pair<int,int>& res);
00066 
00067     bool turbo();
00068     void _set_turbo(bool ison);
00069 
00070     double turbo_speed();
00071     void save_turbo_speed(const double speed);
00072 
00073     bool idle_anim();
00074     void _set_idle_anim(const bool ison);
00075 
00076     int idle_anim_rate();
00077     void _set_idle_anim_rate(const int rate);
00078 
00079     std::string language();
00080     void set_language(const std::string& s);
00081 
00082     // Don't rename it to sound() because of a gcc-3.3 branch bug,
00083     // which will cause it to conflict with the sound namespace.
00084     bool sound_on();
00085     bool set_sound(bool ison);
00086 
00087     unsigned int sample_rate();
00088     void save_sample_rate(const unsigned int rate);
00089 
00090     size_t sound_buffer_size();
00091     void save_sound_buffer_size(const size_t size);
00092 
00093     int sound_volume();
00094     void set_sound_volume(int vol);
00095 
00096     int bell_volume();
00097     void set_bell_volume(int vol);
00098 
00099     int UI_volume();
00100     void set_UI_volume(int vol);
00101 
00102     bool music_on();
00103     bool set_music(bool ison);
00104 
00105     int music_volume();
00106     void set_music_volume(int vol);
00107 
00108     bool turn_bell();
00109     bool set_turn_bell(bool ison);
00110 
00111     bool UI_sound_on();
00112     bool set_UI_sound(bool ison);
00113 
00114     bool message_bell();
00115 
00116     // Proxies for preferences_dialog
00117     void load_hotkeys();
00118     void save_hotkeys();
00119     void clear_hotkeys();
00120 
00121     void add_alias(const std::string& alias, const std::string& command);
00122     const config &get_alias();
00123 
00124     bool use_color_cursors();
00125     void _set_color_cursors(bool value);
00126 
00127     bool joystick_support_enabled();
00128     int joystick_mouse_deadzone();
00129     int joystick_num_mouse_xaxis();
00130     int joystick_num_mouse_yaxis();
00131     int joystick_mouse_xaxis_num();
00132     int joystick_mouse_yaxis_num();
00133 
00134     int joystick_scroll_deadzone();
00135     int joystick_num_scroll_xaxis();
00136     int joystick_num_scroll_yaxis();
00137     int joystick_scroll_xaxis_num();
00138     int joystick_scroll_yaxis_num();
00139 
00140     int joystick_cursor_deadzone();
00141     int joystick_num_cursor_xaxis();
00142     int joystick_num_cursor_yaxis();
00143     int joystick_cursor_xaxis_num();
00144     int joystick_cursor_yaxis_num();
00145     int joystick_cursor_threshold();
00146 
00147     int joystick_thrusta_deadzone();
00148     int joystick_num_thrusta_axis();
00149     int joystick_thrusta_axis_num();
00150 
00151     int joystick_thrustb_deadzone();
00152     int joystick_num_thrustb_axis();
00153     int joystick_thrustb_axis_num();
00154 
00155     int scroll_speed();
00156     void set_scroll_speed(const int scroll);
00157 
00158     bool middle_click_scrolls();
00159     bool mouse_scroll_enabled();
00160     void enable_mouse_scroll(bool value);
00161 
00162     /**
00163      * Gets the threshold for when to scroll.
00164      *
00165      * This scrolling happens when the mouse is in the application and near
00166      * the border.
00167      */
00168     int mouse_scroll_threshold();
00169 
00170     int draw_delay();
00171     void set_draw_delay(int value);
00172 
00173     bool animate_map();
00174     void set_animate_map(bool value);
00175 
00176     bool show_standing_animations();
00177     void set_show_standing_animations(bool value);
00178 
00179     bool show_fps();
00180     void set_show_fps(bool value);
00181 
00182     bool ellipses();
00183     void _set_ellipses(bool ison);
00184 
00185     bool grid();
00186     void _set_grid(bool ison);
00187 
00188     bool confirm_load_save_from_different_version();
00189 
00190     bool use_twelve_hour_clock_format();
00191     void set_use_twelve_hour_clock_format(bool value);
00192 
00193 } // end namespace preferences
00194 
00195 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:03:08 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs