/******************************************************************************
 SyGPrefsMgr.h

	Interface for the SyGPrefsMgr class

	Copyright © 1999 by Glenn W. Bach.  All rights reserved.
	
	Base code generated by Codemill v0.1.0

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

#ifndef _H_SyGPrefsMgr
#define _H_SyGPrefsMgr

#include <JUNIXPrefsManager.h>
#include <JPtrArray.h>
#include <JString.h>
#include <JFontStyle.h>

class JXStringHistoryMenu;
class SyGEditPrefsDialog;

enum
{
	kSProgramVersionID = 1,
	kSTreeOptionsID,
	kSShortcutStringsID,
	kSChildWindowListID,
	kSDefaultWindowSizeID,
	kSFilterHistoryID,
	kSFilterVisibleID,
	kSBindingsMgrID,
	kSHelpSetupID,
	kSMainToolBarID,
	kSTermCmdID,
	kSManCmdID,
	kSDefActionID,
	kSBSActionID,
	kSWarnTrashID,
	kSyGRunCmdDialogID,
	kSCSSetupID,
	kSViewManPagePrefID,
	kSAltCSSetupID
};

class SyGPrefsMgr : public JUNIXPrefsManager
{
public:

	SyGPrefsMgr(JBoolean*	isNew);
	virtual ~SyGPrefsMgr();

	JString 	GetSystemGVersionStr() const;

	void 		SetTreePreferences(JBoolean prefs[]);
	void 		GetTreePreferences(JBoolean prefs[]) const;
	
	void 		SaveDefaultWindowSize(const JSize w, const JSize h);
	void 		GetDefaultWindowSize(JSize* w, JSize* h) const;
	
	void 		SaveFilterHistoryPrefs(JXStringHistoryMenu* filterHistory);
	void 		GetFilterHistoryPrefs(JXStringHistoryMenu* filterHistory) const;

	void 		SaveFilterStatePref(const JBoolean show);
	JBoolean 	GetFilterStatePref() const;

	void 		SaveShortcuts(const JPtrArray<JString>& shortcuts);
	void 		GetShortcuts(JPtrArray<JString>* shortcuts) const;
	
	void 		SaveChildWindows(const JPtrArray<JString>& children);
	void 		GetChildWindows(JPtrArray<JString>* children) const;

	void		SetManViewCmd(const JCharacter* manCmd);
	JString		GetManViewCmd() const;

	void		SetTerminalCmd(const JCharacter* termCmd);
	JString		GetTerminalCmd() const;

	void 		ShouldMoveByDefault(const JBoolean move);
	JBoolean 	IsMovingByDefault() const;

	void 		BSShouldTrash(const JBoolean trash);
	JBoolean 	BSIsTrashing() const;

	void 		ShouldWarnBeforeTrash(const JBoolean warn);
	JBoolean 	IsWarningBeforeTrash() const;

	void		EditPrefs();

protected:

	virtual void	UpgradeData(const JBoolean isNew, const JFileVersion currentVersion);
	virtual void	Receive(JBroadcaster* sender, const Message& message);

private:

	SyGEditPrefsDialog*	itsDialog;

private:

	void	UpdatePrefs();

	// not allowed

	SyGPrefsMgr(const SyGPrefsMgr& source);
	const SyGPrefsMgr& operator=(const SyGPrefsMgr& source);

public:

	static const JCharacter* kSyGPrefsChanged;

	class SyGPrefsChanged : public JBroadcaster::Message
		{
		public:
			SyGPrefsChanged()
			: 
			JBroadcaster::Message(kSyGPrefsChanged)
			{ };
		};

};

#endif
