1/*
2 * Copyright 2011, Haiku, Inc. All rights reserved.
3 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef FILTER_ADDON_LIST_H
7#define FILTER_ADDON_LIST_H
8
9
10#include "MailSettings.h"
11
12#include <View.h>
13
14
15enum direction {
16	kIncomming,
17	kOutgoing
18};
19
20
21struct FilterAddonInfo {
22	image_id		image;
23	entry_ref		ref;
24};
25
26
27class FilterAddonList {
28public:
29								FilterAddonList(direction dir,
30									bool loadOnStart = true);
31								~FilterAddonList();
32
33			void				Reload();
34
35			int32				CountFilterAddons();
36			FilterAddonInfo&	FilterAddonAt(int32 index);
37
38			bool				GetDescriptiveName(int32 index, BString& name);
39			bool				GetDescriptiveName(const entry_ref& ref,
40									BString& name);
41
42			BView*				CreateConfigView(AddonSettings& settings);
43
44			int32				FindInfo(const entry_ref& ref);
45private:
46			void				_MakeEmpty();
47			void				_LoadAddon(BEntry& entry);
48
49			direction				fDirection;
50			std::vector<FilterAddonInfo>	fFilterAddonList;
51};
52
53
54#endif //FILTER_ADDON_LIST_H
55