/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_SC_SOURCE_UI_INC_DATAFDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_DATAFDLG_HXX

#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/layout.hxx>
#include <types.hxx>

class ScTabViewShell;
class ScDocument;

#define MAX_DATAFORM_COLS   256
#define MAX_DATAFORM_ROWS   32000

class ScDataFormDlg : public ModalDialog
{
private:

    VclPtr<PushButton>     m_pBtnNew;
    VclPtr<PushButton>     m_pBtnDelete;
    VclPtr<PushButton>     m_pBtnRestore;
    VclPtr<PushButton>     m_pBtnPrev;
    VclPtr<PushButton>     m_pBtnNext;
    VclPtr<PushButton>     m_pBtnClose;
    VclPtr<ScrollBar>      m_pSlider;
    VclPtr<VclGrid>        m_pGrid;
    VclPtr<FixedText>      m_pFixedText;
    OUString        sNewRecord;

    ScTabViewShell* pTabViewShell;
    ScDocument*     pDoc;
    sal_uInt16      aColLength;
    SCROW           nCurrentRow;
    SCCOL           nStartCol;
    SCCOL           nEndCol;
    SCROW           nStartRow;
    SCROW           nEndRow;
    SCTAB           nTab;

    std::vector<VclPtr<FixedText> > maFixedTexts;
    std::vector<VclPtr<Edit> >      maEdits;

public:
    ScDataFormDlg( vcl::Window* pParent, ScTabViewShell* pTabViewShell);
    virtual ~ScDataFormDlg() override;
    virtual void dispose() override;

    void FillCtrls();
private:

    void SetButtonState();

    // Handler:
    DECL_LINK(Impl_NewHdl, Button*, void);
    DECL_LINK(Impl_PrevHdl, Button*, void);
    DECL_LINK(Impl_NextHdl, Button*, void);

    DECL_LINK(Impl_RestoreHdl, Button*, void);
    DECL_LINK(Impl_DeleteHdl, Button*, void);
    DECL_LINK(Impl_CloseHdl, Button*, void);

    DECL_LINK(Impl_ScrollHdl, ScrollBar*, void);
    DECL_LINK(Impl_DataModifyHdl, Edit&, void);
};
#endif // INCLUDED_SC_SOURCE_UI_INC_DATAFDLG_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
