xref: /AOO42X/main/dbaccess/inc/ToolBoxHelper.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef DBAUI_TOOLBOXHELPER_HXX
25cdf0e10cSrcweir #define DBAUI_TOOLBOXHELPER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _SAL_TYPES_H_
28cdf0e10cSrcweir #include <sal/types.h>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _LINK_HXX
31cdf0e10cSrcweir #include <tools/link.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _SV_GEN_HXX
34cdf0e10cSrcweir #include <tools/gen.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _SV_IMAGE_HXX
37cdf0e10cSrcweir #include <vcl/image.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #include "dbaccessdllapi.h"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SvtMiscOptions;
42cdf0e10cSrcweir class ToolBox;
43cdf0e10cSrcweir class VclWindowEvent;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace dbaui
46cdf0e10cSrcweir {
47cdf0e10cSrcweir     class DBACCESS_DLLPUBLIC OToolBoxHelper
48cdf0e10cSrcweir     {
49cdf0e10cSrcweir         sal_Bool        m_bIsHiContrast;// true when the toolbox is in hi contrast mode
50cdf0e10cSrcweir         sal_Int16       m_nSymbolsSize; // shows the toolbox large or small bitmaps
51cdf0e10cSrcweir         ToolBox*        m_pToolBox;     // our toolbox (may be NULL)
52cdf0e10cSrcweir     public:
53cdf0e10cSrcweir         OToolBoxHelper();
54cdf0e10cSrcweir         virtual ~OToolBoxHelper();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir         /** will be called when the controls need to be resized.
57cdf0e10cSrcweir             @param  _rDiff
58cdf0e10cSrcweir                 Contains the difference of the old and new toolbox size.
59cdf0e10cSrcweir         */
60cdf0e10cSrcweir         virtual void resizeControls(const Size& _rDiff) = 0;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir         /** will be called when the image list is needed.
63cdf0e10cSrcweir             @param  _eSymbolsSize
64cdf0e10cSrcweir                 <svtools/imgdef.hxx>
65cdf0e10cSrcweir             @param  _bHiContast
66cdf0e10cSrcweir                 <TRUE/> when in high contrast mode.
67cdf0e10cSrcweir         */
68cdf0e10cSrcweir         virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const = 0;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         /** only the member will be set, derived classes can overload this function and do what need to be done.
71cdf0e10cSrcweir             @param  _pTB
72cdf0e10cSrcweir                 The new ToolBox.
73cdf0e10cSrcweir             @attention
74cdf0e10cSrcweir                 Must be called after a FreeResource() call.
75cdf0e10cSrcweir         */
76cdf0e10cSrcweir         virtual void    setToolBox(ToolBox* _pTB);
77cdf0e10cSrcweir 
getToolBox() const78cdf0e10cSrcweir         inline ToolBox* getToolBox() const          { return m_pToolBox; }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir         /** checks if the toolbox needs a new imagelist.
81cdf0e10cSrcweir         */
82cdf0e10cSrcweir         void checkImageList();
83cdf0e10cSrcweir 
isToolBoxHiContrast() const84cdf0e10cSrcweir         inline sal_Bool isToolBoxHiContrast() const { return m_bIsHiContrast; }
85cdf0e10cSrcweir     protected:
86cdf0e10cSrcweir         DECL_LINK(ConfigOptionsChanged, SvtMiscOptions*);
87cdf0e10cSrcweir         DECL_LINK(SettingsChanged, VclWindowEvent* );
88cdf0e10cSrcweir     };
89cdf0e10cSrcweir }
90cdf0e10cSrcweir #endif // DBAUI_TOOLBOXHELPER_HXX
91