/*******************************************************************************
  TPI - flexible but useless plug-in framework.
  Copyright (C) 2002-2009 Silky

  This library is free software; you can redistribute it and/or modify it under
  the terms of the GNU Lesser General Public License as published by the Free
  Software Foundation; either version 2.1 of the License, or (at your option)
  any later version.

  This library is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
  for more details.

  You should have received a copy of the GNU Lesser General Public License along
  with this library; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

  $Id: frm_main.h 128 2009-11-21 10:26:13Z sirakaba $
*******************************************************************************/

#include <wx/cmdline.h>
#include <wx/splitter.h>
#include <wx/fileconf.h>

#ifndef H_LOADED_FRM_MAIN
#define H_LOADED_FRM_MAIN

class MainFrame: public wxFrame {
public:
    wxTreeCtrl * tree_ctrl;
    myListCtrl * list_ctrl;
	ArrayTPI_FILEINFO fileinfo;
	TPIHandle tpi;
	wxFileName fnArchive;
	wxString szComment;
	wxFileConfig conf;
	wxString szCurrentPath;
	wxCmdLineParser cmdLine;

    // Event handler.
    void OnInit(    wxInitDialogEvent&);

	void OnExit(       wxCommandEvent&);
    void OnArcCreate(  wxCommandEvent&);
    void OnArcOpen(    wxCommandEvent&);
    void OnArcClose(   wxCommandEvent&);
    void OnArcAdd(     wxCommandEvent&);
    void OnArcConvert( wxCommandEvent&);

	void OnArcExtract( wxCommandEvent&);
    void OnArcDelete(  wxCommandEvent&);
    void OnArcTest(    wxCommandEvent&);
    void OnArcRepair(  wxCommandEvent&);

	void OnViewMode(wxCommandEvent&);

	void OnShowToolBar(  wxCommandEvent&);
	void OnShowStatusBar(wxCommandEvent&);

	void OnSelectAll(wxCommandEvent&);

	void OnTreeChanged(wxTreeEvent&);
	void OnTreeBeginDrag(wxTreeEvent&);

	void OnListItemDClick(wxListEvent&);
    void OnListBeginDrag( wxListEvent&);

	void OnFilter(wxCommandEvent&);

	int LoadTPI(wxString);
	int ErrorCheck(int);

	MainFrame();
	~MainFrame();

protected:
    wxMenuBar * menubar;
    wxToolBar * toolbar;
    wxStatusBar * statusbar;
    wxSplitterWindow * window_splitter;
    wxTextCtrl * tcFilter;
    DECLARE_EVENT_TABLE()
};

#endif
