LibreOffice Module dbaccess (master) 1
textconnectionsettings.cxx
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
22#include <dsitems.hxx>
23#include <stringconstants.hxx>
24
25namespace dbaui
26{
27 // TextConnectionSettingsDialog
29 : GenericDialogController(pParent, "dbaccess/ui/textconnectionsettings.ui", "TextConnectionSettingsDialog")
30 , m_rItems(rItems)
31 , m_xContainer(m_xBuilder->weld_widget("TextPageContainer"))
32 , m_xOK(m_xBuilder->weld_button("ok"))
33 , m_xTextConnectionHelper(new OTextConnectionHelper(m_xContainer.get(), TC_HEADER | TC_SEPARATORS | TC_CHARSET))
34 {
35 m_xOK->connect_clicked(LINK(this, TextConnectionSettingsDialog, OnOK));
36 }
37
39 {
40 }
41
43 {
44 _rValues[ PROPERTY_ID_HEADER_LINE ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_TEXTFILEHEADER );
45 _rValues[ PROPERTY_ID_FIELD_DELIMITER ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_FIELDDELIMITER );
46 _rValues[ PROPERTY_ID_STRING_DELIMITER ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_TEXTDELIMITER );
47 _rValues[ PROPERTY_ID_DECIMAL_DELIMITER ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_DECIMALDELIMITER );
48 _rValues[ PROPERTY_ID_THOUSAND_DELIMITER ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_THOUSANDSDELIMITER );
49 _rValues[ PROPERTY_ID_ENCODING ] = std::make_shared<SetItemPropertyStorage>( _rSet, DSID_CHARSET );
50 }
51
53 {
54 m_xTextConnectionHelper->implInitControls(m_rItems, true);
55 return GenericDialogController::run();
56 }
57
59 {
60 if (m_xTextConnectionHelper->prepareLeave())
61 {
62 m_xTextConnectionHelper->FillItemSet( m_rItems, false/*bUnused*/ );
63 m_xDialog->response(RET_OK);
64 }
65 }
66
67} // namespace dbaui
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TC_HEADER
#define TC_CHARSET
#define TC_SEPARATORS
Reference< XExecutableDialog > m_xDialog
static void bindItemStorages(SfxItemSet &_rSet, PropertyValues &_rValues)
initializes a set of PropertyStorage instances, which are bound to the text-connection relevant items...
TextConnectionSettingsDialog(weld::Window *_pParent, SfxItemSet &rItems)
std::unique_ptr< weld::Button > m_xOK
std::unique_ptr< OTextConnectionHelper > m_xTextConnectionHelper
#define DSID_CHARSET
Definition: dsitems.hxx:44
#define DSID_DECIMALDELIMITER
Definition: dsitems.hxx:51
#define DSID_THOUSANDSDELIMITER
Definition: dsitems.hxx:52
#define DSID_FIELDDELIMITER
Definition: dsitems.hxx:49
#define DSID_TEXTFILEHEADER
Definition: dsitems.hxx:54
#define DSID_TEXTDELIMITER
Definition: dsitems.hxx:50
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Reference< XNameAccess > m_xContainer
Definition: objectnames.cxx:80
#define PROPERTY_ID_HEADER_LINE
#define PROPERTY_ID_FIELD_DELIMITER
#define PROPERTY_ID_ENCODING
#define PROPERTY_ID_STRING_DELIMITER
#define PROPERTY_ID_THOUSAND_DELIMITER
#define PROPERTY_ID_DECIMAL_DELIMITER
RET_OK