xref: /haiku/src/preferences/filetypes/FileTypeWindow.h (revision 2beda3bb5be8191b672688bed7ddcadd2b17dc41)
1 /*
2  * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef FILE_TYPE_WINDOW_H
6 #define FILE_TYPE_WINDOW_H
7 
8 
9 #include <Mime.h>
10 #include <String.h>
11 #include <Window.h>
12 
13 #include <ObjectList.h>
14 
15 class BButton;
16 class BMenuField;
17 class BTextControl;
18 
19 class IconView;
20 class MimeTypeListView;
21 
22 
23 class FileTypeWindow : public BWindow {
24 	public:
25 		FileTypeWindow(BPoint position, const BMessage& refs);
26 		virtual ~FileTypeWindow();
27 
28 		virtual void MessageReceived(BMessage* message);
29 		virtual bool QuitRequested();
30 
31 	private:
32 		BString _Title(const BMessage& refs);
33 		void _SetTo(const BMessage& refs);
34 		void _AdoptType(BMessage* message);
35 		void _AdoptType();
36 		void _AdoptPreferredApp(BMessage* message, bool sameAs);
37 		void _AdoptPreferredApp();
38 		void _UpdatePreferredApps();
39 
40 	private:
41 		BObjectList<entry_ref> fEntries;
42 		BString			fCommonType;
43 		BString			fCommonPreferredApp;
44 
45 		BTextControl*	fTypeControl;
46 		BButton*		fSelectTypeButton;
47 		BButton*		fSameTypeAsButton;
48 
49 		IconView*		fIconView;
50 
51 		BMenuField*		fPreferredField;
52 		BButton*		fSelectAppButton;
53 		BButton*		fSameAppAsButton;
54 };
55 
56 #endif // FILE_TYPE_WINDOW_H
57