xref: /haiku/src/preferences/notifications/GeneralView.h (revision 437e3c1c068fa84621711d4977eefe427ec0f2c6)
1 /*
2  * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3  * Copyright 2009, Pier Luigi Fiorini.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef _GENERAL_VIEW_H
7 #define _GENERAL_VIEW_H
8 
9 
10 #include <Button.h>
11 #include <CheckBox.h>
12 #include <Menu.h>
13 #include <MenuField.h>
14 #include <Mime.h>
15 #include <PopUpMenu.h>
16 #include <RadioButton.h>
17 #include <Slider.h>
18 #include <StringView.h>
19 #include <TextControl.h>
20 
21 #include "SettingsPane.h"
22 
23 
24 class GeneralView : public SettingsPane {
25 public:
26 							GeneralView(SettingsHost* host);
27 
28 	virtual	void			AttachedToWindow();
29 	virtual	void			MessageReceived(BMessage* msg);
30 
31 			// SettingsPane hooks
32 			status_t		Load(BMessage&);
33 			status_t		Save(BMessage&);
34 			status_t		Revert();
35 			bool			RevertPossible();
36 			status_t		Defaults();
37 			bool			DefaultsPossible();
38 			bool			UseDefaultRevertButtons();
39 
40 private:
41 		BCheckBox*			fNotificationBox;
42 		BSlider*			fDurationSlider;
43 		BSlider*			fWidthSlider;
44 		BPopUpMenu*			fPositionMenu;
45 
46 
47 		int32				fOriginalTimeout;
48 		float				fOriginalWidth;
49 		icon_size			fOriginalIconSize;
50 		uint32				fOriginalPosition;
51 		uint32				fNewPosition;
52 
53 		void				_EnableControls();
54 		void				_SetTimeoutLabel(int32 value);
55 		bool				_IsServerRunning();
56 };
57 
58 #endif // _GENERAL_VIEW_H
59