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 */ 8 #ifndef DESKTOP_SETTINGS_H 9 #define DESKTOP_SETTINGS_H 10 11 12 #include <InterfaceDefs.h> 13 #include <Menu.h> 14 #include <Message.h> 15 16 class Desktop; 17 class DesktopSettingsPrivate; 18 class ServerFont; 19 20 21 static const int32 kMaxWorkspaces = 32; 22 23 enum { 24 kAllSettings = 0xff, 25 kWorkspacesSettings = 0x01, 26 kFontSettings = 0x02, 27 kAppearanceSettings = 0x04, 28 kMouseSettings = 0x08, 29 kDraggerSettings = 0x10, 30 }; 31 32 class DesktopSettings { 33 public: 34 DesktopSettings(Desktop* desktop); 35 36 status_t Save(uint32 mask = kAllSettings); 37 38 void GetDefaultPlainFont(ServerFont& font) const; 39 void GetDefaultBoldFont(ServerFont& font) const; 40 void GetDefaultFixedFont(ServerFont& font) const; 41 42 void GetScrollBarInfo(scroll_bar_info& info) const; 43 void GetMenuInfo(menu_info& info) const; 44 45 mode_mouse MouseMode() const; 46 bool FocusFollowsMouse() const; 47 48 bool ShowAllDraggers() const; 49 50 int32 WorkspacesCount() const; 51 const BMessage* WorkspacesMessage(int32 index) const; 52 53 protected: 54 DesktopSettingsPrivate* fSettings; 55 }; 56 57 class LockedDesktopSettings : public DesktopSettings { 58 public: 59 LockedDesktopSettings(Desktop* desktop); 60 ~LockedDesktopSettings(); 61 62 void SetDefaultPlainFont(const ServerFont& font); 63 void SetDefaultBoldFont(const ServerFont& font); 64 void SetDefaultFixedFont(const ServerFont& font); 65 66 void SetScrollBarInfo(const scroll_bar_info& info); 67 void SetMenuInfo(const menu_info& info); 68 69 void SetMouseMode(mode_mouse mode); 70 71 void SetShowAllDraggers(bool show); 72 73 private: 74 Desktop* fDesktop; 75 }; 76 77 #endif /* DESKTOP_SETTINGS_H */ 78