xref: /aoo4110/main/svx/inc/svx/tbxcolorupdate.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SVX_TBXCOLORUPDATE_HXX
25 #define SVX_TBXCOLORUPDATE_HXX
26 
27 #include <svx/svxdllapi.h>
28 
29 #include <tools/gen.hxx>
30 #include <tools/color.hxx>
31 
32 class ToolBox;
33 class VirtualDevice;
34 
35 //........................................................................
36 namespace svx
37 {
38 //........................................................................
39 
40 #define TBX_UPDATER_MODE_NONE 				0x00
41 #define TBX_UPDATER_MODE_CHAR_COLOR 		0x01
42 #define TBX_UPDATER_MODE_CHAR_BACKGROUND 	0x02
43 #define TBX_UPDATER_MODE_CHAR_COLOR_NEW		0x03
44 
45     //====================================================================
46     //= ToolboxButtonColorUpdater
47     //====================================================================
48     /** helper class to update a color in a toolbox button image
49 
50         formerly known as SvxTbxButtonColorUpdater_Impl, residing in svx/source/tbxctrls/colorwindow.hxx.
51     */
52     class SVX_DLLPUBLIC ToolboxButtonColorUpdater
53     {
54     public:
55                     ToolboxButtonColorUpdater( sal_uInt16   nSlotId,
56                                                 sal_uInt16   nTbxBtnId,
57 										        ToolBox* ptrTbx,
58                                                 sal_uInt16   nMode = 0 );
59                     ~ToolboxButtonColorUpdater();
60 
61 	    void 		Update( const Color& rColor );
62 
63     protected:
64 	    void 		DrawChar(VirtualDevice&, const Color&);
65 
66     private:
67 	    sal_uInt16		mnDrawMode;
68 	    sal_uInt16		mnBtnId;
69         sal_uInt16      mnSlotId;
70 	    ToolBox*	mpTbx;
71 	    Color		maCurColor;
72 	    Rectangle	maUpdRect;
73 	    Size		maBmpSize;
74 	    sal_Bool		mbWasHiContrastMode;
75     };
76 
77 //........................................................................
78 } // namespace svx
79 //........................................................................
80 
81 #endif // SVX_TBXCOLORUPDATE_HXX
82