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