LibreOffice Module svx (master) 1
xfm_addcondition.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
20
21#include <xfm_addcondition.hxx>
22
23#include <com/sun/star/beans/PropertyAttribute.hpp>
25#include <vcl/svapp.hxx>
26#include <datanavi.hxx>
27#include <fmservs.hxx>
28
29namespace svxform
30{
31
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
36
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;
41
42
43 //= OAddConditionDialog
44
45
46 Reference< XInterface > OAddConditionDialog_Create( const Reference< XMultiServiceFactory > & _rxORB )
47 {
48 return OAddConditionDialog::Create( _rxORB );
49 }
50
51
53 {
54 return { "com.sun.star.xforms.ui.dialogs.AddCondition" };
55 }
56
57
59 {
60 return "org.openoffice.comp.svx.OAddConditionDialog";
61 }
62
63 OAddConditionDialog::OAddConditionDialog( const Reference< XComponentContext >& _rxORB )
65 {
66 registerProperty(
67 "Binding",
69 PropertyAttribute::TRANSIENT,
71 cppu::UnoType<decltype(m_xBinding)>::get()
72 );
73
74 registerProperty(
75 "FacetName",
77 PropertyAttribute::TRANSIENT,
79 cppu::UnoType<decltype(m_sFacetName)>::get()
80 );
81
82 registerProperty(
83 "ConditionValue",
85 PropertyAttribute::TRANSIENT,
87 cppu::UnoType<decltype(m_sConditionValue)>::get()
88 );
89
90 registerProperty(
91 "FormModel",
93 PropertyAttribute::TRANSIENT,
95 cppu::UnoType<decltype(m_xWorkModel)>::get()
96 );
97 }
98
99
100 Sequence<sal_Int8> SAL_CALL OAddConditionDialog::getImplementationId( )
101 {
102 return css::uno::Sequence<sal_Int8>();
103 }
104
105
106 Reference< XInterface > OAddConditionDialog::Create( const Reference< XMultiServiceFactory >& _rxFactory )
107 {
108 return *( new OAddConditionDialog( comphelper::getComponentContext(_rxFactory) ) );
109 }
110
111
113 {
115 }
116
117
118 Sequence< OUString > SAL_CALL OAddConditionDialog::getSupportedServiceNames()
119 {
121 }
122
123
124 Reference<XPropertySetInfo> SAL_CALL OAddConditionDialog::getPropertySetInfo()
125 {
126 return createPropertySetInfo( getInfoHelper() );
127 }
128
130 {
131 return *getArrayHelper();
132 }
133
135 {
136 Sequence< Property > aProperties;
137 describeProperties( aProperties );
138 return new ::cppu::OPropertyArrayHelper( aProperties );
139 }
140
141 std::unique_ptr<weld::DialogController> OAddConditionDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
142 {
143 if ( !m_xBinding.is() || m_sFacetName.isEmpty() )
144 throw RuntimeException( OUString(), *this );
145
146 return std::make_unique<AddConditionDialog>(Application::GetFrameWeld(rParent), m_sFacetName, m_xBinding);
147 }
148
149 void OAddConditionDialog::executedDialog( sal_Int16 _nExecutionResult )
150 {
151 OAddConditionDialogBase::executedDialog( _nExecutionResult );
152 if ( _nExecutionResult == RET_OK )
153 m_sConditionValue = static_cast<AddConditionDialog*>(m_xDialog.get())->GetCondition();
154 }
155}
156
157/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
std::unique_ptr< weld::DialogController > m_xDialog
virtual void executedDialog(sal_Int16)
OAddConditionDialog(const css::uno::Reference< css::uno::XComponentContext > &_rxORB)
virtual OUString SAL_CALL getImplementationName() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void executedDialog(sal_Int16 _nExecutionResult) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
static css::uno::Reference< css::uno::XInterface > Create(const css::uno::Reference< css::lang::XMultiServiceFactory > &)
css::uno::Reference< css::xforms::XModel > m_xWorkModel
css::uno::Reference< css::beans::XPropertySet > m_xBinding
virtual std::unique_ptr< weld::DialogController > createDialog(const css::uno::Reference< css::awt::XWindow > &rParent) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
class FmSearchEngine - Impl class for FmSearchDialog
OUString OAddConditionDialog_GetImplementationName()
Reference< XInterface > OAddConditionDialog_Create(const Reference< XMultiServiceFactory > &_rxORB)
Sequence< OUString > OAddConditionDialog_GetSupportedServiceNames()
RET_OK
#define PROPERTY_ID_FACET_NAME
#define PROPERTY_ID_CONDITION_VALUE
#define PROPERTY_ID_BINDING
#define PROPERTY_ID_FORM_MODEL