merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / inc / ToolBoxHelper.hxx
blob15657a268f561e8bd66cb0871cf1429105e8e674
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ToolBoxHelper.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBAUI_TOOLBOXHELPER_HXX
32 #define DBAUI_TOOLBOXHELPER_HXX
34 #ifndef _SAL_TYPES_H_
35 #include <sal/types.h>
36 #endif
37 #ifndef _LINK_HXX
38 #include <tools/link.hxx>
39 #endif
40 #ifndef _SV_GEN_HXX
41 #include <tools/gen.hxx>
42 #endif
43 #ifndef _SV_IMAGE_HXX
44 #include <vcl/image.hxx>
45 #endif
46 #include "dbaccessdllapi.h"
48 class SvtMiscOptions;
49 class ToolBox;
50 class VclWindowEvent;
52 namespace dbaui
54 class DBACCESS_DLLPUBLIC OToolBoxHelper
56 sal_Bool m_bIsHiContrast;// true when the toolbox is in hi contrast mode
57 sal_Int16 m_nSymbolsSize; // shows the toolbox large or small bitmaps
58 ToolBox* m_pToolBox; // our toolbox (may be NULL)
59 public:
60 OToolBoxHelper();
61 virtual ~OToolBoxHelper();
63 /** will be called when the controls need to be resized.
64 @param _rDiff
65 Contains the difference of the old and new toolbox size.
67 virtual void resizeControls(const Size& _rDiff) = 0;
69 /** will be called when the image list is needed.
70 @param _eSymbolsSize
71 <svtools/imgdef.hxx>
72 @param _bHiContast
73 <TRUE/> when in high contrast mode.
75 virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const = 0;
77 /** only the member will be set, derived classes can overload this function and do what need to be done.
78 @param _pTB
79 The new ToolBox.
80 @attention
81 Must be called after a FreeResource() call.
83 virtual void setToolBox(ToolBox* _pTB);
85 inline ToolBox* getToolBox() const { return m_pToolBox; }
87 /** checks if the toolbox needs a new imagelist.
89 void checkImageList();
91 inline sal_Bool isToolBoxHiContrast() const { return m_bIsHiContrast; }
92 protected:
93 DECL_LINK(ConfigOptionsChanged, SvtMiscOptions*);
94 DECL_LINK(SettingsChanged, VclWindowEvent* );
97 #endif // DBAUI_TOOLBOXHELPER_HXX