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 // 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"
18 #include <RadioButton.h>
20 class ConnectionOptionsView
;
23 class ConnectionOptionsAddon
: public DialUpAddon
{
25 ConnectionOptionsAddon(BMessage
*addons
);
26 virtual ~ConnectionOptionsAddon();
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
40 BMessage
*Profile() const
43 virtual int32
Position() const
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
,
49 virtual bool GetPreferredSize(float *width
, float *height
) const;
50 virtual BView
*CreateView();
54 bool fDoesDialOnDemand
, fAskBeforeDialing
, fDoesAutoRedial
;
55 BMessage
*fSettings
, *fProfile
;
56 // saves last settings state
57 ConnectionOptionsView
*fConnectionOptionsView
;
61 class ConnectionOptionsView
: public BView
{
63 ConnectionOptionsView(ConnectionOptionsAddon
*addon
);
65 ConnectionOptionsAddon
*Addon() const
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
);
80 void UpdateControls();
83 ConnectionOptionsAddon
*fAddon
;
84 BCheckBox
*fDialOnDemand
, *fAskBeforeDialing
, *fAutoRedial
;