/******************************************************************************
 SyGApplication.h

	Interface for the SyGApplication class

	Copyright © 1997 by Glenn W. Bach. All rights reserved.

 ******************************************************************************/

#ifndef _H_SyGApplication
#define _H_SyGApplication

#include <JXApplication.h>

class JXWindow;
class JXStringHistoryMenu;

class JString;
class SyGTreeDir;
class JUNIXPrefsFile;
class JXWindowDirector;
class BindingsManager;

enum GXFM_WindowType
{
	kFMList = 1,
	kFMIconView,
	kFMList2,
	kFMList3
};

class SyGApplication : public JXApplication
{
public:
	SyGApplication(int* argc, char* argv[], JBoolean* displayAbout, JString* prevVersStr);
	
	virtual ~SyGApplication();

	void NewChildWindow(const JString& pathName, const JCharacter* selectName = "");
	void CloseAllChildWindows();
	void CloseOtherChildWindows(JXWindowDirector* dir);
	void BringWindowsToFront();
	void GetWindowNames(JPtrArray<JString>& names);
	void RaiseWindow(const JIndex index);
	
	void OpenShortcut(const JIndex index);
	void AddShortcut(const JString& shortcut);
	void RemoveShortcut(const JString& shortcut);
	void RemoveAllShortcuts();
	
	JPtrArray<JString>& GetShortcuts();
	void	DisplayAbout(const JCharacter* prevVersStr = NULL);
	virtual JBoolean 	Close();

	void	ViewManPage(const JCharacter* item, const JCharacter index = ' ', 
						const JBoolean apropos = kFalse);

	void	OpenTerminal(const JCharacter* dir);
			
protected:

	virtual void Receive(JBroadcaster*	sender, const Message&	message);
	virtual void DirectorClosed(JXDirector* theDirector);

	virtual void	CleanUpBeforeSuddenDeath(const JXDocumentManager::SafetySaveReason reason);
	
private:

	JPtrArray<SyGTreeDir>*	itsChildWindows;
	JPtrArray<JString>* 		itsShortcuts;
	
private:

	void	SaveChildWindows();
	void	LoadChildWindows();

};

#endif


