Work in progress of mail rework.
* 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.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
#ifndef FILE_CONFIG_VIEW
|
||||
#define FILE_CONFIG_VIEW
|
||||
/* FileConfigView - a file configuration view for filters
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
/*
|
||||
* 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 _FILE_CONFIG_VIEW_H
|
||||
#define _FILE_CONFIG_VIEW_H
|
||||
|
||||
|
||||
#include <View.h>
|
||||
@@ -13,45 +15,56 @@
|
||||
class BTextControl;
|
||||
class BButton;
|
||||
|
||||
class BFileControl : public BView
|
||||
{
|
||||
public:
|
||||
BFileControl(BRect rect,const char *name,const char *label,const char *pathOfFile = NULL,uint32 flavors = B_DIRECTORY_NODE);
|
||||
~BFileControl();
|
||||
|
||||
virtual void AttachedToWindow();
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
namespace BPrivate {
|
||||
|
||||
void SetText(const char *pathOfFile);
|
||||
const char *Text() const;
|
||||
|
||||
void SetEnabled(bool enabled);
|
||||
class FileControl : public BView {
|
||||
public:
|
||||
FileControl(const char* name, const char* label,
|
||||
const char* pathOfFile = NULL,
|
||||
uint32 flavors = B_DIRECTORY_NODE);
|
||||
virtual ~FileControl();
|
||||
|
||||
virtual void GetPreferredSize(float *width, float *height);
|
||||
virtual void AttachedToWindow();
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
|
||||
private:
|
||||
BTextControl *fText;
|
||||
BButton *fButton;
|
||||
void SetText(const char* pathOfFile);
|
||||
const char* Text() const;
|
||||
|
||||
BFilePanel *fPanel;
|
||||
|
||||
uint32 _reserved[5];
|
||||
void SetEnabled(bool enabled);
|
||||
|
||||
private:
|
||||
BTextControl* fText;
|
||||
BButton* fButton;
|
||||
|
||||
BFilePanel* fPanel;
|
||||
|
||||
uint32 _reserved[5];
|
||||
};
|
||||
|
||||
class BMailFileConfigView : public BFileControl
|
||||
{
|
||||
public:
|
||||
BMailFileConfigView(const char *label,const char *name,bool useMeta = false,const char *defaultPath = NULL,uint32 flavors = B_DIRECTORY_NODE);
|
||||
|
||||
void SetTo(const BMessage *archive, BMessage *metadata);
|
||||
virtual status_t Archive(BMessage *into, bool deep = true) const;
|
||||
class MailFileConfigView : public FileControl {
|
||||
public:
|
||||
MailFileConfigView(const char* label,
|
||||
const char* name, bool useMeta = false,
|
||||
const char* defaultPath = NULL,
|
||||
uint32 flavors = B_DIRECTORY_NODE);
|
||||
|
||||
private:
|
||||
BMessage *fMeta;
|
||||
bool fUseMeta;
|
||||
const char *fName;
|
||||
void SetTo(const BMessage* archive,
|
||||
BMessage* metadata);
|
||||
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
||||
|
||||
uint32 _reserved[5];
|
||||
private:
|
||||
BMessage* fMeta;
|
||||
bool fUseMeta;
|
||||
const char* fName;
|
||||
|
||||
uint32 _reserved[5];
|
||||
};
|
||||
|
||||
#endif /* FILE_CONFIG_VIEW */
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
#endif // _FILE_CONFIG_VIEW_H
|
||||
|
||||
Reference in New Issue
Block a user