BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / add-ons / network_settings / dialup / ConnectionOptionsAddon.h
blob075d7f027c5091a6b6d3bd1760cda3dfc7906f2d
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 // ConnectionOptionsAddon saves the loaded settings.
9 // ConnectionOptionsView saves the current settings.
10 //-----------------------------------------------------------------------
12 #ifndef _CONNECTION_OPTIONS_ADDON__H
13 #define _CONNECTION_OPTIONS_ADDON__H
15 #include "DialUpAddon.h"
17 #include <CheckBox.h>
18 #include <RadioButton.h>
20 class ConnectionOptionsView;
23 class ConnectionOptionsAddon : public DialUpAddon {
24 public:
25 ConnectionOptionsAddon(BMessage *addons);
26 virtual ~ConnectionOptionsAddon();
28 bool IsNew() const
29 { return fIsNew; }
31 bool DoesDialOnDemand() const
32 { return fDoesDialOnDemand; }
33 bool AskBeforeDialing() const
34 { return fAskBeforeDialing; }
35 bool DoesAutoRedial() const
36 { return fDoesAutoRedial; }
38 BMessage *Settings() const
39 { return fSettings; }
40 BMessage *Profile() const
41 { return fProfile; }
43 virtual int32 Position() const
44 { return 50; }
45 virtual bool LoadSettings(BMessage *settings, BMessage *profile, bool isNew);
46 virtual void IsModified(bool *settings, bool *profile) const;
47 virtual bool SaveSettings(BMessage *settings, BMessage *profile,
48 bool saveTemporary);
49 virtual bool GetPreferredSize(float *width, float *height) const;
50 virtual BView *CreateView();
52 private:
53 bool fIsNew;
54 bool fDoesDialOnDemand, fAskBeforeDialing, fDoesAutoRedial;
55 BMessage *fSettings, *fProfile;
56 // saves last settings state
57 ConnectionOptionsView *fConnectionOptionsView;
61 class ConnectionOptionsView : public BView {
62 public:
63 ConnectionOptionsView(ConnectionOptionsAddon *addon);
65 ConnectionOptionsAddon *Addon() const
66 { return fAddon; }
67 void Reload();
69 bool DoesDialOnDemand() const
70 { return fDialOnDemand->Value(); }
71 bool AskBeforeDialing() const
72 { return fAskBeforeDialing->Value(); }
73 bool DoesAutoRedial() const
74 { return fAutoRedial->Value(); }
76 virtual void AttachedToWindow();
77 virtual void MessageReceived(BMessage *message);
79 private:
80 void UpdateControls();
82 private:
83 ConnectionOptionsAddon *fAddon;
84 BCheckBox *fDialOnDemand, *fAskBeforeDialing, *fAutoRedial;
88 #endif