1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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
)
69 PropertyAttribute::TRANSIENT
,
71 cppu::UnoType
<decltype(m_xBinding
)>::get()
76 PROPERTY_ID_FACET_NAME
,
77 PropertyAttribute::TRANSIENT
,
79 cppu::UnoType
<decltype(m_sFacetName
)>::get()
84 PROPERTY_ID_CONDITION_VALUE
,
85 PropertyAttribute::TRANSIENT
,
87 cppu::UnoType
<decltype(m_sConditionValue
)>::get()
92 PROPERTY_ID_FORM_MODEL
,
93 PropertyAttribute::TRANSIENT
,
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: */