Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _SWNUMFMTLB_HXX
20 : : #define _SWNUMFMTLB_HXX
21 : :
22 : : #include <vcl/lstbox.hxx>
23 : : #include <svl/zforlist.hxx>
24 : : #include "swdllapi.h"
25 : :
26 : : class SwView;
27 : :
28 : : class SW_DLLPUBLIC NumFormatListBox : public ListBox
29 : : {
30 : : short nCurrFormatType;
31 : : sal_uInt16 nStdEntry;
32 : : sal_Bool bOneArea;
33 : : sal_uLong nDefFormat;
34 : : SwView* pVw;
35 : : SvNumberFormatter* pOwnFormatter;
36 : : LanguageType eCurLanguage;
37 : : sal_Bool bShowLanguageControl; //determine whether the language control has
38 : : //to be shown in the number format dialog
39 : : sal_Bool bUseAutomaticLanguage;//determine whether language is automatically assigned
40 : :
41 : : SW_DLLPRIVATE DECL_LINK( SelectHdl, ListBox * );
42 : :
43 : : SW_DLLPRIVATE double GetDefValue(const short nFormatType) const;
44 : : SW_DLLPRIVATE void Init(short nFormatType, sal_Bool bUsrFmts);
45 : : SW_DLLPRIVATE SwView* GetView();
46 : :
47 : : public:
48 : : NumFormatListBox( Window* pWin, const ResId& rResId,
49 : : short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0,
50 : : sal_Bool bUsrFmts = sal_True );
51 : :
52 : : NumFormatListBox( Window* pWin, SwView* pView, const ResId& rResId,
53 : : short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0,
54 : : sal_Bool bUsrFmts = sal_True );
55 : :
56 : : ~NumFormatListBox();
57 : :
58 : : void Clear();
59 : :
60 : 0 : inline void SetOneArea(sal_Bool bOnlyOne = sal_True) { bOneArea = bOnlyOne; }
61 : :
62 : : void SetFormatType(const short nFormatType);
63 : 0 : inline short GetFormatType() const { return nCurrFormatType; }
64 : : void SetDefFormat(const sal_uLong nDefFmt);
65 : : sal_uLong GetFormat() const;
66 : :
67 : 0 : inline LanguageType GetCurLanguage() const { return eCurLanguage;}
68 : 0 : void SetLanguage(LanguageType eSet) { eCurLanguage = eSet;}
69 : :
70 : 0 : void SetAutomaticLanguage(sal_Bool bSet){bUseAutomaticLanguage = bSet;}
71 : 0 : sal_Bool IsAutomaticLanguage()const {return bUseAutomaticLanguage;}
72 : :
73 : 0 : void SetShowLanguageControl(sal_Bool bSet){bShowLanguageControl = bSet;}
74 : :
75 : : };
76 : :
77 : :
78 : : #endif
79 : :
80 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|