BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / add-ons / network_settings / dialup / PPPoEAddon.h
blobef76c9dcc71d1a96dc2e5e3869581e6a9e62a26b
1 /*
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.
5 */
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"
17 #include <String.h>
18 #include <TextControl.h>
20 class BMenuField;
21 class BMenuItem;
22 class PPPoEView;
25 class PPPoEAddon : public DialUpAddon {
26 public:
27 PPPoEAddon(BMessage *addons);
28 virtual ~PPPoEAddon();
30 bool IsNew() const
31 { return fIsNew; }
33 const char *InterfaceName() const
34 { return fInterfaceName.String(); }
35 const char *ServiceName() const
36 { return fServiceName.String(); }
38 BMessage *Settings() const
39 { return fSettings; }
40 BMessage *Profile() const
41 { return fProfile; }
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,
52 bool saveTemporary);
53 virtual bool GetPreferredSize(float *width, float *height) const;
54 virtual BView *CreateView();
56 void UnregisterView()
57 { fPPPoEView = NULL; }
59 private:
60 bool fIsNew;
61 BString fInterfaceName, fServiceName;
62 BMessage *fSettings, *fProfile;
63 // saves last settings state
64 PPPoEView *fPPPoEView;
65 float fHeight;
66 // height of PPPoEView
70 class PPPoEView : public BView {
71 public:
72 PPPoEView(PPPoEAddon *addon, BRect frame);
73 virtual ~PPPoEView();
75 PPPoEAddon *Addon() const
76 { return fAddon; }
77 void Reload();
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);
87 private:
88 void ReloadInterfaces();
90 private:
91 PPPoEAddon *fAddon;
92 BMenuField *fInterface;
93 BMenuItem *fOtherInterface;
94 BString fInterfaceName;
95 BTextControl *fServiceName;
99 #endif