xref: /haiku/src/preferences/backgrounds/ImageFilePanel.h (revision 99d027cd0238c1d86da86d7c3f4200509ccc61a6)
1 /*
2  * Copyright 2002-2009, 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 <FilePanel.h>
13 #include <Node.h>
14 
15 
16 class BStringView;
17 class BView;
18 
19 
20 class CustomRefFilter : public BRefFilter {
21 public:
22 							CustomRefFilter(bool imageFiltering);
23 	virtual					~CustomRefFilter() {};
24 
25 			bool			Filter(const entry_ref* ref, BNode* node,
26 								struct stat_beos* st, const char* filetype);
27 
28 protected:
29 			bool			fImageFiltering;
30 								// true for images
31 								// false for directory
32 };
33 
34 
35 class ImageFilePanel : public BFilePanel {
36 public:
37 							ImageFilePanel(file_panel_mode mode = B_OPEN_PANEL,
38 								BMessenger* target = NULL,
39 								const entry_ref* startDirectory = NULL,
40 								uint32 nodeFlavors = 0,
41 								bool allowMultipleSelection = true,
42 								BMessage* message = NULL,
43 								BRefFilter* filter = NULL,
44 								bool modal = false,
45 								bool hideWhenDone = true);
46 							~ImageFilePanel();
47 
48 	virtual	void			SelectionChanged();
49 			void			Show();
50 
51 protected:
52 			BView*			fImageView;
53 			BStringView*	fResolutionView;
54 			BStringView*	fImageTypeView;
55 };
56 
57 #endif	// IMAGE_FILE_PANEL_H
58 
59