2 * Copyright 2003-2004 Waldemar Kornewald. All rights reserved.
3 * Copyright 2017 Haiku, Inc. All rights reserved.
4 * Distributed under the terms of the MIT License.
7 //-----------------------------------------------------------------------
8 // PPPoEAddon saves the loaded settings.
9 // PPPoEView saves the current settings.
10 //-----------------------------------------------------------------------
12 #ifndef _PPPoE_ADDON__H
13 #define _PPPoE_ADDON__H
15 #include "DialUpAddon.h"
18 #include <TextControl.h>
25 class PPPoEAddon
: public DialUpAddon
{
27 PPPoEAddon(BMessage
*addons
);
28 virtual ~PPPoEAddon();
33 const char *InterfaceName() const
34 { return fInterfaceName
.String(); }
35 const char *ServiceName() const
36 { return fServiceName
.String(); }
38 BMessage
*Settings() const
40 BMessage
*Profile() const
43 virtual const char *FriendlyName() const;
44 virtual const char *TechnicalName() const;
45 virtual const char *KernelModuleName() const;
47 virtual bool LoadSettings(BMessage
*settings
, BMessage
*profile
, bool isNew
);
49 virtual void IsModified(bool *settings
, bool *profile
) const;
51 virtual bool SaveSettings(BMessage
*settings
, BMessage
*profile
,
53 virtual bool GetPreferredSize(float *width
, float *height
) const;
54 virtual BView
*CreateView();
57 { fPPPoEView
= NULL
; }
61 BString fInterfaceName
, fServiceName
;
62 BMessage
*fSettings
, *fProfile
;
63 // saves last settings state
64 PPPoEView
*fPPPoEView
;
66 // height of PPPoEView
70 class PPPoEView
: public BView
{
72 PPPoEView(PPPoEAddon
*addon
, BRect frame
);
75 PPPoEAddon
*Addon() const
79 const char *InterfaceName() const
80 { return fInterfaceName
.String(); }
81 const char *ServiceName() const
82 { return fServiceName
->Text(); }
84 virtual void AttachedToWindow();
85 virtual void MessageReceived(BMessage
*message
);
88 void ReloadInterfaces();
92 BMenuField
*fInterface
;
93 BMenuItem
*fOtherInterface
;
94 BString fInterfaceName
;
95 BTextControl
*fServiceName
;