Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "xfm_addcondition.hxx"
31 : :
32 : : #include <cppuhelper/typeprovider.hxx>
33 : : #include "datanavi.hxx"
34 : : #include <vcl/msgbox.hxx>
35 : :
36 : : //........................................................................
37 : : namespace svxform
38 : : {
39 : : //........................................................................
40 : :
41 : : #define PROPERTY_ID_BINDING 5724
42 : : #define PROPERTY_ID_FORM_MODEL 5725
43 : : #define PROPERTY_ID_FACET_NAME 5726
44 : : #define PROPERTY_ID_CONDITION_VALUE 5727
45 : :
46 : : using namespace ::com::sun::star::uno;
47 : : using namespace ::com::sun::star::lang;
48 : : using namespace ::com::sun::star::beans;
49 : : using namespace ::com::sun::star::xforms;
50 : :
51 : : //====================================================================
52 : : //= OAddConditionDialog
53 : : //====================================================================
54 : : //--------------------------------------------------------------------
55 : 0 : Reference< XInterface > SAL_CALL OAddConditionDialog_Create( const Reference< XMultiServiceFactory > & _rxORB )
56 : : {
57 : 0 : return OAddConditionDialog::Create( _rxORB );
58 : : }
59 : :
60 : : //--------------------------------------------------------------------
61 : 135 : Sequence< ::rtl::OUString > SAL_CALL OAddConditionDialog_GetSupportedServiceNames()
62 : : {
63 : 135 : ::comphelper::StringSequence aSupported( 1 );
64 [ + - ]: 135 : aSupported.getArray()[0] = ::rtl::OUString( "com.sun.star.xforms.ui.dialogs.AddCondition" );
65 : 135 : return aSupported;
66 : : }
67 : :
68 : : //--------------------------------------------------------------------
69 : 135 : ::rtl::OUString SAL_CALL OAddConditionDialog_GetImplementationName()
70 : : {
71 : 135 : return ::rtl::OUString("org.openoffice.comp.svx.OAddConditionDialog");
72 : : }
73 : :
74 : : //====================================================================
75 : : //= OAddConditionDialog
76 : : //====================================================================
77 : : //--------------------------------------------------------------------
78 : 0 : OAddConditionDialog::OAddConditionDialog( const Reference< XMultiServiceFactory >& _rxORB )
79 [ # # ]: 0 : :OAddConditionDialogBase( _rxORB )
80 : : {
81 : : registerProperty(
82 : : ::rtl::OUString( "Binding" ),
83 : : PROPERTY_ID_BINDING,
84 : : PropertyAttribute::TRANSIENT,
85 : : &m_xBinding,
86 [ # # ]: 0 : ::getCppuType( &m_xBinding )
87 [ # # ]: 0 : );
88 : :
89 : : registerProperty(
90 : : ::rtl::OUString( "FacetName" ),
91 : : PROPERTY_ID_FACET_NAME,
92 : : PropertyAttribute::TRANSIENT,
93 : : &m_sFacetName,
94 [ # # ]: 0 : ::getCppuType( &m_sFacetName )
95 [ # # ]: 0 : );
96 : :
97 : : registerProperty(
98 : : ::rtl::OUString( "ConditionValue" ),
99 : : PROPERTY_ID_CONDITION_VALUE,
100 : : PropertyAttribute::TRANSIENT,
101 : : &m_sConditionValue,
102 [ # # ]: 0 : ::getCppuType( &m_sConditionValue )
103 [ # # ]: 0 : );
104 : :
105 : : registerProperty(
106 : : ::rtl::OUString( "FormModel" ),
107 : : PROPERTY_ID_FORM_MODEL,
108 : : PropertyAttribute::TRANSIENT,
109 : : &m_xWorkModel,
110 [ # # ]: 0 : ::getCppuType( &m_xWorkModel )
111 [ # # ]: 0 : );
112 : 0 : }
113 : :
114 : : //-------------------------------------------------------------------------
115 : 0 : Sequence<sal_Int8> SAL_CALL OAddConditionDialog::getImplementationId( ) throw(RuntimeException)
116 : : {
117 : : static ::cppu::OImplementationId * pId = 0;
118 [ # # ]: 0 : if (! pId)
119 : : {
120 [ # # ][ # # ]: 0 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
121 [ # # ]: 0 : if (! pId)
122 : : {
123 [ # # ][ # # ]: 0 : static ::cppu::OImplementationId aId;
124 : 0 : pId = &aId;
125 [ # # ]: 0 : }
126 : : }
127 : 0 : return pId->getImplementationId();
128 : : }
129 : :
130 : : //-------------------------------------------------------------------------
131 : 0 : Reference< XInterface > SAL_CALL OAddConditionDialog::Create( const Reference< XMultiServiceFactory >& _rxFactory )
132 : : {
133 [ # # ]: 0 : return *( new OAddConditionDialog( _rxFactory ) );
134 : : }
135 : :
136 : : //-------------------------------------------------------------------------
137 : 0 : ::rtl::OUString SAL_CALL OAddConditionDialog::getImplementationName() throw(RuntimeException)
138 : : {
139 : 0 : return OAddConditionDialog_GetImplementationName();
140 : : }
141 : :
142 : : //-------------------------------------------------------------------------
143 : 0 : Sequence< ::rtl::OUString > SAL_CALL OAddConditionDialog::getSupportedServiceNames() throw(RuntimeException)
144 : : {
145 : 0 : return OAddConditionDialog_GetSupportedServiceNames();
146 : : }
147 : :
148 : : //-------------------------------------------------------------------------
149 : 0 : Reference<XPropertySetInfo> SAL_CALL OAddConditionDialog::getPropertySetInfo() throw(RuntimeException)
150 : : {
151 : 0 : return createPropertySetInfo( getInfoHelper() );
152 : : }
153 : :
154 : : //-------------------------------------------------------------------------
155 : 0 : ::cppu::IPropertyArrayHelper& OAddConditionDialog::getInfoHelper()
156 : : {
157 : 0 : return *const_cast< OAddConditionDialog* >( this )->getArrayHelper();
158 : : }
159 : :
160 : : //------------------------------------------------------------------------------
161 : 0 : ::cppu::IPropertyArrayHelper* OAddConditionDialog::createArrayHelper( ) const
162 : : {
163 [ # # ]: 0 : Sequence< Property > aProperties;
164 [ # # ]: 0 : describeProperties( aProperties );
165 [ # # ][ # # ]: 0 : return new ::cppu::OPropertyArrayHelper( aProperties );
166 : : }
167 : :
168 : : //------------------------------------------------------------------------------
169 : 0 : Dialog* OAddConditionDialog::createDialog(Window* _pParent)
170 : : {
171 [ # # ][ # # ]: 0 : if ( !m_xBinding.is() || m_sFacetName.isEmpty() )
[ # # ]
172 [ # # ][ # # ]: 0 : throw RuntimeException( ::rtl::OUString(), *this );
173 : :
174 [ # # ]: 0 : return new AddConditionDialog( _pParent, m_sFacetName, m_xBinding );
175 : : }
176 : :
177 : : //------------------------------------------------------------------------------
178 : 0 : void OAddConditionDialog::executedDialog( sal_Int16 _nExecutionResult )
179 : : {
180 : 0 : OAddConditionDialogBase::executedDialog( _nExecutionResult );
181 [ # # ]: 0 : if ( _nExecutionResult == RET_OK )
182 [ # # ]: 0 : m_sConditionValue = static_cast< AddConditionDialog* >( m_pDialog )->GetCondition();
183 : 0 : }
184 : :
185 : : //........................................................................
186 : : } // namespace svxformv
187 : : //........................................................................
188 : :
189 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|