summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/inc/datafdlg.hxx
blob: c7bd3d0b76107ba6234630d3fe86051dcb5a204e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* -*- 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/weld.hxx>
#include <types.hxx>
#include "viewfunc.hxx"

class ScTabViewShell;
class ScDocument;

#define MAX_DATAFORM_COLS   256
#define MAX_DATAFORM_ROWS   32000

class ScDataFormDlg : public weld::GenericDialogController
{
private:
    OUString        sNewRecord;

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

    std::unique_ptr<weld::Button> m_xBtnNew;
    std::unique_ptr<weld::Button> m_xBtnDelete;
    std::unique_ptr<weld::Button> m_xBtnRestore;
    std::unique_ptr<weld::Button> m_xBtnPrev;
    std::unique_ptr<weld::Button> m_xBtnNext;
    std::unique_ptr<weld::Button> m_xBtnClose;
    std::unique_ptr<weld::ScrolledWindow> m_xSlider;
    std::unique_ptr<weld::Container> m_xGrid;
    std::unique_ptr<weld::Label> m_xFixedText;
    std::vector<std::unique_ptr<ScDataFormFragment>> m_aEntries;

public:
    ScDataFormDlg(weld::Window* pParent, ScTabViewShell* pTabViewShell);
    virtual ~ScDataFormDlg() override;

    void FillCtrls();
private:

    void SetButtonState();

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

    DECL_LINK(Impl_RestoreHdl, weld::Button&, void);
    DECL_LINK(Impl_DeleteHdl, weld::Button&, void);
    DECL_LINK(Impl_CloseHdl, weld::Button&, void);

    DECL_LINK(Impl_ScrollHdl, weld::ScrolledWindow&, void);
    DECL_LINK(Impl_DataModifyHdl, weld::Entry&, void);
};
#endif // INCLUDED_SC_SOURCE_UI_INC_DATAFDLG_HXX

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