// Wild Magic Source Code
// David Eberly
// http://www.geometrictools.com
// Copyright (c) 1998-2007
//
// 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.  The license is available for reading at
// either of the locations:
//     http://www.gnu.org/copyleft/lgpl.html
//     http://www.geometrictools.com/License/WildMagicLicense.pdf
//
// Version: 4.0.0 (2006/06/28)

#ifndef WSCENEEXPORT_H
#define WSCENEEXPORT_H

#include "max.h"
#include "WExportSettings.h"

class WSceneExport : public SceneExport 
{
public:
    // construction and destruction
    WSceneExport ();
    virtual ~WSceneExport ();       

    // overrides from SceneExport
    virtual int ExtCount ();                    
    virtual const TCHAR* Ext (int iExt);    
    virtual const TCHAR* LongDesc ();           
    virtual const TCHAR* ShortDesc ();          
    virtual const TCHAR* AuthorName ();         
    virtual const TCHAR* CopyrightMessage ();   
    virtual const TCHAR* OtherMessage1 ();      
    virtual const TCHAR* OtherMessage2 ();      
    virtual unsigned int Version ();                
    virtual void ShowAbout (HWND hWnd);         
    virtual int DoExport (const TCHAR* acFilename, ExpInterface* pkExport,
        Interface* pkMax, BOOL bSuppressPrompts = FALSE, DWORD dwOptions = 0);
    virtual BOOL SupportsOptions (int iExt, DWORD dwOptions);

    // user interface dialog's window procedure
    static BOOL CALLBACK DialogProcedure (HWND hWnd, UINT uiMsg,
        WPARAM wParam, LPARAM lParam);

    // user interface dialog message handlers   
    BOOL OnEnableFrameSpinners (HWND hWnd, BOOL bEnabled);
    BOOL OnEndFrameSpinnerChanged (HWND hWnd);
    BOOL OnInitDialog (HWND hWnd);
    BOOL OnMeshChecked (HWND hWnd, BOOL bEnabled);
    BOOL OnModifiersChecked (HWND hWnd, BOOL bEnabled);
    BOOL OnObjectsChecked (HWND hWnd, BOOL bEnabled);
    void OnOK (HWND hWnd);
    BOOL OnStartFrameSpinnerChanged (HWND hWnd);

private:
    enum { WSCENE_VERSION = 100 };

    // exporter configuration file methods
    void ReadConfiguration ();
    void WriteConfiguration ();
    
    Interface* m_pkMax;
    WExportSettings m_kSettings, m_kEffectiveSettings;
    TSTR m_kStrConfigFile;
};

#endif
