1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef RPTUI_STARTMARKER_HXX
28 #define RPTUI_STARTMARKER_HXX
29 
30 #include <osl/interlck.h>
31 #include <svtools/ruler.hxx>
32 #include "ColorListener.hxx"
33 #include <vcl/fixed.hxx>
34 
35 
36 namespace rptui
37 {
38 	class OSectionWindow;
39 	class OStartMarker : public OColorListener
40 	{
41 
42 		Ruler						m_aVRuler;
43         FixedText                   m_aText;
44         FixedImage                  m_aImage;
45 		OSectionWindow*			    m_pParent;
46 		static Image*				s_pDefCollapsed;
47 		static Image*				s_pDefExpanded;
48 		static Image*				s_pDefCollapsedHC;
49 		static Image*				s_pDefExpandedHC;
50 		static oslInterlockedCount	s_nImageRefCount; /// When 0 all static images will be destroyed
51 
52 		sal_Bool					m_bShowRuler;
53 
54         void changeImage();
55 		void initDefaultNodeImages();
56         void setColor();
57 		virtual void ImplInitSettings();
58         OStartMarker(OStartMarker&);
59         void operator =(OStartMarker&);
60 	public:
61 		OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sColorEntry);
62 		virtual ~OStartMarker();
63 
64         // SfxListener
65 		virtual void    Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
66 		// window overloads
67 		virtual void    Paint( const Rectangle& rRect );
68 		virtual void	MouseButtonUp( const MouseEvent& rMEvt );
69 		virtual void	Resize();
70 		virtual void	RequestHelp( const HelpEvent& rHEvt );
71         using Window::Notify;
72 
73 		void			setTitle(const String& _sTitle);
74 		sal_Int32		getMinHeight() const;
75 
76 		/** shows or hides the ruler.
77 		*/
78 		void			showRuler(sal_Bool _bShow);
79 
80         virtual void	setCollapsed(sal_Bool _bCollapsed);
81 
82         /** zoom the ruler and view windows
83         */
84         void            zoom(const Fraction& _aZoom);
85 	};
86 }
87 #endif // RPTUI_STARTMARKER_HXX
88 
89