101aa44aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
301aa44aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
401aa44aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
501aa44aaSAndrew Rist  * distributed with this work for additional information
601aa44aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
701aa44aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
801aa44aaSAndrew Rist  * "License"); you may not use this file except in compliance
901aa44aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
1001aa44aaSAndrew Rist  *
1101aa44aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1201aa44aaSAndrew Rist  *
1301aa44aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1401aa44aaSAndrew Rist  * software distributed under the License is distributed on an
1501aa44aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1601aa44aaSAndrew Rist  * KIND, either express or implied.  See the License for the
1701aa44aaSAndrew Rist  * specific language governing permissions and limitations
1801aa44aaSAndrew Rist  * under the License.
1901aa44aaSAndrew Rist  *
2001aa44aaSAndrew Rist  *************************************************************/
2101aa44aaSAndrew Rist 
2201aa44aaSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
25cdf0e10cSrcweir #define INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //_________________________________________________________________________________________________________________
28cdf0e10cSrcweir //	includes
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "svtools/svtdllapi.h"
32cdf0e10cSrcweir #include <sal/types.h>
33cdf0e10cSrcweir #include <osl/mutex.hxx>
34cdf0e10cSrcweir #include <rtl/ustring.hxx>
35cdf0e10cSrcweir #include <tools/color.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //_________________________________________________________________________________________________________________
38cdf0e10cSrcweir //	forward declarations
39cdf0e10cSrcweir //_________________________________________________________________________________________________________________
40cdf0e10cSrcweir 
41cdf0e10cSrcweir /*-************************************************************************************************************//**
42cdf0e10cSrcweir 	@short			forward declaration to our private date container implementation
43cdf0e10cSrcweir 	@descr			We use these class as internal member to support small memory requirements.
44*86e1cf34SPedro Giffuni 					You can create the container if it is necessary. The class which use these mechanism
45cdf0e10cSrcweir 					is faster and smaller then a complete implementation!
46cdf0e10cSrcweir *//*-*************************************************************************************************************/
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class SvtOptionsDrawinglayer_Impl;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir //_________________________________________________________________________________________________________________
51cdf0e10cSrcweir //	declarations
52cdf0e10cSrcweir //_________________________________________________________________________________________________________________
53cdf0e10cSrcweir 
54cdf0e10cSrcweir /*-************************************************************************************************************//**
55cdf0e10cSrcweir 	@short			collect informations about startup features
56cdf0e10cSrcweir 	@descr          -
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	@implements		-
59cdf0e10cSrcweir 	@base			-
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	@devstatus		ready to use
62cdf0e10cSrcweir *//*-*************************************************************************************************************/
63cdf0e10cSrcweir 
64cdf0e10cSrcweir class SVT_DLLPUBLIC SvtOptionsDrawinglayer
65cdf0e10cSrcweir {
66cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
67cdf0e10cSrcweir 	//	public methods
68cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	public:
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
73cdf0e10cSrcweir 		//	constructor / destructor
74cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 		/*-****************************************************************************************************//**
77cdf0e10cSrcweir 			@short		standard constructor and destructor
78cdf0e10cSrcweir 			@descr		This will initialize an instance with default values.
79cdf0e10cSrcweir 						We implement these class with a refcount mechanism! Every instance of this class increase it
80cdf0e10cSrcweir 						at create and decrease it at delete time - but all instances use the same data container!
81cdf0e10cSrcweir 						He is implemented as a static member ...
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 			@seealso	member m_nRefCount
84cdf0e10cSrcweir 			@seealso	member m_pDataContainer
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 			@param		-
87cdf0e10cSrcweir 			@return		-
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 			@onerror	-
90cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
91cdf0e10cSrcweir 
92cdf0e10cSrcweir          SvtOptionsDrawinglayer();
93cdf0e10cSrcweir         ~SvtOptionsDrawinglayer();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
96cdf0e10cSrcweir 		//	interface
97cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 		/*-****************************************************************************************************//**
100cdf0e10cSrcweir 			@short		interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
101cdf0e10cSrcweir 			@descr      These options describe internal states to enable/disable features of installed office.
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 						IsOverlayBuffer()
104cdf0e10cSrcweir 						SetOverlayBuffer()		=>	Activate this field for letting Overlay use a buffer
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 						IsPaintBuffer()
107cdf0e10cSrcweir 						SetPaintBuffer()		=>	Activate this field for letting Paint use a prerender buffer
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 						GetStripeColorA()
110cdf0e10cSrcweir 						SetStripeColorA()		=>	Set first of two colors which overlay uses to draw stripes
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 						GetStripeColorB()
113cdf0e10cSrcweir 						SetStripeColorB()		=>	Set second of two colors which overlay uses to draw stripes
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 						GetStripeLength()
116cdf0e10cSrcweir 						SetStripeLength()		=>	Set length of a single stripe in pixels
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 			@seealso	configuration package "org.openoffice.Office.Common/Drawinglayer"
119cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 		sal_Bool	IsOverlayBuffer() const;
122cdf0e10cSrcweir 		sal_Bool	IsPaintBuffer() const;
123cdf0e10cSrcweir 		Color		GetStripeColorA() const;
124cdf0e10cSrcweir 		Color		GetStripeColorB() const;
125cdf0e10cSrcweir 		sal_uInt16	GetStripeLength() const;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 		void		SetOverlayBuffer( sal_Bool bState );
128cdf0e10cSrcweir 		void		SetPaintBuffer( sal_Bool bState );
129cdf0e10cSrcweir 		void		SetStripeColorA( Color aColor );
130cdf0e10cSrcweir 		void		SetStripeColorB( Color aColor );
131cdf0e10cSrcweir 		void		SetStripeLength( sal_uInt16 nLength );
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 		// #i73602#
134cdf0e10cSrcweir 		sal_Bool	IsOverlayBuffer_Calc() const;
135cdf0e10cSrcweir 		sal_Bool	IsOverlayBuffer_Writer() const;
136cdf0e10cSrcweir 		sal_Bool	IsOverlayBuffer_DrawImpress() const;
137cdf0e10cSrcweir 		void		SetOverlayBuffer_Calc( sal_Bool bState );
138cdf0e10cSrcweir 		void		SetOverlayBuffer_Writer( sal_Bool bState );
139cdf0e10cSrcweir 		void		SetOverlayBuffer_DrawImpress( sal_Bool bState );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 		// #i74769#, #i75172#
142cdf0e10cSrcweir 		sal_Bool	IsPaintBuffer_Calc() const;
143cdf0e10cSrcweir 		sal_Bool	IsPaintBuffer_Writer() const;
144cdf0e10cSrcweir 		sal_Bool	IsPaintBuffer_DrawImpress() const;
145cdf0e10cSrcweir 		void		SetPaintBuffer_Calc( sal_Bool bState );
146cdf0e10cSrcweir 		void		SetPaintBuffer_Writer( sal_Bool bState );
147cdf0e10cSrcweir 		void		SetPaintBuffer_DrawImpress( sal_Bool bState );
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 		// #i4219#
150cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperWidth() const;
151cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperHeight() const;
152cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperLeftMargin() const;
153cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperRightMargin() const;
154cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperTopMargin() const;
155cdf0e10cSrcweir 		sal_uInt32 GetMaximumPaperBottomMargin() const;
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 		void SetMaximumPaperWidth(sal_uInt32 nNew);
158cdf0e10cSrcweir 		void SetMaximumPaperHeight(sal_uInt32 nNew);
159cdf0e10cSrcweir 		void SetMaximumPaperLeftMargin(sal_uInt32 nNew);
160cdf0e10cSrcweir 		void SetMaximumPaperRightMargin(sal_uInt32 nNew);
161cdf0e10cSrcweir 		void SetMaximumPaperTopMargin(sal_uInt32 nNew);
162cdf0e10cSrcweir 		void SetMaximumPaperBottomMargin(sal_uInt32 nNew);
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 		// #i95644# helper to check if AA is allowed on this system. Currently, for WIN its disabled
165cdf0e10cSrcweir 		// and OutDevSupport_TransparentRect is checked (this  hits XRenderExtension, e.g.
166cdf0e10cSrcweir 		// currently for SunRay as long as not supported there)
167cdf0e10cSrcweir 		sal_Bool IsAAPossibleOnThisSystem() const;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 		// primitives
170cdf0e10cSrcweir 		sal_Bool	IsAntiAliasing() const;
171cdf0e10cSrcweir 		sal_Bool	IsSnapHorVerLinesToDiscrete() const;
172cdf0e10cSrcweir 		sal_Bool	IsSolidDragCreate() const;
173cdf0e10cSrcweir 		sal_Bool	IsRenderDecoratedTextDirect() const;
174cdf0e10cSrcweir 		sal_Bool	IsRenderSimpleTextDirect() const;
175cdf0e10cSrcweir 		sal_uInt32  GetQuadratic3DRenderLimit() const;
176cdf0e10cSrcweir 		sal_uInt32  GetQuadraticFormControlRenderLimit() const;
177cdf0e10cSrcweir 
178cdf0e10cSrcweir         void		SetAntiAliasing( sal_Bool bState );
179cdf0e10cSrcweir         void		SetSnapHorVerLinesToDiscrete( sal_Bool bState );
180cdf0e10cSrcweir 		void		SetSolidDragCreate( sal_Bool bState );
181cdf0e10cSrcweir         void		SetRenderDecoratedTextDirect( sal_Bool bState );
182cdf0e10cSrcweir         void		SetRenderSimpleTextDirect( sal_Bool bState );
183cdf0e10cSrcweir    		void        SetQuadratic3DRenderLimit(sal_uInt32 nNew);
184cdf0e10cSrcweir    		void        SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 		// #i97672# selection settings
187cdf0e10cSrcweir 		sal_Bool	IsTransparentSelection() const;
188cdf0e10cSrcweir 		sal_uInt16	GetTransparentSelectionPercent() const;
189cdf0e10cSrcweir         sal_uInt16	GetSelectionMaximumLuminancePercent() const;
190cdf0e10cSrcweir 
1916043ac9bSArmin Le Grand         // get system hilight color, limited to the maximum allowed luminance
1926043ac9bSArmin Le Grand         // (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer,
1936043ac9bSArmin Le Grand         // combined with Application::GetSettings().GetStyleSettings().GetHighlightColor())
1946043ac9bSArmin Le Grand         Color getHilightColor() const;
1956043ac9bSArmin Le Grand 
196cdf0e10cSrcweir 		void		SetTransparentSelection( sal_Bool bState );
197cdf0e10cSrcweir 		void		SetTransparentSelectionPercent( sal_uInt16 nPercent );
198cdf0e10cSrcweir 		void		SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent );
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
201cdf0e10cSrcweir 	//	private methods
202cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     private:
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 		/*-****************************************************************************************************//**
207cdf0e10cSrcweir 			@short		return a reference to a static mutex
208cdf0e10cSrcweir 			@descr		These class use his own static mutex to be threadsafe.
209cdf0e10cSrcweir 						We create a static mutex only for one ime and use at different times.
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 			@seealso	-
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 			@param		-
214cdf0e10cSrcweir 			@return		A reference to a static mutex member.
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 			@onerror	-
217cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
218cdf0e10cSrcweir 		SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
221cdf0e10cSrcweir 	//	private member
222cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	private:
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 		/*Attention
227cdf0e10cSrcweir 
228cdf0e10cSrcweir 			Don't initialize these static member in these header!
229cdf0e10cSrcweir 			a) Double dfined symbols will be detected ...
230cdf0e10cSrcweir 			b) and unresolved externals exist at linking time.
231cdf0e10cSrcweir 			Do it in your source only.
232cdf0e10cSrcweir 		 */
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     	static SvtOptionsDrawinglayer_Impl*		m_pDataContainer	;	/// impl. data container as dynamic pointer for smaller memory requirements!
235cdf0e10cSrcweir 		static sal_Int32						m_nRefCount			;	/// internal ref count mechanism
236cdf0e10cSrcweir 
237cdf0e10cSrcweir };		// class SvtOptionsDrawinglayer
238cdf0e10cSrcweir 
239cdf0e10cSrcweir #endif	// #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
240