bump product version to 7.2.5.1
[LibreOffice.git] / svx / source / form / xfm_addcondition.cxx
blob6c8d6ef35ab588cfcfc725412fe49a02e55c50a7
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 .
21 #include <xfm_addcondition.hxx>
23 #include <com/sun/star/beans/PropertyAttribute.hpp>
24 #include <comphelper/processfactory.hxx>
25 #include <vcl/svapp.hxx>
26 #include <datanavi.hxx>
27 #include <fmservs.hxx>
29 namespace svxform
32 #define PROPERTY_ID_BINDING 5724
33 #define PROPERTY_ID_FORM_MODEL 5725
34 #define PROPERTY_ID_FACET_NAME 5726
35 #define PROPERTY_ID_CONDITION_VALUE 5727
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::beans;
40 using namespace ::com::sun::star::xforms;
43 //= OAddConditionDialog
46 Reference< XInterface > OAddConditionDialog_Create( const Reference< XMultiServiceFactory > & _rxORB )
48 return OAddConditionDialog::Create( _rxORB );
52 Sequence< OUString > OAddConditionDialog_GetSupportedServiceNames()
54 return { "com.sun.star.xforms.ui.dialogs.AddCondition" };
58 OUString OAddConditionDialog_GetImplementationName()
60 return "org.openoffice.comp.svx.OAddConditionDialog";
63 OAddConditionDialog::OAddConditionDialog( const Reference< XComponentContext >& _rxORB )
64 :OAddConditionDialogBase( _rxORB )
66 registerProperty(
67 "Binding",
68 PROPERTY_ID_BINDING,
69 PropertyAttribute::TRANSIENT,
70 &m_xBinding,
71 cppu::UnoType<decltype(m_xBinding)>::get()
74 registerProperty(
75 "FacetName",
76 PROPERTY_ID_FACET_NAME,
77 PropertyAttribute::TRANSIENT,
78 &m_sFacetName,
79 cppu::UnoType<decltype(m_sFacetName)>::get()
82 registerProperty(
83 "ConditionValue",
84 PROPERTY_ID_CONDITION_VALUE,
85 PropertyAttribute::TRANSIENT,
86 &m_sConditionValue,
87 cppu::UnoType<decltype(m_sConditionValue)>::get()
90 registerProperty(
91 "FormModel",
92 PROPERTY_ID_FORM_MODEL,
93 PropertyAttribute::TRANSIENT,
94 &m_xWorkModel,
95 cppu::UnoType<decltype(m_xWorkModel)>::get()
100 Sequence<sal_Int8> SAL_CALL OAddConditionDialog::getImplementationId( )
102 return css::uno::Sequence<sal_Int8>();
106 Reference< XInterface > OAddConditionDialog::Create( const Reference< XMultiServiceFactory >& _rxFactory )
108 return *( new OAddConditionDialog( comphelper::getComponentContext(_rxFactory) ) );
112 OUString SAL_CALL OAddConditionDialog::getImplementationName()
114 return OAddConditionDialog_GetImplementationName();
118 Sequence< OUString > SAL_CALL OAddConditionDialog::getSupportedServiceNames()
120 return OAddConditionDialog_GetSupportedServiceNames();
124 Reference<XPropertySetInfo> SAL_CALL OAddConditionDialog::getPropertySetInfo()
126 return createPropertySetInfo( getInfoHelper() );
129 ::cppu::IPropertyArrayHelper& OAddConditionDialog::getInfoHelper()
131 return *getArrayHelper();
134 ::cppu::IPropertyArrayHelper* OAddConditionDialog::createArrayHelper( ) const
136 Sequence< Property > aProperties;
137 describeProperties( aProperties );
138 return new ::cppu::OPropertyArrayHelper( aProperties );
141 std::unique_ptr<weld::DialogController> OAddConditionDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
143 if ( !m_xBinding.is() || m_sFacetName.isEmpty() )
144 throw RuntimeException( OUString(), *this );
146 return std::make_unique<AddConditionDialog>(Application::GetFrameWeld(rParent), m_sFacetName, m_xBinding);
149 void OAddConditionDialog::executedDialog( sal_Int16 _nExecutionResult )
151 OAddConditionDialogBase::executedDialog( _nExecutionResult );
152 if ( _nExecutionResult == RET_OK )
153 m_sConditionValue = static_cast<AddConditionDialog*>(m_xDialog.get())->GetCondition();
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */