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_SVX_SOURCE_SIDEBAR_TEXT_TEXTPROPERTYPANEL_HXX
20 : #define INCLUDED_SVX_SOURCE_SIDEBAR_TEXT_TEXTPROPERTYPANEL_HXX
21 :
22 : #include <sfx2/sidebar/SidebarPanelBase.hxx>
23 : #include <sfx2/sidebar/ControllerItem.hxx>
24 : #include <sfx2/sidebar/IContextChangeReceiver.hxx>
25 : #include <sfx2/sidebar/EnumContext.hxx>
26 : #include <svtools/ctrlbox.hxx>
27 : #include <editeng/fhgtitem.hxx>
28 :
29 : #include <com/sun/star/ui/XSidebar.hpp>
30 : #include <com/sun/star/frame/XToolbarController.hpp>
31 :
32 : #include "TextCharacterSpacingPopup.hxx"
33 : #include "TextUnderlinePopup.hxx"
34 : #include <svx/sidebar/PanelLayout.hxx>
35 :
36 : class ToolBox;
37 :
38 : namespace svx { namespace sidebar {
39 :
40 : class PopupControl;
41 : class PopupContainer;
42 :
43 : class TextPropertyPanel
44 : : public PanelLayout,
45 : public ::sfx2::sidebar::IContextChangeReceiver,
46 : public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
47 : {
48 : public:
49 : virtual ~TextPropertyPanel();
50 : virtual void dispose() SAL_OVERRIDE;
51 :
52 : static VclPtr<vcl::Window> Create (
53 : vcl::Window* pParent,
54 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
55 : SfxBindings* pBindings,
56 : const ::sfx2::sidebar::EnumContext& rContext);
57 :
58 : virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
59 :
60 0 : ::sfx2::sidebar::ControllerItem& GetSpaceController() { return maSpacingControl;}
61 : long GetSelFontSize();
62 : void EndSpacingPopupMode();
63 : void EndUnderlinePopupMode();
64 0 : Color& GetUnderlineColor() { return meUnderlineColor;}
65 :
66 :
67 : virtual void HandleContextChange (
68 : const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE;
69 :
70 :
71 : virtual void NotifyItemUpdate(
72 : const sal_uInt16 nSId,
73 : const SfxItemState eState,
74 : const SfxPoolItem* pState,
75 : const bool bIsEnabled) SAL_OVERRIDE;
76 :
77 : TextPropertyPanel (
78 : vcl::Window* pParent,
79 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
80 : SfxBindings* pBindings,
81 : const ::sfx2::sidebar::EnumContext& rContext);
82 :
83 : private:
84 : //ui controls
85 : VclPtr<ToolBox> mpToolBoxFont;
86 : VclPtr<ToolBox> mpToolBoxIncDec;
87 : VclPtr<ToolBox> mpToolBoxSpacing;
88 : VclPtr<ToolBox> mpToolBoxFontColorSw;
89 : VclPtr<ToolBox> mpToolBoxFontColor;
90 : VclPtr<ToolBox> mpToolBoxBackgroundColor;
91 :
92 : //control items
93 : ::sfx2::sidebar::ControllerItem maFontSizeControl;
94 : ::sfx2::sidebar::ControllerItem maUnderlineControl;
95 : ::sfx2::sidebar::ControllerItem maSpacingControl;
96 :
97 : FontUnderline meUnderline;
98 : Color meUnderlineColor;
99 : bool mbKernAvailable;
100 : bool mbKernLBAvailable;
101 : long mlKerning;
102 : SvxFontHeightItem* mpHeightItem;
103 :
104 : TextCharacterSpacingPopup maCharSpacePopup;
105 : TextUnderlinePopup maUnderlinePopup;
106 :
107 : ::sfx2::sidebar::EnumContext maContext;
108 : SfxBindings* mpBindings;
109 :
110 : VclPtr<PopupControl> CreateCharacterSpacingControl (PopupContainer* pParent);
111 : VclPtr<PopupControl> CreateUnderlinePopupControl (PopupContainer* pParent);
112 : DECL_LINK_TYPED(SpacingClickHdl, ToolBox*, void);
113 : DECL_LINK_TYPED(UnderlineClickHdl, ToolBox*, void);
114 :
115 : void SetupToolboxItems();
116 : void InitToolBoxFont();
117 : void InitToolBoxSpacing();
118 : };
119 :
120 : } } // end of namespace svx::sidebar
121 :
122 : #endif
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|