25#include <editeng/editeng.hxx>
61 HeaderFooterSettings maSettings;
69 explicit PresLayoutPreview();
76 void update(HeaderFooterSettings
const & rSettings);
92struct DateAndTimeFormat {
101 { SvxDateFormat::A, SvxTimeFormat::AppDefault },
102 { SvxDateFormat::B, SvxTimeFormat::AppDefault },
103 { SvxDateFormat::C, SvxTimeFormat::AppDefault },
104 { SvxDateFormat::D, SvxTimeFormat::AppDefault },
105 { SvxDateFormat::E, SvxTimeFormat::AppDefault },
106 { SvxDateFormat::F, SvxTimeFormat::AppDefault },
108 { SvxDateFormat::A, SvxTimeFormat::HH24_MM },
109 { SvxDateFormat::A, SvxTimeFormat::HH12_MM },
111 { SvxDateFormat::AppDefault, SvxTimeFormat::HH24_MM },
112 { SvxDateFormat::AppDefault, SvxTimeFormat::HH24_MM_SS },
114 { SvxDateFormat::AppDefault, SvxTimeFormat::HH12_MM },
115 { SvxDateFormat::AppDefault, SvxTimeFormat::HH12_MM_SS },
169 : GenericDialogController(pParent,
"modules/simpress/ui/headerfooterdialog.ui",
"HeaderFooterDialog")
171 , mpCurrentPage( pCurrentPage )
172 , mpViewShell( pViewShell )
173 , mxTabCtrl(m_xBuilder->weld_notebook(
"tabcontrol"))
174 , mxPBApplyToAll(m_xBuilder->weld_button(
"apply_all"))
175 , mxPBApply(m_xBuilder->weld_button(
"apply"))
176 , mxPBCancel(m_xBuilder->weld_button(
"cancel"))
182 pSlide = pCurrentPage;
187 pNotes = pCurrentPage;
205 ActivatePageHdl(
mxTabCtrl->get_current_page_ident());
228IMPL_LINK(HeaderFooterDialog, ActivatePageHdl,
const OUString&, rIdent,
void)
230 mxPBApply->set_visible(rIdent ==
"slides");
231 mxPBApply->set_sensitive(mpCurrentPage !=
nullptr);
251 short nRet = GenericDialogController::run();
259 OUString tabId =
mxTabCtrl->get_current_page_ident();
260 apply(
true, tabId ==
"slides");
266 OUString tabId =
mxTabCtrl->get_current_page_ident();
267 apply(
false, tabId ==
"slides");
274 OUString aComment(
m_xDialog->get_title() );
275 pUndoGroup->SetComment( aComment );
293 for( nPage = 0; nPage < nPageCount; nPage++ )
296 change( pUndoGroup.get(), pPage, aNewSettings );
334 for( nPage = 0; nPage < nPageCount; nPage++ )
338 change( pUndoGroup.get(), pPage, aNewSettings );
357 , mbHandoutMode(bHandoutMode)
358 , mxBuilder(
Application::CreateBuilder(pParent,
"modules/simpress/ui/headerfootertab.ui"))
359 ,
mxContainer(mxBuilder->weld_container(
"HeaderFooterTab"))
360 , mxFTIncludeOn(mxBuilder->weld_label(
"include_label"))
361 , mxCBHeader(mxBuilder->weld_check_button(
"header_cb" ))
362 , mxHeaderBox(mxBuilder->weld_widget(
"header_box"))
363 , mxTBHeader(mxBuilder->weld_entry(
"header_text"))
364 , mxCBDateTime(mxBuilder->weld_check_button(
"datetime_cb"))
365 , mxRBDateTimeFixed(mxBuilder->weld_radio_button(
"rb_fixed"))
366 , mxRBDateTimeAutomatic(mxBuilder->weld_radio_button(
"rb_auto"))
367 , mxTBDateTimeFixed(mxBuilder->weld_entry(
"datetime_value"))
368 , mxCBDateTimeFormat(mxBuilder->weld_combo_box(
"datetime_format_list"))
369 , mxFTDateTimeLanguage(mxBuilder->weld_label(
"language_label"))
370 , mxCBDateTimeLanguage(new
SvxLanguageBox(mxBuilder->weld_combo_box(
"language_list")))
371 , mxCBFooter(mxBuilder->weld_check_button(
"footer_cb"))
372 , mxFooterBox(mxBuilder->weld_widget(
"footer_box" ))
373 , mxTBFooter(mxBuilder->weld_entry(
"footer_text"))
374 , mxCBSlideNumber(mxBuilder->weld_check_button(
"slide_number"))
375 , mxCBNotOnTitle(mxBuilder->weld_check_button(
"not_on_title"))
376 , mxReplacementA(mxBuilder->weld_label(
"replacement_a"))
377 , mxReplacementB(mxBuilder->weld_label(
"replacement_b"))
378 , mxCTPreview(new PresLayoutPreview)
379 , mxCTPreviewWin(new
weld::CustomWeld(*mxBuilder,
"preview", *mxCTPreview))
405 mxCBDateTimeLanguage->SetLanguageList( SvxLanguageListFlags::ALL|SvxLanguageListFlags::ONLY_KNOWN,
false,
false );
417 FillFormatList( mxCBDateTimeFormat->get_active() );
431 aDateTime, aDateTime,
433 *(
SD_MOD()->GetNumberFormatter()), eLanguage ) );
435 if (nFormat == nSelectedPos)
509 getData( aSettings, bNotOnTitle );
527 for( nPage = 0; nPage < nPageCount; nPage++ )
542 for( nPage = 0; nPage < nPageCount; nPage++ )
559 pOutl->
Init( OutlinerMode::TextObject );
569 bool bHasDateFieldItem =
false;
572 for (sal_Int32 nPara = 0; (nPara < nParaCount) && !bHasDateFieldItem; ++nPara)
575 for (sal_uInt16 nField = 0; (nField < nFieldCount); ++nField)
582 dynamic_cast<const SvxDateField*
>(pFieldData) !=
nullptr)
584 bHasDateFieldItem =
true;
585 aDateFieldPosition = aFieldInfo.
aPosition;
592 if (bHasDateFieldItem)
597 aDateFieldPosition.
nIndex,
598 aDateFieldPosition.
nIndex+1,
599 GetAttribsFlags::CHARATTRIBS));
605 aSet.
Put( aItemCJK );
608 aSet.
Put( aItemCTL );
611 aDateFieldPosition.
nPara, aDateFieldPosition.
nIndex+1 );
620 aDateFieldPosition.
nIndex );
625 pOutl->
Init( nOutlMode );
628PresLayoutPreview::PresLayoutPreview()
637 CustomWidgetController::SetDrawingArea(pDrawingArea);
638 SetOutputSizePixel(aSize);
641void PresLayoutPreview::init(
SdPage *pMaster )
647void PresLayoutPreview::update( HeaderFooterSettings
const & rSettings )
649 maSettings = rSettings;
662 const double fScaleX(
static_cast<double>(maOutRect.getOpenWidth()) /
static_cast<double>(
maPageSize.Width()));
663 const double fScaleY(
static_cast<double>(maOutRect.getOpenHeight()) /
static_cast<double>(
maPageSize.Height()));
664 aObjectTransform.
scale(fScaleX, fScaleY);
665 aObjectTransform.
translate(maOutRect.Left(), maOutRect.Top());
669 aGeometry.transform(aObjectTransform);
674 static const double fFactor(1.0);
675 std::vector<double> aPattern
694 for (sal_uInt32
a(0);
a < aGeometry.count();
a++)
696 rRenderContext.
DrawPolyLine(aGeometry.getB2DPolygon(a));
700void PresLayoutPreview::Paint(
vcl::RenderContext& rRenderContext, const ::tools::Rectangle&)
702 rRenderContext.
Push();
710 nWidth = maOutRect.GetWidth();
715 nHeight = maOutRect.GetHeight();
719 maOutRect.AdjustLeft((maOutRect.GetWidth() - nWidth) >> 1 );
720 maOutRect.SetRight( maOutRect.Left() + nWidth - 1 );
721 maOutRect.AdjustTop((maOutRect.GetHeight() - nHeight) >> 1 );
722 maOutRect.SetBottom( maOutRect.Top() + nHeight - 1 );
726 maOutRect = aDecoView.DrawFrame(maOutRect, DrawFrameStyle::In);
733 if (
nullptr != mpMaster)
743 Paint(rRenderContext, pMasterTitle,
true,
true);
745 Paint(rRenderContext, pMasterOutline,
true,
true);
747 Paint(rRenderContext, pHeader, maSettings.mbHeaderVisible);
749 Paint(rRenderContext, pFooter, maSettings.mbFooterVisible);
751 Paint(rRenderContext, pDate, maSettings.mbDateTimeVisible);
753 Paint(rRenderContext, pNumber, maSettings.mbSlideNumberVisible);
756 rRenderContext.
Pop();
const ::basegfx::B2DSize maPageSize
Reference< XExecutableDialog > m_xDialog
FILE * init(int, char **)
sal_Int32 GetParagraphCount() const
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const
sal_uInt16 GetFieldCount(sal_Int32 nPara) const
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
static LanguageType getRealLanguage(LanguageType nLang)
void SetText(const OutlinerParaObject &)
const EditEngine & GetEditEngine() const
OutlinerMode GetOutlinerMode() const
LanguageType GetLanguage(sal_Int32 nPara, sal_Int32 nPos) const
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
void Init(OutlinerMode nMode)
Size GetOutputSize() const
void DrawPolyLine(const tools::Polygon &rPoly)
void DrawRect(const tools::Rectangle &rRect)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
void StopWorkStartupDelay()
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
PageKind GetPageKind() const
const sd::HeaderFooterSettings & getHeaderFooterSettings() const
void setHeaderFooterSettings(const sd::HeaderFooterSettings &rNewSettings)
void AddAction(SdUndoAction *pAction)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
SdrPage & TRG_GetMasterPage() const
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual SfxUndoManager * GetUndoManager()
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
virtual SfxObjectShell * GetObjectShell() override
static OUString GetFormatted(Date const &rDate, tools::Time const &rTime, SvxDateFormat eDateFormat, SvxTimeFormat eTimeFormat, SvNumberFormatter &rFormatter, LanguageType eLanguage)
void translate(double fX, double fY)
void scale(double fX, double fY)
virtual void SetModified(bool=true) override
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
virtual OutputDevice & get_ref_device()=0
std::shared_ptr< weld::Dialog > m_xDialog
#define DBG_ASSERT(sCon, aError)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
#define LINK(Instance, Class, Member)
void applyLineDashing(const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget, double fDotDashLength)
B2DPolygon const & createUnitPolygon()
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
DateAndTimeFormat const nDateTimeFormats[nDateTimeFormatsCount]
const int nDateTimeFormatsCount
std::unique_ptr< SvxFieldItem > pFieldItem