xref: /haiku/src/servers/app/DesktopSettings.h (revision 2c69b5b6c0e7b481a0c43366a1942a6055cbb864)
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 		int32			WorkspacesColumns() const;
53 		int32			WorkspacesRows() const;
54 		const BMessage*	WorkspacesMessage(int32 index) const;
55 
56 		rgb_color		UIColor(color_which which) const;
57 
58 		bool			SubpixelAntialiasing() const;
59 		uint8			Hinting() const;
60 		uint8			SubpixelAverageWeight() const;
61 		bool			IsSubpixelOrderingRegular() const;
62 
63 	protected:
64 		DesktopSettingsPrivate*	fSettings;
65 };
66 
67 class LockedDesktopSettings : public DesktopSettings {
68 	public:
69 		LockedDesktopSettings(Desktop* desktop);
70 		~LockedDesktopSettings();
71 
72 		void			SetDefaultPlainFont(const ServerFont& font);
73 		void			SetDefaultBoldFont(const ServerFont& font);
74 		void			SetDefaultFixedFont(const ServerFont& font);
75 
76 		void			SetScrollBarInfo(const scroll_bar_info& info);
77 		void			SetMenuInfo(const menu_info& info);
78 
79 		void			SetMouseMode(mode_mouse mode);
80 
81 		void			SetShowAllDraggers(bool show);
82 
83 		void			SetUIColor(color_which which, const rgb_color color);
84 
85 		void			SetSubpixelAntialiasing(bool subpix);
86 		void			SetHinting(uint8 hinting);
87 		void			SetSubpixelAverageWeight(uint8 averageWeight);
88 		void			SetSubpixelOrderingRegular(bool subpixelOrdering);
89 
90 	private:
91 		Desktop*		fDesktop;
92 };
93 
94 #endif	/* DESKTOP_SETTINGS_H */
95