LibreOffice Module extensions (master) 1
formlinkdialog.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 <vcl/weld.hxx>
23
24#include <com/sun/star/sdbc/XConnection.hpp>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/uno/XComponentContext.hpp>
27
28#include <memory>
29
30
31namespace pcr
32{
33 class FieldLinkRow;
34
35 //= FormLinkDialog
36
38 {
39 private:
40 css::uno::Reference< css::uno::XComponentContext >
42 css::uno::Reference< css::beans::XPropertySet >
44 css::uno::Reference< css::beans::XPropertySet >
46
47 std::vector< OUString > m_aRelationDetailColumns;
48 std::vector< OUString > m_aRelationMasterColumns;
49
52
53 std::unique_ptr<weld::Label> m_xExplanation;
54 std::unique_ptr<weld::Label> m_xDetailLabel;
55 std::unique_ptr<weld::Label> m_xMasterLabel;
56 std::unique_ptr<FieldLinkRow> m_xRow1;
57 std::unique_ptr<FieldLinkRow> m_xRow2;
58 std::unique_ptr<FieldLinkRow> m_xRow3;
59 std::unique_ptr<FieldLinkRow> m_xRow4;
60 std::unique_ptr<weld::Button> m_xOK;
61 std::unique_ptr<weld::Button> m_xSuggest;
62
63 public:
65 weld::Window* _pParent,
66 const css::uno::Reference< css::beans::XPropertySet >& _rxDetailForm,
67 const css::uno::Reference< css::beans::XPropertySet >& _rxMasterForm,
68 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
69 const OUString& _sExplanation = OUString(),
70 OUString _sDetailLabel = OUString(),
71 OUString _sMasterLabel = OUString()
72 );
73
74 virtual ~FormLinkDialog() override;
75
76 // Dialog overridables
77 virtual short run() override;
78
79 private:
80 DECL_LINK( OnSuggest, weld::Button&, void );
81 DECL_LINK( OnFieldChanged, FieldLinkRow&, void );
82 DECL_LINK( OnInitialize, void*, void);
83
84 void updateOkButton();
87 void initializeLinks();
88 void initializeSuggest();
89 void commitLinkPairs();
90
92 std::vector< OUString >& _rDetailFields,
93 std::vector< OUString >& _rMasterFields
94 );
95
96 static OUString getFormDataSourceType(
97 const css::uno::Reference< css::beans::XPropertySet >& _rxForm
98 );
99
100 void getFormFields(
101 const css::uno::Reference< css::beans::XPropertySet >& _rxForm,
102 css::uno::Sequence< OUString >& /* [out] */ _rNames
103 ) const;
104
106 const css::uno::Reference< css::beans::XPropertySet >& _rxFormProps,
107 css::uno::Reference< css::sdbc::XConnection >& /* [out] */ _rxConnection
108 ) const;
109
110 static void getConnectionMetaData(
111 const css::uno::Reference< css::beans::XPropertySet >& _rxFormProps,
112 css::uno::Reference< css::sdbc::XDatabaseMetaData >& /* [out] */ _rxMeta
113 );
114
115 css::uno::Reference< css::beans::XPropertySet >
116 getCanonicUnderlyingTable( const css::uno::Reference< css::beans::XPropertySet >& _rxFormProps ) const;
117 static bool getExistingRelation(
118 const css::uno::Reference< css::beans::XPropertySet >& _rxLHS,
119 const css::uno::Reference< css::beans::XPropertySet >& _rxRHS,
120 std::vector< OUString >& /* [out] */ _rLeftFields,
121 std::vector< OUString >& /* [out] */ _rRightFields
122 );
123 };
124
125} // namespace pcr
126
127/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< FieldLinkRow > m_xRow4
static OUString getFormDataSourceType(const css::uno::Reference< css::beans::XPropertySet > &_rxForm)
DECL_LINK(OnSuggest, weld::Button &, void)
css::uno::Reference< css::uno::XComponentContext > m_xContext
std::unique_ptr< weld::Label > m_xExplanation
std::vector< OUString > m_aRelationMasterColumns
std::unique_ptr< FieldLinkRow > m_xRow1
DECL_LINK(OnInitialize, void *, void)
std::vector< OUString > m_aRelationDetailColumns
css::uno::Reference< css::beans::XPropertySet > m_xDetailForm
css::uno::Reference< css::beans::XPropertySet > getCanonicUnderlyingTable(const css::uno::Reference< css::beans::XPropertySet > &_rxFormProps) const
static bool getExistingRelation(const css::uno::Reference< css::beans::XPropertySet > &_rxLHS, const css::uno::Reference< css::beans::XPropertySet > &_rxRHS, std::vector< OUString > &_rLeftFields, std::vector< OUString > &_rRightFields)
std::unique_ptr< weld::Label > m_xDetailLabel
std::unique_ptr< FieldLinkRow > m_xRow3
std::unique_ptr< weld::Button > m_xSuggest
static void getConnectionMetaData(const css::uno::Reference< css::beans::XPropertySet > &_rxFormProps, css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxMeta)
std::unique_ptr< FieldLinkRow > m_xRow2
void initializeFieldRowsFrom(std::vector< OUString > &_rDetailFields, std::vector< OUString > &_rMasterFields)
virtual short run() override
void getFormFields(const css::uno::Reference< css::beans::XPropertySet > &_rxForm, css::uno::Sequence< OUString > &_rNames) const
DECL_LINK(OnFieldChanged, FieldLinkRow &, void)
FormLinkDialog(weld::Window *_pParent, const css::uno::Reference< css::beans::XPropertySet > &_rxDetailForm, const css::uno::Reference< css::beans::XPropertySet > &_rxMasterForm, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_sExplanation=OUString(), OUString _sDetailLabel=OUString(), OUString _sMasterLabel=OUString())
std::unique_ptr< weld::Button > m_xOK
css::uno::Reference< css::beans::XPropertySet > m_xMasterForm
virtual ~FormLinkDialog() override
std::unique_ptr< weld::Label > m_xMasterLabel
void ensureFormConnection(const css::uno::Reference< css::beans::XPropertySet > &_rxFormProps, css::uno::Reference< css::sdbc::XConnection > &_rxConnection) const
a property handler for any virtual string properties
Definition: browserline.cxx:39