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_STARTMARKER_HXX
24 #define RPTUI_STARTMARKER_HXX
25 
26 #include <osl/interlck.h>
27 #include <svtools/ruler.hxx>
28 #include "ColorListener.hxx"
29 #include <vcl/fixed.hxx>
30 
31 
32 namespace rptui
33 {
34 	class OSectionWindow;
35 	class OStartMarker : public OColorListener
36 	{
37 
38 		Ruler						m_aVRuler;
39         FixedText                   m_aText;
40         FixedImage                  m_aImage;
41 		OSectionWindow*			    m_pParent;
42 		static Image*				s_pDefCollapsed;
43 		static Image*				s_pDefExpanded;
44 		static Image*				s_pDefCollapsedHC;
45 		static Image*				s_pDefExpandedHC;
46 		static oslInterlockedCount	s_nImageRefCount; /// When 0 all static images will be destroyed
47 
48 		sal_Bool					m_bShowRuler;
49 
50         void changeImage();
51 		void initDefaultNodeImages();
52         void setColor();
53 		virtual void ImplInitSettings();
54         OStartMarker(OStartMarker&);
55         void operator =(OStartMarker&);
56 	public:
57 		OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sColorEntry);
58 		virtual ~OStartMarker();
59 
60         // SfxListener
61 		virtual void    Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
62 		// window overloads
63 		virtual void    Paint( const Rectangle& rRect );
64 		virtual void	MouseButtonUp( const MouseEvent& rMEvt );
65 		virtual void	Resize();
66 		virtual void	RequestHelp( const HelpEvent& rHEvt );
67         using Window::Notify;
68 
69 		void			setTitle(const String& _sTitle);
70 		sal_Int32		getMinHeight() const;
71 
72 		/** shows or hides the ruler.
73 		*/
74 		void			showRuler(sal_Bool _bShow);
75 
76         virtual void	setCollapsed(sal_Bool _bCollapsed);
77 
78         /** zoom the ruler and view windows
79         */
80         void            zoom(const Fraction& _aZoom);
81 	};
82 }
83 #endif // RPTUI_STARTMARKER_HXX
84 
85