xref: /haiku/src/apps/expander/ExpanderWindow.h (revision 1acbe440b8dd798953bec31d18ee589aa3f71b73)
1 /*
2  * Copyright 2004-2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Jérôme Duval
7  */
8 #ifndef EXPANDER_WINDOW_H
9 #define EXPANDER_WINDOW_H
10 
11 
12 #include "DirectoryFilePanel.h"
13 #include "ExpanderRules.h"
14 
15 #include <Window.h>
16 
17 class BCheckBox;
18 class BMenu;
19 class BScrollView;
20 class BStringView;
21 class BTextControl;
22 class BTextView;
23 
24 class ExpanderThread;
25 class ExpanderPreferences;
26 
27 
28 class ExpanderWindow : public BWindow {
29 	public:
30 		ExpanderWindow(BRect frameRect, const entry_ref *ref, BMessage *settings);
31 		virtual ~ExpanderWindow();
32 
33 		virtual void FrameResized(float width, float height);
34 		virtual void MessageReceived(BMessage *msg);
35 		virtual bool QuitRequested();
36 
37 		void SetRef(const entry_ref *ref);
38 		void RefsReceived(BMessage *msg);
39 
40 	private:
41 		bool CanQuit();
42 		// returns true if the window can be closed safely, false if not
43 		void CloseWindowOrKeepOpen();
44 		void OpenDestFolder();
45 		void AutoListing();
46 		void AutoExpand();
47 		void StartExpanding();
48 		void StopExpanding();
49 		void _UpdateWindowSize(bool showContents);
50 		void StartListing();
51 		void StopListing();
52 
53 		BFilePanel *fSourcePanel;
54 		DirectoryFilePanel *fDestPanel;
55 		BMenuBar *fBar;
56 		BMenu *fMenu;
57 		entry_ref fSourceRef;
58 		entry_ref fDestRef;
59 		bool fSourceChanged;
60 
61 		BButton *fSourceButton, *fDestButton, *fExpandButton;
62 		BMenuItem *fExpandItem, *fShowItem, *fStopItem,
63 			*fSourceItem, *fDestItem, *fPreferencesItem;
64 		BCheckBox *fShowContents;
65 		BTextControl *fSourceText, *fDestText;
66 		BStringView* fStatusView;
67 		BTextView *fListingText;
68 		BScrollView *fListingScroll;
69 
70 		ExpanderThread *fListingThread;
71 		bool fListingStarted;
72 
73 		ExpanderThread *fExpandingThread;
74 		bool fExpandingStarted;
75 
76 		BMessage fSettings;
77 		ExpanderPreferences *fPreferences;
78 		ExpanderRules fRules;
79 };
80 
81 #endif /* EXPANDER_WINDOW_H */
82