1/* 2 * Copyright 2015 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel D��rfler, <axeld@pinc-software.de> 7 */ 8#ifndef SERVICE_VIEW_H 9#define SERVICE_VIEW_H 10 11 12#include <NetworkSettings.h> 13#include <GroupView.h> 14 15 16using namespace BNetworkKit; 17 18class BButton; 19 20 21class ServiceView : public BGroupView { 22public: 23 ServiceView(const char* name, 24 const char* executable, const char* title, 25 const char* description, 26 BNetworkSettings& settings); 27 virtual ~ServiceView(); 28 29 bool IsRevertable() const; 30 status_t Revert(); 31 32 void SettingsUpdated(uint32 which); 33 34 virtual void AttachedToWindow(); 35 virtual void MessageReceived(BMessage* message); 36 37protected: 38 virtual bool IsEnabled() const; 39 virtual void Enable(); 40 virtual void Disable(); 41 42private: 43 void _Toggle(); 44 void _UpdateEnableButton(); 45 46protected: 47 const char* fName; 48 const char* fExecutable; 49 BNetworkSettings& fSettings; 50 BButton* fEnableButton; 51 bool fWasEnabled; 52}; 53 54 55#endif // SERVICE_VIEW_H 56