1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
21 #define INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
23 #include <svtools/svtdllapi.h>
24 #include <sal/types.h>
25 #include <osl/mutex.hxx>
26 #include <rtl/ustring.hxx>
27 #include <tools/color.hxx>
29 //_________________________________________________________________________________________________________________
30 // forward declarations
31 //_________________________________________________________________________________________________________________
33 /*-************************************************************************************************************//**
34 @short forward declaration to our private date container implementation
35 @descr We use these class as internal member to support small memory requirements.
36 You can create the container if it is neccessary. The class which use these mechanism
37 is faster and smaller then a complete implementation!
38 *//*-*************************************************************************************************************/
40 class SvtOptionsDrawinglayer_Impl
;
42 /*-************************************************************************************************************//**
43 @short collect information about startup features
49 @devstatus ready to use
50 *//*-*************************************************************************************************************/
52 class SVT_DLLPUBLIC SvtOptionsDrawinglayer
54 //-------------------------------------------------------------------------------------------------------------
56 //-------------------------------------------------------------------------------------------------------------
60 //---------------------------------------------------------------------------------------------------------
61 // constructor / destructor
62 //---------------------------------------------------------------------------------------------------------
64 /*-****************************************************************************************************//**
65 @short standard constructor and destructor
66 @descr This will initialize an instance with default values.
67 We implement these class with a refcount mechanism! Every instance of this class increase it
68 at create and decrease it at delete time - but all instances use the same data container!
69 He is implemented as a static member ...
71 @seealso member m_nRefCount
72 @seealso member m_pDataContainer
78 *//*-*****************************************************************************************************/
80 SvtOptionsDrawinglayer();
81 ~SvtOptionsDrawinglayer();
83 //---------------------------------------------------------------------------------------------------------
85 //---------------------------------------------------------------------------------------------------------
87 /*-****************************************************************************************************//**
88 @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
89 @descr These options describe internal states to enable/disable features of installed office.
92 SetOverlayBuffer() => Activate this field for letting Overlay use a buffer
95 SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer
98 SetStripeColorA() => Set first of two colors which overlay uses to draw stripes
101 SetStripeColorB() => Set second of two colors which overlay uses to draw stripes
104 SetStripeLength() => Set length of a single stripe in pixels
106 @seealso configuration package "org.openoffice.Office.Common/Drawinglayer"
107 *//*-*****************************************************************************************************/
109 sal_Bool
IsOverlayBuffer() const;
110 sal_Bool
IsPaintBuffer() const;
111 Color
GetStripeColorA() const;
112 Color
GetStripeColorB() const;
113 sal_uInt16
GetStripeLength() const;
116 sal_Bool
IsOverlayBuffer_Calc() const;
117 sal_Bool
IsOverlayBuffer_Writer() const;
118 sal_Bool
IsOverlayBuffer_DrawImpress() const;
120 // #i74769#, #i75172#
121 sal_Bool
IsPaintBuffer_Calc() const;
122 sal_Bool
IsPaintBuffer_Writer() const;
123 sal_Bool
IsPaintBuffer_DrawImpress() const;
126 sal_uInt32
GetMaximumPaperWidth() const;
127 sal_uInt32
GetMaximumPaperHeight() const;
128 sal_uInt32
GetMaximumPaperLeftMargin() const;
129 sal_uInt32
GetMaximumPaperRightMargin() const;
130 sal_uInt32
GetMaximumPaperTopMargin() const;
131 sal_uInt32
GetMaximumPaperBottomMargin() const;
133 // #i95644# helper to check if AA is allowed on this system. Currently, for WIN its disabled
134 // and OutDevSupport_TransparentRect is checked (this hits XRenderExtension, e.g.
135 // currently for SunRay as long as not supported there)
136 sal_Bool
IsAAPossibleOnThisSystem() const;
139 sal_Bool
IsAntiAliasing() const;
140 sal_Bool
IsSnapHorVerLinesToDiscrete() const;
141 sal_Bool
IsSolidDragCreate() const;
142 sal_Bool
IsRenderDecoratedTextDirect() const;
143 sal_Bool
IsRenderSimpleTextDirect() const;
144 sal_uInt32
GetQuadratic3DRenderLimit() const;
145 sal_uInt32
GetQuadraticFormControlRenderLimit() const;
147 void SetAntiAliasing( sal_Bool bState
);
149 // #i97672# selection settings
150 sal_Bool
IsTransparentSelection() const;
151 sal_uInt16
GetTransparentSelectionPercent() const;
152 sal_uInt16
GetSelectionMaximumLuminancePercent() const;
154 // get system hilight color, limited to the maximum allowed luminance
155 // (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer,
156 // combined with Application::GetSettings().GetStyleSettings().GetHighlightColor())
157 Color
getHilightColor() const;
159 void SetTransparentSelection( sal_Bool bState
);
160 void SetTransparentSelectionPercent( sal_uInt16 nPercent
);
162 //-------------------------------------------------------------------------------------------------------------
164 //-------------------------------------------------------------------------------------------------------------
168 /*-****************************************************************************************************//**
169 @short return a reference to a static mutex
170 @descr These class use his own static mutex to be threadsafe.
171 We create a static mutex only for one ime and use at different times.
176 @return A reference to a static mutex member.
179 *//*-*****************************************************************************************************/
180 SVT_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
182 //-------------------------------------------------------------------------------------------------------------
184 //-------------------------------------------------------------------------------------------------------------
190 Don't initialize these static member in these header!
191 a) Double dfined symbols will be detected ...
192 b) and unresolved externals exist at linking time.
193 Do it in your source only.
196 static SvtOptionsDrawinglayer_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
197 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
199 }; // class SvtOptionsDrawinglayer
201 #endif // #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */