/////////////////////////////////////////////////////////////////////////////
// Name:        decompressdlg.h
// Purpose:     wxPackageDecompressDlg definition
// Author:      Francesco Montorsi
// Modified by: 
// Created:     17/07/2006 23:38:05
// RCS-ID:      $Id: decompressdlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
// Copyright:   (c) 2006 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////

#ifndef _PMDECOMPRESSDLG_H_
#define _PMDECOMPRESSDLG_H_


/*!
 * Includes
 */

#include <wx/statline.h>
#include <wx/filepicker.h>

#include "wxp/package.h"


/*!
 * Forward declarations
 */

class wxPackage;


/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE _("Decompress")
#define SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME wxID_ANY
#define SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE wxSize(400, 300)
#define SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION wxDefaultPosition
#define ID_DECOMPRESS_DESTINATION 10030
#define ID_DECOMPRESS_PROGRESS 10038
////@end control identifiers



// ----------------------------------------------------------------------------
// wxPackageDecompressDlg
// ----------------------------------------------------------------------------

class wxPackageDecompressDlg: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( wxPackageDecompressDlg )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    wxPackageDecompressDlg( );
    wxPackageDecompressDlg( wxWindow* parent, 
                            wxWindowID id = SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME, 
                            const wxString& caption = SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE, 
                            const wxPoint& pos = SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION, 
                            const wxSize& size = SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE, 
                            long style = SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE );

    /// Creation
    bool Create( wxWindow* parent, 
                 wxWindowID id = SYMBOL_WXPACKAGEDECOMPRESSDLG_IDNAME, 
                 const wxString& caption = SYMBOL_WXPACKAGEDECOMPRESSDLG_TITLE, 
                 const wxPoint& pos = SYMBOL_WXPACKAGEDECOMPRESSDLG_POSITION, 
                 const wxSize& size = SYMBOL_WXPACKAGEDECOMPRESSDLG_SIZE, 
                 long style = SYMBOL_WXPACKAGEDECOMPRESSDLG_STYLE );

    /// Creates the controls and sizers
    void CreateControls();

    /// Should we show tooltips?
    static bool ShowToolTips();

public:     // event handlers

    void OnDestinationChange(wxFileDirPickerEvent &);
    void OnOK(wxCommandEvent &);

public:     // public API

    void UpdateFreeSpace();

    void SetPackage(const wxPackage &pkg);

    void SetDestination(const wxString &dest)
        { m_pDestination->SetPath(dest); UpdateFreeSpace(); }

    wxString GetDestination() const
        { return m_pDestination->GetPath(); }

protected:      // controls

    wxStaticText* m_pRequiredSpace;
    wxStaticText* m_pFreeSpace;
    wxTextCtrl* m_pCompressedFileName;
    wxDirPickerCtrl *m_pDestination;
    wxGauge *m_pProgress;

protected:

    wxPackage m_pkg;
};

#endif
    // _PMDECOMPRESSDLG_H_
