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