Fix FreeBSD build.
[haiku.git] / src / preferences / network / ServiceView.h
blob9ffe81a03de852169ba4c9347af10a705e58b0af
1 /*
2 * Copyright 2015 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, <axeld@pinc-software.de>
7 */
8 #ifndef SERVICE_VIEW_H
9 #define SERVICE_VIEW_H
12 #include <NetworkSettings.h>
13 #include <View.h>
16 using namespace BNetworkKit;
18 class BButton;
21 class ServiceView : public BView {
22 public:
23 ServiceView(const char* name,
24 const char* executable, const char* title,
25 const char* description,
26 BNetworkSettings& settings);
27 virtual ~ServiceView();
29 bool IsRevertable() const;
30 status_t Revert();
32 void SettingsUpdated(uint32 which);
34 virtual void AttachedToWindow();
35 virtual void MessageReceived(BMessage* message);
37 protected:
38 virtual bool IsEnabled() const;
39 virtual void Enable();
40 virtual void Disable();
42 private:
43 void _Toggle();
44 void _UpdateEnableButton();
46 protected:
47 const char* fName;
48 const char* fExecutable;
49 BNetworkSettings& fSettings;
50 BButton* fEnableButton;
51 bool fWasEnabled;
55 #endif // SERVICE_VIEW_H