26#include <svx/strings.hrc>
34#include <bitmaps.hlst>
45const sal_Int32
gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 };
48constexpr 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"))
187 mxParallel->set_active(nProjection == 1 && bEnabled);
193 const css::frame::FeatureStateEvent& Event
198 if( !Event.IsEnabled )
205 if( Event.State >>=
nValue )
211 if( !Event.IsEnabled )
218 if( Event.State >>=
nValue )
228 gSkewList[mxDirectionSet->GetSelectedItemId()-1]) };
232 mxControl->EndPopupMode();
237 int nProjection = mxPerspective->get_active() ? 0 : 1;
243 implSetProjection( nProjection,
true );
245 mxControl->EndPopupMode();
249 const Reference< XComponentContext >& rxContext
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" };
299extern "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;
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)
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())
502 mbCommandDispatched =
true;
503 implSetDepth( fDepth );
505 mxControl->EndPopupMode();
519 if (mxCustom->get_active() && !mbCommandDispatched)
521 DispatchDepthDialog();
529 const Reference< XComponentContext >& rxContext
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" };
579extern "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
694 if( !Event.IsEnabled )
701 if( Event.State >>=
nValue )
707 if( !Event.IsEnabled )
714 if( Event.State >>=
nValue )
722 sal_Int32 nDirection = mxLightingSet->GetSelectedItemId();
724 if( (nDirection > 0) && (nDirection < 10) )
733 implSetDirection( nDirection,
true );
736 mxControl->EndPopupMode();
741 if (!rButton.get_active())
745 if (mxBright->get_active())
747 else if (mxNormal->get_active())
757 implSetIntensity( nLevel,
true );
759 mxControl->EndPopupMode();
763 const Reference< XComponentContext >& rxContext
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" };
812extern "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
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())
901 implSetSurface( nSurface,
true );
903 mxControl->EndPopupMode();
907 const Reference< XComponentContext >& rxContext
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" };
958extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
960 css::uno::XComponentContext* xContext,
961 css::uno::Sequence<css::uno::Any>
const &)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static VclPtr< reference_type > Create(Arg &&... arg)
virtual OUString SAL_CALL getImplementationName() override
ExtrusionDepthController(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual ~ExtrusionDepthDialog() override
std::unique_ptr< weld::MetricSpinButton > m_xMtrDepth
ExtrusionDepthDialog(weld::Window *pParent, double fDepth, FieldUnit eDefaultUnit)
std::unique_ptr< weld::RadioButton > mxDepth4
void implSetDepth(double fDepth)
virtual void GrabFocus() override
ExtrusionDepthWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxDepth0
void implFillStrings(FieldUnit eUnit)
std::unique_ptr< weld::RadioButton > mxCustom
std::unique_ptr< weld::RadioButton > mxDepth3
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< weld::RadioButton > mxDepth2
std::unique_ptr< weld::RadioButton > mxInfinity
std::unique_ptr< weld::RadioButton > mxDepth1
rtl::Reference< svt::PopupWindowController > mxControl
void DispatchDepthDialog()
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
ExtrusionDirectionControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
ExtrusionDirectionWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxParallel
void implSetDirection(sal_Int32 nSkew, bool bEnabled)
virtual void GrabFocus() override
std::unique_ptr< weld::RadioButton > mxPerspective
void implSetProjection(sal_Int32 nProjection, bool bEnabled)
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< ValueSet > mxDirectionSet
virtual ~ExtrusionDirectionWindow() override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual OUString SAL_CALL getImplementationName() override
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
ExtrusionLightingControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
ExtrusionLightingWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
Image maImgLightingPreview[9]
std::unique_ptr< weld::RadioButton > mxDim
Image maImgLightingOff[9]
std::unique_ptr< ValueSet > mxLightingSet
virtual ~ExtrusionLightingWindow() override
std::unique_ptr< weld::RadioButton > mxNormal
std::unique_ptr< weld::RadioButton > mxBright
void implSetDirection(int nDirection, bool bEnabled)
void implSetIntensity(int nLevel, bool bEnabled)
virtual void GrabFocus() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
ExtrusionSurfaceControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
std::unique_ptr< weld::RadioButton > mxMetalMSO
std::unique_ptr< weld::RadioButton > mxMetal
ExtrusionSurfaceWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxWireFrame
std::unique_ptr< weld::RadioButton > mxPlastic
virtual void GrabFocus() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
void implSetSurface(int nSurface, bool bEnabled)
std::unique_ptr< weld::RadioButton > mxMatt
weld::Window * GetFrameWeld() const
OUString SvxResId(TranslateId aId)
#define FROM_BOTTOM_RIGHT
constexpr OUStringLiteral HID_VALUESET_EXTRUSION_LIGHTING
Sequence< PropertyValue > aArguments
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
void copy(const fs::path &src, const fs::path &dest)
constexpr OUStringLiteral g_sExtrusionLightingIntensity
double const aDepthListMM[]
IMPL_LINK(HangulHanjaConversionDialog, ClickByCharacterHdl, weld::Toggleable &, rBox, void)
constexpr OUStringLiteral EMPTY
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 &)
constexpr OUStringLiteral g_sExtrusionDirection
constexpr OUStringLiteral gsExtrusionDepth(u".uno:ExtrusionDepth")
constexpr rtl::OUStringConstExpr aLightPreviewBmps[]
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 &)
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 &)
const sal_Int32 gSkewList[]
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 gsMetricUnit(u".uno:MetricUnit")
constexpr OUStringLiteral g_sExtrusionLightingDirection
constexpr OUStringLiteral g_sExtrusionSurface
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
constexpr OUStringLiteral g_sExtrusionProjection
constexpr rtl::OUStringConstExpr aLightOnBmps[]
constexpr rtl::OUStringConstExpr aLightOffBmps[]
double const aDepthListInch[]
static TranslateId aDirectionStrs[]
constexpr rtl::OUStringConstExpr aDirectionBmps[]
bool IsMetric(MapUnit eU)
#define WB_MENUSTYLEVALUESET
#define WB_NO_DIRECTSELECT
WinBits const WB_NOBORDER