Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / dbaccess / source / ui / inc / WColumnSelect.hxx
blob38b1317fd50728fcec814c87b6612e657b18cf68
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 .
19 #pragma once
21 #include "WTabPage.hxx"
22 #include "WCopyTable.hxx"
24 #include <comphelper/stl_types.hxx>
26 namespace dbaui
28 class OFieldDescription;
30 // Wizard Page: OWizColumnSelect
32 class OWizColumnSelect : public OWizardPage
34 std::unique_ptr<weld::TreeView> m_xOrgColumnNames; // left side
35 std::unique_ptr<weld::Button> m_xColumn_RH;
36 std::unique_ptr<weld::Button> m_xColumns_RH;
37 std::unique_ptr<weld::Button> m_xColumn_LH;
38 std::unique_ptr<weld::Button> m_xColumns_LH;
39 std::unique_ptr<weld::TreeView> m_xNewColumnNames; // right side
41 DECL_LINK( ButtonClickHdl, weld::Button&, void );
42 DECL_LINK( ListDoubleClickHdl, weld::TreeView&, bool );
44 static void clearListBox(weld::TreeView& _rListBox);
45 static void fillColumns(weld::TreeView const * pRight,
46 std::vector< OUString> &_rRightColumns);
48 void createNewColumn( weld::TreeView* _pListbox,
49 OFieldDescription const * _pSrcField,
50 std::vector< OUString>& _rRightColumns,
51 const OUString& _sColumnName,
52 std::u16string_view _sExtraChars,
53 sal_Int32 _nMaxNameLen,
54 const ::comphelper::UStringMixEqual& _aCase);
56 void moveColumn( weld::TreeView* _pRight,
57 weld::TreeView const * _pLeft,
58 std::vector< OUString>& _rRightColumns,
59 const OUString& _sColumnName,
60 std::u16string_view _sExtraChars,
61 sal_Int32 _nMaxNameLen,
62 const ::comphelper::UStringMixEqual& _aCase);
64 void enableButtons();
66 sal_Int32 adjustColumnPosition(weld::TreeView const * _pLeft,
67 std::u16string_view _sColumnName,
68 ODatabaseExport::TColumnVector::size_type nCurrentPos,
69 const ::comphelper::UStringMixEqual& _aCase);
71 public:
72 virtual void Reset ( ) override;
73 virtual void Activate() override;
74 virtual bool LeavePage() override;
75 virtual OUString GetTitle() const override ;
77 OWizColumnSelect(weld::Container* pParent, OCopyTableWizard* pWizard);
78 virtual ~OWizColumnSelect() override;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */