1ef8810f2SAxel Dörfler/*
27f9368caSlooncraz * Copyright 2005-2015, Haiku.
3ef8810f2SAxel Dörfler * Distributed under the terms of the MIT License.
4ef8810f2SAxel Dörfler *
5ef8810f2SAxel Dörfler * Authors:
6ef8810f2SAxel Dörfler *		Axel D��rfler, axeld@pinc-software.de
7b09e2f6fSStephan Aßmus *		Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
87f9368caSlooncraz *		Joseph Groover <looncraz@looncraz.net>
9ef8810f2SAxel Dörfler */
10ef8810f2SAxel Dörfler#ifndef DESKTOP_SETTINGS_PRIVATE_H
11ef8810f2SAxel Dörfler#define DESKTOP_SETTINGS_PRIVATE_H
12ef8810f2SAxel Dörfler
13ef8810f2SAxel Dörfler
14ef8810f2SAxel Dörfler#include "DesktopSettings.h"
15ef8810f2SAxel Dörfler
16ef8810f2SAxel Dörfler#include <Locker.h>
17ef8810f2SAxel Dörfler
18926e63c8SBrecht Machiels#include "ServerFont.h"
19926e63c8SBrecht Machiels
20926e63c8SBrecht Machiels
216d5488e1SAxel Dörflerstruct server_read_only_memory;
226d5488e1SAxel Dörfler
23ef8810f2SAxel Dörfler
24a17c3a48SAxel Dörflerclass DesktopSettingsPrivate {
25e4737a92SAxel Dörflerpublic:
26e4737a92SAxel Dörfler								DesktopSettingsPrivate(
27e4737a92SAxel Dörfler									server_read_only_memory* shared);
28e4737a92SAxel Dörfler								~DesktopSettingsPrivate();
29ef8810f2SAxel Dörfler
30e4737a92SAxel Dörfler			status_t			Save(uint32 mask = kAllSettings);
31ef8810f2SAxel Dörfler
32e4737a92SAxel Dörfler			void				SetDefaultPlainFont(const ServerFont& font);
33e4737a92SAxel Dörfler			const ServerFont&	DefaultPlainFont() const;
3405bd1efeSAxel Dörfler
35e4737a92SAxel Dörfler			void				SetDefaultBoldFont(const ServerFont& font);
36e4737a92SAxel Dörfler			const ServerFont&	DefaultBoldFont() const;
3705bd1efeSAxel Dörfler
38e4737a92SAxel Dörfler			void				SetDefaultFixedFont(const ServerFont& font);
39e4737a92SAxel Dörfler			const ServerFont&	DefaultFixedFont() const;
4005bd1efeSAxel Dörfler
41e4737a92SAxel Dörfler			void				SetScrollBarInfo(const scroll_bar_info &info);
42e4737a92SAxel Dörfler			const scroll_bar_info& ScrollBarInfo() const;
43ef8810f2SAxel Dörfler
44e4737a92SAxel Dörfler			void				SetMenuInfo(const menu_info &info);
45e4737a92SAxel Dörfler			const menu_info&	MenuInfo() const;
46ef8810f2SAxel Dörfler
47e4737a92SAxel Dörfler			void				SetMouseMode(mode_mouse mode);
48e4737a92SAxel Dörfler			mode_mouse			MouseMode() const;
49926e63c8SBrecht Machiels			void				SetFocusFollowsMouseMode(
50926e63c8SBrecht Machiels									mode_focus_follows_mouse mode);
51c3d0a5e8SAxel Dörfler			mode_focus_follows_mouse FocusFollowsMouseMode() const;
52d6bb64d8SAxel Dörfler			bool				NormalMouse() const
53d6bb64d8SAxel Dörfler									{ return MouseMode() == B_NORMAL_MOUSE; }
54d6bb64d8SAxel Dörfler			bool				FocusFollowsMouse() const
55d6bb64d8SAxel Dörfler									{ return MouseMode()
56d6bb64d8SAxel Dörfler										== B_FOCUS_FOLLOWS_MOUSE; }
57d6bb64d8SAxel Dörfler			bool				ClickToFocusMouse() const
58d6bb64d8SAxel Dörfler									{ return MouseMode()
59d6bb64d8SAxel Dörfler										== B_CLICK_TO_FOCUS_MOUSE; }
60c3d0a5e8SAxel Dörfler			void				SetAcceptFirstClick(bool acceptFirstClick);
61926e63c8SBrecht Machiels			bool				AcceptFirstClick() const;
62ef8810f2SAxel Dörfler
63e4737a92SAxel Dörfler			void				SetShowAllDraggers(bool show);
64e4737a92SAxel Dörfler			bool				ShowAllDraggers() const;
65cf2aeb20SAxel Dörfler
6669f9a367SAxel Dörfler			void				SetWorkspacesLayout(int32 columns, int32 rows);
67e4737a92SAxel Dörfler			int32				WorkspacesCount() const;
6869f9a367SAxel Dörfler			int32				WorkspacesColumns() const;
6969f9a367SAxel Dörfler			int32				WorkspacesRows() const;
70ef8810f2SAxel Dörfler
71e4737a92SAxel Dörfler			void				SetWorkspacesMessage(int32 index,
72e4737a92SAxel Dörfler									BMessage& message);
73e4737a92SAxel Dörfler			const BMessage*		WorkspacesMessage(int32 index) const;
74ef8810f2SAxel Dörfler
75e4737a92SAxel Dörfler			void				SetUIColor(color_which which,
767f9368caSlooncraz									const rgb_color color,
777f9368caSlooncraz									bool* changed = NULL);
787f9368caSlooncraz			void				SetUIColors(const BMessage& colors,
797f9368caSlooncraz									bool* changed = NULL);
807f9368caSlooncraz									// changed must be boolean array equal in
817f9368caSlooncraz									// size to colors' size
827f9368caSlooncraz
83e4737a92SAxel Dörfler			rgb_color			UIColor(color_which which) const;
84b09e2f6fSStephan Aßmus
85e4737a92SAxel Dörfler			void				SetSubpixelAntialiasing(bool subpix);
86e4737a92SAxel Dörfler			bool				SubpixelAntialiasing() const;
87e4737a92SAxel Dörfler			void				SetHinting(uint8 hinting);
88e4737a92SAxel Dörfler			uint8				Hinting() const;
89e4737a92SAxel Dörfler			void				SetSubpixelAverageWeight(uint8 averageWeight);
90e4737a92SAxel Dörfler			uint8				SubpixelAverageWeight() const;
91e4737a92SAxel Dörfler			void				SetSubpixelOrderingRegular(
92e4737a92SAxel Dörfler									bool subpixelOrdering);
93e4737a92SAxel Dörfler			bool				IsSubpixelOrderingRegular() const;
94b09e2f6fSStephan Aßmus
95629397f2SFrançois Revol			status_t			SetControlLook(const char* path);
96629397f2SFrançois Revol			const BString&		ControlLook() const;
97629397f2SFrançois Revol
98e4737a92SAxel Dörflerprivate:
99e4737a92SAxel Dörfler			void				_SetDefaults();
100e4737a92SAxel Dörfler			status_t			_Load();
101e4737a92SAxel Dörfler			status_t			_GetPath(BPath& path);
10269f9a367SAxel Dörfler			void				_ValidateWorkspacesLayout(int32& columns,
10369f9a367SAxel Dörfler									int32& rows) const;
104ef8810f2SAxel Dörfler
105e4737a92SAxel Dörfler			ServerFont			fPlainFont;
106e4737a92SAxel Dörfler			ServerFont			fBoldFont;
107e4737a92SAxel Dörfler			ServerFont			fFixedFont;
10805bd1efeSAxel Dörfler
109e4737a92SAxel Dörfler			scroll_bar_info		fScrollBarInfo;
110e4737a92SAxel Dörfler			menu_info			fMenuInfo;
111e4737a92SAxel Dörfler			mode_mouse			fMouseMode;
112926e63c8SBrecht Machiels			mode_focus_follows_mouse	fFocusFollowsMouseMode;
113926e63c8SBrecht Machiels			bool				fAcceptFirstClick;
114e4737a92SAxel Dörfler			bool				fShowAllDraggers;
11569f9a367SAxel Dörfler			int32				fWorkspacesColumns;
11669f9a367SAxel Dörfler			int32				fWorkspacesRows;
117e4737a92SAxel Dörfler			BMessage			fWorkspaceMessages[kMaxWorkspaces];
118629397f2SFrançois Revol			BString				fControlLook;
1196d5488e1SAxel Dörfler
120e4737a92SAxel Dörfler			server_read_only_memory& fShared;
121ef8810f2SAxel Dörfler};
122ef8810f2SAxel Dörfler
123ef8810f2SAxel Dörfler#endif	/* DESKTOP_SETTINGS_PRIVATE_H */
124