xref: /haiku/src/apps/expander/DirectoryFilePanel.h (revision 67bce78b48ed6d01b5a8eef89f5694c372b7e0a1)
1 /*****************************************************************************/
2 // Expander
3 // Written by Jérôme Duval
4 //
5 // DirectoryFilePanel.h
6 //
7 // Copyright (c) 2004 OpenBeOS Project
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a
10 // copy of this software and associated documentation files (the "Software"),
11 // to deal in the Software without restriction, including without limitation
12 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 // and/or sell copies of the Software, and to permit persons to whom the
14 // Software is furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included
17 // in all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 /*****************************************************************************/
27 
28 #ifndef _DirectoryFilePanel_h
29 #define _DirectoryFilePanel_h
30 
31 #include <FilePanel.h>
32 #include <Button.h>
33 
34 const uint32 MSG_DIRECTORY = 'mDIR';
35 
36 
37 class DirectoryRefFilter : public BRefFilter {
38 	public:
39 		DirectoryRefFilter();
40 		bool Filter(const entry_ref *ref, BNode* node, struct stat *st,
41 			const char *filetype);
42 };
43 
44 
45 class DirectoryFilePanel : public BFilePanel {
46 	public:
47 		DirectoryFilePanel(file_panel_mode mode = B_OPEN_PANEL,
48 			BMessenger *target = 0, const entry_ref *start_directory = 0,
49 			uint32 node_flavors = 0, bool allow_multiple_selection = true,
50 			BMessage *message = 0, BRefFilter * = 0,
51 			bool modal = false, bool hide_when_done = true);
52 		virtual void SelectionChanged(void);
53 		virtual void Show();
54 
55 	protected:
56 		BButton *fCurrentButton;
57 };
58 
59 #endif