LibreOffice Module cui (master)  1
newtabledlg.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 #pragma once
20 
21 #include <svx/svxdlg.hxx>
22 #include <vcl/weld.hxx>
23 
25 {
26 private:
27  std::unique_ptr<weld::SpinButton> mxNumColumns;
28  std::unique_ptr<weld::SpinButton> mxNumRows;
29 
30 public:
32 
33  sal_Int32 getRows() const;
34  sal_Int32 getColumns() const;
35 };
36 
38 {
39 private:
40  std::shared_ptr<weld::DialogController> m_xDlg;
41 
42 public:
44  : m_xDlg(std::make_shared<SvxNewTableDialog>(pParent))
45  {
46  }
47 
48  virtual std::shared_ptr<weld::DialogController> getDialogController() override
49  {
50  return m_xDlg;
51  }
52 
53  virtual sal_Int32 getRows() const override
54  {
55  SvxNewTableDialog* pDlg = dynamic_cast<SvxNewTableDialog*>(m_xDlg.get());
56  if (pDlg)
57  return pDlg->getRows();
58 
59  return 0;
60  }
61 
62  virtual sal_Int32 getColumns() const override
63  {
64  SvxNewTableDialog* pDlg = dynamic_cast<SvxNewTableDialog*>(m_xDlg.get());
65  if (pDlg)
66  return pDlg->getColumns();
67 
68  return 0;
69  }
70 };
71 
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int32 getColumns() const override
Definition: newtabledlg.hxx:62
SvxNewTableDialog(weld::Window *pParent)
Definition: newtabledlg.cxx:22
sal_Int32 getColumns() const
Definition: newtabledlg.cxx:34
std::shared_ptr< T > make_shared(Args &&...args)
virtual std::shared_ptr< weld::DialogController > getDialogController() override
Definition: newtabledlg.hxx:48
std::unique_ptr< weld::SpinButton > mxNumColumns
Definition: newtabledlg.hxx:27
std::shared_ptr< weld::DialogController > m_xDlg
Definition: newtabledlg.hxx:40
SvxNewTableDialogWrapper(weld::Window *pParent)
Definition: newtabledlg.hxx:43
std::unique_ptr< weld::SpinButton > mxNumRows
Definition: newtabledlg.hxx:28
sal_Int32 getRows() const
Definition: newtabledlg.cxx:29
virtual sal_Int32 getRows() const override
Definition: newtabledlg.hxx:53