20#include <com/sun/star/document/PrinterIndependentLayout.hpp>
21#include <com/sun/star/frame/Desktop.hpp>
22#include <com/sun/star/container/XEnumerationAccess.hpp>
25#include <com/sun/star/uno/Exception.hpp>
27#include <svx/svxids.hrc>
71 rAttrs->
Put( aOptsItem );
101 return std::make_unique<SdTpOptionsSnap>(pPage, pController, *rAttrs);
110 :
SfxTabPage(pPage, pController,
"modules/simpress/ui/sdviewpage.ui",
"SdViewPage", &rInAttrs)
111 , m_xCbxRuler(m_xBuilder->weld_check_button(
"ruler"))
112 , m_xCbxDragStripes(m_xBuilder->weld_check_button(
"dragstripes"))
113 , m_xCbxHandlesBezier(m_xBuilder->weld_check_button(
"handlesbezier"))
114 , m_xCbxMoveOutline(m_xBuilder->weld_check_button(
"moveoutline"))
124 bool bModified =
false;
138 rAttrs->
Put( aOptsItem );
162 return std::make_unique<SdTpOptionsContents>(pPage, pController, *rAttrs);
170#define TABLE_COUNT 12
174 :
SfxTabPage(pPage, pController,
"modules/simpress/ui/optimpressgeneralpage.ui",
"OptSavePage", &rInAttrs)
177 , m_xCbxQuickEdit(m_xBuilder->weld_check_button(
"qickedit"))
178 , m_xCbxPickThrough(m_xBuilder->weld_check_button(
"textselected"))
179 , m_xNewDocumentFrame(m_xBuilder->weld_frame(
"newdocumentframe"))
180 , m_xCbxStartWithTemplate(m_xBuilder->weld_check_button(
"startwithwizard"))
181 , m_xCbxMasterPageCache(m_xBuilder->weld_check_button(
"backgroundback"))
182 , m_xCbxCopy(m_xBuilder->weld_check_button(
"copywhenmove"))
183 , m_xCbxMarkedHitMovesAlways(m_xBuilder->weld_check_button(
"objalwymov"))
184 , m_xPresentationFrame(m_xBuilder->weld_frame(
"presentationframe"))
185 , m_xLbMetric(m_xBuilder->weld_combo_box(
"units"))
186 , m_xMtrFldTabstop(m_xBuilder->weld_metric_spin_button(
"metricFields",
FieldUnit::
MM))
187 , m_xCbxEnableSdremote(m_xBuilder->weld_check_button(
"enremotcont"))
188 , m_xCbxEnablePresenterScreen(m_xBuilder->weld_check_button(
"enprsntcons"))
189 , m_xCbxPresenterScreenFullScreen(m_xBuilder->weld_check_button(
"enprsntconsfullscreen"))
190 , m_xCbxCompatibility(m_xBuilder->weld_check_button(
"cbCompatibility"))
191 , m_xScaleFrame(m_xBuilder->weld_frame(
"scaleframe"))
192 , m_xCbScale(m_xBuilder->weld_combo_box(
"scaleBox"))
193 , m_xNewDocLb(m_xBuilder->weld_label(
"newdoclbl"))
194 , m_xFiInfo1(m_xBuilder->weld_label(
"info1"))
195 , m_xMtrFldOriginalWidth(m_xBuilder->weld_metric_spin_button(
"metricWidthFields",
FieldUnit::
MM))
196 , m_xWidthLb(m_xBuilder->weld_label(
"widthlbl"))
197 , m_xHeightLb(m_xBuilder->weld_label(
"heightlbl"))
198 , m_xFiInfo2(m_xBuilder->weld_label(
"info2"))
199 , m_xMtrFldOriginalHeight(m_xBuilder->weld_metric_spin_button(
"metricHeightFields",
FieldUnit::
MM))
200 , m_xCbxDistort(m_xBuilder->weld_check_button(
"distortcb"))
201 , m_xMtrFldInfo1(m_xBuilder->weld_metric_spin_button(
"metricInfo1Fields",
FieldUnit::
MM))
202 , m_xMtrFldInfo2(m_xBuilder->weld_metric_spin_button(
"metricInfo2Fields",
FieldUnit::
MM))
209 sal_uInt16 nWhich =
GetWhich( SID_ATTR_METRIC );
210 if ( rInAttrs.
GetItemState( nWhich ) >= SfxItemState::DEFAULT )
230 m_xLbMetric->append(OUString::number(nFieldUnit), sMetric);
254 { 1, 2, 4, 5, 8, 10, 16, 20, 30, 40, 50, 100 };
314 return DeactivateRC::LeavePage;
318 VclMessageType::Warning, VclButtonsType::YesNo,
319 SdResId(STR_WARN_SCALE_FAIL)));
321 return DeactivateRC::KeepPage;
326 return DeactivateRC::LeavePage;
331 bool bModified =
false;
358 rAttrs->
Put( aOptsItem );
367 sal_uInt16 nFieldUnit =
m_xLbMetric->get_id(nMPos).toUInt32();
422 sal_uInt16 nWhich =
GetWhich( SID_ATTR_METRIC );
425 if ( rAttrs->
GetItemState( nWhich ) >= SfxItemState::DEFAULT )
428 sal_uInt32 nFieldUnit =
static_cast<sal_uInt32
>(rItem.
GetValue());
430 for (sal_Int32
i = 0, nEntryCount =
m_xLbMetric->get_count();
i < nEntryCount; ++
i)
441 constexpr auto nWhich2 = SID_ATTR_DEFTABSTOP;
442 if( rAttrs->
GetItemState( nWhich2 ) >= SfxItemState::DEFAULT )
451 sal_Int32 nX = rAttrs->
Get( ATTR_OPTIONS_SCALE_X ).GetValue();
452 sal_Int32 nY = rAttrs->
Get( ATTR_OPTIONS_SCALE_Y ).GetValue();
453 nWidth = rAttrs->
Get( ATTR_OPTIONS_SCALE_WIDTH ).GetValue();
454 nHeight = rAttrs->
Get( ATTR_OPTIONS_SCALE_HEIGHT ).GetValue();
471 return std::make_unique<SdTpOptionsMisc>( pPage, pController, *rAttrs );
476 int nPos = m_xLbMetric->get_active();
481 m_xMtrFldTabstop->denormalize(m_xMtrFldTabstop->get_value(FieldUnit::TWIP));
483 m_xMtrFldTabstop->set_value( m_xMtrFldTabstop->normalize( nVal ), FieldUnit::TWIP );
489#ifndef ENABLE_SDREMOTE
521 return OUString::number(nX) + OUStringChar(
TOKEN) + OUString::number(nY);
562 Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext());
565 Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(xContext);
567 Reference<container::XEnumerationAccess> xComponents =
568 xDesktop->getComponents();
569 if ( ! xComponents.is())
572 Reference<container::XEnumeration> xEnumeration (
573 xComponents->createEnumeration());
574 if ( ! xEnumeration.is())
577 while (xEnumeration->hasMoreElements())
579 Reference<frame::XModel>
xModel (xEnumeration->nextElement(), UNO_QUERY);
591 catch (
const uno::Exception&)
605 sal_uInt32 nFlags=pFlagItem->
GetValue();
606 if ( ( nFlags & SD_DRAW_MODE ) == SD_DRAW_MODE )
608 if ( ( nFlags & SD_IMPRESS_MODE ) == SD_IMPRESS_MODE )
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt16 GetValue() const
sal_uInt32 GetValue() const
SdOptionsLayout & GetOptionsLayout()
bool IsMoveOutline() const
bool IsRulerVisible() const
void SetHandlesBezier(bool bOn)
bool IsDragStripes() const
void SetDragStripes(bool bOn)
bool IsHandlesBezier() const
void SetMoveOutline(bool bOn)
void SetRulerVisible(bool bOn)
SdOptionsMisc & GetOptionsMisc()
bool IsMasterPagePaintCaching() const
bool IsCrookNoContortion() const
void SetSummationOfParagraphs(bool bOn)
bool IsEnableSdremote() const
bool IsDragWithCopy() const
bool IsPresenterScreenFullScreen() const
bool IsEnablePresenterScreen() const
void SetPresenterScreenFullScreen(bool bOn)
bool IsMarkedHitMovesAlways() const
bool IsStartWithTemplate() const
void SetMarkedHitMovesAlways(bool bOn)
bool IsSummationOfParagraphs() const
void SetStartWithTemplate(bool bOn)
void SetCrookNoContortion(bool bOn)
void SetQuickEdit(bool bOn)
void SetMasterPagePaintCaching(bool bOn)
void SetEnablePresenterScreen(bool bOn)
void SetEnableSdremote(bool bOn)
void SetDragWithCopy(bool bOn)
void SetPickThrough(bool bOn)
bool IsPickThrough() const
SdOptionsSnap & GetOptionsSnap()
void SetAngle(Degree100 nIn)
void SetSnapFrame(bool bOn)
void SetSnapArea(sal_Int16 nIn)
void SetSnapPoints(bool bOn)
bool IsSnapHelplines() const
void SetSnapHelplines(bool bOn)
void SetEliminatePolyPointLimitAngle(Degree100 nIn)
bool IsSnapPoints() const
Degree100 GetAngle() const
void SetSnapBorder(bool bOn)
bool IsSnapBorder() const
Degree100 GetEliminatePolyPointLimitAngle() const
void SetBigOrtho(bool bOn)
sal_Int16 GetSnapArea() const
std::unique_ptr< weld::CheckButton > m_xCbxMoveOutline
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::CheckButton > m_xCbxDragStripes
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xCbxRuler
virtual ~SdTpOptionsContents() override
SdTpOptionsContents(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::CheckButton > m_xCbxHandlesBezier
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::Label > m_xHeightLb
std::unique_ptr< weld::CheckButton > m_xCbxMarkedHitMovesAlways
virtual ~SdTpOptionsMisc() override
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldInfo2
std::unique_ptr< weld::CheckButton > m_xCbxPickThrough
SdTpOptionsMisc(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::CheckButton > m_xCbxEnablePresenterScreen
std::unique_ptr< weld::ComboBox > m_xLbMetric
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldTabstop
std::unique_ptr< weld::CheckButton > m_xCbxCopy
std::unique_ptr< weld::CheckButton > m_xCbxMasterPageCache
std::unique_ptr< weld::CheckButton > m_xCbxQuickEdit
std::unique_ptr< weld::CheckButton > m_xCbxEnableSdremote
std::unique_ptr< weld::Label > m_xWidthLb
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::Label > m_xFiInfo2
void SetImpressMode()
Hide Draw specific controls, make Impress specific controls visible and arrange the visible controls.
std::unique_ptr< weld::Label > m_xNewDocLb
std::unique_ptr< weld::CheckButton > m_xCbxCompatibility
std::unique_ptr< weld::CheckButton > m_xCbxPresenterScreenFullScreen
std::unique_ptr< weld::Frame > m_xScaleFrame
std::unique_ptr< weld::CheckButton > m_xCbxDistort
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldOriginalHeight
std::unique_ptr< weld::Frame > m_xPresentationFrame
void SetDrawMode()
Hide Impress specific controls, make Draw specific controls visible and arrange the visible controls.
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldOriginalWidth
virtual void PageCreated(const SfxAllItemSet &aSet) override
static bool SetScale(std::u16string_view aScale, sal_Int32 &rX, sal_Int32 &rY)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::Frame > m_xNewDocumentFrame
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldInfo1
std::unique_ptr< weld::Label > m_xFiInfo1
std::unique_ptr< weld::CheckButton > m_xCbxStartWithTemplate
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
void UpdateCompatibilityControls()
Enable or disable the controls in the compatibility section of the 'general' tab page depending on wh...
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::ComboBox > m_xCbScale
static OUString GetScale(sal_Int32 nX, sal_Int32 nY)
virtual void Reset(const SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
virtual bool FillItemSet(SfxItemSet *) override
virtual ~SdTpOptionsSnap() override
SdTpOptionsSnap(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static FieldUnit GetCurrentFieldUnit()
void SetExchangeSupport()
weld::Window * GetFrameWeld() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
static FieldUnit GetValue(sal_uInt32 i)
static sal_uInt32 Count()
static OUString GetString(sal_uInt32 i)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldSnapArea
std::unique_ptr< weld::CheckButton > m_xCbxOrtho
std::unique_ptr< weld::CheckButton > m_xCbxRotate
std::unique_ptr< weld::Widget > m_xSnapFrames
std::unique_ptr< weld::CheckButton > m_xCbxSnapFrame
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldBezAngle
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldAngle
virtual bool FillItemSet(SfxItemSet *rSet) override
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::CheckButton > m_xCbxSnapBorder
std::unique_ptr< weld::CheckButton > m_xCbxSnapPoints
std::unique_ptr< weld::CheckButton > m_xCbxSnapHelplines
std::unique_ptr< weld::CheckButton > m_xCbxBigOrtho
#define DBG_ASSERT(sCon, aError)
#define LINK(Instance, Class, Member)
bool isdigitAsciiString(std::string_view rString)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OUString SdResId(TranslateId aId)
UNDERLYING_TYPE get() const
Reference< XModel > xModel
IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl, weld::ComboBox &, void)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)