xref: /haiku/src/preferences/appearance/APRView.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
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 <ColorControl.h>
17 #include <ListItem.h>
18 #include <ListView.h>
19 #include <Menu.h>
20 #include <MenuBar.h>
21 #include <MenuField.h>
22 #include <MenuItem.h>
23 #include <Message.h>
24 #include <ScrollBar.h>
25 #include <ScrollView.h>
26 #include <String.h>
27 #include <StringView.h>
28 #include <View.h>
29 
30 #include <DecorInfo.h>
31 
32 
33 class APRWindow;
34 class ColorPreview;
35 
36 class APRView : public BView {
37 public:
38 								APRView(const char *name);
39 	virtual						~APRView();
40 
41 	virtual	void				AttachedToWindow();
42 	virtual	void				MessageReceived(BMessage *msg);
43 
44 			void				LoadSettings();
45 
46 			void				SetDefaults();
47 			void				Revert();
48 
49 			bool				IsDefaultable();
50 			bool				IsRevertable();
51 
52 private:
53 			void				_SetColor(color_which which, rgb_color color);
54 			void				_SetCurrentColor(rgb_color color);
55 			void				_SetUIColors(const BMessage& colors);
56 			void				_UpdatePreviews(const BMessage& colors);
57 
58 private:
59 			BColorControl*		fPicker;
60 
61 			BListView*			fAttrList;
62 
63 			color_which			fWhich;
64 
65 			BScrollView*		fScrollView;
66 
67 			ColorPreview*		fColorPreview;
68 
69 			BMessage			fPrevColors;
70 			BMessage			fDefaultColors;
71 			BMessage			fCurrentColors;
72 };
73 
74 #endif	// APR_VIEW_H_
75