1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_TEXT_TEXTPROPERTYPANEL_HXX
20 #define INCLUDED_SVX_SOURCE_SIDEBAR_TEXT_TEXTPROPERTYPANEL_HXX
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>
29 #include <com/sun/star/ui/XSidebar.hpp>
30 #include <com/sun/star/frame/XToolbarController.hpp>
32 #include "TextCharacterSpacingPopup.hxx"
33 #include "TextUnderlinePopup.hxx"
34 #include <svx/sidebar/PanelLayout.hxx>
38 namespace svx
{ namespace sidebar
{
43 class TextPropertyPanel
45 public ::sfx2::sidebar::IContextChangeReceiver
,
46 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
49 virtual ~TextPropertyPanel();
50 virtual void dispose() SAL_OVERRIDE
;
52 static VclPtr
<vcl::Window
> Create (
54 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
55 SfxBindings
* pBindings
,
56 const ::sfx2::sidebar::EnumContext
& rContext
);
58 virtual void DataChanged (const DataChangedEvent
& rEvent
) SAL_OVERRIDE
;
60 ::sfx2::sidebar::ControllerItem
& GetSpaceController() { return maSpacingControl
;}
61 long GetSelFontSize();
62 void EndSpacingPopupMode();
63 void EndUnderlinePopupMode();
64 Color
& GetUnderlineColor() { return meUnderlineColor
;}
67 virtual void HandleContextChange (
68 const ::sfx2::sidebar::EnumContext
& rContext
) SAL_OVERRIDE
;
71 virtual void NotifyItemUpdate(
72 const sal_uInt16 nSId
,
73 const SfxItemState eState
,
74 const SfxPoolItem
* pState
,
75 const bool bIsEnabled
) SAL_OVERRIDE
;
79 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
80 SfxBindings
* pBindings
,
81 const ::sfx2::sidebar::EnumContext
& rContext
);
85 VclPtr
<ToolBox
> mpToolBoxFont
;
86 VclPtr
<ToolBox
> mpToolBoxIncDec
;
87 VclPtr
<ToolBox
> mpToolBoxSpacing
;
88 VclPtr
<ToolBox
> mpToolBoxFontColorSw
;
89 VclPtr
<ToolBox
> mpToolBoxFontColor
;
90 VclPtr
<ToolBox
> mpToolBoxBackgroundColor
;
93 ::sfx2::sidebar::ControllerItem maFontSizeControl
;
94 ::sfx2::sidebar::ControllerItem maUnderlineControl
;
95 ::sfx2::sidebar::ControllerItem maSpacingControl
;
97 FontUnderline meUnderline
;
98 Color meUnderlineColor
;
100 bool mbKernLBAvailable
;
102 SvxFontHeightItem
* mpHeightItem
;
104 TextCharacterSpacingPopup maCharSpacePopup
;
105 TextUnderlinePopup maUnderlinePopup
;
107 ::sfx2::sidebar::EnumContext maContext
;
108 SfxBindings
* mpBindings
;
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);
115 void SetupToolboxItems();
116 void InitToolBoxFont();
117 void InitToolBoxSpacing();
120 } } // end of namespace svx::sidebar
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */