xref: /haiku/src/preferences/backgrounds/ImageFilePanel.h (revision bcfe344c537cb0dcee183c5a9afb4c362f5abe86)
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 		virtual ~CustomRefFilter() {};
23 
24 		bool Filter(const entry_ref *ref, BNode* node, struct stat_beos *st,
25 			const char *filetype);
26 
27 	protected:
28 		bool fImageFiltering;	// true for images only, false for directory only
29 };
30 
31 
32 class ImageFilePanel : public BFilePanel {
33 	public:
34 		ImageFilePanel(file_panel_mode mode = B_OPEN_PANEL,
35 			BMessenger* target = NULL, const entry_ref* startDirectory = NULL,
36 			uint32 nodeFlavors = 0, bool allowMultipleSelection = true,
37 			BMessage* message = NULL, BRefFilter* filter = NULL,
38 			bool modal = false, bool hideWhenDone = true);
39 		~ImageFilePanel();
40 
41 		virtual void SelectionChanged();
42 
43 		void Show();
44 
45 	protected:
46 		BView*			fImageView;
47 		BStringView*	fResolutionView;
48 		BStringView*	fImageTypeView;
49 };
50 
51 #endif	// IMAGE_FILE_PANEL_H
52