LibreOffice Module dbaccess (master) 1
TextConnectionHelper.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 "adminpages.hxx"
23#include <charsetlistbox.hxx>
24#include <rtl/ustring.hxx>
25
26namespace dbaui
27
28{
29
30 #define TC_EXTENSION (short(0x01)) // a section specifying the extension of the files to connect to
31 #define TC_SEPARATORS (short(0x02)) // a section specifying the various separators
32 #define TC_HEADER (short(0x04)) // a section containing the "Text contains header" check box only
33 #define TC_CHARSET (short(0x08)) // not yet implemented
34
36 {
37 public:
38 OTextConnectionHelper(weld::Widget* pParent , const short _nAvailableSections);
39
40 private:
43 OUString m_aTextNone;
46
48
49 std::unique_ptr<weld::Builder> m_xBuilder;
50 std::unique_ptr<weld::Widget> m_xContainer;
51 std::unique_ptr<weld::Widget> m_xExtensionHeader;
52 std::unique_ptr<weld::RadioButton> m_xAccessTextFiles;
53 std::unique_ptr<weld::RadioButton> m_xAccessCSVFiles;
54 std::unique_ptr<weld::RadioButton> m_xAccessOtherFiles;
55 std::unique_ptr<weld::Entry> m_xOwnExtension;
56 std::unique_ptr<weld::Label> m_xExtensionExample;
57 std::unique_ptr<weld::Widget> m_xFormatHeader;
58 std::unique_ptr<weld::Label> m_xFieldSeparatorLabel;
59 std::unique_ptr<weld::ComboBox> m_xFieldSeparator;
60 std::unique_ptr<weld::Label> m_xTextSeparatorLabel;
61 std::unique_ptr<weld::ComboBox> m_xTextSeparator;
62 std::unique_ptr<weld::Label> m_xDecimalSeparatorLabel;
63 std::unique_ptr<weld::ComboBox> m_xDecimalSeparator;
64 std::unique_ptr<weld::Label> m_xThousandsSeparatorLabel;
65 std::unique_ptr<weld::ComboBox> m_xThousandsSeparator;
66 std::unique_ptr<weld::CheckButton> m_xRowHeader;
67 std::unique_ptr<weld::Widget> m_xCharSetHeader;
68 std::unique_ptr<weld::Label> m_xCharSetLabel;
69 std::unique_ptr<CharSetListBox> m_xCharSet;
70
71 DECL_LINK(OnSetExtensionHdl, weld::Toggleable&, void);
72 DECL_LINK(OnEditModified, weld::Entry&, void);
73
74 OUString GetSeparator(const weld::ComboBox& rBox, std::u16string_view rList);
75 void SetSeparator(weld::ComboBox& rBox, std::u16string_view rList, const OUString& rVal);
76 void SetExtension(const OUString& _rVal);
77
78 public:
79 void implInitControls(const SfxItemSet& _rSet, bool _bValid);
80 void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList);
81 void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList);
83 OUString GetExtension() const;
84 bool FillItemSet( SfxItemSet& rSet, const bool bChangedSomething );
85 bool prepareLeave();
86 };
87} // namespace dbaui
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool FillItemSet(SfxItemSet &rSet, const bool bChangedSomething)
OTextConnectionHelper(weld::Widget *pParent, const short _nAvailableSections)
std::unique_ptr< weld::Widget > m_xFormatHeader
std::unique_ptr< weld::Builder > m_xBuilder
std::unique_ptr< weld::Entry > m_xOwnExtension
void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)
std::unique_ptr< weld::Widget > m_xCharSetHeader
void SetExtension(const OUString &_rVal)
std::unique_ptr< weld::ComboBox > m_xDecimalSeparator
Link< OTextConnectionHelper *, void > m_aGetExtensionHandler
std::unique_ptr< weld::Label > m_xExtensionExample
short m_nAvailableSections
to be called if a new type is selected
void implInitControls(const SfxItemSet &_rSet, bool _bValid)
DECL_LINK(OnEditModified, weld::Entry &, void)
std::unique_ptr< weld::RadioButton > m_xAccessCSVFiles
std::unique_ptr< weld::ComboBox > m_xFieldSeparator
std::unique_ptr< weld::RadioButton > m_xAccessTextFiles
std::unique_ptr< CharSetListBox > m_xCharSet
void SetSeparator(weld::ComboBox &rBox, std::u16string_view rList, const OUString &rVal)
void SetClickHandler(const Link< OTextConnectionHelper *, void > &_rHandler)
std::unique_ptr< weld::Widget > m_xExtensionHeader
std::unique_ptr< weld::Label > m_xDecimalSeparatorLabel
std::unique_ptr< weld::Label > m_xThousandsSeparatorLabel
std::unique_ptr< weld::Label > m_xCharSetLabel
std::unique_ptr< weld::ComboBox > m_xTextSeparator
OUString GetSeparator(const weld::ComboBox &rBox, std::u16string_view rList)
std::unique_ptr< weld::ComboBox > m_xThousandsSeparator
std::unique_ptr< weld::RadioButton > m_xAccessOtherFiles
std::unique_ptr< weld::Widget > m_xContainer
std::unique_ptr< weld::Label > m_xFieldSeparatorLabel
std::unique_ptr< weld::Label > m_xTextSeparatorLabel
DECL_LINK(OnSetExtensionHdl, weld::Toggleable &, void)
std::unique_ptr< weld::CheckButton > m_xRowHeader
void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)