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 INCLUDED_SC_SOURCE_UI_SIDEBAR_NUMBERFORMATPROPERTYPANEL_HXX
20 : #define INCLUDED_SC_SOURCE_UI_SIDEBAR_NUMBERFORMATPROPERTYPANEL_HXX
21 :
22 : #include <sfx2/sidebar/ControllerItem.hxx>
23 : #include <sfx2/sidebar/IContextChangeReceiver.hxx>
24 : #include <svx/sidebar/PanelLayout.hxx>
25 : #include <boost/scoped_ptr.hpp>
26 :
27 : class FixedText;
28 : class ListBox;
29 : class NumericField;
30 :
31 : namespace sc { namespace sidebar {
32 :
33 : class NumberFormatPropertyPanel
34 : : public PanelLayout,
35 : public ::sfx2::sidebar::IContextChangeReceiver,
36 : public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
37 : {
38 : public:
39 : public:
40 : static VclPtr<vcl::Window> Create(
41 : vcl::Window* pParent,
42 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
43 : SfxBindings* pBindings);
44 :
45 : virtual void DataChanged(
46 : const DataChangedEvent& rEvent) SAL_OVERRIDE;
47 :
48 : virtual void HandleContextChange(
49 : const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE;
50 :
51 : virtual void NotifyItemUpdate(
52 : const sal_uInt16 nSId,
53 : const SfxItemState eState,
54 : const SfxPoolItem* pState,
55 : const bool bIsEnabled) SAL_OVERRIDE;
56 :
57 0 : SfxBindings* GetBindings() { return mpBindings;}
58 :
59 : // constructor/destuctor
60 : NumberFormatPropertyPanel(
61 : vcl::Window* pParent,
62 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
63 : SfxBindings* pBindings);
64 : virtual ~NumberFormatPropertyPanel();
65 : virtual void dispose() SAL_OVERRIDE;
66 : private:
67 : //ui controls
68 : VclPtr<ListBox> mpLbCategory;
69 : VclPtr<ToolBox> mpTBCategory;
70 : VclPtr<NumericField> mpEdDecimals;
71 : VclPtr<NumericField> mpEdLeadZeroes;
72 : VclPtr<CheckBox> mpBtnNegRed;
73 : VclPtr<CheckBox> mpBtnThousand;
74 :
75 : OUString maThousandSeparator;
76 : OUString maEngineeringNotation;
77 :
78 : ::sfx2::sidebar::ControllerItem maNumFormatControl;
79 : ::sfx2::sidebar::ControllerItem maFormatControl;
80 :
81 : sal_uInt16 mnCategorySelected;
82 :
83 : css::uno::Reference<css::frame::XFrame> mxFrame;
84 : ::sfx2::sidebar::EnumContext maContext;
85 : SfxBindings* mpBindings;
86 :
87 : DECL_LINK_TYPED(NumFormatHdl, ToolBox*, void);
88 : DECL_LINK(NumFormatSelectHdl, ListBox*);
89 : DECL_LINK(NumFormatValueHdl, void*);
90 :
91 : void Initialize();
92 : };
93 :
94 : } } // end of namespace ::sc::sidebar
95 :
96 : #endif
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|