build fix
[LibreOffice.git] / include / svx / bmpmask.hxx
blob6705b1c5fe5beee7fa4b724e57950f006fd1dc13
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_SVX_BMPMASK_HXX
20 #define INCLUDED_SVX_BMPMASK_HXX
22 #include <sfx2/ctrlitem.hxx>
23 #include <sfx2/dockwin.hxx>
24 #include <vcl/toolbox.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/group.hxx>
27 #include <vcl/graph.hxx>
28 #include <svx/svxdllapi.h>
30 #include <svx/dlgctrl.hxx>
32 /*************************************************************************
34 |* class SvxBmpMaskSelectItem
36 \************************************************************************/
37 class SvxBmpMask;
39 class SvxBmpMaskSelectItem : public SfxControllerItem
41 private:
42 SvxBmpMask &rBmpMask;
44 protected:
45 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
46 const SfxPoolItem* pState ) override;
48 public:
49 SvxBmpMaskSelectItem( SvxBmpMask& rMask,
50 SfxBindings& rBindings );
53 /*************************************************************************
55 |* Derivative from SfxChildWindow as 'container' for Float
57 \************************************************************************/
59 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMaskChildWindow : public SfxChildWindow
61 public:
62 SvxBmpMaskChildWindow( vcl::Window*,
63 sal_uInt16, SfxBindings*,
64 SfxChildWinInfo* );
66 SFX_DECL_CHILDWINDOW_WITHID(SvxBmpMaskChildWindow);
69 /*************************************************************************
71 |* class SvxBmpMask
73 \************************************************************************/
75 class MaskData;
76 class MaskSet;
77 class ColorWindow;
78 class SvxColorListBox;
80 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow
82 friend class MaskData;
83 friend class MaskSet;
85 VclPtr<ToolBox> m_pTbxPipette;
86 VclPtr<ColorWindow> m_pCtlPipette;
87 VclPtr<PushButton> m_pBtnExec;
89 VclPtr<CheckBox> m_pCbx1;
90 VclPtr<MaskSet> m_pQSet1;
91 VclPtr<MetricField> m_pSp1;
92 VclPtr<SvxColorListBox> m_pLbColor1;
94 VclPtr<CheckBox> m_pCbx2;
95 VclPtr<MaskSet> m_pQSet2;
96 VclPtr<MetricField> m_pSp2;
97 VclPtr<SvxColorListBox> m_pLbColor2;
99 VclPtr<CheckBox> m_pCbx3;
100 VclPtr<MaskSet> m_pQSet3;
101 VclPtr<MetricField> m_pSp3;
102 VclPtr<SvxColorListBox> m_pLbColor3;
104 VclPtr<CheckBox> m_pCbx4;
105 VclPtr<MaskSet> m_pQSet4;
106 VclPtr<MetricField> m_pSp4;
107 VclPtr<SvxColorListBox> m_pLbColor4;
109 MaskData* pData;
110 VclPtr<CheckBox> m_pCbxTrans;
111 VclPtr<SvxColorListBox> m_pLbColorTrans;
113 Color aPipetteColor;
114 SvxBmpMaskSelectItem aSelItem;
116 virtual bool Close() override;
118 sal_uInt16 InitColorArrays( Color* pSrcCols, Color* pDstCols,
119 sal_uIntPtr* pTols );
121 Bitmap ImpMask( const Bitmap& rBitmap );
122 GDIMetaFile ImpMask( const GDIMetaFile& rMtf );
123 Animation ImpMask( const Animation& rAnimation );
124 BitmapEx ImpMaskTransparent( const BitmapEx& rBitmapEx,
125 const Color& rColor,
126 const long nTol );
127 static BitmapEx ImpReplaceTransparency( const BitmapEx& rBmpEx,
128 const Color& rColor );
129 static Animation ImpReplaceTransparency( const Animation& rAnim,
130 const Color& rColor );
131 static GDIMetaFile ImpReplaceTransparency( const GDIMetaFile& rMtf,
132 const Color& rColor );
134 public:
136 SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent);
137 virtual ~SvxBmpMask() override;
138 virtual void dispose() override;
140 void SetColor( const Color& rColor );
141 void PipetteClicked();
143 void SetExecState( bool bEnable );
145 Graphic Mask( const Graphic& rGraphic );
147 bool IsEyedropping() const;
149 void onSelect( MaskSet* pSet );
151 private:
153 /** Set names for accessible objects. This is necessary for objects
154 like the source color checkboxes which initially have no name and
155 for which the description would be read by AT.
157 SVX_DLLPRIVATE void SetAccessibleNames();
160 #endif // INCLUDED_SVX_BMPMASK_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */