LibreOffice Module vcl (master)  1
outdevstate.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_OUTDEVSTATE_HXX
21 #define INCLUDED_VCL_OUTDEVSTATE_HXX
22 
23 #include <vcl/mapmod.hxx>
24 #include <vcl/vclenum.hxx>
25 
26 #include <tools/color.hxx>
27 #include <tools/gen.hxx>
28 #include <tools/fontenum.hxx>
29 #include <o3tl/typed_flags_set.hxx>
30 #include <memory>
31 #include <boost/optional.hpp>
32 #include <i18nlangtag/lang.h>
33 
34 namespace vcl { class Font; }
35 namespace vcl { class Region; }
36 
37 // Flags for OutputDevice::Push() and OutDevState
38 enum class PushFlags {
39  NONE = 0x0000,
40  LINECOLOR = 0x0001,
41  FILLCOLOR = 0x0002,
42  FONT = 0x0004,
43  TEXTCOLOR = 0x0008,
44  MAPMODE = 0x0010,
45  CLIPREGION = 0x0020,
46  RASTEROP = 0x0040,
47  TEXTFILLCOLOR = 0x0080,
48  TEXTALIGN = 0x0100,
49  REFPOINT = 0x0200,
50  TEXTLINECOLOR = 0x0400,
51  TEXTLAYOUTMODE = 0x0800,
52  TEXTLANGUAGE = 0x1000,
53  OVERLINECOLOR = 0x2000,
54  ALL = 0xFFFF
55 };
56 
57 namespace o3tl
58 {
59  template<> struct typed_flags<PushFlags> : is_typed_flags<PushFlags, 0xFFFF> {};
60 }
61 #define PUSH_ALLTEXT (PushFlags::TEXTCOLOR | PushFlags::TEXTFILLCOLOR | PushFlags::TEXTLINECOLOR | PushFlags::OVERLINECOLOR | PushFlags::TEXTALIGN | PushFlags::TEXTLAYOUTMODE | PushFlags::TEXTLANGUAGE)
62 #define PUSH_ALLFONT (PUSH_ALLTEXT | PushFlags::FONT)
63 
64 // Layout flags for Complex Text Layout
65 // These are flag values, i.e they can be combined
67 {
68  Default = 0x0000,
69  BiDiRtl = 0x0001,
70  BiDiStrong = 0x0002,
71  TextOriginLeft = 0x0004,
72  TextOriginRight = 0x0008
73 };
74 namespace o3tl {
75  template<> struct typed_flags<ComplexTextLayoutFlags> : is_typed_flags<ComplexTextLayoutFlags, 0x000f> {};
76 }
77 
79 {
80  OutDevState();
82  ~OutDevState();
83 
86  std::unique_ptr<vcl::Region> mpClipRegion;
89  std::unique_ptr<vcl::Font> mpFont;
100 };
101 
102 #endif // INCLUDED_VCL_OUTDEVSTATE_HXX
103 
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ComplexTextLayoutFlags mnTextLayoutMode
Definition: outdevstate.hxx:97
boost::optional< Color > mpTextFillColor
Definition: outdevstate.hxx:91
boost::optional< Color > mpTextColor
Definition: outdevstate.hxx:90
boost::optional< Color > mpOverlineColor
Definition: outdevstate.hxx:93
PushFlags mnFlags
Definition: outdevstate.hxx:99
RasterOp
Definition: vclenum.hxx:191
PushFlags
Definition: outdevstate.hxx:38
LanguageType meTextLanguage
Definition: outdevstate.hxx:98
boost::optional< Color > mpLineColor
Definition: outdevstate.hxx:87
std::unique_ptr< vcl::Font > mpFont
Definition: outdevstate.hxx:89
ComplexTextLayoutFlags
Definition: outdevstate.hxx:66
std::unique_ptr< vcl::Region > mpClipRegion
Definition: outdevstate.hxx:86
boost::optional< Point > mpRefPoint
Definition: outdevstate.hxx:94
TextAlign meTextAlign
Definition: outdevstate.hxx:95
boost::optional< Color > mpFillColor
Definition: outdevstate.hxx:88
RasterOp meRasterOp
Definition: outdevstate.hxx:96
boost::optional< MapMode > mpMapMode
Definition: outdevstate.hxx:84
boost::optional< Color > mpTextLineColor
Definition: outdevstate.hxx:92
TextAlign
bool mbMapActive
Definition: outdevstate.hxx:85