#pragma once

namespace xtr::dialog {

//! Dialog: Application options page
class GeneralPage final : public CPropertyPage {
  BOOL promptVersion;
  BOOL disableAutoKeyboard;
  BOOL showStartPage;
  BOOL enablePython;

  CString pythonPath;

public:
  GeneralPage();

private:
  void DoDataExchange(CDataExchange* pDX) override;
  void OnOK() override;

DECLARE_MESSAGE_MAP()
  afx_msg void OnChange() { SetModified(); }
};

//! Dialog: OSS options page
class OSSPage final : public CPropertyPage {
  BOOL m_RunOperation;
  BOOL m_EnableGrid;

  int32_t zoom;

public:
  OSSPage();

private:
  void DoDataExchange(CDataExchange* pDX) override;
  BOOL OnInitDialog() override;
  void OnOK() override;

DECLARE_MESSAGE_MAP()
  afx_msg void OnChange()  {
    SetModified();
  }
};

//! Dialog: RS parsing options page
class ParsingPage final : public CPropertyPage {
  BOOL autoCheck;
  BOOL colorBrackets;
  BOOL showAST;
  BOOL enableNavigator;
  int32_t m_IndexCst;
  int32_t m_IndexLocal;
  int32_t m_IndexPr;

public:
  ParsingPage();

private:
  void DoDataExchange(CDataExchange* pDX) override;
  void OnOK() override;

DECLARE_MESSAGE_MAP()
  afx_msg void OnChange() {
    SetModified();
  }
};

//! Dialog: RSModel options page
class ModelPage final : public CPropertyPage {
  BOOL m_DataMode;

public:
  ModelPage();

private:
  void DoDataExchange(CDataExchange* pDX) override;
  void OnOK() override;

DECLARE_MESSAGE_MAP()
  afx_msg void OnChange() {
    SetModified();
  }
};

//! Dialog: Exteor options
struct ExteorOptionsSheet final : CPropertySheet {
  GeneralPage m_App;
  OSSPage m_OSS;
  ParsingPage parsing;
  ModelPage m_RSModel;

public:
  explicit ExteorOptionsSheet(CWnd* pWndParent = nullptr);

private:
  BOOL PreTranslateMessage(MSG* pMsg) override;
};

} // namespace xtr::dialog