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 static TextPropertyPanel
* Create (
51 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
52 SfxBindings
* pBindings
,
53 const ::sfx2::sidebar::EnumContext
& rContext
);
55 virtual void DataChanged (const DataChangedEvent
& rEvent
) SAL_OVERRIDE
;
57 ::sfx2::sidebar::ControllerItem
& GetSpaceController();
58 long GetSelFontSize();
59 void EndSpacingPopupMode (void);
60 void EndUnderlinePopupMode (void);
61 Color
& GetUnderlineColor();
64 virtual void HandleContextChange (
65 const ::sfx2::sidebar::EnumContext aContext
) SAL_OVERRIDE
;
68 virtual void NotifyItemUpdate(
69 const sal_uInt16 nSId
,
70 const SfxItemState eState
,
71 const SfxPoolItem
* pState
,
72 const bool bIsEnabled
) SAL_OVERRIDE
;
76 ToolBox
* mpToolBoxFont
;
77 ToolBox
* mpToolBoxIncDec
;
78 ToolBox
* mpToolBoxSpacing
;
79 ToolBox
* mpToolBoxFontColorSw
;
80 ToolBox
* mpToolBoxFontColor
;
83 ::sfx2::sidebar::ControllerItem maFontSizeControl
;
84 ::sfx2::sidebar::ControllerItem maUnderlineControl
;
85 ::sfx2::sidebar::ControllerItem maSpacingControl
;
87 FontUnderline meUnderline
;
88 Color meUnderlineColor
;
90 bool mbKernLBAvailable
;
92 SvxFontHeightItem
* mpHeightItem
;
94 TextCharacterSpacingPopup maCharSpacePopup
;
95 TextUnderlinePopup maUnderlinePopup
;
97 ::sfx2::sidebar::EnumContext maContext
;
98 SfxBindings
* mpBindings
;
102 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
103 SfxBindings
* pBindings
,
104 const ::sfx2::sidebar::EnumContext
& rContext
);
105 virtual ~TextPropertyPanel (void);
108 PopupControl
* CreateCharacterSpacingControl (PopupContainer
* pParent
);
109 PopupControl
* CreateUnderlinePopupControl (PopupContainer
* pParent
);
110 DECL_LINK(SpacingClickHdl
, ToolBox
*);
111 DECL_LINK(UnderlineClickHdl
, ToolBox
* );
113 void SetupToolboxItems (void);
114 void InitToolBoxFont();
115 void InitToolBoxSpacing();
118 } } // end of namespace ::svx::sidebar
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */