102be5353SAxel Dörfler/*
202be5353SAxel DörflerOpen Tracker License
302be5353SAxel Dörfler
402be5353SAxel DörflerTerms and Conditions
502be5353SAxel Dörfler
602be5353SAxel DörflerCopyright (c) 1991-2000, Be Incorporated. All rights reserved.
702be5353SAxel Dörfler
802be5353SAxel DörflerPermission is hereby granted, free of charge, to any person obtaining a copy of
902be5353SAxel Dörflerthis software and associated documentation files (the "Software"), to deal in
1002be5353SAxel Dörflerthe Software without restriction, including without limitation the rights to
1102be5353SAxel Dörfleruse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1202be5353SAxel Dörflerof the Software, and to permit persons to whom the Software is furnished to do
1302be5353SAxel Dörflerso, subject to the following conditions:
1402be5353SAxel Dörfler
1502be5353SAxel DörflerThe above copyright notice and this permission notice applies to all licensees
1602be5353SAxel Dörflerand shall be included in all copies or substantial portions of the Software.
1702be5353SAxel Dörfler
1802be5353SAxel DörflerTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1902be5353SAxel DörflerIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
2002be5353SAxel DörflerFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2102be5353SAxel DörflerBE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2202be5353SAxel DörflerAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
2302be5353SAxel DörflerWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2402be5353SAxel Dörfler
2502be5353SAxel DörflerExcept as contained in this notice, the name of Be Incorporated shall not be
2602be5353SAxel Dörflerused in advertising or otherwise to promote the sale, use or other dealings in
2702be5353SAxel Dörflerthis Software without prior written authorization from Be Incorporated.
2802be5353SAxel Dörfler
2902be5353SAxel DörflerTracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
3002be5353SAxel Dörflerof Be Incorporated in the United States and other countries. Other brand product
3102be5353SAxel Dörflernames are registered trademarks or trademarks of their respective holders.
3202be5353SAxel DörflerAll rights reserved.
3302be5353SAxel Dörfler*/
34b05aa8b5SJohn Scipione#ifndef _CONTAINER_WINDOW_H
3502be5353SAxel Dörfler#define _CONTAINER_WINDOW_H
3602be5353SAxel Dörfler
37b05aa8b5SJohn Scipione
38e7803cf1SAugustin Cavalier#include <GroupView.h>
39da51f9c3SJohn Scipione#include <StringList.h>
4002be5353SAxel Dörfler#include <Window.h>
4102be5353SAxel Dörfler
4202be5353SAxel Dörfler#include "LockingList.h"
4302be5353SAxel Dörfler#include "Model.h"
4402be5353SAxel Dörfler#include "SlowContextPopup.h"
4502be5353SAxel Dörfler#include "TaskLoop.h"
4602be5353SAxel Dörfler
47da51f9c3SJohn Scipione
48e7803cf1SAugustin Cavalierclass BGridView;
49e7803cf1SAugustin Cavalierclass BGroupLayout;
50e7803cf1SAugustin Cavalierclass BGroupView;
5102be5353SAxel Dörflerclass BPopUpMenu;
5202be5353SAxel Dörflerclass BMenuBar;
5302be5353SAxel Dörfler
5402be5353SAxel Dörflernamespace BPrivate {
5502be5353SAxel Dörfler
5602be5353SAxel Dörflerclass BNavigator;
5702be5353SAxel Dörflerclass BPoseView;
58e7803cf1SAugustin Cavalierclass DraggableContainerIcon;
5902be5353SAxel Dörflerclass ModelMenuItem;
6002be5353SAxel Dörflerclass AttributeStreamNode;
6102be5353SAxel Dörflerclass BackgroundImage;
6202be5353SAxel Dörflerclass Model;
6302be5353SAxel Dörflerclass ModelNodeLazyOpener;
64e7803cf1SAugustin Cavalierclass BorderedView;
6502be5353SAxel Dörflerclass SelectionWindow;
6602be5353SAxel Dörfler
6763c1c892SJohn Scipione
6802be5353SAxel Dörfler#define kDefaultFolderTemplate "DefaultFolderTemplate"
6902be5353SAxel Dörfler
7063c1c892SJohn Scipione
71b05aa8b5SJohn Scipioneextern const char* kAddOnsMenuName;
7202be5353SAxel Dörfler
7363c1c892SJohn Scipione
7402be5353SAxel Dörflerenum {
7502be5353SAxel Dörfler	// flags that describe opening of the window
7612104c2eSStephan Aßmus	kRestoreWorkspace	= 0x1,
7712104c2eSStephan Aßmus	kIsHidden			= 0x2,
7802be5353SAxel Dörfler		// set when opening a window during initial Tracker start
7912104c2eSStephan Aßmus	kRestoreDecor		= 0x4
8002be5353SAxel Dörfler};
8102be5353SAxel Dörfler
8263c1c892SJohn Scipione
83d058a4aeSPhilippe Saint-Pierrestruct AddonShortcut {
8463c1c892SJohn Scipione	Model*	model;
8563c1c892SJohn Scipione	char	key;
8663c1c892SJohn Scipione	char	defaultKey;
8763c1c892SJohn Scipione	uint32	modifiers;
88d058a4aeSPhilippe Saint-Pierre};
89d058a4aeSPhilippe Saint-Pierre
9063c1c892SJohn Scipione
9102be5353SAxel Dörflerclass BContainerWindow : public BWindow {
9263c1c892SJohn Scipionepublic:
9363c1c892SJohn Scipione	BContainerWindow(LockingList<BWindow>* windowList,
9463c1c892SJohn Scipione		uint32 containerWindowFlags,
9563c1c892SJohn Scipione		window_look look = B_DOCUMENT_WINDOW_LOOK,
9663c1c892SJohn Scipione		window_feel feel = B_NORMAL_WINDOW_FEEL,
97e7803cf1SAugustin Cavalier		uint32 flags = B_WILL_ACCEPT_FIRST_CLICK | B_NO_WORKSPACE_ACTIVATION,
98e7803cf1SAugustin Cavalier		uint32 workspace = B_CURRENT_WORKSPACE, bool useLayouts = true,
99e7803cf1SAugustin Cavalier		bool isDeskWindow = false);
10063c1c892SJohn Scipione
10163c1c892SJohn Scipione	virtual ~BContainerWindow();
10263c1c892SJohn Scipione
10363c1c892SJohn Scipione	virtual void Init(const BMessage* message = NULL);
104e7803cf1SAugustin Cavalier	virtual void InitLayout();
10563c1c892SJohn Scipione
10663c1c892SJohn Scipione	static BRect InitialWindowRect(window_feel);
10763c1c892SJohn Scipione
10863c1c892SJohn Scipione	virtual void Minimize(bool minimize);
10963c1c892SJohn Scipione	virtual void Quit();
11063c1c892SJohn Scipione	virtual bool QuitRequested();
11163c1c892SJohn Scipione
11263c1c892SJohn Scipione	virtual void UpdateIfTrash(Model*);
11363c1c892SJohn Scipione
11463c1c892SJohn Scipione	virtual void CreatePoseView(Model*);
11563c1c892SJohn Scipione
11663c1c892SJohn Scipione	virtual void ShowContextMenu(BPoint, const entry_ref*, BView*);
11763c1c892SJohn Scipione	virtual uint32 ShowDropContextMenu(BPoint);
11863c1c892SJohn Scipione	virtual void MenusBeginning();
11963c1c892SJohn Scipione	virtual void MenusEnded();
12063c1c892SJohn Scipione	virtual void MessageReceived(BMessage*);
12163c1c892SJohn Scipione	virtual void FrameResized(float, float);
12263c1c892SJohn Scipione	virtual void FrameMoved(BPoint);
12363c1c892SJohn Scipione	virtual void Zoom(BPoint, float, float);
12463c1c892SJohn Scipione	virtual void WorkspacesChanged(uint32, uint32);
12563c1c892SJohn Scipione
12663c1c892SJohn Scipione	// virtuals that control setup of window
12763c1c892SJohn Scipione	virtual bool ShouldAddMenus() const;
12863c1c892SJohn Scipione	virtual bool ShouldAddScrollBars() const;
12963c1c892SJohn Scipione
13063c1c892SJohn Scipione	virtual void CheckScreenIntersect();
13163c1c892SJohn Scipione
13263c1c892SJohn Scipione	bool IsTrash() const;
13363c1c892SJohn Scipione	bool InTrash() const;
13463c1c892SJohn Scipione	bool IsPrintersDir() const;
13563c1c892SJohn Scipione
13663c1c892SJohn Scipione	virtual bool IsShowing(const node_ref*) const;
13763c1c892SJohn Scipione	virtual bool IsShowing(const entry_ref*) const;
13863c1c892SJohn Scipione
13963c1c892SJohn Scipione	void ResizeToFit();
14063c1c892SJohn Scipione
14163c1c892SJohn Scipione	Model* TargetModel() const;
14263c1c892SJohn Scipione	BPoseView* PoseView() const;
14363c1c892SJohn Scipione	BNavigator* Navigator() const;
14463c1c892SJohn Scipione
14563c1c892SJohn Scipione	virtual void SelectionChanged();
14663c1c892SJohn Scipione	virtual void ViewModeChanged(uint32 oldMode, uint32 newMode);
14763c1c892SJohn Scipione
14863c1c892SJohn Scipione	virtual void RestoreState();
14963c1c892SJohn Scipione	virtual void RestoreState(const BMessage &);
15063c1c892SJohn Scipione	void RestoreStateCommon();
15163c1c892SJohn Scipione	virtual void SaveState(bool hide = true);
15263c1c892SJohn Scipione	virtual void SaveState(BMessage &) const;
15363c1c892SJohn Scipione	void UpdateTitle();
15463c1c892SJohn Scipione
15563c1c892SJohn Scipione	bool StateNeedsSaving() const;
15663c1c892SJohn Scipione	bool SaveStateIsEnabled() const;
15763c1c892SJohn Scipione	void SetSaveStateEnabled(bool);
15863c1c892SJohn Scipione
15963c1c892SJohn Scipione	void UpdateBackgroundImage();
16063c1c892SJohn Scipione
16163c1c892SJohn Scipione	static status_t GetLayoutState(BNode*, BMessage*);
16263c1c892SJohn Scipione	static status_t SetLayoutState(BNode*, const BMessage*);
16363c1c892SJohn Scipione		// calls for inheriting window size, attribute layout, etc.
16463c1c892SJohn Scipione		// deprecated
16563c1c892SJohn Scipione
16663c1c892SJohn Scipione	virtual void AddMimeTypesToMenu(BMenu*);
16763c1c892SJohn Scipione	void AddMimeTypesToMenu();
16863c1c892SJohn Scipione	virtual void MarkAttributeMenu(BMenu*);
16963c1c892SJohn Scipione	void MarkAttributeMenu();
17063c1c892SJohn Scipione	void MarkArrangeByMenu(BMenu*);
17163c1c892SJohn Scipione	BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
17263c1c892SJohn Scipione		int32 type, float width, int32 align, bool editable,
17363c1c892SJohn Scipione		bool statField);
17463c1c892SJohn Scipione	BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
17563c1c892SJohn Scipione		int32 type, const char* displayAs, float width, int32 align,
17663c1c892SJohn Scipione		bool editable, bool statField);
17763c1c892SJohn Scipione	virtual void NewAttributeMenu(BMenu*);
17863c1c892SJohn Scipione
17963c1c892SJohn Scipione	void HideAttributeMenu();
18063c1c892SJohn Scipione	void ShowAttributeMenu();
18163c1c892SJohn Scipione	PiggybackTaskLoop* DelayedTaskLoop();
18263c1c892SJohn Scipione		// use for RunLater queueing
18363c1c892SJohn Scipione	void PulseTaskLoop();
18463c1c892SJohn Scipione		// called by some view that has pulse, either BackgroundView
18563c1c892SJohn Scipione		// or BPoseView
18663c1c892SJohn Scipione
18763c1c892SJohn Scipione	static bool DefaultStateSourceNode(const char* name, BNode* result,
18863c1c892SJohn Scipione		bool createNew = false, bool createFolder = true);
18963c1c892SJohn Scipione
19063c1c892SJohn Scipione	// add-on iteration
19163c1c892SJohn Scipione	void EachAddon(bool (*)(const Model*, const char*, uint32 shortcut,
192bc8427c5SHrishi Hiraskar			uint32 modifiers, bool primary, void*, BContainerWindow*, BMenu*),
193bc8427c5SHrishi Hiraskar		void*, BStringList&, BMenu*);
194bc8427c5SHrishi Hiraskar
195bc8427c5SHrishi Hiraskar	BMessage* AddOnMessage(int32);
196bc8427c5SHrishi Hiraskar	entry_ref GetCurrentDirRef();
19763c1c892SJohn Scipione
19863c1c892SJohn Scipione	BPopUpMenu* ContextMenu();
19963c1c892SJohn Scipione
20063c1c892SJohn Scipione	// drag&drop support
20163c1c892SJohn Scipione	status_t DragStart(const BMessage*);
20263c1c892SJohn Scipione	void DragStop();
20363c1c892SJohn Scipione	bool Dragging() const;
20463c1c892SJohn Scipione	BMessage* DragMessage() const;
20563c1c892SJohn Scipione
20663c1c892SJohn Scipione	void ShowSelectionWindow();
20763c1c892SJohn Scipione
20863c1c892SJohn Scipione	void ShowNavigator(bool);
20963c1c892SJohn Scipione	void SetSingleWindowBrowseShortcuts(bool);
21063c1c892SJohn Scipione
21163c1c892SJohn Scipione	void SetPathWatchingEnabled(bool);
21263c1c892SJohn Scipione	bool IsPathWatchingEnabled(void) const;
21363c1c892SJohn Scipione
21463c1c892SJohn Scipioneprotected:
215e7803cf1SAugustin Cavalier	virtual BPoseView* NewPoseView(Model*, uint32);
21663c1c892SJohn Scipione		// instantiate a different flavor of BPoseView for different
21763c1c892SJohn Scipione		// ContainerWindows
21863c1c892SJohn Scipione
21963c1c892SJohn Scipione	virtual void RestoreWindowState(AttributeStreamNode*);
22063c1c892SJohn Scipione	virtual void RestoreWindowState(const BMessage &);
22163c1c892SJohn Scipione	virtual void SaveWindowState(AttributeStreamNode*);
22263c1c892SJohn Scipione	virtual void SaveWindowState(BMessage&) const;
22363c1c892SJohn Scipione
22463c1c892SJohn Scipione	virtual bool NeedsDefaultStateSetup();
22563c1c892SJohn Scipione	virtual void SetUpDefaultState();
22663c1c892SJohn Scipione		// these two virtuals control setting up a new folder that
22763c1c892SJohn Scipione		// does not have any state settings yet with the default
22863c1c892SJohn Scipione
22963c1c892SJohn Scipione	virtual void AddMenus();
23063c1c892SJohn Scipione	virtual void AddShortcuts();
23163c1c892SJohn Scipione		// add equivalents of the menu shortcuts to the menuless
23263c1c892SJohn Scipione		// desktop window
23363c1c892SJohn Scipione	virtual void AddFileMenu(BMenu* menu);
23463c1c892SJohn Scipione	virtual void AddWindowMenu(BMenu* menu);
23563c1c892SJohn Scipione
23663c1c892SJohn Scipione	virtual void AddContextMenus();
23763c1c892SJohn Scipione
23863c1c892SJohn Scipione	virtual void AddFileContextMenus(BMenu*);
23963c1c892SJohn Scipione	virtual void AddWindowContextMenus(BMenu*);
24063c1c892SJohn Scipione	virtual void AddVolumeContextMenus(BMenu*);
24163c1c892SJohn Scipione	virtual void AddDropContextMenus(BMenu*);
24263c1c892SJohn Scipione	virtual void AddTrashContextMenus(BMenu*);
24363c1c892SJohn Scipione
24463c1c892SJohn Scipione	virtual void RepopulateMenus();
24563c1c892SJohn Scipione	void PopulateArrangeByMenu(BMenu*);
24663c1c892SJohn Scipione
24763c1c892SJohn Scipione	virtual void SetCutItem(BMenu*);
24863c1c892SJohn Scipione	virtual void SetCopyItem(BMenu*);
24963c1c892SJohn Scipione	virtual void SetPasteItem(BMenu*);
25063c1c892SJohn Scipione	virtual void SetArrangeMenu(BMenu*);
25163c1c892SJohn Scipione	virtual void SetCloseItem(BMenu*);
25263c1c892SJohn Scipione	virtual void SetupNavigationMenu(const entry_ref*, BMenu*);
25363c1c892SJohn Scipione	virtual void SetupMoveCopyMenus(const entry_ref*, BMenu*);
25463c1c892SJohn Scipione	virtual void PopulateMoveCopyNavMenu(BNavMenu*, uint32,
25563c1c892SJohn Scipione		const entry_ref*, bool);
25663c1c892SJohn Scipione
25763c1c892SJohn Scipione	virtual void SetupOpenWithMenu(BMenu*);
25863c1c892SJohn Scipione	virtual void SetUpEditQueryItem(BMenu*);
25963c1c892SJohn Scipione	virtual void SetUpDiskMenu(BMenu*);
26063c1c892SJohn Scipione
26163c1c892SJohn Scipione	virtual void BuildAddOnMenu(BMenu*);
262da51f9c3SJohn Scipione	void BuildMimeTypeList(BStringList& mimeTypes);
26363c1c892SJohn Scipione
26463c1c892SJohn Scipione	enum UpdateMenuContext {
26563c1c892SJohn Scipione		kMenuBarContext,
26663c1c892SJohn Scipione		kPosePopUpContext,
26763c1c892SJohn Scipione		kWindowPopUpContext
26863c1c892SJohn Scipione	};
26963c1c892SJohn Scipione
27063c1c892SJohn Scipione	virtual void UpdateMenu(BMenu* menu, UpdateMenuContext context);
27163c1c892SJohn Scipione
27263c1c892SJohn Scipione	BMenu* AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
27363c1c892SJohn Scipione		BMenu* menu, int32 start);
27463c1c892SJohn Scipione
27563c1c892SJohn Scipione	BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, int32,
27663c1c892SJohn Scipione		const char*);
27763c1c892SJohn Scipione
27863c1c892SJohn Scipione	bool EachAddon(BPath &path,
27963c1c892SJohn Scipione		bool (*)(const Model*, const char*, uint32, bool, void*),
280da51f9c3SJohn Scipione		BObjectList<Model>*, void*, BStringList&);
28163c1c892SJohn Scipione	void LoadAddOn(BMessage*);
28263c1c892SJohn Scipione
2831dedefafSAugustin Cavalier	bool fUseLayouts;
284e7803cf1SAugustin Cavalier	BGroupLayout* fRootLayout;
285e7803cf1SAugustin Cavalier	BGroupView* fMenuContainer;
286e7803cf1SAugustin Cavalier	BGridView* fPoseContainer;
287e7803cf1SAugustin Cavalier	BorderedView* fBorderedView;
288e7803cf1SAugustin Cavalier	BGroupView* fVScrollBarContainer;
289e7803cf1SAugustin Cavalier	BGroupView* fCountContainer;
290e7803cf1SAugustin Cavalier
29163c1c892SJohn Scipione	BPopUpMenu* fFileContextMenu;
29263c1c892SJohn Scipione	BPopUpMenu* fWindowContextMenu;
29363c1c892SJohn Scipione	BPopUpMenu* fDropContextMenu;
29463c1c892SJohn Scipione	BPopUpMenu* fVolumeContextMenu;
29563c1c892SJohn Scipione	BPopUpMenu* fTrashContextMenu;
29663c1c892SJohn Scipione	BSlowContextMenu* fDragContextMenu;
29763c1c892SJohn Scipione	BMenuItem* fMoveToItem;
29863c1c892SJohn Scipione	BMenuItem* fCopyToItem;
29963c1c892SJohn Scipione	BMenuItem* fCreateLinkItem;
30063c1c892SJohn Scipione	BMenuItem* fOpenWithItem;
30163c1c892SJohn Scipione	ModelMenuItem* fNavigationItem;
30263c1c892SJohn Scipione	BMenuBar* fMenuBar;
303e7803cf1SAugustin Cavalier	DraggableContainerIcon* fDraggableIcon;
30463c1c892SJohn Scipione	BNavigator* fNavigator;
30563c1c892SJohn Scipione	BPoseView* fPoseView;
30663c1c892SJohn Scipione	LockingList<BWindow>* fWindowList;
30763c1c892SJohn Scipione	BMenu* fAttrMenu;
30863c1c892SJohn Scipione	BMenu* fWindowMenu;
30963c1c892SJohn Scipione	BMenu* fFileMenu;
31063c1c892SJohn Scipione	BMenu* fArrangeByMenu;
31163c1c892SJohn Scipione
31263c1c892SJohn Scipione	SelectionWindow* fSelectionWindow;
31363c1c892SJohn Scipione
31463c1c892SJohn Scipione	PiggybackTaskLoop* fTaskLoop;
31563c1c892SJohn Scipione
31663c1c892SJohn Scipione	bool fIsTrash;
31763c1c892SJohn Scipione	bool fInTrash;
31863c1c892SJohn Scipione	bool fIsPrinters;
319e7803cf1SAugustin Cavalier	bool fIsDesktop;
32063c1c892SJohn Scipione
32163c1c892SJohn Scipione	uint32 fContainerWindowFlags;
32263c1c892SJohn Scipione	BackgroundImage* fBackgroundImage;
32363c1c892SJohn Scipione
32463c1c892SJohn Scipione	static LockingList<struct AddonShortcut>* fAddonsList;
32563c1c892SJohn Scipione
32663c1c892SJohn Scipioneprivate:
32763c1c892SJohn Scipione	BRect fSavedZoomRect;
32863c1c892SJohn Scipione	BRect fPreviousBounds;
32963c1c892SJohn Scipione
33063c1c892SJohn Scipione	static BRect sNewWindRect;
33163c1c892SJohn Scipione
33263c1c892SJohn Scipione	BPopUpMenu* fContextMenu;
33363c1c892SJohn Scipione	BMessage* fDragMessage;
33463c1c892SJohn Scipione	BObjectList<BString>* fCachedTypesList;
33563c1c892SJohn Scipione	bool fWaitingForRefs;
33663c1c892SJohn Scipione
33763c1c892SJohn Scipione	bool fStateNeedsSaving;
33863c1c892SJohn Scipione	bool fSaveStateIsEnabled;
33963c1c892SJohn Scipione
34063c1c892SJohn Scipione	bool fIsWatchingPath;
34163c1c892SJohn Scipione
34263c1c892SJohn Scipione	typedef BWindow _inherited;
34363c1c892SJohn Scipione
34463c1c892SJohn Scipione	friend int32 show_context_menu(void*);
34563c1c892SJohn Scipione	friend class BackgroundView;
34663c1c892SJohn Scipione
34763c1c892SJohn Scipione	void _UpdateSelectionMIMEInfo();
348384eec8fSPhilippe Saint-Pierre	void _AddFolderIcon();
349bc8427c5SHrishi Hiraskar	void _PassMessageToAddOn(BMessage*);
35002be5353SAxel Dörfler};
35102be5353SAxel Dörfler
35263c1c892SJohn Scipione
35302be5353SAxel Dörflerclass WindowStateNodeOpener {
354116b363cSJohn Scipione	// this class manages opening and closing the proper node for
355116b363cSJohn Scipione	// state restoring / saving; the constructor knows how to decide whether
356116b363cSJohn Scipione	// to use a special directory for root, etc.
357116b363cSJohn Scipione	// setter calls used when no attributes can be read from a node and
358116b363cSJohn Scipione	// defaults are to be substituted
35963c1c892SJohn Scipionepublic:
36063c1c892SJohn Scipione	WindowStateNodeOpener(BContainerWindow* window, bool forWriting);
36163c1c892SJohn Scipione	virtual ~WindowStateNodeOpener();
36263c1c892SJohn Scipione
36363c1c892SJohn Scipione	void SetTo(const BDirectory*);
36463c1c892SJohn Scipione	void SetTo(const BEntry* entry, bool forWriting);
36563c1c892SJohn Scipione	void SetTo(Model*, bool forWriting);
36663c1c892SJohn Scipione
36763c1c892SJohn Scipione	AttributeStreamNode* StreamNode() const;
36863c1c892SJohn Scipione	BNode* Node() const;
36963c1c892SJohn Scipione
37063c1c892SJohn Scipioneprivate:
37163c1c892SJohn Scipione	ModelNodeLazyOpener* fModelOpener;
37263c1c892SJohn Scipione	BNode* fNode;
37363c1c892SJohn Scipione	AttributeStreamNode* fStreamNode;
37402be5353SAxel Dörfler};
37502be5353SAxel Dörfler
37663c1c892SJohn Scipione
377e7803cf1SAugustin Cavalierclass BorderedView : public BGroupView {
37863c1c892SJohn Scipionepublic:
379e7803cf1SAugustin Cavalier	BorderedView();
38002be5353SAxel Dörfler
38163c1c892SJohn Scipione	void PoseViewFocused(bool);
38263c1c892SJohn Scipione	virtual void Pulse();
38302be5353SAxel Dörfler
384e7803cf1SAugustin Cavalier	void EnableBorderHighlight(bool);
385e7803cf1SAugustin Cavalier
38663c1c892SJohn Scipioneprotected:
38763c1c892SJohn Scipione	virtual void WindowActivated(bool);
38802be5353SAxel Dörfler
38963c1c892SJohn Scipioneprivate:
390e7803cf1SAugustin Cavalier	bool fEnableBorderHighlight;
391e7803cf1SAugustin Cavalier
392e7803cf1SAugustin Cavalier	typedef BGroupView _inherited;
39302be5353SAxel Dörfler};
39402be5353SAxel Dörfler
39563c1c892SJohn Scipione
396b05aa8b5SJohn Scipioneint CompareLabels(const BMenuItem*, const BMenuItem*);
39702be5353SAxel Dörfler
39863c1c892SJohn Scipione
39902be5353SAxel Dörfler// inlines ---------
40002be5353SAxel Dörfler
401b05aa8b5SJohn Scipioneinline BNavigator*
40202be5353SAxel DörflerBContainerWindow::Navigator() const
40302be5353SAxel Dörfler{
40402be5353SAxel Dörfler	return fNavigator;
40502be5353SAxel Dörfler}
40602be5353SAxel Dörfler
40763c1c892SJohn Scipione
408b05aa8b5SJohn Scipioneinline BPoseView*
40902be5353SAxel DörflerBContainerWindow::PoseView() const
41002be5353SAxel Dörfler{
41102be5353SAxel Dörfler	return fPoseView;
41202be5353SAxel Dörfler}
41302be5353SAxel Dörfler
41463c1c892SJohn Scipione
41502be5353SAxel Dörflerinline bool
41602be5353SAxel DörflerBContainerWindow::IsTrash() const
41702be5353SAxel Dörfler{
41802be5353SAxel Dörfler	return fIsTrash;
41902be5353SAxel Dörfler}
42002be5353SAxel Dörfler
42163c1c892SJohn Scipione
42202be5353SAxel Dörflerinline bool
42302be5353SAxel DörflerBContainerWindow::InTrash() const
42402be5353SAxel Dörfler{
42502be5353SAxel Dörfler	return fInTrash;
42602be5353SAxel Dörfler}
42702be5353SAxel Dörfler
42863c1c892SJohn Scipione
42915a27c4dSAxel Dörflerinline bool
43002be5353SAxel DörflerBContainerWindow::IsPrintersDir() const
43102be5353SAxel Dörfler{
43202be5353SAxel Dörfler	return fIsPrinters;
43302be5353SAxel Dörfler}
43402be5353SAxel Dörfler
43563c1c892SJohn Scipione
43615a27c4dSAxel Dörflerinline void
437b05aa8b5SJohn ScipioneBContainerWindow::SetUpDiskMenu(BMenu*)
43802be5353SAxel Dörfler{
43902be5353SAxel Dörfler	// nothing at this level
44002be5353SAxel Dörfler}
44102be5353SAxel Dörfler
44263c1c892SJohn Scipione
443b05aa8b5SJohn Scipioneinline BPopUpMenu*
44402be5353SAxel DörflerBContainerWindow::ContextMenu()
44502be5353SAxel Dörfler{
44602be5353SAxel Dörfler	return fContextMenu;
44702be5353SAxel Dörfler}
44802be5353SAxel Dörfler
44963c1c892SJohn Scipione
45015a27c4dSAxel Dörflerinline bool
45102be5353SAxel DörflerBContainerWindow::Dragging() const
45202be5353SAxel Dörfler{
45302be5353SAxel Dörfler	return fDragMessage && fCachedTypesList;
45402be5353SAxel Dörfler}
45502be5353SAxel Dörfler
45663c1c892SJohn Scipione
457b05aa8b5SJohn Scipioneinline BMessage*
45802be5353SAxel DörflerBContainerWindow::DragMessage() const
45902be5353SAxel Dörfler{
46002be5353SAxel Dörfler	return fDragMessage;
46102be5353SAxel Dörfler}
46263c1c892SJohn Scipione
46363c1c892SJohn Scipione
46463c1c892SJohn Scipioneinline bool
46502be5353SAxel DörflerBContainerWindow::SaveStateIsEnabled() const
46602be5353SAxel Dörfler{
46702be5353SAxel Dörfler	return fSaveStateIsEnabled;
46802be5353SAxel Dörfler}
46902be5353SAxel Dörfler
47063c1c892SJohn Scipione
47163c1c892SJohn Scipioneinline void
47202be5353SAxel DörflerBContainerWindow::SetSaveStateEnabled(bool value)
47302be5353SAxel Dörfler{
47402be5353SAxel Dörfler	fSaveStateIsEnabled = value;
47502be5353SAxel Dörfler}
47602be5353SAxel Dörfler
47763c1c892SJohn Scipione
47863c1c892SJohn Scipioneinline bool
47902be5353SAxel DörflerBContainerWindow::IsPathWatchingEnabled() const
48002be5353SAxel Dörfler{
48102be5353SAxel Dörfler	return fIsWatchingPath;
48202be5353SAxel Dörfler}
48302be5353SAxel Dörfler
48463c1c892SJohn Scipione
485ea001e58SJohn Scipionefilter_result ActivateWindowFilter(BMessage* message, BHandler** target,
486b05aa8b5SJohn Scipione	BMessageFilter* messageFilter);
48702be5353SAxel Dörfler
48802be5353SAxel Dörfler} // namespace BPrivate
48902be5353SAxel Dörfler
49002be5353SAxel Dörflerusing namespace BPrivate;
49102be5353SAxel Dörfler
49263c1c892SJohn Scipione
49363c1c892SJohn Scipione#endif	// _CONTAINER_WINDOW_H
494