xref: /haiku/src/servers/app/DesktopSettings.h (revision c9060eb991e10e477ece52478d6743fc7691c143)
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			FontSubpixelAntialiasing() const;
57 		bool			Hinting() const;
58 
59 	protected:
60 		DesktopSettingsPrivate*	fSettings;
61 };
62 
63 class LockedDesktopSettings : public DesktopSettings {
64 	public:
65 		LockedDesktopSettings(Desktop* desktop);
66 		~LockedDesktopSettings();
67 
68 		void			SetDefaultPlainFont(const ServerFont& font);
69 		void			SetDefaultBoldFont(const ServerFont& font);
70 		void			SetDefaultFixedFont(const ServerFont& font);
71 
72 		void			SetScrollBarInfo(const scroll_bar_info& info);
73 		void			SetMenuInfo(const menu_info& info);
74 
75 		void			SetMouseMode(mode_mouse mode);
76 
77 		void			SetShowAllDraggers(bool show);
78 
79 		void			SetUIColor(color_which which, const rgb_color color);
80 
81 		void			SetFontSubpixelAntialiasing(bool subpix);
82 		void			SetHinting(bool hinting);
83 
84 	private:
85 		Desktop*		fDesktop;
86 };
87 
88 #endif	/* DESKTOP_SETTINGS_H */
89