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 
27 class ScViewData;
28 class ScDocument;
29 class ScDocShell;
30 
31 namespace sfx2 { class DocumentInserter; }
32 namespace sfx2 { class FileDialogHelper; }
33 
35 {
36 public:
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 
51 private:
56  std::unique_ptr<sfx2::DocumentInserter> pDocInserter;
58 
59  bool bMustClose;
60  sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
61  OUString aStrCurSelTable;
64 
65  std::unique_ptr<weld::RadioButton> m_xBtnBefore;
66  std::unique_ptr<weld::RadioButton> m_xBtnBehind;
67  std::unique_ptr<weld::RadioButton> m_xBtnNew;
68  std::unique_ptr<weld::RadioButton> m_xBtnFromFile;
69  std::unique_ptr<weld::Label> m_xFtCount;
70  std::unique_ptr<weld::SpinButton> m_xNfCount;
71  std::unique_ptr<weld::Label> m_xFtName;
72  std::unique_ptr<weld::Entry> m_xEdName;
73  std::unique_ptr<weld::TreeView> m_xLbTables;
74  std::unique_ptr<weld::Label> m_xFtPath;
75  std::unique_ptr<weld::Button> m_xBtnBrowse;
76  std::unique_ptr<weld::CheckButton> m_xBtnLink;
77  std::unique_ptr<weld::Button> m_xBtnOk;
78 
79  void Init_Impl( bool bFromFile );
80  void SetNewTable_Impl();
81  void SetFromTo_Impl();
82  void FillTables_Impl( const ScDocument* pSrcDoc );
83  void DoEnable_Impl();
84 
85  DECL_LINK( BrowseHdl_Impl, weld::Button&, void );
86  DECL_LINK( ChoiceHdl_Impl, weld::Toggleable&, void );
87  DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
88  DECL_LINK( CountHdl_Impl, weld::SpinButton&, void );
89  DECL_LINK( DoEnterHdl, weld::Button&, void );
90  DECL_LINK( BrowseTimeoutHdl, Timer *, void );
91  DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void );
92 };
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xBtnBrowse
Definition: instbdlg.hxx:75
bool GetTablesAsLink() const
Definition: instbdlg.hxx:43
std::unique_ptr< weld::Label > m_xFtPath
Definition: instbdlg.hxx:74
OUString m_sSheetDotDotDot
Definition: instbdlg.hxx:63
void SetFromTo_Impl()
Definition: instbdlg.cxx:146
ScDocShell * GetDocShellTables()
Definition: instbdlg.hxx:47
sal_uInt16 nSelTabIndex
Definition: instbdlg.hxx:60
std::unique_ptr< weld::RadioButton > m_xBtnFromFile
Definition: instbdlg.hxx:68
ScInsertTableDlg(weld::Window *pParent, ScViewData &rViewData, SCTAB nTabCount, bool bFromFile)
Definition: instbdlg.cxx:37
std::unique_ptr< weld::RadioButton > m_xBtnBefore
Definition: instbdlg.hxx:65
const OUString * GetNextTable(sal_uInt16 *pN)
Definition: instbdlg.cxx:209
OUString aStrCurSelTable
Definition: instbdlg.hxx:61
std::unique_ptr< weld::RadioButton > m_xBtnBehind
Definition: instbdlg.hxx:66
std::unique_ptr< weld::Label > m_xFtCount
Definition: instbdlg.hxx:69
std::unique_ptr< weld::RadioButton > m_xBtnNew
Definition: instbdlg.hxx:67
void Init_Impl(bool bFromFile)
Definition: instbdlg.cxx:71
virtual short run() override
Definition: instbdlg.cxx:119
void DoEnable_Impl()
Definition: instbdlg.cxx:277
void FillTables_Impl(const ScDocument *pSrcDoc)
Definition: instbdlg.cxx:161
std::unique_ptr< weld::TreeView > m_xLbTables
Definition: instbdlg.hxx:73
std::unique_ptr< weld::Button > m_xBtnOk
Definition: instbdlg.hxx:77
ScDocShell * pDocShTables
Definition: instbdlg.hxx:55
std::unique_ptr< sfx2::DocumentInserter > pDocInserter
Definition: instbdlg.hxx:56
void SetNewTable_Impl()
Definition: instbdlg.cxx:127
ScViewData & rViewData
Definition: instbdlg.hxx:53
const OUString * GetFirstTable(sal_uInt16 *pN)
Definition: instbdlg.cxx:184
std::unique_ptr< weld::SpinButton > m_xNfCount
Definition: instbdlg.hxx:70
SCTAB GetTableCount() const
Definition: instbdlg.hxx:49
DECL_LINK(BrowseHdl_Impl, weld::Button &, void)
bool IsTableBefore() const
Definition: instbdlg.hxx:48
ScDocument & rDoc
Definition: instbdlg.hxx:54
std::unique_ptr< weld::Entry > m_xEdName
Definition: instbdlg.hxx:72
virtual ~ScInsertTableDlg() override
Definition: instbdlg.cxx:64
SfxObjectShellRef aDocShTablesRef
Definition: instbdlg.hxx:57
std::unique_ptr< weld::CheckButton > m_xBtnLink
Definition: instbdlg.hxx:76
bool GetTablesFromFile() const
Definition: instbdlg.hxx:42
sal_Int16 SCTAB
Definition: types.hxx:22
std::unique_ptr< weld::Label > m_xFtName
Definition: instbdlg.hxx:71
Timer aBrowseTimer
Definition: instbdlg.hxx:52