fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / preferences / mail / ConfigWindow.h
blob84336e0243d9cc8193c0a4a0a479857db68d0707
1 /*
2 * Copyright 2004-2012, Haiku Inc. All rights reserved.
3 * Copyright 2001, Dr. Zoidberg Enterprises. All rights reserved.
4 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
6 * Distributed under the terms of the MIT License.
7 */
8 #ifndef CONFIG_WINDOW_H
9 #define CONFIG_WINDOW_H
12 #include <Window.h>
13 #include <ObjectList.h>
14 #include <ListItem.h>
16 #include "MailSettings.h"
19 class BPopup;
20 class BTextControl;
21 class BCheckBox;
22 class BListView;
23 class BButton;
24 class BMenuField;
25 class BMailSettings;
26 class CenterContainer;
29 enum item_types {
30 ACCOUNT_ITEM = 0,
31 INBOUND_ITEM,
32 OUTBOUND_ITEM,
33 FILTER_ITEM
37 class AccountItem : public BStringItem {
38 public:
39 AccountItem(const char* label,
40 BMailAccountSettings* account,
41 item_types type);
43 void Update(BView* owner, const BFont* font);
44 void DrawItem(BView* owner, BRect rect,
45 bool complete);
46 BMailAccountSettings* Account() { return fAccount; }
47 item_types Type() { return fType; }
49 private:
50 BMailAccountSettings* fAccount;
51 item_types fType;
55 class ConfigWindow : public BWindow {
56 public:
57 ConfigWindow();
58 ~ConfigWindow();
60 bool QuitRequested();
61 void MessageReceived(BMessage* msg);
63 BMailAccountSettings* AddAccount();
64 void AccountUpdated(BMailAccountSettings* account);
66 private:
67 BView* _BuildHowToView();
69 void _LoadSettings();
70 void _LoadAccounts();
71 void _SaveSettings();
73 status_t _SetToGeneralSettings(BMailSettings *general);
74 void _RevertToLastSettings();
76 void _AddAccountToView(
77 BMailAccountSettings* account);
78 void _RemoveAccount(BMailAccountSettings* account);
79 void _RemoveAccountFromListView(
80 BMailAccountSettings* account);
81 void _AccountSelected(AccountItem* item);
82 void _ReplaceConfigView(BView* view);
84 private:
85 BListView* fAccountsListView;
86 BMailAccountSettings* fLastSelectedAccount;
87 BView* fConfigView;
88 BButton* fRemoveButton;
90 BCheckBox* fCheckMailCheckBox;
91 BTextControl* fIntervalControl;
92 BMenuField* fStatusModeField;
94 bool fSaveSettings;
95 BObjectList<BMailAccountSettings> fAccounts;
96 BObjectList<BMailAccountSettings> fToDeleteAccounts;
99 #endif /* CONFIG_WINDOW_H */