26 #include <svx/strings.hrc>
34 #include <bitmaps.hlst>
45 const sal_Int32
gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 };
48 constexpr OUStringLiteral
EMPTY =
u"";
52 RID_SVXBMP_LIGHT_OFF_FROM_TOP_LEFT,
53 RID_SVXBMP_LIGHT_OFF_FROM_TOP,
54 RID_SVXBMP_LIGHT_OFF_FROM_TOP_RIGHT,
55 RID_SVXBMP_LIGHT_OFF_FROM_LEFT,
57 RID_SVXBMP_LIGHT_OFF_FROM_RIGHT,
58 RID_SVXBMP_LIGHT_OFF_FROM_BOTTOM_LEFT,
59 RID_SVXBMP_LIGHT_OFF_FROM_BOTTOM,
60 RID_SVXBMP_LIGHT_OFF_FROM_BOTTOM_RIGHT
65 RID_SVXBMP_LIGHT_ON_FROM_TOP_LEFT,
66 RID_SVXBMP_LIGHT_ON_FROM_TOP,
67 RID_SVXBMP_LIGHT_ON_FROM_TOP_RIGHT,
68 RID_SVXBMP_LIGHT_ON_FROM_LEFT,
70 RID_SVXBMP_LIGHT_ON_FROM_RIGHT,
71 RID_SVXBMP_LIGHT_ON_FROM_BOTTOM_LEFT,
72 RID_SVXBMP_LIGHT_ON_FROM_BOTTOM,
73 RID_SVXBMP_LIGHT_ON_FROM_BOTTOM_RIGHT
78 RID_SVXBMP_LIGHT_PREVIEW_FROM_TOP_LEFT,
79 RID_SVXBMP_LIGHT_PREVIEW_FROM_TOP,
80 RID_SVXBMP_LIGHT_PREVIEW_FROM_TOP_RIGHT,
81 RID_SVXBMP_LIGHT_PREVIEW_FROM_LEFT,
82 RID_SVXBMP_LIGHT_PREVIEW_FROM_FRONT,
83 RID_SVXBMP_LIGHT_PREVIEW_FROM_RIGHT,
84 RID_SVXBMP_LIGHT_PREVIEW_FROM_BOTTOM_LEFT,
85 RID_SVXBMP_LIGHT_PREVIEW_FROM_BOTTOM,
86 RID_SVXBMP_LIGHT_PREVIEW_FROM_BOTTOM_RIGHT
91 RID_SVXBMP_DIRECTION_DIRECTION_NW,
92 RID_SVXBMP_DIRECTION_DIRECTION_N,
93 RID_SVXBMP_DIRECTION_DIRECTION_NE,
94 RID_SVXBMP_DIRECTION_DIRECTION_W,
95 RID_SVXBMP_DIRECTION_DIRECTION_NONE,
96 RID_SVXBMP_DIRECTION_DIRECTION_E,
97 RID_SVXBMP_DIRECTION_DIRECTION_SW,
98 RID_SVXBMP_DIRECTION_DIRECTION_S,
99 RID_SVXBMP_DIRECTION_DIRECTION_SE
104 RID_SVXSTR_DIRECTION_NW,
105 RID_SVXSTR_DIRECTION_N,
106 RID_SVXSTR_DIRECTION_NE,
107 RID_SVXSTR_DIRECTION_W,
108 RID_SVXSTR_DIRECTION_NONE,
109 RID_SVXSTR_DIRECTION_E,
110 RID_SVXSTR_DIRECTION_SW,
111 RID_SVXSTR_DIRECTION_S,
112 RID_SVXSTR_DIRECTION_SE
118 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/directionwindow.ui",
"DirectionWindow")
119 , mxControl(pControl)
120 , mxDirectionSet(new
ValueSet(nullptr))
121 , mxDirectionSetWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *mxDirectionSet))
122 , mxPerspective(m_xBuilder->weld_radio_button(
"perspective"))
123 , mxParallel(m_xBuilder->weld_radio_button(
"parallel"))
165 if( gSkewList[nItemId] == nSkew )
187 mxParallel->set_active(nProjection == 1 && bEnabled);
193 const css::frame::FeatureStateEvent& Event
196 if( Event.FeatureURL.Main == g_sExtrusionDirection )
198 if( !Event.IsEnabled )
205 if( Event.State >>= nValue )
209 else if( Event.FeatureURL.Main == g_sExtrusionProjection )
211 if( !Event.IsEnabled )
218 if( Event.State >>= nValue )
227 OUString(g_sExtrusionDirection).
copy(5),
228 gSkewList[mxDirectionSet->GetSelectedItemId()-1]) };
230 mxControl->dispatchCommand( g_sExtrusionDirection, aArgs );
232 mxControl->EndPopupMode();
237 int nProjection = mxPerspective->get_active() ? 0 : 1;
240 OUString(g_sExtrusionProjection).
copy(5), static_cast<sal_Int32>(nProjection)) };
242 mxControl->dispatchCommand( g_sExtrusionProjection, aArgs );
243 implSetProjection( nProjection,
true );
245 mxControl->EndPopupMode();
250 ) :
svt::PopupWindowController(
253 ".uno:ExtrusionDirectionFloater"
260 return std::make_unique<ExtrusionDirectionWindow>(
this, m_pToolbar);
266 std::make_unique<ExtrusionDirectionWindow>(
this, pParent->
GetFrameWeld()));
276 svt::PopupWindowController::initialize( aArguments );
280 if ( getToolboxId( nId, &pToolBox ) )
289 return "com.sun.star.comp.svx.ExtrusionDirectionController";
295 return {
"com.sun.star.frame.ToolbarController" };
299 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
301 css::uno::XComponentContext* xContext,
302 css::uno::Sequence<css::uno::Any>
const &)
309 : GenericDialogController(pParent,
"svx/ui/extrustiondepthdialog.ui",
"ExtrustionDepthDialog")
310 , m_xMtrDepth(m_xBuilder->weld_metric_spin_button(
"depth", eDefaultUnit))
312 m_xMtrDepth->set_value(static_cast<int>(fDepth) * 100, FieldUnit::MM_100TH);
321 return static_cast<double>(
m_xMtrDepth->get_value(FieldUnit::MM_100TH)) / 100.0;
328 constexpr OUStringLiteral
gsMetricUnit( u
".uno:MetricUnit" );
331 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/depthwindow.ui",
"DepthWindow")
332 , mxControl(pControl)
333 , mxDepth0(m_xBuilder->weld_radio_button(
"depth0"))
334 , mxDepth1(m_xBuilder->weld_radio_button(
"depth1"))
335 , mxDepth2(m_xBuilder->weld_radio_button(
"depth2"))
336 , mxDepth3(m_xBuilder->weld_radio_button(
"depth3"))
337 , mxDepth4(m_xBuilder->weld_radio_button(
"depth4"))
338 , mxInfinity(m_xBuilder->weld_radio_button(
"infinity"))
339 , mxCustom(m_xBuilder->weld_radio_button(
"custom"))
342 , mbSettingValue(
false)
343 , mbCommandDispatched(
false)
372 mxDepth0->set_active(fDepth == (bIsMetric ? aDepthListMM[0] : aDepthListInch[0]));
373 mxDepth1->set_active(fDepth == (bIsMetric ? aDepthListMM[1] : aDepthListInch[1]));
374 mxDepth2->set_active(fDepth == (bIsMetric ? aDepthListMM[2] : aDepthListInch[2]));
375 mxDepth3->set_active(fDepth == (bIsMetric ? aDepthListMM[3] : aDepthListInch[3]));
376 mxDepth4->set_active(fDepth == (bIsMetric ? aDepthListMM[4] : aDepthListInch[4]));
397 RID_SVXSTR_DEPTH_0_INCH,
398 RID_SVXSTR_DEPTH_1_INCH,
399 RID_SVXSTR_DEPTH_2_INCH,
400 RID_SVXSTR_DEPTH_3_INCH,
401 RID_SVXSTR_DEPTH_4_INCH
416 const css::frame::FeatureStateEvent& Event
421 if( !Event.IsEnabled )
428 if( Event.State >>= fValue )
434 if( Event.IsEnabled )
437 if( Event.State >>= nValue )
449 Sequence< PropertyValue > aArgs{
455 xControl->EndPopupMode();
456 xControl->dispatchCommand(
".uno:ExtrusionDepthDialog", aArgs);
462 if (mbSettingValue || !rButton.get_active())
468 if (mbCommandDispatched)
471 if (mxCustom->get_active())
472 DispatchDepthDialog();
477 if (mxInfinity->get_active())
484 if (mxDepth0->get_active())
486 else if (mxDepth1->get_active())
488 else if (mxDepth2->get_active())
490 else if (mxDepth3->get_active())
495 fDepth =
IsMetric( meUnit ) ? aDepthListMM[nSelected] : aDepthListInch[nSelected];
502 mbCommandDispatched =
true;
503 implSetDepth( fDepth );
505 mxControl->EndPopupMode();
519 if (mxCustom->get_active() && !mbCommandDispatched)
521 DispatchDepthDialog();
530 ) :
svt::PopupWindowController(
533 ".uno:ExtrusionDepthFloater"
540 return std::make_unique<ExtrusionDepthWindow>(
this, m_pToolbar);
546 std::make_unique<ExtrusionDepthWindow>(
this, pParent->
GetFrameWeld()));
556 svt::PopupWindowController::initialize( aArguments );
560 if ( getToolboxId( nId, &pToolBox ) )
569 return "com.sun.star.comp.svx.ExtrusionDepthController";
575 return {
"com.sun.star.frame.ToolbarController" };
579 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
581 css::uno::XComponentContext* xContext,
582 css::uno::Sequence<css::uno::Any>
const &)
593 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/lightingwindow.ui",
"LightingWindow")
594 , mxControl(pControl)
595 , mxLightingSet(new
ValueSet(nullptr))
596 , mxLightingSetWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *mxLightingSet))
597 , mxBright(m_xBuilder->weld_radio_button(
"bright"))
598 , mxNormal(m_xBuilder->weld_radio_button(
"normal"))
599 , mxDim(m_xBuilder->weld_radio_button(
"dim"))
654 mxBright->set_active(nLevel == 0 && bEnabled);
656 mxNormal->set_active(nLevel == 1 && bEnabled);
657 mxDim->set_sensitive(bEnabled);
658 mxDim->set_active(nLevel == 2 && bEnabled);
689 const css::frame::FeatureStateEvent& Event
692 if( Event.FeatureURL.Main == g_sExtrusionLightingIntensity )
694 if( !Event.IsEnabled )
701 if( Event.State >>= nValue )
705 else if( Event.FeatureURL.Main == g_sExtrusionLightingDirection )
707 if( !Event.IsEnabled )
714 if( Event.State >>= nValue )
722 sal_Int32 nDirection = mxLightingSet->GetSelectedItemId();
724 if( (nDirection > 0) && (nDirection < 10) )
729 OUString(g_sExtrusionLightingDirection).
copy(5), nDirection) };
731 mxControl->dispatchCommand( g_sExtrusionLightingDirection, aArgs );
733 implSetDirection( nDirection,
true );
736 mxControl->EndPopupMode();
741 if (!rButton.get_active())
745 if (mxBright->get_active())
747 else if (mxNormal->get_active())
753 OUString(g_sExtrusionLightingIntensity).
copy(5), static_cast<sal_Int32>(nLevel)) };
755 mxControl->dispatchCommand( g_sExtrusionLightingIntensity, aArgs );
757 implSetIntensity( nLevel,
true );
759 mxControl->EndPopupMode();
764 ) :
svt::PopupWindowController( rxContext,
766 ".uno:ExtrusionDirectionFloater"
773 return std::make_unique<ExtrusionLightingWindow>(
this, m_pToolbar);
779 std::make_unique<ExtrusionLightingWindow>(
this, pParent->
GetFrameWeld()));
789 svt::PopupWindowController::initialize( aArguments );
793 if ( getToolboxId( nId, &pToolBox ) )
802 return "com.sun.star.comp.svx.ExtrusionLightingController";
808 return {
"com.sun.star.frame.ToolbarController" };
812 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
814 css::uno::XComponentContext* xContext,
815 css::uno::Sequence<css::uno::Any>
const &)
824 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/surfacewindow.ui",
"SurfaceWindow")
825 , mxControl(pControl)
826 , mxWireFrame(m_xBuilder->weld_radio_button(
"wireframe"))
827 , mxMatt(m_xBuilder->weld_radio_button(
"matt"))
828 , mxPlastic(m_xBuilder->weld_radio_button(
"plastic"))
829 , mxMetal(m_xBuilder->weld_radio_button(
"metal"))
830 , mxMetalMSO(m_xBuilder->weld_radio_button(
"metalMSO"))
848 mxWireFrame->set_active(nSurface == 0 && bEnabled);
850 mxMatt->set_active(nSurface == 1 && bEnabled);
851 mxMatt->set_sensitive(bEnabled);
852 mxPlastic->set_active(nSurface == 2 && bEnabled);
854 mxMetal->set_active(nSurface == 3 && bEnabled);
855 mxMetal->set_sensitive(bEnabled);
856 mxMetalMSO->set_active(nSurface == 4 && bEnabled);
861 const css::frame::FeatureStateEvent& Event
864 if( Event.FeatureURL.Main != g_sExtrusionSurface )
867 if( !Event.IsEnabled )
874 if( Event.State >>= nValue )
881 if (!rButton.get_active())
885 if (mxWireFrame->get_active())
887 else if (mxMatt->get_active())
889 else if (mxPlastic->get_active())
891 else if (mxMetal->get_active())
897 OUString(g_sExtrusionSurface).
copy(5), nSurface) };
899 mxControl->dispatchCommand( g_sExtrusionSurface, aArgs );
901 implSetSurface( nSurface,
true );
903 mxControl->EndPopupMode();
909 :
svt::PopupWindowController(
912 ".uno:ExtrusionSurfaceFloater"
919 return std::make_unique<ExtrusionSurfaceWindow>(
this, m_pToolbar);
925 std::make_unique<ExtrusionSurfaceWindow>(
this, pParent->
GetFrameWeld()));
935 svt::PopupWindowController::initialize( aArguments );
939 if ( getToolboxId( nId, &pToolBox ) )
948 return "com.sun.star.comp.svx.ExtrusionSurfaceController";
954 return {
"com.sun.star.frame.ToolbarController" };
958 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
960 css::uno::XComponentContext* xContext,
961 css::uno::Sequence<css::uno::Any>
const &)
#define LINK(Instance, Class, Member)
std::unique_ptr< weld::RadioButton > mxCustom
virtual OUString SAL_CALL getImplementationName() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
std::unique_ptr< weld::RadioButton > mxMetalMSO
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
double const aDepthListInch[]
constexpr OUStringLiteral g_sExtrusionDirection
#define WB_MENUSTYLEVALUESET
virtual ~ExtrusionLightingWindow() override
void implSetIntensity(int nLevel, bool bEnabled)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
double const aDepthListMM[]
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
ExtrusionLightingControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
std::unique_ptr< weld::RadioButton > mxPlastic
constexpr rtl::OUStringConstExpr aLightOnBmps[]
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_ExtrusionDepthController_get_implementation(css::uno::XComponentContext *xContext, css::uno::Sequence< css::uno::Any > const &)
std::unique_ptr< weld::RadioButton > mxWireFrame
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
bool IsMetric(MapUnit eU)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< svt::PopupWindowController > mxControl
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
std::unique_ptr< weld::RadioButton > mxMatt
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_ExtrusionSurfaceControl_get_implementation(css::uno::XComponentContext *xContext, css::uno::Sequence< css::uno::Any > const &)
constexpr OUStringLiteral g_sExtrusionProjection
void DispatchDepthDialog()
std::unique_ptr< ValueSet > mxDirectionSet
static TranslateId aDirectionStrs[]
constexpr tools::Long Width() const
weld::Window * GetFrameWeld() const
constexpr rtl::OUStringConstExpr aLightOffBmps[]
ExtrusionDepthDialog(weld::Window *pParent, double fDepth, FieldUnit eDefaultUnit)
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual void GrabFocus() override
virtual void GrabFocus() override
exports com.sun.star. frame
OUString SvxResId(TranslateId aId)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
const sal_Int32 gSkewList[]
std::unique_ptr< weld::RadioButton > mxDepth1
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_ExtrusionLightingControl_get_implementation(css::uno::XComponentContext *xContext, css::uno::Sequence< css::uno::Any > const &)
std::unique_ptr< weld::RadioButton > mxDepth2
Image maImgLightingPreview[9]
#define SAL_N_ELEMENTS(arr)
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
constexpr OUStringLiteral g_sExtrusionSurface
ExtrusionSurfaceControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void GrabFocus() override
IMPL_LINK(HangulHanjaConversionDialog, ClickByCharacterHdl, weld::Toggleable &, rBox, void)
virtual OUString SAL_CALL getImplementationName() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< weld::RadioButton > mxDepth3
std::unique_ptr< weld::RadioButton > mxPerspective
std::unique_ptr< weld::RadioButton > mxParallel
ExtrusionLightingWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
virtual ~ExtrusionDirectionWindow() override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual ~ExtrusionDepthDialog() override
constexpr OUStringLiteral EMPTY
std::unique_ptr< weld::RadioButton > mxDepth0
std::unique_ptr< weld::RadioButton > mxDim
constexpr rtl::OUStringConstExpr aLightPreviewBmps[]
constexpr OStringLiteral HID_VALUESET_EXTRUSION_LIGHTING
ExtrusionDirectionWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxBright
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual void GrabFocus() override
ExtrusionDepthWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxNormal
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
ExtrusionDepthController(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
ExtrusionSurfaceWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
WinBits const WB_NOBORDER
constexpr OUStringLiteral g_sExtrusionLightingIntensity
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
#define WB_NO_DIRECTSELECT
constexpr tools::Long Height() const
std::unique_ptr< weld::RadioButton > mxInfinity
void implSetProjection(sal_Int32 nProjection, bool bEnabled)
#define FROM_BOTTOM_RIGHT
std::unique_ptr< ValueSet > mxLightingSet
std::unique_ptr< weld::RadioButton > mxDepth4
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
static VclPtr< reference_type > Create(Arg &&...arg)
virtual OUString SAL_CALL getImplementationName() override
constexpr rtl::OUStringConstExpr aDirectionBmps[]
void copy(const fs::path &src, const fs::path &dest)
std::unique_ptr< weld::RadioButton > mxMetal
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_ExtrusionDirectionControl_get_implementation(css::uno::XComponentContext *xContext, css::uno::Sequence< css::uno::Any > const &)
ExtrusionDirectionControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Image maImgLightingOff[9]
std::unique_ptr< weld::MetricSpinButton > m_xMtrDepth
void implSetDirection(int nDirection, bool bEnabled)
void implSetSurface(int nSurface, bool bEnabled)
void implFillStrings(FieldUnit eUnit)
constexpr OUStringLiteral gsExtrusionDepth(u".uno:ExtrusionDepth")
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
constexpr OUStringLiteral gsMetricUnit(u".uno:MetricUnit")
void implSetDepth(double fDepth)
void implSetDirection(sal_Int32 nSkew, bool bEnabled)
constexpr OUStringLiteral g_sExtrusionLightingDirection
bool m_bDetectedRangeSegmentation false
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override