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