2 * Copyright 2007-2015, Haiku, Inc. All rights reserved.
3 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
4 * Distributed under the terms of the MIT License.
6 #ifndef AUTO_CONFIG_VIEW_H
7 #define AUTO_CONFIG_VIEW_H
10 #include "AutoConfig.h"
11 #include "ConfigViews.h"
15 #include <GroupView.h>
16 #include <MenuField.h>
18 #include <TextControl.h>
23 const int32 kNameChangedMsg
= '?nch';
24 const int32 kEMailChangedMsg
= '?ech';
25 const int32 kProtokollChangedMsg
= '?pch';
26 const int32 kServerChangedMsg
= '?sch';
37 protocol_type inboundType
;
38 entry_ref inboundProtocol
;
39 entry_ref outboundProtocol
;
45 provider_info providerInfo
;
49 class AutoConfigView
: public BBox
{
51 AutoConfigView(AutoConfig
& config
);
53 virtual void AttachedToWindow();
54 virtual void MessageReceived(BMessage
* msg
);
56 bool GetBasicAccountInfo(account_info
& info
);
57 bool IsValidMailAddress(BString email
);
60 BPopUpMenu
* _SetupProtocolMenu();
61 status_t
_GetSMTPAddOnRef(entry_ref
* ref
);
63 BString
_ExtractLocalPart(const char* email
);
64 void _ProposeUsername();
67 entry_ref fSMTPAddOnRef
;
68 BMenuField
* fInProtocolsField
;
69 BTextControl
* fNameView
;
70 BTextControl
* fAccountNameView
;
71 BTextControl
* fEmailView
;
72 BTextControl
* fLoginNameView
;
73 BTextControl
* fPasswordView
;
75 // ref to the parent autoconfig so you only ones read the database
76 AutoConfig
& fAutoConfig
;
80 class ServerSettingsView
: public BGroupView
{
82 ServerSettingsView(const account_info
& info
);
83 ~ServerSettingsView();
84 void GetServerInfo(account_info
& info
);
87 void _DetectMenuChanges();
88 bool _HasMarkedChanged(BMenuField
* field
,
89 BMenuItem
* originalItem
);
90 void _GetAuthEncrMenu(entry_ref protocol
,
91 BMenuField
*& authField
,
92 BMenuField
*& sslField
);
96 bool fOutboundAccount
;
97 BTextControl
* fInboundNameView
;
98 BMenuField
* fInboundAuthMenu
;
99 BMenuField
* fInboundEncryptionMenu
;
100 BTextControl
* fOutboundNameView
;
101 BMenuField
* fOutboundAuthMenu
;
102 BMenuField
* fOutboundEncryptionMenu
;
104 BMenuItem
* fInboundAuthItemStart
;
105 BMenuItem
* fInboundEncrItemStart
;
106 BMenuItem
* fOutboundAuthItemStart
;
107 BMenuItem
* fOutboundEncrItemStart
;
113 #endif // AUTO_CONFIG_VIEW_H