2 * Copyright 2007-2012, 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 <MenuField.h>
17 #include <TextControl.h>
20 const int32 kNameChangedMsg
= '?nch';
21 const int32 kEMailChangedMsg
= '?ech';
22 const int32 kProtokollChangedMsg
= '?pch';
23 const int32 kServerChangedMsg
= '?sch';
34 protocol_type inboundType
;
35 entry_ref inboundProtocol
;
36 entry_ref outboundProtocol
;
42 provider_info providerInfo
;
46 class AutoConfigView
: public BBox
{
48 AutoConfigView(BRect rect
, AutoConfig
& config
);
50 virtual void AttachedToWindow();
51 virtual void MessageReceived(BMessage
*msg
);
53 bool GetBasicAccountInfo(account_info
&info
);
54 bool IsValidMailAddress(BString email
);
57 BMenuField
* _SetupProtocolView(BRect rect
);
58 status_t
_GetSMTPAddonRef(entry_ref
*ref
);
60 BString
_ExtractLocalPart(const char* email
);
61 void _ProposeUsername();
64 entry_ref fSMTPAddonRef
;
65 BMenuField
* fInProtocolsField
;
66 BTextControl
* fNameView
;
67 BTextControl
* fAccountNameView
;
68 BTextControl
* fEmailView
;
69 BTextControl
* fLoginNameView
;
70 BTextControl
* fPasswordView
;
72 // ref to the parent autoconfig so you only ones read the database
73 AutoConfig
& fAutoConfig
;
77 class ServerSettingsView
: public BView
{
79 ServerSettingsView(BRect rect
,
80 const account_info
& info
);
81 ~ServerSettingsView();
82 void GetServerInfo(account_info
& info
);
85 void _DetectMenuChanges();
86 void _GetAuthEncrMenu(entry_ref protocol
,
87 BMenuField
** authField
,
88 BMenuField
** sslField
);
92 bool fOutboundAccount
;
93 BTextControl
* fInboundNameView
;
94 BMenuField
* fInboundAuthMenu
;
95 BMenuField
* fInboundEncryptionMenu
;
96 BTextControl
* fOutboundNameView
;
97 BMenuField
* fOutboundAuthMenu
;
98 BMenuField
* fOutboundEncryptionMenu
;
100 BMenuItem
* fInboundAuthItemStart
;
101 BMenuItem
* fInboundEncrItemStart
;
102 BMenuItem
* fOutboundAuthItemStart
;
103 BMenuItem
* fOutboundEncrItemStart
;
109 #endif // AUTO_CONFIG_VIEW_H