1 /* 2 * Copyright 2007-2012, Haiku, Inc. All rights reserved. 3 * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved. 4 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de> 5 * Distributed under the terms of the MIT License. 6 */ 7 #ifndef FILTER_CONFIG_VIEW_H 8 #define FILTER_CONFIG_VIEW_H 9 10 11 #include <vector> 12 13 #include <Box.h> 14 #include <Button.h> 15 #include <ListView.h> 16 #include <MailSettings.h> 17 #include <Message.h> 18 #include <MenuField.h> 19 20 #include "FilterList.h" 21 22 23 class FilterConfigBox; 24 25 26 class FiltersConfigView : public BBox { 27 public: 28 FiltersConfigView( 29 BMailAccountSettings& account); 30 ~FiltersConfigView(); 31 32 void AttachedToWindow(); 33 void DetachedFromWindow(); 34 void MessageReceived(BMessage *msg); 35 36 private: 37 BMailProtocolSettings* _MailSettings(); 38 ::FilterList* _FilterList(); 39 40 void _SelectFilter(int32 index); 41 void _SetDirection(direction direction); 42 void _SaveConfig(int32 index); 43 44 private: 45 BMailAccountSettings& fAccount; 46 direction fDirection; 47 48 ::FilterList fInboundFilters; 49 ::FilterList fOutboundFilters; 50 51 BMenuField* fChainsField; 52 BListView* fListView; 53 BMenuField* fAddField; 54 BButton* fRemoveButton; 55 FilterConfigBox* fFilterView; 56 57 int32 fCurrentIndex; 58 }; 59 60 #endif //FILTER_CONFIG_VIEW_H 61