update dev300-m58
[ooovba.git] / sw / source / ui / inc / numfmtlb.hxx
blob5b9fb76cb837086f1e4fcd3319dfd8ac02234ca7
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: numfmtlb.hxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
30 #ifndef _SWNUMFMTLB_HXX
31 #define _SWNUMFMTLB_HXX
33 #include <vcl/lstbox.hxx>
34 #include <svtools/zforlist.hxx>
35 #include "swdllapi.h"
37 class SwView;
39 class SW_DLLPUBLIC NumFormatListBox : public ListBox
41 short nCurrFormatType;
42 USHORT nStdEntry;
43 BOOL bOneArea;
44 ULONG nDefFormat;
45 SwView* pVw;
46 SvNumberFormatter* pOwnFormatter;
47 LanguageType eCurLanguage;
48 BOOL bShowLanguageControl; //determine whether the language control has
49 //to be shown in the number format dialog
50 BOOL bUseAutomaticLanguage;//determine whether language is automatically assigned
52 SW_DLLPRIVATE DECL_LINK( SelectHdl, ListBox * );
54 SW_DLLPRIVATE double GetDefValue(const short nFormatType) const;
55 SW_DLLPRIVATE void Init(short nFormatType, BOOL bUsrFmts);
56 SW_DLLPRIVATE SwView* GetView();
58 public:
59 NumFormatListBox( Window* pWin, const ResId& rResId,
60 short nFormatType = NUMBERFORMAT_NUMBER, ULONG nDefFmt = 0,
61 BOOL bUsrFmts = TRUE );
63 NumFormatListBox( Window* pWin, SwView* pView, const ResId& rResId,
64 short nFormatType = NUMBERFORMAT_NUMBER, ULONG nDefFmt = 0,
65 BOOL bUsrFmts = TRUE );
67 ~NumFormatListBox();
69 void Clear();
71 inline void SetOneArea(BOOL bOnlyOne = TRUE) { bOneArea = bOnlyOne; }
73 void SetFormatType(const short nFormatType);
74 inline short GetFormatType() const { return nCurrFormatType; }
75 void SetDefFormat(const ULONG nDefFmt);
76 ULONG GetFormat() const;
78 inline LanguageType GetCurLanguage() const { return eCurLanguage;}
79 void SetLanguage(LanguageType eSet) { eCurLanguage = eSet;}
81 void SetAutomaticLanguage(BOOL bSet){bUseAutomaticLanguage = bSet;}
82 BOOL IsAutomaticLanguage()const {return bUseAutomaticLanguage;}
84 void SetShowLanguageControl(BOOL bSet){bShowLanguageControl = bSet;}
89 #endif