1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONPROPERTYHANDLER_HXX
25 #define EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONPROPERTYHANDLER_HXX
26 
27 #include "propertyhandler.hxx"
28 
29 /** === begin UNO includes === **/
30 /** === end UNO includes === **/
31 
32 #include <memory>
33 
34 //........................................................................
35 namespace pcr
36 {
37 //........................................................................
38 
39     class XSDValidationHelper;
40 	//====================================================================
41 	//= XSDValidationPropertyHandler
42 	//====================================================================
43     class XSDValidationPropertyHandler;
44     typedef HandlerComponentBase< XSDValidationPropertyHandler > XSDValidationPropertyHandler_Base;
45     class XSDValidationPropertyHandler : public XSDValidationPropertyHandler_Base
46 	{
47     private:
48         ::std::auto_ptr< XSDValidationHelper >  m_pHelper;
49 
50     public:
51         XSDValidationPropertyHandler(
52             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
53         );
54 
55         static ::rtl::OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
56         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
57 
58     protected:
59         ~XSDValidationPropertyHandler();
60 
61     protected:
62         // XPropertyHandler overriables
63         virtual ::com::sun::star::uno::Any  SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
64         virtual void                        SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
65         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
66                                             SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
67         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
68                                             SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
69         virtual ::com::sun::star::inspection::LineDescriptor
70                                             SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
71         virtual ::com::sun::star::inspection::InteractiveSelectionResult
72                                             SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
73         virtual void                        SAL_CALL actuatingPropertyChanged( const ::rtl::OUString& _rActuatingPropertyName, const ::com::sun::star::uno::Any& _rNewValue, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI, sal_Bool ) throw (::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
74         virtual void                        SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
75         virtual void                        SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
76 
77         // PropertyHandler overridables
78         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
79                                             SAL_CALL doDescribeSupportedProperties() const;
80         virtual void onNewComponent();
81 
82     private:
83         bool    implPrepareRemoveCurrentDataType() SAL_THROW(());
84         bool    implDoRemoveCurrentDataType() SAL_THROW(());
85 
86         bool    implPrepareCloneDataCurrentType( ::rtl::OUString& _rNewName ) SAL_THROW(());
87         bool    implDoCloneCurrentDataType( const ::rtl::OUString& _rNewName ) SAL_THROW(());
88 
89         /** retrieves the names of the data types which our introspectee can be validated against
90         */
91         void    implGetAvailableDataTypeNames( ::std::vector< ::rtl::OUString >& /* [out] */ _rNames ) const SAL_THROW(());
92 	};
93 
94 //........................................................................
95 } // namespace pcr
96 //........................................................................
97 
98 #endif // EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONPROPERTYHANDLER_HXX
99 
100