xref: /AOO41X/main/dbaccess/inc/ToolBoxHelper.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
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 DBAUI_TOOLBOXHELPER_HXX
25 #define DBAUI_TOOLBOXHELPER_HXX
26 
27 #ifndef _SAL_TYPES_H_
28 #include <sal/types.h>
29 #endif
30 #ifndef _LINK_HXX
31 #include <tools/link.hxx>
32 #endif
33 #ifndef _SV_GEN_HXX
34 #include <tools/gen.hxx>
35 #endif
36 #ifndef _SV_IMAGE_HXX
37 #include <vcl/image.hxx>
38 #endif
39 #include "dbaccessdllapi.h"
40 
41 class SvtMiscOptions;
42 class ToolBox;
43 class VclWindowEvent;
44 
45 namespace dbaui
46 {
47     class DBACCESS_DLLPUBLIC OToolBoxHelper
48     {
49         sal_Bool        m_bIsHiContrast;// true when the toolbox is in hi contrast mode
50         sal_Int16       m_nSymbolsSize; // shows the toolbox large or small bitmaps
51         ToolBox*        m_pToolBox;     // our toolbox (may be NULL)
52     public:
53         OToolBoxHelper();
54         virtual ~OToolBoxHelper();
55 
56         /** will be called when the controls need to be resized.
57             @param  _rDiff
58                 Contains the difference of the old and new toolbox size.
59         */
60         virtual void resizeControls(const Size& _rDiff) = 0;
61 
62         /** will be called when the image list is needed.
63             @param  _eSymbolsSize
64                 <svtools/imgdef.hxx>
65             @param  _bHiContast
66                 <TRUE/> when in high contrast mode.
67         */
68         virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const = 0;
69 
70         /** only the member will be set, derived classes can overload this function and do what need to be done.
71             @param  _pTB
72                 The new ToolBox.
73             @attention
74                 Must be called after a FreeResource() call.
75         */
76         virtual void    setToolBox(ToolBox* _pTB);
77 
getToolBox() const78         inline ToolBox* getToolBox() const          { return m_pToolBox; }
79 
80         /** checks if the toolbox needs a new imagelist.
81         */
82         void checkImageList();
83 
isToolBoxHiContrast() const84         inline sal_Bool isToolBoxHiContrast() const { return m_bIsHiContrast; }
85     protected:
86         DECL_LINK(ConfigOptionsChanged, SvtMiscOptions*);
87         DECL_LINK(SettingsChanged, VclWindowEvent* );
88     };
89 }
90 #endif // DBAUI_TOOLBOXHELPER_HXX
91 
92