xref: /haiku/src/preferences/appearance/APRView.h (revision 9f3bdf3d039430b5172c424def20ce5d9f7367d4)
1 /*
2  * Copyright 2002-2015, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		DarkWyrm (darkwyrm@earthlink.net)
7  *		Rene Gollent (rene@gollent.com)
8  *		Stephan Aßmus <superstippi@gmx.de>
9  *		Joseph Groover <looncraz@looncraz.net>
10  */
11 #ifndef APR_VIEW_H_
12 #define APR_VIEW_H_
13 
14 
15 #include <Button.h>
16 #include <CheckBox.h>
17 #include <ColorControl.h>
18 #include <ListItem.h>
19 #include <ListView.h>
20 #include <Menu.h>
21 #include <MenuBar.h>
22 #include <MenuField.h>
23 #include <MenuItem.h>
24 #include <Message.h>
25 #include <ScrollBar.h>
26 #include <ScrollView.h>
27 #include <String.h>
28 #include <StringView.h>
29 #include <View.h>
30 
31 #include <DecorInfo.h>
32 
33 
34 class APRWindow;
35 class ColorPreview;
36 
37 class APRView : public BView {
38 public:
39 								APRView(const char *name);
40 	virtual						~APRView();
41 
42 	virtual	void				AttachedToWindow();
43 	virtual	void				MessageReceived(BMessage *msg);
44 
45 			void				LoadSettings();
46 
47 			void				SetDefaults();
48 			void				Revert();
49 
50 			bool				IsDefaultable();
51 			bool				IsRevertable();
52 
53 private:
54 			void				_CreateItems();
55 			void				_UpdatePreviews(const BMessage& colors);
56 
57 			void				_SetColor(color_which which, rgb_color color);
58 			void				_SetOneColor(color_which which, rgb_color color);
59 			void				_SetCurrentColor(rgb_color color);
60 			void				_SetUIColors(const BMessage& colors);
61 
62 private:
63 			BColorControl*		fPicker;
64 
65 			BCheckBox*			fAutoSelectCheckBox;
66 			BListView*			fAttrList;
67 
68 			color_which			fWhich;
69 
70 			BScrollView*		fScrollView;
71 
72 			ColorPreview*		fColorPreview;
73 
74 			BMessage			fPrevColors;
75 			BMessage			fDefaultColors;
76 			BMessage			fCurrentColors;
77 };
78 
79 #endif	// APR_VIEW_H_
80