preferences.hpp

Go to the documentation of this file.
00001 /* $Id: preferences.hpp 26500 2008-05-09 22:28:12Z mordante $ */
00002 /*
00003    Copyright (C) 2003 - 2008 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 version 2
00008    or at your option any later version.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 //! @file preferences.hpp 
00016 //!
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 #include "config.hpp"
00027 
00028 #include <string>
00029 #include <utility>
00030 #include <set>
00031 
00032 // Only there temporary
00033 #ifdef USE_TINY_GUI
00034 const int min_allowed_width = 320;
00035 const int min_allowed_height = 240;
00036 #elif defined USE_SMALL_GUI
00037 const int min_allowed_width = 800;
00038 const int min_allowed_height = 480;
00039 #else
00040 const int min_allowed_width = 800;
00041 const int min_allowed_height = 600;
00042 #endif
00043 
00044 namespace preferences {
00045 
00046     struct base_manager
00047     {
00048         base_manager();
00049         ~base_manager();
00050     };
00051 
00052     void write_preferences();
00053 
00054     // Low-level, should be seen only by preferences_display ?
00055     void set(const std::string key, std::string value);
00056     void set_child(const std::string& key, const config& val);
00057     config* get_child(const std::string& key);
00058     const std::string get(const std::string key);
00059     void erase(const std::string key);
00060 
00061     void disable_preferences_save();
00062 
00063     config* get_prefs();
00064 
00065     bool fullscreen();
00066     void _set_fullscreen(bool ison);
00067 
00068     std::pair<int,int> resolution();
00069     void _set_resolution(const std::pair<int,int>& res);
00070 
00071     bool turbo();
00072     void _set_turbo(bool ison);
00073 
00074     double turbo_speed();
00075     void save_turbo_speed(const double speed);
00076 
00077     bool idle_anim();
00078     void _set_idle_anim(const bool ison);
00079 
00080     int idle_anim_rate();
00081     void _set_idle_anim_rate(const int rate);
00082 
00083     const std::string& language();
00084     void set_language(const std::string& s);
00085 
00086     bool adjust_gamma();
00087     void _set_adjust_gamma(bool val);
00088 
00089     int gamma();
00090     void _set_gamma(int gamma);
00091 
00092     // Don't rename it to sound() because of a gcc-3.3 branch bug,
00093     // which will cause it to conflict with the sound namespace.
00094     bool sound_on();
00095     bool set_sound(bool ison);
00096 
00097     unsigned int sample_rate();
00098     void save_sample_rate(const unsigned int rate);
00099 
00100     size_t sound_buffer_size();
00101     void save_sound_buffer_size(const size_t size);
00102 
00103     int sound_volume();
00104     void set_sound_volume(int vol);
00105 
00106     int bell_volume();
00107     void set_bell_volume(int vol);
00108 
00109     int UI_volume();
00110     void set_UI_volume(int vol);
00111 
00112     bool music_on();
00113     bool set_music(bool ison);
00114 
00115     int music_volume();
00116     void set_music_volume(int vol);
00117 
00118     bool turn_bell();
00119     bool set_turn_bell(bool ison);
00120 
00121     bool UI_sound_on();
00122     bool set_UI_sound(bool ison);
00123 
00124     bool message_bell();
00125 
00126     // Proxies for preferences_dialog
00127     void load_hotkeys();
00128     void save_hotkeys();
00129 
00130     bool use_colour_cursors();
00131     void _set_colour_cursors(bool value);
00132 
00133     int scroll_speed();
00134     void set_scroll_speed(const int scroll);
00135     
00136     bool mouse_scroll_enabled();
00137     void enable_mouse_scroll(bool value);
00138 
00139     //! Set editor red tint level.
00140     void set_editor_r(int value);
00141     //! Set editor green tint level.
00142     void set_editor_g(int value);
00143     //! Set editor blue tint level.
00144     void set_editor_b(int value);
00145     
00146     //! Get editor red tint level.
00147     int editor_r(void);
00148     //! Get editor green tint level.
00149     int editor_g(void);
00150     //! Get editor blue tint level.
00151     int editor_b(void);
00152 
00153     int draw_delay();
00154     void set_draw_delay(int value);
00155 
00156     bool animate_map();
00157     bool show_standing_animations();
00158 
00159     bool show_fps();
00160     void set_show_fps(bool value);
00161 
00162     bool grid();
00163     void _set_grid(bool ison);
00164 } // end namespace preferences
00165 
00166 #endif

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs