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