xref: /haiku/src/servers/app/DesktopSettingsPrivate.h (revision 58481f0f6ef1a61ba07283f012cafbc2ed874ead)
1 /*
2  * Copyright 2005-2008, 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_PRIVATE_H
10 #define DESKTOP_SETTINGS_PRIVATE_H
11 
12 
13 #include "DesktopSettings.h"
14 #include "ServerFont.h"
15 
16 #include <Locker.h>
17 
18 struct server_read_only_memory;
19 
20 
21 class DesktopSettingsPrivate {
22 public:
23 								DesktopSettingsPrivate(
24 									server_read_only_memory* shared);
25 								~DesktopSettingsPrivate();
26 
27 			status_t			Save(uint32 mask = kAllSettings);
28 
29 			void				SetDefaultPlainFont(const ServerFont& font);
30 			const ServerFont&	DefaultPlainFont() const;
31 
32 			void				SetDefaultBoldFont(const ServerFont& font);
33 			const ServerFont&	DefaultBoldFont() const;
34 
35 			void				SetDefaultFixedFont(const ServerFont& font);
36 			const ServerFont&	DefaultFixedFont() const;
37 
38 			void				SetScrollBarInfo(const scroll_bar_info &info);
39 			const scroll_bar_info& ScrollBarInfo() const;
40 
41 			void				SetMenuInfo(const menu_info &info);
42 			const menu_info&	MenuInfo() const;
43 
44 			void				SetMouseMode(mode_mouse mode);
45 			mode_mouse			MouseMode() const;
46 			bool				FocusFollowsMouse() const;
47 
48 			void				SetShowAllDraggers(bool show);
49 			bool				ShowAllDraggers() const;
50 
51 			void				SetWorkspacesCount(int32 number);
52 			int32				WorkspacesCount() const;
53 
54 			void				SetWorkspacesMessage(int32 index,
55 									BMessage& message);
56 			const BMessage*		WorkspacesMessage(int32 index) const;
57 
58 			void				SetUIColor(color_which which,
59 									const rgb_color color);
60 			rgb_color			UIColor(color_which which) const;
61 
62 			void				SetSubpixelAntialiasing(bool subpix);
63 			bool				SubpixelAntialiasing() const;
64 			void				SetHinting(uint8 hinting);
65 			uint8				Hinting() const;
66 			void				SetSubpixelAverageWeight(uint8 averageWeight);
67 			uint8				SubpixelAverageWeight() const;
68 			void				SetSubpixelOrderingRegular(
69 									bool subpixelOrdering);
70 			bool				IsSubpixelOrderingRegular() const;
71 
72 private:
73 			void				_SetDefaults();
74 			status_t			_Load();
75 			status_t			_GetPath(BPath& path);
76 
77 			ServerFont			fPlainFont;
78 			ServerFont			fBoldFont;
79 			ServerFont			fFixedFont;
80 
81 			scroll_bar_info		fScrollBarInfo;
82 			menu_info			fMenuInfo;
83 			mode_mouse			fMouseMode;
84 			bool				fShowAllDraggers;
85 			int32				fWorkspacesCount;
86 			BMessage			fWorkspaceMessages[kMaxWorkspaces];
87 
88 			server_read_only_memory& fShared;
89 };
90 
91 #endif	/* DESKTOP_SETTINGS_PRIVATE_H */
92