xref: /haiku/src/preferences/backgrounds/ImageFilePanel.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2002-2005, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Jerome Duval (jerome.duval@free.fr)
7  */
8 #ifndef IMAGE_FILE_PANEL_H
9 #define IMAGE_FILE_PANEL_H
10 
11 
12 #include <Node.h>
13 #include <FilePanel.h>
14 
15 class BStringView;
16 class BView;
17 
18 
19 class CustomRefFilter : public BRefFilter {
20 	public:
21 		CustomRefFilter(bool imageFiltering);
22 
23 		bool Filter(const entry_ref *ref, BNode* node, struct stat *st,
24 			const char *filetype);
25 
26 	protected:
27 		bool fImageFiltering;	// true for images only, false for directory only
28 };
29 
30 
31 class ImageFilePanel : public BFilePanel {
32 	public:
33 		ImageFilePanel(file_panel_mode mode = B_OPEN_PANEL,
34 			BMessenger* target = NULL, const entry_ref* startDirectory = NULL,
35 			uint32 nodeFlavors = 0, bool allowMultipleSelection = true,
36 			BMessage* message = NULL, BRefFilter* filter = NULL,
37 			bool modal = false, bool hideWhenDone = true);
38 
39 		virtual void SelectionChanged();
40 
41 		void Show();
42 
43 	protected:
44 		BView*			fImageView;
45 		BStringView*	fResolutionView;
46 		BStringView*	fImageTypeView;
47 };
48 
49 #endif	// IMAGE_FILE_PANEL_H
50