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_SC_SOURCE_UI_SIDEBAR_CELLAPPEARANCEPROPERTYPANEL_HXX
20 #define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLAPPEARANCEPROPERTYPANEL_HXX
22 #include <sfx2/sidebar/ControllerItem.hxx>
23 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
24 #include <svx/sidebar/PanelLayout.hxx>
25 #include <boost/scoped_ptr.hpp>
28 namespace svx
{ namespace sidebar
{
32 namespace sc
{ namespace sidebar
{
33 class CellLineStylePopup
;
34 class CellBorderStylePopup
;
35 class CellLineStyleControl
;
36 class CellBorderUpdater
;
41 namespace sc
{ namespace sidebar
{
43 class CellAppearancePropertyPanel
45 public ::sfx2::sidebar::IContextChangeReceiver
,
46 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
49 friend class CellLineStyleControl
;
50 friend class CellBorderStyleControl
;
53 static VclPtr
<vcl::Window
> Create(
55 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
56 SfxBindings
* pBindings
);
58 virtual void DataChanged(
59 const DataChangedEvent
& rEvent
) SAL_OVERRIDE
;
61 virtual void HandleContextChange(
62 const ::sfx2::sidebar::EnumContext
& rContext
) SAL_OVERRIDE
;
64 virtual void NotifyItemUpdate(
65 const sal_uInt16 nSId
,
66 const SfxItemState eState
,
67 const SfxPoolItem
* pState
,
68 const bool bIsEnabled
) SAL_OVERRIDE
;
70 SfxBindings
* GetBindings() { return mpBindings
;}
72 // constructor/destuctor
73 CellAppearancePropertyPanel(
75 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
76 SfxBindings
* pBindings
);
77 virtual ~CellAppearancePropertyPanel();
78 virtual void dispose() SAL_OVERRIDE
;
83 VclPtr
<ToolBox
> mpTBCellBorder
;
84 VclPtr
<ToolBox
> mpTBLineStyle
;
85 VclPtr
<ToolBox
> mpTBLineColor
;
86 ::boost::scoped_ptr
< CellBorderUpdater
> mpCellBorderUpdater
;
88 ::sfx2::sidebar::ControllerItem maLineStyleControl
;
89 ::sfx2::sidebar::ControllerItem maBorderOuterControl
;
90 ::sfx2::sidebar::ControllerItem maBorderInnerControl
;
91 ::sfx2::sidebar::ControllerItem maGridShowControl
;
92 ::sfx2::sidebar::ControllerItem maBorderTLBRControl
;
93 ::sfx2::sidebar::ControllerItem maBorderBLTRControl
;
96 Image maIMGCellBorder
;
97 Image maIMGLineStyle1
;
98 Image maIMGLineStyle2
;
99 Image maIMGLineStyle3
;
100 Image maIMGLineStyle4
;
101 Image maIMGLineStyle5
;
102 Image maIMGLineStyle6
;
103 Image maIMGLineStyle7
;
104 Image maIMGLineStyle8
;
105 Image maIMGLineStyle9
;
107 // BorderStyle defines
112 sal_uInt16 mnTLBROut
;
113 sal_uInt16 mnTLBRDis
;
115 sal_uInt16 mnBLTROut
;
116 sal_uInt16 mnBLTRDis
;
119 bool mbBorderStyleAvailable
: 1;
121 // CellBorder defines
129 bool mbOuterBorder
: 1; // mbLeft || mbRight || mbTop || mbBottom
130 bool mbInnerBorder
: 1; // mbVer || mbHor || bLeft || bRight || bTop || bBottom
136 ::boost::scoped_ptr
< CellLineStylePopup
> mpCellLineStylePopup
;
137 ::boost::scoped_ptr
< CellBorderStylePopup
> mpCellBorderStylePopup
;
139 css::uno::Reference
<css::frame::XFrame
> mxFrame
;
140 ::sfx2::sidebar::EnumContext maContext
;
141 SfxBindings
* mpBindings
;
143 DECL_LINK_TYPED(TbxCellBorderSelectHdl
, ToolBox
*, void);
144 DECL_LINK_TYPED(TbxLineStyleSelectHdl
, ToolBox
*, void);
146 // for CellLineStyle popup
147 svx::sidebar::PopupControl
* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer
* pParent
);
148 void EndCellLineStylePopupMode();
150 // for CellBorderStyle popup
151 svx::sidebar::PopupControl
* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer
* pParent
);
152 void EndCellBorderStylePopupMode();
156 void UpdateControlState();
159 } } // end of namespace ::sc::sidebar
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */