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 #ifndef _SWNUMFMTLB_HXX 28 #define _SWNUMFMTLB_HXX 29 30 #include <vcl/lstbox.hxx> 31 #include <svl/zforlist.hxx> 32 #include "swdllapi.h" 33 34 class SwView; 35 36 class SW_DLLPUBLIC NumFormatListBox : public ListBox 37 { 38 short nCurrFormatType; 39 sal_uInt16 nStdEntry; 40 sal_Bool bOneArea; 41 sal_uLong nDefFormat; 42 SwView* pVw; 43 SvNumberFormatter* pOwnFormatter; 44 LanguageType eCurLanguage; 45 sal_Bool bShowLanguageControl; //determine whether the language control has 46 //to be shown in the number format dialog 47 sal_Bool bUseAutomaticLanguage;//determine whether language is automatically assigned 48 49 SW_DLLPRIVATE DECL_LINK( SelectHdl, ListBox * ); 50 51 SW_DLLPRIVATE double GetDefValue(const short nFormatType) const; 52 SW_DLLPRIVATE void Init(short nFormatType, sal_Bool bUsrFmts); 53 SW_DLLPRIVATE SwView* GetView(); 54 55 public: 56 NumFormatListBox( Window* pWin, const ResId& rResId, 57 short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0, 58 sal_Bool bUsrFmts = sal_True ); 59 60 NumFormatListBox( Window* pWin, SwView* pView, const ResId& rResId, 61 short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0, 62 sal_Bool bUsrFmts = sal_True ); 63 64 ~NumFormatListBox(); 65 66 void Clear(); 67 68 inline void SetOneArea(sal_Bool bOnlyOne = sal_True) { bOneArea = bOnlyOne; } 69 70 void SetFormatType(const short nFormatType); 71 inline short GetFormatType() const { return nCurrFormatType; } 72 void SetDefFormat(const sal_uLong nDefFmt); 73 sal_uLong GetFormat() const; 74 75 inline LanguageType GetCurLanguage() const { return eCurLanguage;} 76 void SetLanguage(LanguageType eSet) { eCurLanguage = eSet;} 77 78 void SetAutomaticLanguage(sal_Bool bSet){bUseAutomaticLanguage = bSet;} 79 sal_Bool IsAutomaticLanguage()const {return bUseAutomaticLanguage;} 80 81 void SetShowLanguageControl(sal_Bool bSet){bShowLanguageControl = bSet;} 82 83 }; 84 85 86 #endif 87 88