715bf3d17a
* Not everything compiles; all protocols, and inbound filters do, though. * Renamed a few classes to give a better idea what they are for; prefixed public classes with the 'B' prefix. * Moved ProtocolConfigView's classes into the BPrivate namespace. * Moved BMailFilter into its own file. * Added BMailFilter::DescriptiveName(). This is now used by the RuleFilter in order to give a description of what it's doing (ie. no more dozens of "Rule filter" entries in the preferences). * Removed no longer used MailAddon.h. * Renamed Addon to AddOn where found, since that is more consistent with the rest of the API. * Merged the former MailProtocol with the former MailProtocolThread; the differentiation between those two was pretty messy. * All configuration views touched so far are now using the layout kit. * The RuleFilter is currently broken functionality wise; I have not yet decided how to solve the stuff it uses (TriggerFileMove() does not exist anymore, for example). * BMailAddOnSettings (formerly known as AddonSettings) now directly subclass BMessage; there are no Settings() and EditSettings() method anymore. The class uses a copy of itself to determine whether or not it has been changed. * Lots of cleanup.
107 lines
2.7 KiB
C++
107 lines
2.7 KiB
C++
/*
|
|
* Copyright 2004-2012, Haiku Inc. All rights reserved.
|
|
* Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
|
*
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _PROTOCOL_CONFIG_VIEW_H
|
|
#define _PROTOCOL_CONFIG_VIEW_H
|
|
|
|
|
|
#include <CheckBox.h>
|
|
#include <StringView.h>
|
|
#include <TextControl.h>
|
|
#include <View.h>
|
|
|
|
#include <MailSettings.h>
|
|
|
|
|
|
class BCheckBox;
|
|
class BGridLayout;
|
|
class BMenuField;
|
|
class BTextControl;
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
class BodyDownloadConfig : public BView {
|
|
public:
|
|
BodyDownloadConfig();
|
|
|
|
void SetTo(BMailProtocolSettings& settings);
|
|
|
|
void MessageReceived(BMessage* message);
|
|
void AttachedToWindow();
|
|
void GetPreferredSize(float* width, float* height);
|
|
status_t Archive(BMessage* into, bool deep = true) const;
|
|
|
|
private:
|
|
BTextControl* fSizeBox;
|
|
BCheckBox* fPartialBox;
|
|
BStringView* fBytesLabel;
|
|
};
|
|
|
|
|
|
enum mail_protocol_config_options {
|
|
B_MAIL_PROTOCOL_HAS_AUTH_METHODS = 1,
|
|
B_MAIL_PROTOCOL_HAS_FLAVORS = 2,
|
|
B_MAIL_PROTOCOL_HAS_USERNAME = 4,
|
|
B_MAIL_PROTOCOL_HAS_PASSWORD = 8,
|
|
B_MAIL_PROTOCOL_HAS_HOSTNAME = 16,
|
|
B_MAIL_PROTOCOL_CAN_LEAVE_MAIL_ON_SERVER = 32,
|
|
B_MAIL_PROTOCOL_PARTIAL_DOWNLOAD = 64
|
|
};
|
|
|
|
|
|
class MailProtocolConfigView : public BView {
|
|
public:
|
|
MailProtocolConfigView(uint32 optionsMask
|
|
= B_MAIL_PROTOCOL_HAS_FLAVORS
|
|
| B_MAIL_PROTOCOL_HAS_USERNAME
|
|
| B_MAIL_PROTOCOL_HAS_PASSWORD
|
|
| B_MAIL_PROTOCOL_HAS_HOSTNAME);
|
|
virtual ~MailProtocolConfigView();
|
|
|
|
void SetTo(BMailProtocolSettings& settings);
|
|
|
|
void AddFlavor(const char* label);
|
|
void AddAuthMethod(const char* label,
|
|
bool needUserPassword = true);
|
|
|
|
BGridLayout* Layout() const;
|
|
|
|
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
|
|
|
virtual void AttachedToWindow();
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
private:
|
|
BTextControl* _AddTextControl(BGridLayout* layout,
|
|
const char* name, const char* label);
|
|
BMenuField* _AddMenuField(BGridLayout* layout,
|
|
const char* name, const char* label);
|
|
void _StoreIndexOfMarked(BMessage& message,
|
|
const char* name, BMenuField* field) const;
|
|
void _StoreCheckBox(BMessage& message,
|
|
const char* name,
|
|
BCheckBox* checkBox) const;
|
|
void _SetCredentialsEnabled(bool enabled);
|
|
|
|
private:
|
|
BTextControl* fHostControl;
|
|
BTextControl* fUserControl;
|
|
BTextControl* fPasswordControl;
|
|
BMenuField* fFlavorField;
|
|
BMenuField* fAuthenticationField;
|
|
BCheckBox* fLeaveOnServerCheckBox;
|
|
BCheckBox* fRemoveFromServerCheckBox;
|
|
BodyDownloadConfig* fBodyDownloadConfig;
|
|
};
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
#endif /* _PROTOCOL_CONFIG_VIEW_H */
|