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 INCLUDED_FORMATTEDFIELDBEAUTIFIER_HXX
25 #define INCLUDED_FORMATTEDFIELDBEAUTIFIER_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
29 #include <com/sun/star/container/XChild.hpp>
30 #include <com/sun/star/awt/XVclWindowPeer.hpp>
31 #include <com/sun/star/report/XReportComponent.hpp>
32 /** === end UNO includes === **/
33 
34 //#include <boost/noncopyable.hpp>
35 #include <vector>
36 #include <IReportControllerObserver.hxx>
37 
38 namespace rptui
39 {
40     class OReportController;
41 
42     class FormattedFieldBeautifier : public IReportControllerObserver
43     {
44         const OReportController& m_rReportController;
45         sal_Int32 m_nTextColor;
46 
47         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > getVclWindowPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent) throw(::com::sun::star::uno::RuntimeException);
48 
49         void setPlaceholderText( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
50         void setPlaceholderText( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >& _xVclWindowPeer, const ::rtl::OUString& _rText );
51 
52         sal_Int32 getTextColor();
53 
54     public:
55         FormattedFieldBeautifier(const OReportController & _aObserver);
56         virtual ~FormattedFieldBeautifier();
57 
58         void    notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent );
59         void    notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
60         void    handle( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
61     };
62 
63 } // namespace rptui
64 
65 
66 #endif
67