//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright            : (C) 2008 by Eran Ifrah                            
// file name            : fileexplorer.h              
//                                                                          
// -------------------------------------------------------------------------
// A                                                                        
//              _____           _      _     _ _                            
//             /  __ \         | |    | |   (_) |                           
//             | /  \/ ___   __| | ___| |    _| |_ ___                      
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )                     
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/                     
//              \____/\___/ \__,_|\___\_____/_|\__\___|                     
//                                                                          
//                                                  F i l e                 
//                                                                          
//    This program is free software; you can redistribute it and/or modify  
//    it under the terms of the GNU General Public License as published by  
//    the Free Software Foundation; either version 2 of the License, or     
//    (at your option) any later version.                                   
//                                                                          
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
 #ifndef FILEEXPLORER_H
#define FILEEXPLORER_H

#include "wx/panel.h"
#include "wx/choice.h"
#include "volumelocatorthread.h"

class FileExplorerTree;

class FileExplorer : public wxPanel
{
private:
	FileExplorerTree *m_fileTree;
	wxString m_caption;
	bool m_isLinkedToEditor;
	
#ifdef __WXMSW__
	wxChoice *m_volumes;
	VolumeLocatorThread m_thread;
#endif

private:
	void CreateGUIControls();
#ifdef __WXMSW__
	void OnVolumeChanged(wxCommandEvent &e);
	void OnRootChanged(wxCommandEvent &e);
	void OnVolumes(wxCommandEvent &e);
#endif

public:
	FileExplorer(wxWindow *parent, const wxString &caption);
	virtual ~FileExplorer();

	//setters/getters
	const wxString &GetCaption() const{return m_caption;}
	FileExplorerTree *GetFileTree() {return m_fileTree;}
	void OnLinkEditor(wxCommandEvent &e);
	void Scan();
	
	void SetIsLinkedToEditor(const bool& isLinkedToEditor) {this->m_isLinkedToEditor = isLinkedToEditor;}
	const bool& GetIsLinkedToEditor() const {return m_isLinkedToEditor;}
};

#endif //FILEEXPLORER_H

