Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / splittbl.hxx
blobc579eea177a9b582eed311b0b6b9a7b373deb8c8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <vcl/weld.hxx>
23 #include <tblenum.hxx>
24 #include <unotools/viewoptions.hxx>
26 class SwWrtShell;
28 class SwSplitTableDlg final : public weld::GenericDialogController
30 private:
31 std::unique_ptr<weld::RadioButton> m_xBoxAttrCopyWithParaRB;
32 std::unique_ptr<weld::RadioButton> m_xBoxAttrCopyNoParaRB;
33 std::unique_ptr<weld::RadioButton> m_xBorderCopyRB;
35 SwWrtShell& m_rShell;
36 SplitTable_HeadlineOption m_nSplit;
38 // tdf#131759 - remember last used option in split table dialog
39 static SplitTable_HeadlineOption m_eRememberedSplitOption;
41 void Apply();
43 public:
44 SwSplitTableDlg(weld::Window* pParent, SwWrtShell& rSh);
46 virtual short run() override
48 short nRet = GenericDialogController::run();
49 if (nRet == RET_OK)
50 Apply();
51 return nRet;
54 SplitTable_HeadlineOption GetSplitMode() const
56 auto nSplit = SplitTable_HeadlineOption::ContentCopy;
57 if (m_xBoxAttrCopyWithParaRB->get_active())
58 nSplit = SplitTable_HeadlineOption::BoxAttrAllCopy;
59 else if (m_xBoxAttrCopyNoParaRB->get_active())
60 nSplit = SplitTable_HeadlineOption::BoxAttrCopy;
61 else if (m_xBorderCopyRB->get_active())
62 nSplit = SplitTable_HeadlineOption::BorderCopy;
64 // tdf#131759 - remember last used option in split table dialog
65 m_eRememberedSplitOption = nSplit;
67 return nSplit;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */