vfs: check userland buffers before reading them.
[haiku.git] / src / apps / expander / ExpanderWindow.h
blob3cf18c6c1919395549c196ab2691007571f12f7e
1 /*
2 * Copyright 2004-2006 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Jérôme Duval
7 * Karsten Heimrich, host.haiku@gmx.de
8 */
9 #ifndef _EXPANDER_WINDOW_H
10 #define _EXPANDER_WINDOW_H
13 #include <Window.h>
16 #include "DirectoryFilePanel.h"
17 #include "ExpanderRules.h"
20 class BCheckBox;
21 class BMenu;
22 class BLayout;
23 class BScrollView;
24 class BStringView;
25 class BTextControl;
26 class BTextView;
28 class ExpanderThread;
29 class ExpanderPreferences;
30 class StatusView;
33 class ExpanderWindow : public BWindow {
34 public:
35 ExpanderWindow(BRect frameRect,
36 const entry_ref* ref, BMessage* settings);
37 virtual ~ExpanderWindow();
39 virtual void MessageReceived(BMessage* message);
40 virtual bool QuitRequested();
42 // void SetRef(const entry_ref* ref);
43 void RefsReceived(BMessage* message);
45 private:
46 void _CreateMenuBar();
47 bool CanQuit();
48 // returns true if the window can be closed safely, false if not
49 void CloseWindowOrKeepOpen();
50 void OpenDestFolder();
51 void AutoListing();
52 void AutoExpand();
53 void StartExpanding();
54 void StopExpanding();
55 void _UpdateWindowSize(bool showContents);
56 void _ExpandListingText();
57 void StartListing();
58 void StopListing();
59 bool ValidateDest();
61 private:
62 BFilePanel* fSourcePanel;
63 DirectoryFilePanel* fDestPanel;
64 BMenuBar* fBar;
65 BMenu* fMenu;
66 entry_ref fSourceRef;
67 entry_ref fDestRef;
68 bool fSourceChanged;
70 BButton* fSourceButton;
71 BButton* fDestButton;
72 BButton* fExpandButton;
73 BMenuItem* fExpandItem;
74 BMenuItem* fShowItem;
75 BMenuItem* fStopItem;
76 BMenuItem* fSourceItem;
77 BMenuItem* fDestItem;
78 BMenuItem* fPreferencesItem;
79 BCheckBox* fShowContents;
80 BTextControl* fSourceText;
81 BTextControl* fDestText;
82 StatusView* fStatusView;
83 BTextView* fListingText;
84 BScrollView* fScrollView;
86 ExpanderThread* fListingThread;
87 bool fListingStarted;
89 ExpanderThread* fExpandingThread;
90 bool fExpandingStarted;
92 BMessage fSettings;
93 ExpanderPreferences* fPreferences;
94 ExpanderRules fRules;
96 float fLongestLine;
97 float fLineHeight;
98 float fSizeLimit;
99 float fPreviousHeight;
103 #endif // _EXPANDER_WINDOW_H