1 /* 2 * Copyright 2001-2007, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 * Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk> 8 */ 9 #ifndef DESKTOP_SETTINGS_H 10 #define DESKTOP_SETTINGS_H 11 12 13 #include <InterfaceDefs.h> 14 #include <Menu.h> 15 #include <Message.h> 16 17 class Desktop; 18 class DesktopSettingsPrivate; 19 class ServerFont; 20 21 22 static const int32 kMaxWorkspaces = 32; 23 24 enum { 25 kAllSettings = 0xff, 26 kWorkspacesSettings = 0x01, 27 kFontSettings = 0x02, 28 kAppearanceSettings = 0x04, 29 kMouseSettings = 0x08, 30 kDraggerSettings = 0x10, 31 }; 32 33 class DesktopSettings { 34 public: 35 DesktopSettings(Desktop* desktop); 36 37 status_t Save(uint32 mask = kAllSettings); 38 39 void GetDefaultPlainFont(ServerFont& font) const; 40 void GetDefaultBoldFont(ServerFont& font) const; 41 void GetDefaultFixedFont(ServerFont& font) const; 42 43 void GetScrollBarInfo(scroll_bar_info& info) const; 44 void GetMenuInfo(menu_info& info) const; 45 46 mode_mouse MouseMode() const; 47 bool FocusFollowsMouse() const; 48 49 bool ShowAllDraggers() const; 50 51 int32 WorkspacesCount() const; 52 const BMessage* WorkspacesMessage(int32 index) const; 53 54 rgb_color UIColor(color_which which) const; 55 56 bool SubpixelAntialiasing() const; 57 bool Hinting() const; 58 uint8 SubpixelAverageWeight() const; 59 bool IsSubpixelOrderingRegular() const; 60 61 protected: 62 DesktopSettingsPrivate* fSettings; 63 }; 64 65 class LockedDesktopSettings : public DesktopSettings { 66 public: 67 LockedDesktopSettings(Desktop* desktop); 68 ~LockedDesktopSettings(); 69 70 void SetDefaultPlainFont(const ServerFont& font); 71 void SetDefaultBoldFont(const ServerFont& font); 72 void SetDefaultFixedFont(const ServerFont& font); 73 74 void SetScrollBarInfo(const scroll_bar_info& info); 75 void SetMenuInfo(const menu_info& info); 76 77 void SetMouseMode(mode_mouse mode); 78 79 void SetShowAllDraggers(bool show); 80 81 void SetUIColor(color_which which, const rgb_color color); 82 83 void SetSubpixelAntialiasing(bool subpix); 84 void SetHinting(bool hinting); 85 void SetSubpixelAverageWeight(uint8 averageWeight); 86 void SetSubpixelOrderingRegular(bool subpixelOrdering); 87 88 private: 89 Desktop* fDesktop; 90 }; 91 92 #endif /* DESKTOP_SETTINGS_H */ 93