/////////////////////////////////////////////////////////////////////////////
// Name:        mainfrm.h
// Purpose:     Main package manager frame
// Author:      Julian Smart, Francesco Montorsi
// Modified by:
// Created:     2003-11-08
// RCS-ID:      $Id: mainfrm.h,v 1.1.1.1 2006/12/12 09:38:03 frm Exp $
// Copyright:   (c) Julian Smart
// Licence:     wxWidgets licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _MAINFRM_H_
#define _MAINFRM_H_

#include "wx/frame.h"
#include "wx/docview.h"

class wxPackageBrowserPanel;
class wxPackageViewerPanel;


// ----------------------------------------------------------------------------
// wxPackageManagerFrame
// ----------------------------------------------------------------------------

class wxPackageManagerFrame : public wxFrame
{
public:
    wxPackageManagerFrame() {}

    // size & position are loaded from global wxConfig
    bool Create();

    virtual ~wxPackageManagerFrame();

public:

    void Open(const wxString &filename);

public:     // event handlers

    void OnExit(wxCommandEvent& event);

    /// Handles window closing (saving position & size of the frame)
    void OnCloseWindow(wxCloseEvent& event);

    /// Shows About box
    void OnAbout(wxCommandEvent& event);

    /// Selects the packager guide in the reference panel
    void OnHelp(wxCommandEvent& event);

    /// Handles a MRU file list click
    void OnMRUFile(wxCommandEvent& event);

    /// Handles the open command
    void OnOpenPackage(wxCommandEvent& event);

    /// Handles the show settings command
    void OnSettings(wxCommandEvent& event);

    /// Returns true if creation of this frame was okay
    bool IsOk() const;

protected:
    wxPackageBrowserPanel* m_browser;
    wxPackageViewerPanel* m_viewer;

    wxFileHistory m_mru;

    DECLARE_EVENT_TABLE()
    DECLARE_CLASS(wxPackageManagerFrame)
};

#endif
  // _MAINFRM_H_

