[Libreoffice-commits] core.git: Branch 'feature/chart-sidebar' - 351 commits - accessibility/inc avmedia/Library_avmediavlc.mk avmedia/source basegfx/source basic/qa basic/source bin/lo-commit-stat bridges/source chart2/inc chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk cli_ure/source comphelper/source compilerplugins/clang configmgr/inc configmgr/qa configmgr/source configure.ac connectivity/source cppu/source cui/source dbaccess/source desktop/source dictionaries download.lst dtrans/source editeng/source embeddedobj/source extensions/source external/jfreereport external/libcmis external/liblangtag extras/source filter/CppunitTest_filter_utils.mk filter/Module_filter.mk filter/qa filter/source forms/source fpicker/Library_fps_office.mk fpicker/source fpicker/uiconfig fpicker/UIConfig_fps.mk framework/inc framework/Library_fwk.mk framework/source framework/util helpcontent2 hwpfilter/source icon-themes/breeze icon-themes/tango include/avmedia include/bas ic include/connectivity include/drawinglayer include/editeng include/framework include/linguistic include/o3tl include/osl include/sfx2 include/svtools include/svx include/toolkit include/tools include/ucbhelper include/unotools include/vcl include/xmloff instsetoo_native/CustomTarget_setup.mk jvmfwk/plugins jvmfwk/source linguistic/source mysqlc/source o3tl/qa offapi/com officecfg/registry oox/source package/source postprocess/qa registry/source reportdesign/inc reportdesign/source sal/osl sal/qa sax/source sc/inc sc/Library_sc.mk scp2/source sc/qa scripting/source sc/sdi sc/source sc/uiconfig sd/inc sd/source sfx2/inc sfx2/sdi sfx2/source sfx2/uiconfig shell/source sot/source starmath/source stoc/source stoc/test store/source svgio/inc svgio/source svl/qa svl/source svtools/inc svtools/Library_svt.mk svtools/source svtools/uiconfig svx/inc svx/Library_svx.mk svx/sdi svx/source sw/inc sw/Library_sw.mk sw/qa sw/sdi sw/source sw/uiconfig test/source toolkit/inc toolkit/source tools/s ource ucbhelper/source ucb/source UnoControls/source unotools/source unoxml/source uui/source vbahelper/source vcl/generic vcl/headless vcl/inc vcl/qa vcl/source vcl/unx vcl/win wizards/com writerfilter/source xmloff/inc xmloff/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Jul 20 09:28:58 PDT 2015
Rebased ref, commits from common ancestor:
commit b57b7673b4dd34f11d79243a5ae41860b61f60f0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Jul 20 18:23:04 2015 +0200
split area property sidebar panel into two parts
The AreaPropertyPanelBase is independent from the dispatcher,
SfxBindings and some other sfx2 stuff. There are still a few open
points about some of the controls used but it is a step forward.
Change-Id: I8eed42522abb3d3efc46bad352da9cbaa0b88b12
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index a890ed7..2bb6273 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -186,6 +186,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/paragraph/ParaLineSpacingPopup \
svx/source/sidebar/paragraph/ParaPropertyPanel \
svx/source/sidebar/area/AreaPropertyPanel \
+ svx/source/sidebar/area/AreaPropertyPanelBase \
svx/source/sidebar/area/AreaTransparencyGradientControl \
svx/source/sidebar/area/AreaTransparencyGradientPopup \
svx/source/sidebar/shadow/ShadowPropertyPanel \
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 376dc4e..53836bc 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -49,35 +49,11 @@ const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
namespace svx { namespace sidebar {
-const sal_Int32 AreaPropertyPanel::DEFAULT_CENTERX = 50;
-const sal_Int32 AreaPropertyPanel::DEFAULT_CENTERY = 50;
-const sal_Int32 AreaPropertyPanel::DEFAULT_ANGLE = 0;
-const sal_Int32 AreaPropertyPanel::DEFAULT_STARTVALUE = 0;
-const sal_Int32 AreaPropertyPanel::DEFAULT_ENDVALUE = 16777215;
-const sal_Int32 AreaPropertyPanel::DEFAULT_BORDER = 0;
-
-
AreaPropertyPanel::AreaPropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
- : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui", rxFrame),
- meLastXFS(static_cast<sal_uInt16>(-1)),
- mnLastPosGradient(0),
- mnLastPosHatch(0),
- mnLastPosBitmap(0),
- mnLastTransSolid(50),
- maGradientLinear(),
- maGradientAxial(),
- maGradientRadial(),
- maGradientElliptical(),
- maGradientSquare(),
- maGradientRect(),
- mpStyleItem(),
- mpColorItem(),
- mpFillGradientItem(),
- mpHatchItem(),
- mpBitmapItem(),
+ : AreaPropertyPanelBase(pParent, rxFrame),
maStyleControl(SID_ATTR_FILL_STYLE, *pBindings, *this),
maColorControl(SID_ATTR_FILL_COLOR, *pBindings, *this),
maGradientControl(SID_ATTR_FILL_GRADIENT, *pBindings, *this),
@@ -88,27 +64,8 @@ AreaPropertyPanel::AreaPropertyPanel(
maBitmapListControl(SID_BITMAP_LIST, *pBindings, *this),
maFillTransparenceController(SID_ATTR_FILL_TRANSPARENCE, *pBindings, *this),
maFillFloatTransparenceController(SID_ATTR_FILL_FLOATTRANSPARENCE, *pBindings, *this),
- maImgAxial(SVX_RES(IMG_AXIAL)),
- maImgElli(SVX_RES(IMG_ELLI)),
- maImgQuad(SVX_RES(IMG_QUAD)),
- maImgRadial(SVX_RES(IMG_RADIAL)),
- maImgSquare(SVX_RES(IMG_SQUARE)),
- maImgLinear(SVX_RES(IMG_LINEAR)),
- maTrGrPopup(this, ::boost::bind(&AreaPropertyPanel::CreateTransparencyGradientControl, this, _1)),
- mpFloatTransparenceItem(),
- mpTransparanceItem(),
- mxFrame(rxFrame),
mpBindings(pBindings)
{
- get(mpColorTextFT, "filllabel");
- get(mpLbFillType, "fillstyle");
- get(mpLbFillAttr, "fillattr");
- get(mpTrspTextFT, "transparencylabel");
- get(mpToolBoxColor, "selectcolor");
- get(mpLBTransType, "transtype");
- get(mpMTRTransparent, "settransparency");
- get(mpBTNGradient, "selectgradient");
-
Initialize();
}
@@ -119,15 +76,6 @@ AreaPropertyPanel::~AreaPropertyPanel()
void AreaPropertyPanel::dispose()
{
- mpColorTextFT.clear();
- mpLbFillType.clear();
- mpLbFillAttr.clear();
- mpToolBoxColor.clear();
- mpTrspTextFT.clear();
- mpLBTransType.clear();
- mpMTRTransparent.clear();
- mpBTNGradient.clear();
-
maStyleControl.dispose();
maColorControl.dispose();
maGradientControl.dispose();
@@ -139,367 +87,11 @@ void AreaPropertyPanel::dispose()
maFillTransparenceController.dispose();
maFillFloatTransparenceController.dispose();
- PanelLayout::dispose();
+ AreaPropertyPanelBase::dispose();
}
void AreaPropertyPanel::Initialize()
{
- maGradientLinear.SetXOffset(DEFAULT_CENTERX);
- maGradientLinear.SetYOffset(DEFAULT_CENTERY);
- maGradientLinear.SetAngle(DEFAULT_ANGLE);
- maGradientLinear.SetStartColor(Color(DEFAULT_STARTVALUE));
- maGradientLinear.SetEndColor(Color(DEFAULT_ENDVALUE));
- maGradientLinear.SetBorder(DEFAULT_BORDER);
- maGradientLinear.SetGradientStyle(css::awt::GradientStyle_LINEAR);
-
- maGradientAxial = maGradientLinear;
- maGradientAxial.SetGradientStyle(css::awt::GradientStyle_AXIAL);
-
- maGradientRadial = maGradientLinear;
- maGradientRadial.SetGradientStyle(css::awt::GradientStyle_RADIAL);
-
- maGradientElliptical = maGradientLinear;
- maGradientElliptical.SetGradientStyle(css::awt::GradientStyle_ELLIPTICAL);
-
- maGradientSquare = maGradientLinear;
- maGradientSquare.SetGradientStyle(css::awt::GradientStyle_SQUARE);
-
- maGradientRect = maGradientLinear;
- maGradientRect.SetGradientStyle(css::awt::GradientStyle_RECT);
-
- mpLbFillType->SetAccessibleName(OUString( "Fill")); //wj acc
- mpLbFillAttr->SetAccessibleName(OUString( "Fill")); //wj acc
-
- Link<> aLink = LINK( this, AreaPropertyPanel, SelectFillTypeHdl );
- mpLbFillType->SetSelectHdl( aLink );
-
- aLink = LINK( this, AreaPropertyPanel, SelectFillAttrHdl );
- mpLbFillAttr->SetSelectHdl( aLink );
-
- mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanel, ChangeTrgrTypeHdl_Impl));
- mpLBTransType->SetAccessibleName(OUString( "Transparency")); //wj acc
-
- mpMTRTransparent->SetValue( 50 );
- mpMTRTransparent->SetModifyHdl(LINK(this, AreaPropertyPanel, ModifyTransparentHdl_Impl));
- mpMTRTransparent->SetAccessibleName(OUString( "Transparency")); //wj acc
-
- const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
- mpBTNGradient->SetItemBits( nIdGradient, mpBTNGradient->GetItemBits( nIdGradient ) | ToolBoxItemBits::DROPDOWNONLY );
- Link<ToolBox *, void> aLink2 = LINK( this, AreaPropertyPanel, ClickTrGrHdl_Impl );
- mpBTNGradient->SetDropdownClickHdl( aLink2 );
- mpBTNGradient->SetSelectHdl( aLink2 );
- mpBTNGradient->SetItemImage(nIdGradient,maImgLinear);
- mpBTNGradient->Hide();
-
- mpLbFillType->SetAccessibleRelationLabeledBy(mpColorTextFT);
- mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr);
- mpToolBoxColor->SetAccessibleRelationLabeledBy(mpToolBoxColor);
- mpLBTransType->SetAccessibleRelationLabeledBy(mpTrspTextFT);
- mpMTRTransparent->SetAccessibleRelationLabeledBy(mpMTRTransparent);
- mpBTNGradient->SetAccessibleRelationLabeledBy(mpBTNGradient);
-}
-
-IMPL_LINK(AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox)
-{
- const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos();
-
- if((drawing::FillStyle)meLastXFS != eXFS)
- {
- mpLbFillAttr->Clear();
- SfxObjectShell* pSh = SfxObjectShell::Current();
- const XFillStyleItem aXFillStyleItem(eXFS);
-
- // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE
- // and one for setting the fill attribute itself, but add two SfxPoolItems to the
- // call to get just one action at the SdrObject and to create only one Undo action, too.
- // Checked that this works in all apps.
- switch( eXFS )
- {
- default:
- case drawing::FillStyle_NONE:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
- mpLbFillType->Selected();
- mpLbFillAttr->Disable();
-
- // #i122676# need to call a single SID_ATTR_FILL_STYLE change
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, &aXFillStyleItem, 0L);
- break;
- }
- case drawing::FillStyle_SOLID:
- {
- mpLbFillAttr->Hide();
- mpToolBoxColor->Show();
- const OUString aTmpStr;
- const Color aColor = mpColorItem->GetColorValue();
- const XFillColorItem aXFillColorItem( aTmpStr, aColor );
-
- // #i122676# change FillStyle and Color in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, &aXFillColorItem, &aXFillStyleItem, 0L);
- break;
- }
- case drawing::FillStyle_GRADIENT:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
- {
- if(!mpLbFillAttr->GetEntryCount())
- {
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetGradientList());
- }
-
- mpLbFillAttr->AdaptDropDownLineCountToMaximum();
-
- if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
- {
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
-
- if(mnLastPosGradient < aItem.GetGradientList()->Count())
- {
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
- const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient);
-
- // #i122676# change FillStyle and Gradient in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, &aXFillGradientItem, &aXFillStyleItem, 0L);
- mpLbFillAttr->SelectEntryPos(mnLastPosGradient);
- }
- }
- }
- else
- {
- mpLbFillAttr->Disable();
- }
- break;
- }
- case drawing::FillStyle_HATCH:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_HATCH_LIST))
- {
- if(!mpLbFillAttr->GetEntryCount())
- {
- const SvxHatchListItem aItem( *static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetHatchList());
- }
-
- mpLbFillAttr->AdaptDropDownLineCountToMaximum();
-
- if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch)
- {
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
-
- if(mnLastPosHatch < aItem.GetHatchList()->Count())
- {
- const XHatch aHatch = aItem.GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch();
- const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectEntry(), aHatch);
-
- // #i122676# change FillStyle and Hatch in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, &aXFillHatchItem, &aXFillStyleItem, 0L);
- mpLbFillAttr->SelectEntryPos(mnLastPosHatch);
- }
- }
- }
- else
- {
- mpLbFillAttr->Disable();
- }
- break;
- }
- case drawing::FillStyle_BITMAP:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_BITMAP_LIST))
- {
- if(!mpLbFillAttr->GetEntryCount())
- {
- const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
- }
-
- mpLbFillAttr->AdaptDropDownLineCountToMaximum();
-
- if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap)
- {
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
-
- if(mnLastPosBitmap < aItem.GetBitmapList()->Count())
- {
- const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap);
- const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
-
- // #i122676# change FillStyle and Bitmap in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, &aXFillBitmapItem, &aXFillStyleItem, 0L);
- mpLbFillAttr->SelectEntryPos(mnLastPosBitmap);
- }
- }
- }
- else
- {
- mpLbFillAttr->Disable();
- }
- break;
- }
- }
-
- meLastXFS = (sal_uInt16)eXFS;
-
- if(drawing::FillStyle_NONE != eXFS)
- {
- if(pToolBox)
- {
- mpLbFillType->Selected();
- }
- }
- }
-
- return 0;
-}
-
-IMPL_LINK(AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox)
-{
- const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos();
- const XFillStyleItem aXFillStyleItem(eXFS);
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if(pToolBox)
- {
- // #i122676# dependent from bFillStyleChange, do execute a single or two
- // changes in one Execute call
- const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS);
-
- switch(eXFS)
- {
- case drawing::FillStyle_SOLID:
- {
- if(bFillStyleChange)
- {
- // #i122676# Single FillStyle change call needed here
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, &aXFillStyleItem, 0L);
- }
- break;
- }
- case drawing::FillStyle_GRADIENT:
- {
- sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
-
- if(LISTBOX_ENTRY_NOTFOUND == nPos)
- {
- nPos = mnLastPosGradient;
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST))
- {
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
-
- if(nPos < aItem.GetGradientList()->Count())
- {
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient();
- const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient);
-
- // #i122676# Change FillStale and Gradinet in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, &aXFillGradientItem,
- bFillStyleChange ? &aXFillStyleItem : 0L, 0L);
- }
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- {
- mnLastPosGradient = nPos;
- }
- break;
- }
- case drawing::FillStyle_HATCH:
- {
- sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
-
- if(LISTBOX_ENTRY_NOTFOUND == nPos)
- {
- nPos = mnLastPosHatch;
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST))
- {
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
-
- if(nPos < aItem.GetHatchList()->Count())
- {
- const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch();
- const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch);
-
- // #i122676# Change FillStale and Hatch in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, &aXFillHatchItem,
- bFillStyleChange ? &aXFillStyleItem : 0L, 0L);
- }
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- {
- mnLastPosHatch = nPos;
- }
- break;
- }
- case drawing::FillStyle_BITMAP:
- {
- sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
-
- if(LISTBOX_ENTRY_NOTFOUND == nPos)
- {
- nPos = mnLastPosBitmap;
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST))
- {
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
-
- if(nPos < aItem.GetBitmapList()->Count())
- {
- const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
- const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
-
- // #i122676# Change FillStale and Bitmap in one call
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, &aXFillBitmapItem,
- bFillStyleChange ? &aXFillStyleItem : 0L, 0L);
- }
- }
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- {
- mnLastPosBitmap = nPos;
- }
- break;
- }
- default: break;
- }
- }
-
- return 0;
-}
-
-VclPtr<PopupControl> AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent)
-{
- return VclPtrInstance<AreaTransparencyGradientControl>(pParent, *this);
}
VclPtr<vcl::Window> AreaPropertyPanel::Create (
@@ -520,716 +112,48 @@ VclPtr<vcl::Window> AreaPropertyPanel::Create (
pBindings);
}
-void AreaPropertyPanel::DataChanged(
- const DataChangedEvent& /*rEvent*/)
+void AreaPropertyPanel::setFillTransparence(const XFillTransparenceItem& rItem)
{
+ GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SfxCallMode::RECORD, &rItem, 0L );
}
-void AreaPropertyPanel::ImpUpdateTransparencies()
+void AreaPropertyPanel::setFillFloatTransparence(const XFillFloatTransparenceItem& rItem)
{
- if(mpTransparanceItem.get() && mpFloatTransparenceItem.get())
- {
- bool bZeroValue(false);
-
- if(mpTransparanceItem.get())
- {
- const sal_uInt16 nValue(mpTransparanceItem->GetValue());
-
- if(!nValue)
- {
- bZeroValue = true;
- }
- else if(nValue <= 100)
- {
- mpLBTransType->Enable();
- mpTrspTextFT->Enable();
- mpLBTransType->SelectEntryPos(1);
- mpBTNGradient->Hide();
- mpMTRTransparent->Show();
- mpMTRTransparent->Enable();
- mpMTRTransparent->SetValue(nValue);
- }
-
- if(!bZeroValue)
- {
- maTrGrPopup.Hide();
- }
- }
-
- if(bZeroValue && mpFloatTransparenceItem.get())
- {
- if(mpFloatTransparenceItem->IsEnabled())
- {
- const XGradient& rGradient = mpFloatTransparenceItem->GetGradientValue();
- sal_Int32 nEntryPos(0);
- Image* pImage = 0;
-
- mpLBTransType->Enable();
- mpTrspTextFT->Enable();
- mpMTRTransparent->Hide();
- mpBTNGradient->Enable();
- mpBTNGradient->Show();
-
- switch(rGradient.GetGradientStyle())
- {
- default:
- case css::awt::GradientStyle_LINEAR:
- {
- nEntryPos = 2;
- pImage = &maImgLinear;
- break;
- }
- case css::awt::GradientStyle_AXIAL:
- {
- nEntryPos = 3;
- pImage = &maImgAxial;
- break;
- }
- case css::awt::GradientStyle_RADIAL:
- {
- nEntryPos = 4;
- pImage = &maImgRadial;
- break;
- }
- case css::awt::GradientStyle_ELLIPTICAL:
- {
- nEntryPos = 5;
- pImage = &maImgElli;
- break;
- }
- case css::awt::GradientStyle_SQUARE:
- {
- nEntryPos = 6;
- pImage = &maImgQuad;
- break;
- }
- case css::awt::GradientStyle_RECT:
- {
- nEntryPos = 7;
- pImage = &maImgSquare;
- break;
- }
- }
-
- const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
- mpLBTransType->SelectEntryPos(nEntryPos);
- mpBTNGradient->SetItemImage(nIdGradient, *pImage);
- bZeroValue = false;
- }
- else
- {
- bZeroValue = true;
- }
- }
-
- if(bZeroValue)
- {
- mpLBTransType->Enable();
- mpTrspTextFT->Enable();
- mpLBTransType->SelectEntryPos(0);
- mpBTNGradient->Hide();
- mpMTRTransparent->Enable();
- mpMTRTransparent->Show();
- mpMTRTransparent->SetValue(0);
- }
- }
- else
- {
- // no transparency at all
- mpLBTransType->SetNoSelection();
- mpLBTransType->Disable();
- mpTrspTextFT->Disable();
- mpMTRTransparent->Disable();
- mpMTRTransparent->Show();
- mpBTNGradient->Disable();
- mpBTNGradient->Hide();
- }
+ GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_FLOATTRANSPARENCE, SfxCallMode::RECORD, &rItem, 0L );
}
-void AreaPropertyPanel::NotifyItemUpdate(
- sal_uInt16 nSID,
- SfxItemState eState,
- const SfxPoolItem* pState,
- const bool bIsEnabled)
+void AreaPropertyPanel::setFillStyle(const XFillStyleItem& rItem)
{
- (void)bIsEnabled;
- const bool bDisabled(SfxItemState::DISABLED == eState);
-
- switch(nSID)
- {
- case SID_ATTR_FILL_TRANSPARENCE:
- case SID_ATTR_FILL_FLOATTRANSPARENCE:
- {
- bool bFillTransparenceChanged(false);
-
- if(SID_ATTR_FILL_TRANSPARENCE == nSID)
- {
- bFillTransparenceChanged = true;
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
-
- if(pItem && (!mpTransparanceItem || *pItem != *mpTransparanceItem))
- {
- mpTransparanceItem.reset(static_cast<SfxUInt16Item*>(pItem->Clone()));
- }
- else
- {
- mpTransparanceItem.reset();
- }
- }
- else
- {
- mpTransparanceItem.reset();
- }
- }
- else // if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
- {
- bFillTransparenceChanged = true;
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XFillFloatTransparenceItem* pItem = dynamic_cast< const XFillFloatTransparenceItem* >(pState);
-
- if(pItem && (!mpFloatTransparenceItem || *pItem != *mpFloatTransparenceItem))
- {
- mpFloatTransparenceItem.reset(static_cast<XFillFloatTransparenceItem*>(pItem->Clone()));
- }
- else
- {
- mpFloatTransparenceItem.reset();
- }
- }
- else
- {
- mpFloatTransparenceItem.reset();
- }
- }
-
- if(bFillTransparenceChanged)
- {
- // update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
- ImpUpdateTransparencies();
- }
- break;
- }
- case SID_ATTR_FILL_STYLE:
- {
- if(bDisabled)
- {
- mpLbFillType->Disable();
- mpColorTextFT->Disable();
- mpLbFillType->SetNoSelection();
- mpLbFillAttr->Show();
- mpLbFillAttr->Disable();
- mpLbFillAttr->SetNoSelection();
- mpToolBoxColor->Hide();
- meLastXFS = static_cast<sal_uInt16>(-1);
- mpStyleItem.reset();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XFillStyleItem* pItem = dynamic_cast< const XFillStyleItem* >(pState);
-
- if(pItem)
- {
- mpStyleItem.reset(dynamic_cast< XFillStyleItem* >(pItem->Clone()));
- mpLbFillType->Enable();
- mpColorTextFT->Enable();
- drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue();
- meLastXFS = eXFS;
- mpLbFillType->SelectEntryPos(sal::static_int_cast< sal_Int32 >(eXFS));
-
- if(drawing::FillStyle_NONE == eXFS)
- {
- mpLbFillAttr->SetNoSelection();
- mpLbFillAttr->Disable();
- }
-
- Update();
- break;
- }
- }
-
- mpLbFillType->SetNoSelection();
- mpLbFillAttr->Show();
- mpLbFillAttr->Disable();
- mpLbFillAttr->SetNoSelection();
- mpToolBoxColor->Hide();
- meLastXFS = static_cast<sal_uInt16>(-1);
- mpStyleItem.reset();
- break;
- }
- case SID_ATTR_FILL_COLOR:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- mpColorItem.reset(pState ? static_cast<XFillColorItem*>(pState->Clone()) : 0);
- }
-
- if(mpStyleItem && drawing::FillStyle_SOLID == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- mpLbFillAttr->Hide();
- mpToolBoxColor->Show();
-
- Update();
- }
- break;
- }
- case SID_ATTR_FILL_GRADIENT:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- mpFillGradientItem.reset(pState ? static_cast<XFillGradientItem*>(pState->Clone()) : 0);
- }
-
- if(mpStyleItem && drawing::FillStyle_GRADIENT == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(SfxItemState::DEFAULT == eState)
- {
- mpLbFillAttr->Enable();
- Update();
- }
- else if(SfxItemState::DISABLED == eState )
- {
- mpLbFillAttr->Disable();
- mpLbFillAttr->SetNoSelection();
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- break;
- }
- case SID_ATTR_FILL_HATCH:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- mpHatchItem.reset(pState ? static_cast<XFillHatchItem*>(pState->Clone()) : 0);
- }
-
- if(mpStyleItem && drawing::FillStyle_HATCH == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(SfxItemState::DEFAULT == eState)
- {
- mpLbFillAttr->Enable();
- Update();
- }
- else if(SfxItemState::DISABLED == eState )
- {
- mpLbFillAttr->Disable();
- mpLbFillAttr->SetNoSelection();
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- break;
- }
- case SID_ATTR_FILL_BITMAP:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- mpBitmapItem.reset(pState ? static_cast<XFillBitmapItem*>(pState->Clone()) : 0);
- }
-
- if(mpStyleItem && drawing::FillStyle_BITMAP == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(SfxItemState::DEFAULT == eState)
- {
- mpLbFillAttr->Enable();
- Update();
- }
- else if(SfxItemState::DISABLED == eState )
- {
- mpLbFillAttr->Disable();
- mpLbFillAttr->SetNoSelection();
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- break;
- }
- case SID_GRADIENT_LIST:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- if(mpStyleItem && drawing::FillStyle_GRADIENT == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- if(mpFillGradientItem)
- {
- const OUString aString( mpFillGradientItem->GetName() );
- const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxGradientListItem aItem( *static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
-
- mpLbFillAttr->Clear();
- mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetGradientList());
- mpLbFillAttr->SelectEntry(aString);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- }
- break;
- }
- case SID_HATCH_LIST:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- if(mpStyleItem && drawing::FillStyle_HATCH == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- if(mpHatchItem)
- {
- const OUString aString( mpHatchItem->GetName() );
- const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
-
- mpLbFillAttr->Clear();
- mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetHatchList());
- mpLbFillAttr->SelectEntry(aString);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- }
- break;
- }
- case SID_BITMAP_LIST:
- {
- if(SfxItemState::DEFAULT == eState)
- {
- if(mpStyleItem && drawing::FillStyle_BITMAP == (drawing::FillStyle)mpStyleItem->GetValue())
- {
- if(mpBitmapItem)
- {
- const OUString aString( mpBitmapItem->GetName() );
- const SfxObjectShell* pSh = SfxObjectShell::Current();
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
-
- mpLbFillAttr->Clear();
- mpLbFillAttr->Enable();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
- mpLbFillAttr->SelectEntry(aString);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- }
- break;
- }
- }
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, &rItem, 0L);
}
-void AreaPropertyPanel::Update()
+void AreaPropertyPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem,
+ const XFillColorItem& aColorItem)
{
- if(mpStyleItem)
- {
- const drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue();
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- switch( eXFS )
- {
- case drawing::FillStyle_NONE:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
- break;
- }
- case drawing::FillStyle_SOLID:
- {
- if(mpColorItem)
- {
- mpLbFillAttr->Hide();
- mpToolBoxColor->Show();
- }
- break;
- }
- case drawing::FillStyle_GRADIENT:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
- {
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetGradientList());
-
- if(mpFillGradientItem)
- {
- const OUString aString(mpFillGradientItem->GetName());
-
- mpLbFillAttr->SelectEntry(aString);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- break;
- }
- case drawing::FillStyle_HATCH:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_HATCH_LIST))
- {
- const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetHatchList());
-
- if(mpHatchItem)
- {
- const OUString aString(mpHatchItem->GetName());
-
- mpLbFillAttr->SelectEntry( aString );
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- break;
- }
- case drawing::FillStyle_BITMAP:
- {
- mpLbFillAttr->Show();
- mpToolBoxColor->Hide();
-
- if(pSh && pSh->GetItem(SID_BITMAP_LIST))
- {
- const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
- mpLbFillAttr->Enable();
- mpLbFillAttr->Clear();
- mpLbFillAttr->Fill(aItem.GetBitmapList());
-
- if(mpBitmapItem)
- {
- const OUString aString(mpBitmapItem->GetName());
-
- mpLbFillAttr->SelectEntry(aString);
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- }
- else
- {
- mpLbFillAttr->SetNoSelection();
- }
- break;
- }
- default:
- OSL_ENSURE(false, "Non supported FillType (!)");
- break;
- }
- }
-}
-
-IMPL_LINK_TYPED( AreaPropertyPanel, ClickTrGrHdl_Impl, ToolBox*, pToolBox, void )
-{
- maTrGrPopup.Rearrange(mpFloatTransparenceItem.get());
- OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SIDEBARGRADIENT);
- maTrGrPopup.Show(*pToolBox);
-}
-
-IMPL_LINK_NOARG(AreaPropertyPanel, ChangeTrgrTypeHdl_Impl)
-{
- sal_Int32 nSelectType = mpLBTransType->GetSelectEntryPos();
- bool bGradient = false;
- sal_uInt16 nTrans = 0;
-
- if(!nSelectType)
- {
- mpBTNGradient->Hide();
- mpMTRTransparent->Show();
- mpMTRTransparent->Enable();
- mpMTRTransparent->SetValue(0);
- }
- else if(1 == nSelectType)
- {
- mpBTNGradient->Hide();
- mpMTRTransparent->Show();
- nTrans = mnLastTransSolid;
- mpMTRTransparent->SetValue(nTrans);
- mpLBTransType->SelectEntryPos(1);
- mpMTRTransparent->Enable();
- }
- else
- {
- mpBTNGradient->Show();
-
- const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
- switch (nSelectType)
- {
- case 2:
- mpBTNGradient->SetItemImage(nIdGradient, maImgLinear);
- break;
- case 3:
- mpBTNGradient->SetItemImage(nIdGradient, maImgAxial);
- break;
- case 4:
- mpBTNGradient->SetItemImage(nIdGradient, maImgRadial);
- break;
- case 5:
- mpBTNGradient->SetItemImage(nIdGradient, maImgElli );
- break;
- case 6:
- mpBTNGradient->SetItemImage(nIdGradient, maImgQuad );
- break;
- case 7:
- mpBTNGradient->SetItemImage(nIdGradient, maImgSquare);
- break;
- }
-
- mpMTRTransparent->Hide();
- mpBTNGradient->Enable();
- bGradient = true;
- }
-
- const XFillTransparenceItem aLinearItem(nTrans);
- GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SfxCallMode::RECORD, &aLinearItem, 0L );
-
- if(nSelectType > 1)
- {
- nSelectType -= 2;
- }
-
- XGradient aTmpGradient;
-
- switch(nSelectType)
- {
- case css::awt::GradientStyle_LINEAR:
- aTmpGradient = maGradientLinear;
- break;
- case css::awt::GradientStyle_AXIAL:
- aTmpGradient = maGradientAxial;
- break;
- case css::awt::GradientStyle_RADIAL:
- aTmpGradient = maGradientRadial;
- break;
- case css::awt::GradientStyle_ELLIPTICAL:
- aTmpGradient = maGradientElliptical;
- break;
- case css::awt::GradientStyle_SQUARE:
- aTmpGradient = maGradientSquare;
- break;
- case css::awt::GradientStyle_RECT:
- aTmpGradient = maGradientRect;
- break;
- default:
- break;
- }
-
- SfxItemPool* pPool = 0;
- const XFillFloatTransparenceItem aGradientItem(pPool, aTmpGradient, bGradient);
- GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_FLOATTRANSPARENCE, SfxCallMode::RECORD, &aGradientItem, 0L );
-
- return 0L;
-}
-
-IMPL_LINK_NOARG(AreaPropertyPanel, ModifyTransparentHdl_Impl)
-{
- const sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue();
- mnLastTransSolid = nTrans;
- const sal_Int32 nSelectType = mpLBTransType->GetSelectEntryPos();
-
- if(nTrans && !nSelectType)
- {
- mpLBTransType->SelectEntryPos(1);
- }
-
- const XFillTransparenceItem aLinearItem(nTrans);
- GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SfxCallMode::RECORD, &aLinearItem, 0L );
-
- return 0L;
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, &aColorItem, pStyleItem, 0L);
}
-XGradient AreaPropertyPanel::GetGradient (const css::awt::GradientStyle eStyle) const
+void AreaPropertyPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem,
+ const XFillGradientItem& rGradientItem)
{
- switch (eStyle)
- {
- default:
- case css::awt::GradientStyle_LINEAR:
- return maGradientLinear;
- case css::awt::GradientStyle_AXIAL:
- return maGradientAxial;
- case css::awt::GradientStyle_RADIAL:
- return maGradientRadial;
- case css::awt::GradientStyle_ELLIPTICAL:
- return maGradientElliptical;
- case css::awt::GradientStyle_SQUARE:
- return maGradientSquare;
- case css::awt::GradientStyle_RECT:
- return maGradientRect;
- }
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, &rGradientItem, pStyleItem, 0L);
}
-void AreaPropertyPanel::SetGradient (const XGradient& rGradient)
+void AreaPropertyPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem,
+ const XFillHatchItem& rHatchItem)
{
- switch (rGradient.GetGradientStyle())
- {
- case css::awt::GradientStyle_LINEAR:
- maGradientLinear = rGradient;
- break;
- case css::awt::GradientStyle_AXIAL:
- maGradientAxial = rGradient;
- break;
- case css::awt::GradientStyle_RADIAL:
- maGradientRadial = rGradient;
- break;
- case css::awt::GradientStyle_ELLIPTICAL:
- maGradientElliptical = rGradient;
- break;
- case css::awt::GradientStyle_SQUARE:
- maGradientSquare = rGradient;
- break;
- case css::awt::GradientStyle_RECT:
- maGradientRect = rGradient;
- break;
- default:
- break;
- }
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, &rHatchItem, pStyleItem, 0L);
}
-sal_Int32 AreaPropertyPanel::GetSelectedTransparencyTypeIndex() const
+void AreaPropertyPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem,
+ const XFillBitmapItem& rBitmapItem)
{
- return mpLBTransType->GetSelectEntryPos();
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, &rBitmapItem, pStyleItem, 0L);
}
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 04d8faf..ec805d7 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -19,9 +19,7 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
-#include "AreaTransparencyGradientPopup.hxx"
#include <vcl/ctrl.hxx>
-#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/xgrad.hxx>
#include <svx/itemwin.hxx>
@@ -32,29 +30,28 @@
#include <svx/xbtmpit.hxx>
#include <svx/drawitem.hxx>
#include <svx/sidebar/PanelLayout.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/vclptr.hxx>
#include <svl/intitem.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <boost/scoped_ptr.hpp>
+#include "AreaPropertyPanelBase.hxx"
class XFillFloatTransparenceItem;
-
+class XFillTransparenceItem;
+class XFillStyleItem;
+class XFillGradientItem;
+class XFillColorItem;
+class XFillHatchItem;
+class XFillBitmapItem;
namespace svx { namespace sidebar {
class PopupContainer;
class AreaTransparencyGradientControl;
-class AreaPropertyPanel
-: public PanelLayout,
- public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+class AreaPropertyPanel : public AreaPropertyPanelBase
{
public:
- virtual ~AreaPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
static VclPtr<vcl::Window> Create(
@@ -62,103 +59,39 @@ public:
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
- virtual void DataChanged(
- const DataChangedEvent& rEvent) SAL_OVERRIDE;
-
- virtual void NotifyItemUpdate(
- const sal_uInt16 nSId,
- const SfxItemState eState,
- const SfxPoolItem* pState,
- const bool bIsEnabled) SAL_OVERRIDE;
-
SfxBindings* GetBindings() { return mpBindings;}
- const static sal_Int32 DEFAULT_CENTERX;
- const static sal_Int32 DEFAULT_CENTERY;
- const static sal_Int32 DEFAULT_ANGLE;
- const static sal_Int32 DEFAULT_STARTVALUE;
- const static sal_Int32 DEFAULT_ENDVALUE;
- const static sal_Int32 DEFAULT_BORDER;
-
- XGradient GetGradient (const css::awt::GradientStyle eStyle) const;
- void SetGradient (const XGradient& rGradient);
- sal_Int32 GetSelectedTransparencyTypeIndex() const;
-
// constructor/destuctor
AreaPropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
+ virtual ~AreaPropertyPanel();
+
+ virtual void setFillTransparence(const XFillTransparenceItem& rItem);
+ virtual void setFillFloatTransparence(const XFillFloatTransparenceItem& rItem);
+ virtual void setFillStyle(const XFillStyleItem& rItem);
+ virtual void setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& aColorItem);
+ virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& aGradientItem);
+ virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& aHatchItem);
+ virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& aHatchItem);
+
private:
- sal_uInt16 meLastXFS;
-
- sal_Int32 mnLastPosGradient;
- sal_Int32 mnLastPosHatch;
- sal_Int32 mnLastPosBitmap;
- sal_uInt16 mnLastTransSolid;
-
- XGradient maGradientLinear;
- XGradient maGradientAxial;
- XGradient maGradientRadial;
- XGradient maGradientElliptical;
- XGradient maGradientSquare;
- XGradient maGradientRect;
-
- //ui controls
- VclPtr<FixedText> mpColorTextFT;
- VclPtr<SvxFillTypeBox> mpLbFillType;
- VclPtr<SvxFillAttrBox> mpLbFillAttr;
- VclPtr<ToolBox> mpToolBoxColor; // for new color picker
- VclPtr<FixedText> mpTrspTextFT;
- VclPtr<ListBox> mpLBTransType;
- VclPtr<MetricField> mpMTRTransparent;
- VclPtr<ToolBox> mpBTNGradient;
-
- ::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
- ::boost::scoped_ptr< XFillColorItem > mpColorItem;
- ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem;
- ::boost::scoped_ptr< XFillHatchItem > mpHatchItem;
- ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem;
-
- ::sfx2::sidebar::ControllerItem maStyleControl;
- ::sfx2::sidebar::ControllerItem maColorControl;
- ::sfx2::sidebar::ControllerItem maGradientControl;
- ::sfx2::sidebar::ControllerItem maHatchControl;
- ::sfx2::sidebar::ControllerItem maBitmapControl;
- ::sfx2::sidebar::ControllerItem maGradientListControl;
- ::sfx2::sidebar::ControllerItem maHatchListControl;
- ::sfx2::sidebar::ControllerItem maBitmapListControl;
- ::sfx2::sidebar::ControllerItem maFillTransparenceController;
- ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController;
-
- Image maImgAxial;
- Image maImgElli;
- Image maImgQuad;
- Image maImgRadial;
- Image maImgSquare;
- Image maImgLinear;
-
- AreaTransparencyGradientPopup maTrGrPopup;
-
- ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
- ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem;
-
- css::uno::Reference<css::frame::XFrame> mxFrame;
- SfxBindings* mpBindings;
-
- DECL_LINK(SelectFillTypeHdl, ListBox* );
- DECL_LINK(SelectFillAttrHdl, ListBox* );
- DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
- DECL_LINK(ModifyTransparentHdl_Impl, void*);
-
- // for transparency gradient
- VclPtr<PopupControl> CreateTransparencyGradientControl (PopupContainer* pParent);
- DECL_LINK_TYPED( ClickTrGrHdl_Impl, ToolBox*, void );
+ ::sfx2::sidebar::ControllerItem maStyleControl;
+ ::sfx2::sidebar::ControllerItem maColorControl;
+ ::sfx2::sidebar::ControllerItem maGradientControl;
+ ::sfx2::sidebar::ControllerItem maHatchControl;
+ ::sfx2::sidebar::ControllerItem maBitmapControl;
+ ::sfx2::sidebar::ControllerItem maGradientListControl;
+ ::sfx2::sidebar::ControllerItem maHatchListControl;
+ ::sfx2::sidebar::ControllerItem maBitmapListControl;
+ ::sfx2::sidebar::ControllerItem maFillTransparenceController;
+ ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController;
+
+ SfxBindings* mpBindings;
void Initialize();
- void Update();
- void ImpUpdateTransparencies();
};
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
new file mode 100644
index 0000000..f13599c
--- /dev/null
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -0,0 +1,1182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "svx/sidebar/PopupContainer.hxx"
+#include "AreaTransparencyGradientControl.hxx"
+
+#include <sfx2/sidebar/ResourceDefinitions.hrc>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <AreaPropertyPanelBase.hxx>
+#include <AreaPropertyPanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <svx/xfltrit.hxx>
+#include <svx/xflftrit.hxx>
+#include <svx/xtable.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/bindings.hxx>
+#include <helpid.hrc>
+#include <svtools/valueset.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svx/svxitems.hrc>
+#include <vcl/toolbox.hxx>
+#include <svtools/toolbarmenu.hxx>
+
+#include <boost/bind.hpp>
+
+using namespace css;
+using namespace css::uno;
+
+const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
+
+namespace svx { namespace sidebar {
+
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERX = 50;
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERY = 50;
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_ANGLE = 0;
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_STARTVALUE = 0;
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_ENDVALUE = 16777215;
+const sal_Int32 AreaPropertyPanelBase::DEFAULT_BORDER = 0;
+
+AreaPropertyPanelBase::AreaPropertyPanelBase(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+ : PanelLayout(pParent, "AreaPropertyPanelBase", "svx/ui/sidebararea.ui", rxFrame),
+ meLastXFS(static_cast<sal_uInt16>(-1)),
+ mnLastPosGradient(0),
+ mnLastPosHatch(0),
+ mnLastPosBitmap(0),
+ mnLastTransSolid(50),
+ maGradientLinear(),
+ maGradientAxial(),
+ maGradientRadial(),
+ maGradientElliptical(),
+ maGradientSquare(),
+ maGradientRect(),
+ mpStyleItem(),
+ mpColorItem(),
+ mpFillGradientItem(),
+ mpHatchItem(),
+ mpBitmapItem(),
+ maImgAxial(SVX_RES(IMG_AXIAL)),
+ maImgElli(SVX_RES(IMG_ELLI)),
+ maImgQuad(SVX_RES(IMG_QUAD)),
+ maImgRadial(SVX_RES(IMG_RADIAL)),
+ maImgSquare(SVX_RES(IMG_SQUARE)),
+ maImgLinear(SVX_RES(IMG_LINEAR)),
+ maTrGrPopup(this, ::boost::bind(&AreaPropertyPanelBase::CreateTransparencyGradientControl, this, _1)),
+ mpFloatTransparenceItem(),
+ mpTransparanceItem(),
+ mxFrame(rxFrame)
+{
+ get(mpColorTextFT, "filllabel");
+ get(mpLbFillType, "fillstyle");
+ get(mpLbFillAttr, "fillattr");
+ get(mpTrspTextFT, "transparencylabel");
+ get(mpToolBoxColor, "selectcolor");
+ get(mpLBTransType, "transtype");
+ get(mpMTRTransparent, "settransparency");
+ get(mpBTNGradient, "selectgradient");
+
+ Initialize();
+}
+
+AreaPropertyPanelBase::~AreaPropertyPanelBase()
+{
+ disposeOnce();
+}
+
+void AreaPropertyPanelBase::dispose()
+{
+ mpColorTextFT.clear();
+ mpLbFillType.clear();
+ mpLbFillAttr.clear();
+ mpToolBoxColor.clear();
+ mpTrspTextFT.clear();
+ mpLBTransType.clear();
+ mpMTRTransparent.clear();
+ mpBTNGradient.clear();
+
+ PanelLayout::dispose();
+}
+
+void AreaPropertyPanelBase::Initialize()
+{
+ maGradientLinear.SetXOffset(DEFAULT_CENTERX);
+ maGradientLinear.SetYOffset(DEFAULT_CENTERY);
+ maGradientLinear.SetAngle(DEFAULT_ANGLE);
+ maGradientLinear.SetStartColor(Color(DEFAULT_STARTVALUE));
+ maGradientLinear.SetEndColor(Color(DEFAULT_ENDVALUE));
+ maGradientLinear.SetBorder(DEFAULT_BORDER);
+ maGradientLinear.SetGradientStyle(css::awt::GradientStyle_LINEAR);
+
+ maGradientAxial = maGradientLinear;
+ maGradientAxial.SetGradientStyle(css::awt::GradientStyle_AXIAL);
+
+ maGradientRadial = maGradientLinear;
+ maGradientRadial.SetGradientStyle(css::awt::GradientStyle_RADIAL);
+
+ maGradientElliptical = maGradientLinear;
+ maGradientElliptical.SetGradientStyle(css::awt::GradientStyle_ELLIPTICAL);
+
+ maGradientSquare = maGradientLinear;
+ maGradientSquare.SetGradientStyle(css::awt::GradientStyle_SQUARE);
+
+ maGradientRect = maGradientLinear;
+ maGradientRect.SetGradientStyle(css::awt::GradientStyle_RECT);
+
+ mpLbFillType->SetAccessibleName(OUString( "Fill")); //wj acc
+ mpLbFillAttr->SetAccessibleName(OUString( "Fill")); //wj acc
+
+ Link<> aLink = LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl );
+ mpLbFillType->SetSelectHdl( aLink );
+
+ aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl );
+ mpLbFillAttr->SetSelectHdl( aLink );
+
+ mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl));
+ mpLBTransType->SetAccessibleName(OUString( "Transparency")); //wj acc
+
+ mpMTRTransparent->SetValue( 50 );
+ mpMTRTransparent->SetModifyHdl(LINK(this, AreaPropertyPanelBase, ModifyTransparentHdl_Impl));
+ mpMTRTransparent->SetAccessibleName(OUString( "Transparency")); //wj acc
+
+ const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
+ mpBTNGradient->SetItemBits( nIdGradient, mpBTNGradient->GetItemBits( nIdGradient ) | ToolBoxItemBits::DROPDOWNONLY );
+ Link<ToolBox *, void> aLink2 = LINK( this, AreaPropertyPanelBase, ClickTrGrHdl_Impl );
+ mpBTNGradient->SetDropdownClickHdl( aLink2 );
+ mpBTNGradient->SetSelectHdl( aLink2 );
+ mpBTNGradient->SetItemImage(nIdGradient,maImgLinear);
+ mpBTNGradient->Hide();
+
+ mpLbFillType->SetAccessibleRelationLabeledBy(mpColorTextFT);
+ mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr);
+ mpToolBoxColor->SetAccessibleRelationLabeledBy(mpToolBoxColor);
+ mpLBTransType->SetAccessibleRelationLabeledBy(mpTrspTextFT);
+ mpMTRTransparent->SetAccessibleRelationLabeledBy(mpMTRTransparent);
+ mpBTNGradient->SetAccessibleRelationLabeledBy(mpBTNGradient);
+}
+
+IMPL_LINK(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox *, pToolBox)
+{
+ const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos();
+
+ if((drawing::FillStyle)meLastXFS != eXFS)
+ {
+ mpLbFillAttr->Clear();
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+ const XFillStyleItem aXFillStyleItem(eXFS);
+
+ // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE
+ // and one for setting the fill attribute itself, but add two SfxPoolItems to the
+ // call to get just one action at the SdrObject and to create only one Undo action, too.
+ // Checked that this works in all apps.
+ switch( eXFS )
+ {
+ default:
+ case drawing::FillStyle_NONE:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+ mpLbFillType->Selected();
+ mpLbFillAttr->Disable();
+
+ // #i122676# need to call a single SID_ATTR_FILL_STYLE change
+ setFillStyle(aXFillStyleItem);
+ break;
+ }
+ case drawing::FillStyle_SOLID:
+ {
+ mpLbFillAttr->Hide();
+ mpToolBoxColor->Show();
+ const OUString aTmpStr;
+ const Color aColor = mpColorItem->GetColorValue();
+ const XFillColorItem aXFillColorItem( aTmpStr, aColor );
+
+ // #i122676# change FillStyle and Color in one call
+ setFillStyleAndColor(&aXFillStyleItem, aXFillColorItem);
+ break;
+ }
+ case drawing::FillStyle_GRADIENT:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
+ {
+ if(!mpLbFillAttr->GetEntryCount())
+ {
+ const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetGradientList());
+ }
+
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+
+ if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
+ {
+ const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+
+ if(mnLastPosGradient < aItem.GetGradientList()->Count())
+ {
+ const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
+ const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient);
+
+ // #i122676# change FillStyle and Gradient in one call
+ setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem);
+ mpLbFillAttr->SelectEntryPos(mnLastPosGradient);
+ }
+ }
+ }
+ else
+ {
+ mpLbFillAttr->Disable();
+ }
+ break;
+ }
+ case drawing::FillStyle_HATCH:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_HATCH_LIST))
+ {
+ if(!mpLbFillAttr->GetEntryCount())
+ {
+ const SvxHatchListItem aItem( *static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetHatchList());
+ }
+
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+
+ if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch)
+ {
+ const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+
+ if(mnLastPosHatch < aItem.GetHatchList()->Count())
+ {
+ const XHatch aHatch = aItem.GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch();
+ const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectEntry(), aHatch);
+
+ // #i122676# change FillStyle and Hatch in one call
+ setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem);
+ mpLbFillAttr->SelectEntryPos(mnLastPosHatch);
+ }
+ }
+ }
+ else
+ {
+ mpLbFillAttr->Disable();
+ }
+ break;
+ }
+ case drawing::FillStyle_BITMAP:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_BITMAP_LIST))
+ {
+ if(!mpLbFillAttr->GetEntryCount())
+ {
+ const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetBitmapList());
+ }
+
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
+
+ if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap)
+ {
+ const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+
+ if(mnLastPosBitmap < aItem.GetBitmapList()->Count())
+ {
+ const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap);
+ const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
+
+ // #i122676# change FillStyle and Bitmap in one call
+ setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem);
+ mpLbFillAttr->SelectEntryPos(mnLastPosBitmap);
+ }
+ }
+ }
+ else
+ {
+ mpLbFillAttr->Disable();
+ }
+ break;
+ }
+ }
+
+ meLastXFS = (sal_uInt16)eXFS;
+
+ if(drawing::FillStyle_NONE != eXFS)
+ {
+ if(pToolBox)
+ {
+ mpLbFillType->Selected();
+ }
+ }
+ }
+
+ return 0;
+}
+
+IMPL_LINK(AreaPropertyPanelBase, SelectFillAttrHdl, ListBox*, pToolBox)
+{
+ const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos();
+ const XFillStyleItem aXFillStyleItem(eXFS);
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+
+ if(pToolBox)
+ {
+ // #i122676# dependent from bFillStyleChange, do execute a single or two
+ // changes in one Execute call
+ const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS);
+
+ switch(eXFS)
+ {
+ case drawing::FillStyle_SOLID:
+ {
+ if(bFillStyleChange)
+ {
+ // #i122676# Single FillStyle change call needed here
+ setFillStyle(aXFillStyleItem);
+ }
+ break;
+ }
+ case drawing::FillStyle_GRADIENT:
+ {
+ sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
+
+ if(LISTBOX_ENTRY_NOTFOUND == nPos)
+ {
+ nPos = mnLastPosGradient;
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST))
+ {
+ const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+
+ if(nPos < aItem.GetGradientList()->Count())
+ {
+ const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient();
+ const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient);
+
+ // #i122676# Change FillStyle and Gradinet in one call
+ setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillGradientItem);
+ }
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos)
+ {
+ mnLastPosGradient = nPos;
+ }
+ break;
+ }
+ case drawing::FillStyle_HATCH:
+ {
+ sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
+
+ if(LISTBOX_ENTRY_NOTFOUND == nPos)
+ {
+ nPos = mnLastPosHatch;
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST))
+ {
+ const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+
+ if(nPos < aItem.GetHatchList()->Count())
+ {
+ const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch();
+ const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch);
+
+ // #i122676# Change FillStyle and Hatch in one call
+ setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillHatchItem);
+ }
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos)
+ {
+ mnLastPosHatch = nPos;
+ }
+ break;
+ }
+ case drawing::FillStyle_BITMAP:
+ {
+ sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos();
+
+ if(LISTBOX_ENTRY_NOTFOUND == nPos)
+ {
+ nPos = mnLastPosBitmap;
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST))
+ {
+ const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+
+ if(nPos < aItem.GetBitmapList()->Count())
+ {
+ const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
+ const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
+
+ // #i122676# Change FillStyle and Bitmap in one call
+ setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillBitmapItem);
+ }
+ }
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos)
+ {
+ mnLastPosBitmap = nPos;
+ }
+ break;
+ }
+ default: break;
+ }
+ }
+
+ return 0;
+}
+
+VclPtr<PopupControl> AreaPropertyPanelBase::CreateTransparencyGradientControl (PopupContainer* pParent)
+{
+ return VclPtrInstance<AreaTransparencyGradientControl>(pParent, *this);
+}
+
+void AreaPropertyPanelBase::DataChanged(
+ const DataChangedEvent& /*rEvent*/)
+{
+}
+
+void AreaPropertyPanelBase::ImpUpdateTransparencies()
+{
+ if(mpTransparanceItem.get() && mpFloatTransparenceItem.get())
+ {
+ bool bZeroValue(false);
+
+ if(mpTransparanceItem.get())
+ {
+ const sal_uInt16 nValue(mpTransparanceItem->GetValue());
+
+ if(!nValue)
+ {
+ bZeroValue = true;
+ }
+ else if(nValue <= 100)
+ {
+ mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
+ mpLBTransType->SelectEntryPos(1);
+ mpBTNGradient->Hide();
+ mpMTRTransparent->Show();
+ mpMTRTransparent->Enable();
+ mpMTRTransparent->SetValue(nValue);
+ }
+
+ if(!bZeroValue)
+ {
+ maTrGrPopup.Hide();
+ }
+ }
+
+ if(bZeroValue && mpFloatTransparenceItem.get())
+ {
+ if(mpFloatTransparenceItem->IsEnabled())
+ {
+ const XGradient& rGradient = mpFloatTransparenceItem->GetGradientValue();
+ sal_Int32 nEntryPos(0);
+ Image* pImage = 0;
+
+ mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
+ mpMTRTransparent->Hide();
+ mpBTNGradient->Enable();
+ mpBTNGradient->Show();
+
+ switch(rGradient.GetGradientStyle())
+ {
+ default:
+ case css::awt::GradientStyle_LINEAR:
+ {
+ nEntryPos = 2;
+ pImage = &maImgLinear;
+ break;
+ }
+ case css::awt::GradientStyle_AXIAL:
+ {
+ nEntryPos = 3;
+ pImage = &maImgAxial;
+ break;
+ }
+ case css::awt::GradientStyle_RADIAL:
+ {
+ nEntryPos = 4;
+ pImage = &maImgRadial;
+ break;
+ }
+ case css::awt::GradientStyle_ELLIPTICAL:
+ {
+ nEntryPos = 5;
+ pImage = &maImgElli;
+ break;
+ }
+ case css::awt::GradientStyle_SQUARE:
+ {
+ nEntryPos = 6;
+ pImage = &maImgQuad;
+ break;
+ }
+ case css::awt::GradientStyle_RECT:
+ {
+ nEntryPos = 7;
+ pImage = &maImgSquare;
+ break;
+ }
+ }
+
+ const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
+ mpLBTransType->SelectEntryPos(nEntryPos);
+ mpBTNGradient->SetItemImage(nIdGradient, *pImage);
+ bZeroValue = false;
+ }
+ else
+ {
+ bZeroValue = true;
+ }
+ }
+
+ if(bZeroValue)
+ {
+ mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
+ mpLBTransType->SelectEntryPos(0);
+ mpBTNGradient->Hide();
+ mpMTRTransparent->Enable();
+ mpMTRTransparent->Show();
+ mpMTRTransparent->SetValue(0);
+ }
+ }
+ else
+ {
+ // no transparency at all
+ mpLBTransType->SetNoSelection();
+ mpLBTransType->Disable();
+ mpTrspTextFT->Disable();
+ mpMTRTransparent->Disable();
+ mpMTRTransparent->Show();
+ mpBTNGradient->Disable();
+ mpBTNGradient->Hide();
+ }
+}
+
+void AreaPropertyPanelBase::NotifyItemUpdate(
+ sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
+{
+ (void)bIsEnabled;
+ const bool bDisabled(SfxItemState::DISABLED == eState);
+
+ switch(nSID)
+ {
+ case SID_ATTR_FILL_TRANSPARENCE:
+ case SID_ATTR_FILL_FLOATTRANSPARENCE:
+ {
+ bool bFillTransparenceChanged(false);
+
+ if(SID_ATTR_FILL_TRANSPARENCE == nSID)
+ {
+ bFillTransparenceChanged = true;
+
+ if(eState >= SfxItemState::DEFAULT)
+ {
+ const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
+
+ if(pItem && (!mpTransparanceItem || *pItem != *mpTransparanceItem))
+ {
+ mpTransparanceItem.reset(static_cast<SfxUInt16Item*>(pItem->Clone()));
+ }
+ else
+ {
+ mpTransparanceItem.reset();
+ }
+ }
+ else
+ {
+ mpTransparanceItem.reset();
+ }
+ }
+ else // if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
+ {
+ bFillTransparenceChanged = true;
+
+ if(eState >= SfxItemState::DEFAULT)
+ {
+ const XFillFloatTransparenceItem* pItem = dynamic_cast< const XFillFloatTransparenceItem* >(pState);
+
+ if(pItem && (!mpFloatTransparenceItem || *pItem != *mpFloatTransparenceItem))
+ {
+ mpFloatTransparenceItem.reset(static_cast<XFillFloatTransparenceItem*>(pItem->Clone()));
+ }
+ else
+ {
+ mpFloatTransparenceItem.reset();
+ }
+ }
+ else
+ {
+ mpFloatTransparenceItem.reset();
+ }
+ }
+
+ if(bFillTransparenceChanged)
+ {
+ // update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
+ ImpUpdateTransparencies();
+ }
+ break;
+ }
+ case SID_ATTR_FILL_STYLE:
+ {
+ if(bDisabled)
+ {
+ mpLbFillType->Disable();
+ mpColorTextFT->Disable();
+ mpLbFillType->SetNoSelection();
+ mpLbFillAttr->Show();
+ mpLbFillAttr->Disable();
+ mpLbFillAttr->SetNoSelection();
+ mpToolBoxColor->Hide();
+ meLastXFS = static_cast<sal_uInt16>(-1);
+ mpStyleItem.reset();
+ }
+
+ if(eState >= SfxItemState::DEFAULT)
+ {
+ const XFillStyleItem* pItem = dynamic_cast< const XFillStyleItem* >(pState);
+
+ if(pItem)
+ {
+ mpStyleItem.reset(dynamic_cast< XFillStyleItem* >(pItem->Clone()));
+ mpLbFillType->Enable();
+ mpColorTextFT->Enable();
+ drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue();
+ meLastXFS = eXFS;
+ mpLbFillType->SelectEntryPos(sal::static_int_cast< sal_Int32 >(eXFS));
+
+ if(drawing::FillStyle_NONE == eXFS)
+ {
+ mpLbFillAttr->SetNoSelection();
+ mpLbFillAttr->Disable();
+ }
+
+ Update();
+ break;
+ }
+ }
+
+ mpLbFillType->SetNoSelection();
+ mpLbFillAttr->Show();
+ mpLbFillAttr->Disable();
+ mpLbFillAttr->SetNoSelection();
+ mpToolBoxColor->Hide();
+ meLastXFS = static_cast<sal_uInt16>(-1);
+ mpStyleItem.reset();
+ break;
+ }
+ case SID_ATTR_FILL_COLOR:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpColorItem.reset(pState ? static_cast<XFillColorItem*>(pState->Clone()) : 0);
+ }
+
+ if(mpStyleItem && drawing::FillStyle_SOLID == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ mpLbFillAttr->Hide();
+ mpToolBoxColor->Show();
+
+ Update();
+ }
+ break;
+ }
+ case SID_ATTR_FILL_GRADIENT:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpFillGradientItem.reset(pState ? static_cast<XFillGradientItem*>(pState->Clone()) : 0);
+ }
+
+ if(mpStyleItem && drawing::FillStyle_GRADIENT == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpLbFillAttr->Enable();
+ Update();
+ }
+ else if(SfxItemState::DISABLED == eState )
+ {
+ mpLbFillAttr->Disable();
+ mpLbFillAttr->SetNoSelection();
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ break;
+ }
+ case SID_ATTR_FILL_HATCH:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpHatchItem.reset(pState ? static_cast<XFillHatchItem*>(pState->Clone()) : 0);
+ }
+
+ if(mpStyleItem && drawing::FillStyle_HATCH == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpLbFillAttr->Enable();
+ Update();
+ }
+ else if(SfxItemState::DISABLED == eState )
+ {
+ mpLbFillAttr->Disable();
+ mpLbFillAttr->SetNoSelection();
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ break;
+ }
+ case SID_ATTR_FILL_BITMAP:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpBitmapItem.reset(pState ? static_cast<XFillBitmapItem*>(pState->Clone()) : 0);
+ }
+
+ if(mpStyleItem && drawing::FillStyle_BITMAP == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(SfxItemState::DEFAULT == eState)
+ {
+ mpLbFillAttr->Enable();
+ Update();
+ }
+ else if(SfxItemState::DISABLED == eState )
+ {
+ mpLbFillAttr->Disable();
+ mpLbFillAttr->SetNoSelection();
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ break;
+ }
+ case SID_GRADIENT_LIST:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ if(mpStyleItem && drawing::FillStyle_GRADIENT == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ if(mpFillGradientItem)
+ {
+ const OUString aString( mpFillGradientItem->GetName() );
+ const SfxObjectShell* pSh = SfxObjectShell::Current();
+ const SvxGradientListItem aItem( *static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Fill(aItem.GetGradientList());
+ mpLbFillAttr->SelectEntry(aString);
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ }
+ break;
+ }
+ case SID_HATCH_LIST:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ if(mpStyleItem && drawing::FillStyle_HATCH == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ if(mpHatchItem)
+ {
+ const OUString aString( mpHatchItem->GetName() );
+ const SfxObjectShell* pSh = SfxObjectShell::Current();
+ const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Fill(aItem.GetHatchList());
+ mpLbFillAttr->SelectEntry(aString);
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ }
+ break;
+ }
+ case SID_BITMAP_LIST:
+ {
+ if(SfxItemState::DEFAULT == eState)
+ {
+ if(mpStyleItem && drawing::FillStyle_BITMAP == (drawing::FillStyle)mpStyleItem->GetValue())
+ {
+ if(mpBitmapItem)
+ {
+ const OUString aString( mpBitmapItem->GetName() );
+ const SfxObjectShell* pSh = SfxObjectShell::Current();
+ const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Fill(aItem.GetBitmapList());
+ mpLbFillAttr->SelectEntry(aString);
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ }
+ break;
+ }
+ }
+}
+
+void AreaPropertyPanelBase::Update()
+{
+ if(mpStyleItem)
+ {
+ const drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue();
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+
+ switch( eXFS )
+ {
+ case drawing::FillStyle_NONE:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+ break;
+ }
+ case drawing::FillStyle_SOLID:
+ {
+ if(mpColorItem)
+ {
+ mpLbFillAttr->Hide();
+ mpToolBoxColor->Show();
+ }
+ break;
+ }
+ case drawing::FillStyle_GRADIENT:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_GRADIENT_LIST))
+ {
+ const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetGradientList());
+
+ if(mpFillGradientItem)
+ {
+ const OUString aString(mpFillGradientItem->GetName());
+
+ mpLbFillAttr->SelectEntry(aString);
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ break;
+ }
+ case drawing::FillStyle_HATCH:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_HATCH_LIST))
+ {
+ const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetHatchList());
+
+ if(mpHatchItem)
+ {
+ const OUString aString(mpHatchItem->GetName());
+
+ mpLbFillAttr->SelectEntry( aString );
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ break;
+ }
+ case drawing::FillStyle_BITMAP:
+ {
+ mpLbFillAttr->Show();
+ mpToolBoxColor->Hide();
+
+ if(pSh && pSh->GetItem(SID_BITMAP_LIST))
+ {
+ const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillAttr->Fill(aItem.GetBitmapList());
+
+ if(mpBitmapItem)
+ {
+ const OUString aString(mpBitmapItem->GetName());
+
+ mpLbFillAttr->SelectEntry(aString);
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ }
+ else
+ {
+ mpLbFillAttr->SetNoSelection();
+ }
+ break;
+ }
+ default:
+ OSL_ENSURE(false, "Non supported FillType (!)");
+ break;
+ }
+ }
+}
+
+IMPL_LINK_TYPED( AreaPropertyPanelBase, ClickTrGrHdl_Impl, ToolBox*, pToolBox, void )
+{
+ maTrGrPopup.Rearrange(mpFloatTransparenceItem.get());
+ OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SIDEBARGRADIENT);
+ maTrGrPopup.Show(*pToolBox);
+}
+
+IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl)
+{
+ sal_Int32 nSelectType = mpLBTransType->GetSelectEntryPos();
+ bool bGradient = false;
+ sal_uInt16 nTrans = 0;
+
+ if(!nSelectType)
+ {
+ mpBTNGradient->Hide();
+ mpMTRTransparent->Show();
+ mpMTRTransparent->Enable();
+ mpMTRTransparent->SetValue(0);
+ }
+ else if(1 == nSelectType)
+ {
+ mpBTNGradient->Hide();
+ mpMTRTransparent->Show();
+ nTrans = mnLastTransSolid;
+ mpMTRTransparent->SetValue(nTrans);
+ mpLBTransType->SelectEntryPos(1);
+ mpMTRTransparent->Enable();
+ }
+ else
+ {
+ mpBTNGradient->Show();
+
+ const sal_uInt16 nIdGradient = mpBTNGradient->GetItemId(UNO_SIDEBARGRADIENT);
+ switch (nSelectType)
+ {
+ case 2:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgLinear);
+ break;
+ case 3:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgAxial);
+ break;
+ case 4:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgRadial);
+ break;
+ case 5:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgElli );
+ break;
+ case 6:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgQuad );
+ break;
+ case 7:
+ mpBTNGradient->SetItemImage(nIdGradient, maImgSquare);
+ break;
+ }
+
+ mpMTRTransparent->Hide();
+ mpBTNGradient->Enable();
+ bGradient = true;
+ }
+
+ const XFillTransparenceItem aLinearItem(nTrans);
+ setFillTransparence(aLinearItem);
+
+ if(nSelectType > 1)
+ {
+ nSelectType -= 2;
+ }
+
+ XGradient aTmpGradient;
+
+ switch(nSelectType)
+ {
+ case css::awt::GradientStyle_LINEAR:
+ aTmpGradient = maGradientLinear;
+ break;
+ case css::awt::GradientStyle_AXIAL:
+ aTmpGradient = maGradientAxial;
+ break;
+ case css::awt::GradientStyle_RADIAL:
+ aTmpGradient = maGradientRadial;
+ break;
+ case css::awt::GradientStyle_ELLIPTICAL:
+ aTmpGradient = maGradientElliptical;
+ break;
+ case css::awt::GradientStyle_SQUARE:
+ aTmpGradient = maGradientSquare;
+ break;
+ case css::awt::GradientStyle_RECT:
+ aTmpGradient = maGradientRect;
+ break;
+ default:
+ break;
+ }
+
+ SfxItemPool* pPool = 0;
+ const XFillFloatTransparenceItem aGradientItem(pPool, aTmpGradient, bGradient);
+ setFillFloatTransparence(aGradientItem);
+
+ return 0L;
+}
+
+IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransparentHdl_Impl)
+{
+ const sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue();
+ mnLastTransSolid = nTrans;
+ const sal_Int32 nSelectType = mpLBTransType->GetSelectEntryPos();
+
+ if(nTrans && !nSelectType)
+ {
+ mpLBTransType->SelectEntryPos(1);
+ }
+
+ const XFillTransparenceItem aLinearItem(nTrans);
+ setFillTransparence(aLinearItem);
+
+ return 0L;
+}
+
+XGradient AreaPropertyPanelBase::GetGradient (const css::awt::GradientStyle eStyle) const
+{
+ switch (eStyle)
+ {
+ default:
+ case css::awt::GradientStyle_LINEAR:
+ return maGradientLinear;
+ case css::awt::GradientStyle_AXIAL:
+ return maGradientAxial;
+ case css::awt::GradientStyle_RADIAL:
+ return maGradientRadial;
+ case css::awt::GradientStyle_ELLIPTICAL:
+ return maGradientElliptical;
+ case css::awt::GradientStyle_SQUARE:
+ return maGradientSquare;
+ case css::awt::GradientStyle_RECT:
+ return maGradientRect;
+ }
+}
+
+void AreaPropertyPanelBase::SetGradient (const XGradient& rGradient)
+{
+ switch (rGradient.GetGradientStyle())
+ {
+ case css::awt::GradientStyle_LINEAR:
+ maGradientLinear = rGradient;
+ break;
+ case css::awt::GradientStyle_AXIAL:
+ maGradientAxial = rGradient;
+ break;
+ case css::awt::GradientStyle_RADIAL:
+ maGradientRadial = rGradient;
+ break;
+ case css::awt::GradientStyle_ELLIPTICAL:
+ maGradientElliptical = rGradient;
+ break;
+ case css::awt::GradientStyle_SQUARE:
+ maGradientSquare = rGradient;
+ break;
+ case css::awt::GradientStyle_RECT:
+ maGradientRect = rGradient;
+ break;
+ default:
+ break;
+ }
+}
+
+sal_Int32 AreaPropertyPanelBase::GetSelectedTransparencyTypeIndex() const
+{
+ return mpLBTransType->GetSelectEntryPos();
+}
+
+} } // end of namespace svx::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.hxx b/svx/source/sidebar/area/AreaPropertyPanelBase.hxx
new file mode 100644
index 0000000..5abc15bd
--- /dev/null
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.hxx
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
+
+#include "AreaTransparencyGradientPopup.hxx"
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/itemwin.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/vclptr.hxx>
+#include <svl/intitem.hxx>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <boost/scoped_ptr.hpp>
+
+class XFillFloatTransparenceItem;
+class XFillTransparenceItem;
+class XFillStyleItem;
+class XFillGradientItem;
+class XFillColorItem;
+class XFillHatchItem;
+class XFillBitmapItem;
+
+namespace svx { namespace sidebar {
+
+class PopupContainer;
+class AreaTransparencyGradientControl;
+
+class AreaPropertyPanelBase
+: public PanelLayout,
+ public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+public:
+
+ virtual void dispose() SAL_OVERRIDE;
+
+ virtual void DataChanged(
+ const DataChangedEvent& rEvent) SAL_OVERRIDE;
+
+ virtual void NotifyItemUpdate(
+ const sal_uInt16 nSId,
+ const SfxItemState eState,
+ const SfxPoolItem* pState,
+ const bool bIsEnabled) SAL_OVERRIDE;
+
+ const static sal_Int32 DEFAULT_CENTERX;
+ const static sal_Int32 DEFAULT_CENTERY;
+ const static sal_Int32 DEFAULT_ANGLE;
+ const static sal_Int32 DEFAULT_STARTVALUE;
+ const static sal_Int32 DEFAULT_ENDVALUE;
+ const static sal_Int32 DEFAULT_BORDER;
+
+ XGradient GetGradient (const css::awt::GradientStyle eStyle) const;
+ void SetGradient (const XGradient& rGradient);
+ sal_Int32 GetSelectedTransparencyTypeIndex() const;
+
+ // constructor/destuctor
+ AreaPropertyPanelBase(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ virtual ~AreaPropertyPanelBase();
+
+ virtual void setFillTransparence(const XFillTransparenceItem& rItem) = 0;
+ virtual void setFillFloatTransparence(const XFillFloatTransparenceItem& rItem) = 0;
+ virtual void setFillStyle(const XFillStyleItem& rItem) = 0;
+ virtual void setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& aColorItem) = 0;
+ virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& aGradientItem) = 0;
+ virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& aHatchItem) = 0;
+ virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& aHatchItem) = 0;
+
+protected:
+ sal_uInt16 meLastXFS;
+
+ sal_Int32 mnLastPosGradient;
+ sal_Int32 mnLastPosHatch;
+ sal_Int32 mnLastPosBitmap;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list