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 #ifndef RPTUI_COLORLISTENER_HXX
24 #define RPTUI_COLORLISTENER_HXX
25 
26 #include <vcl/window.hxx>
27 #include <svtools/colorcfg.hxx>
28 #include <svtools/extcolorcfg.hxx>
29 #include "ModuleHelper.hxx"
30 #include <tools/link.hxx>
31 
32 namespace rptui
33 {
34 	class OColorListener : public Window, public SfxListener
35 	{
36         OColorListener(const OColorListener&);
37         void operator =(const OColorListener&);
38     protected:
39         OModuleClient                       m_aModuleClient;
40         Link						        m_aCollapsedLink;
41 		svtools::ColorConfig				m_aColorConfig;
42 		svtools::ExtendedColorConfig		m_aExtendedColorConfig;
43 		::rtl::OUString						m_sColorEntry;
44 		sal_Int32							m_nColor;
45 		sal_Int32							m_nTextBoundaries;
46 		sal_Bool					        m_bCollapsed;
47 		sal_Bool							m_bMarked;
48 
49 		virtual void ImplInitSettings() = 0;
50 	protected:
51 		virtual void DataChanged( const DataChangedEvent& rDCEvt );
52 	public:
53 		OColorListener(Window* _pParent,const ::rtl::OUString& _sColorEntry);
54 		virtual ~OColorListener();
55 
56         using Window::Notify;
57 		// SfxListener
58 		virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
59 
60         /** set the marker as marked or not marked
61 			@param	_bMark	set the new state of the marker
62 		*/
63 		void	setMarked(sal_Bool _bMark);
64 
65 		/** returns if the section is marked
66 		*/
isMarked() const67 		inline sal_Bool	isMarked() const { return m_bMarked; }
68 
setCollapsedHdl(const Link & _aLink)69         inline void		setCollapsedHdl(const Link& _aLink ){ m_aCollapsedLink = _aLink; }
isCollapsed() const70 		inline sal_Bool	isCollapsed() const { return m_bCollapsed; }
71 
72         /** collapse or expand
73          *
74          * \param _bCollapsed
75          */
76         virtual void	setCollapsed(sal_Bool _bCollapsed);
77 	};
78 }
79 #endif // RPTUI_COLORLISTENER_HXX
80 
81