LibreOffice Module sc (master) 1
instbdlg.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <sfx2/objsh.hxx>
23#include <vcl/timer.hxx>
24#include <vcl/weld.hxx>
25#include <types.hxx>
26
27class ScViewData;
28class ScDocument;
29class ScDocShell;
30
31namespace sfx2 { class DocumentInserter; }
32namespace sfx2 { class FileDialogHelper; }
33
35{
36public:
37 ScInsertTableDlg(weld::Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile);
38 virtual ~ScInsertTableDlg() override;
39
40 virtual short run() override; // override to set parent dialog
41
42 bool GetTablesFromFile() const { return m_xBtnFromFile->get_active(); }
43 bool GetTablesAsLink() const { return m_xBtnLink->get_active(); }
44
45 const OUString* GetFirstTable( sal_uInt16* pN );
46 const OUString* GetNextTable( sal_uInt16* pN );
48 bool IsTableBefore() const { return m_xBtnBefore->get_active(); }
49 SCTAB GetTableCount() const { return nTableCount;}
50
51private:
56 std::unique_ptr<sfx2::DocumentInserter> pDocInserter;
58
60 sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
64
65 std::unique_ptr<weld::RadioButton> m_xBtnBefore;
66 std::unique_ptr<weld::RadioButton> m_xBtnNew;
67 std::unique_ptr<weld::RadioButton> m_xBtnFromFile;
68 std::unique_ptr<weld::Label> m_xFtCount;
69 std::unique_ptr<weld::SpinButton> m_xNfCount;
70 std::unique_ptr<weld::Label> m_xFtName;
71 std::unique_ptr<weld::Entry> m_xEdName;
72 std::unique_ptr<weld::TreeView> m_xLbTables;
73 std::unique_ptr<weld::Label> m_xFtPath;
74 std::unique_ptr<weld::Button> m_xBtnBrowse;
75 std::unique_ptr<weld::CheckButton> m_xBtnLink;
76 std::unique_ptr<weld::Button> m_xBtnOk;
77
78 void Init_Impl( bool bFromFile );
79 void SetNewTable_Impl();
80 void SetFromTo_Impl();
81 void FillTables_Impl( const ScDocument* pSrcDoc );
82 void DoEnable_Impl();
83
84 DECL_LINK( BrowseHdl_Impl, weld::Button&, void );
85 DECL_LINK( ChoiceHdl_Impl, weld::Toggleable&, void );
86 DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
87 DECL_LINK( CountHdl_Impl, weld::SpinButton&, void );
88 DECL_LINK( DoEnterHdl, weld::Button&, void );
89 DECL_LINK( BrowseTimeoutHdl, Timer *, void );
90 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void );
91};
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetTablesAsLink() const
Definition: instbdlg.hxx:43
SCTAB GetTableCount() const
Definition: instbdlg.hxx:49
std::unique_ptr< weld::Label > m_xFtPath
Definition: instbdlg.hxx:73
void DoEnable_Impl()
Definition: instbdlg.cxx:276
OUString m_sSheetDotDotDot
Definition: instbdlg.hxx:63
std::unique_ptr< weld::Entry > m_xEdName
Definition: instbdlg.hxx:71
void SetFromTo_Impl()
Definition: instbdlg.cxx:145
DECL_LINK(BrowseHdl_Impl, weld::Button &, void)
OUString aStrCurSelTable
Definition: instbdlg.hxx:61
std::unique_ptr< weld::Label > m_xFtCount
Definition: instbdlg.hxx:68
std::unique_ptr< weld::CheckButton > m_xBtnLink
Definition: instbdlg.hxx:75
std::unique_ptr< weld::RadioButton > m_xBtnNew
Definition: instbdlg.hxx:66
void Init_Impl(bool bFromFile)
Definition: instbdlg.cxx:70
sal_uInt16 nSelTabIndex
Definition: instbdlg.hxx:60
SfxObjectShellRef aDocShTablesRef
Definition: instbdlg.hxx:57
ScViewData & rViewData
Definition: instbdlg.hxx:53
std::unique_ptr< weld::TreeView > m_xLbTables
Definition: instbdlg.hxx:72
virtual ~ScInsertTableDlg() override
Definition: instbdlg.cxx:63
ScDocShell * pDocShTables
Definition: instbdlg.hxx:55
std::unique_ptr< sfx2::DocumentInserter > pDocInserter
Definition: instbdlg.hxx:56
ScDocShell * GetDocShellTables()
Definition: instbdlg.hxx:47
std::unique_ptr< weld::Label > m_xFtName
Definition: instbdlg.hxx:70
DECL_LINK(BrowseTimeoutHdl, Timer *, void)
void SetNewTable_Impl()
Definition: instbdlg.cxx:126
DECL_LINK(DialogClosedHdl, sfx2::FileDialogHelper *, void)
std::unique_ptr< weld::Button > m_xBtnBrowse
Definition: instbdlg.hxx:74
ScDocument & rDoc
Definition: instbdlg.hxx:54
virtual short run() override
Definition: instbdlg.cxx:118
std::unique_ptr< weld::Button > m_xBtnOk
Definition: instbdlg.hxx:76
DECL_LINK(CountHdl_Impl, weld::SpinButton &, void)
bool IsTableBefore() const
Definition: instbdlg.hxx:48
DECL_LINK(DoEnterHdl, weld::Button &, void)
std::unique_ptr< weld::RadioButton > m_xBtnBefore
Definition: instbdlg.hxx:65
bool GetTablesFromFile() const
Definition: instbdlg.hxx:42
DECL_LINK(ChoiceHdl_Impl, weld::Toggleable &, void)
const OUString * GetNextTable(sal_uInt16 *pN)
Definition: instbdlg.cxx:208
void FillTables_Impl(const ScDocument *pSrcDoc)
Definition: instbdlg.cxx:160
DECL_LINK(SelectHdl_Impl, weld::TreeView &, void)
Timer aBrowseTimer
Definition: instbdlg.hxx:52
ScInsertTableDlg(weld::Window *pParent, ScViewData &rViewData, SCTAB nTabCount, bool bFromFile)
Definition: instbdlg.cxx:36
std::unique_ptr< weld::RadioButton > m_xBtnFromFile
Definition: instbdlg.hxx:67
const OUString * GetFirstTable(sal_uInt16 *pN)
Definition: instbdlg.cxx:183
std::unique_ptr< weld::SpinButton > m_xNfCount
Definition: instbdlg.hxx:69
sal_Int16 SCTAB
Definition: types.hxx:22